prompt
stringlengths 83
247k
| response
stringlengths 121
36.1k
| metadata
stringlengths 314
42.3k
|
|---|---|---|
refactor(core): add cache redaction for cgraph
## 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 -->
https://github.com/juspay/hyperswitch/pull/9629
This pull request enhances cache management for connector creation by introducing a new mechanism to invalidate related cache entries whenever a new connector is added. The main change is the addition of the `redact_cgraph_cache` function, which ensures that outdated cgraph cache data is cleared for the relevant merchant and profile, preventing stale data issues.
**Cache invalidation improvements:**
* Added the `redact_cgraph_cache` function in `crates/router/src/core/routing/helpers.rs` to invalidate both payouts and payments cgraph cache entries for a given merchant and profile. This function uses Redis and publishes cache invalidation events.
* Integrated the `redact_cgraph_cache` call into the connector creation flow in `crates/router/src/core/admin.rs`, ensuring cache is redacted whenever a new connector is created.
* Imported the `redact_cgraph_cache` helper function in `crates/router/src/core/admin.rs` to enable its usage in the admin logic.
### 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).
-->
Required for cache redaction.
## 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 wise connector with sepa enabled.
2. Create/confirm a sepa payout link.
```
curl --location 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_7ac45zCz3UdpgVnwr0KrU5eT7kFYgIvuR6rtHT2gwj9zRqMZDvI5XMFXhWu7RX85' \
--data-raw '{
"amount": 4500,
"currency": "USD",
"customer_id": "cus_jtJ8WHTHnsguskpiorEt",
"email": "payout_customer@example.com",
"name": "Doest John",
"phone": "6168205366",
"phone_country_code": "+1",
"description": "Its my first payout request",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "NY",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "6168205366",
"country_code": "1"
}
},
"entity_type": "Individual",
"recurring": false,
"metadata": {
"ref": "123"
},
"confirm": false,
"auto_fulfill": false,
"payout_link": true,
"payout_link_config": {
"logo": "https://hyperswitch.io/favicon.ico",
"merchant_name": "Hyperswitch",
"theme": "#4285F4",
"test_mode": true,
"form_layout": "tabs"
}
}'
```
3. create adyen mca with card.
4. Create/confirm a card payout link(it should be processed with adyen and not wise).
```
curl --location 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_7ac45zCz3UdpgVnwr0KrU5eT7kFYgIvuR6rtHT2gwj9zRqMZDvI5XMFXhWu7RX85' \
--data-raw '{
"amount": 4500,
"currency": "USD",
"customer_id": "cus_jtJ8WHTHnsguskpiorEt",
"email": "payout_customer@example.com",
"name": "Doest John",
"phone": "6168205366",
"phone_country_code": "+1",
"description": "Its my first payout request",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "NY",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "6168205366",
"country_code": "1"
}
},
"entity_type": "Individual",
"recurring": false,
"metadata": {
"ref": "123"
},
"confirm": false,
"auto_fulfill": false,
"payout_link": true,
"payout_link_config": {
"logo": "https://hyperswitch.io/favicon.ico",
"merchant_name": "Hyperswitch",
"theme": "#4285F4",
"test_mode": true,
"form_layout": "tabs"
}
}'
```
## 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/admin.rs`
- `crates/router/src/core/routing/helpers.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (3 changes)
**Detailed Identifier Changes:**
Commit 5108868e:
Files to modify:
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Add:
- function: pub::redact_cgraph_cache
|
{"pr_number": 9639, "pr_title": "refactor(core): add cache redaction for cgraph", "merged_at": "2025-10-01T11:30:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/routing/helpers.rs"]}, "change_types": {"functions_added": 1, "fields_added": 3, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): fix incorrect mapping of attempt status in NMI connector
## 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 -->
After making a `capture` call following the `Payments-Create` call, the backend was returning an incorrect error message, incorrectly indicating an issue with the `capture_method`. This is because, after the `Payments-Create` call, the payment status was being set to `processing` instead of `requires_capture` due to an incorrect mapping of an attempt status in the NMI connector. This fix ensures that the correct payment status is displayed.
### 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. Payments Connector - Create (NMI)
Request -
```
curl --location 'http://localhost:8080/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": "nmi",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "API KEY",
"key1": "KEY1"
},
"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"
]
}
}
]
}
],
"metadata": {
"city": "NY",
"unit": "245"
},
"connector_webhook_details": {
"merchant_secret": "MyWebhookSecret"
},
"business_country": "US",
"business_label": "default"
}'
```
Response -
```
{
"connector_type": "payment_processor",
"connector_name": "nmi",
"connector_label": "nmi_US_default",
"merchant_connector_id": "mca_lSdgOhqb7xkLIwFG5RmF",
"profile_id": "pro_8TCRT4W0cFxSiwrX6UZX",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "8Y****************************Sm",
"key1": "ch********************************************59"
},
"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
}
]
}
],
"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": null
}
```
2. 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": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "manual",
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"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": "4012000033330026",
"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": "joseph",
"last_name": "Doe"
}
},
"shipping": {
"address": {
"line1": "123",
"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_nbmtZ5WEPRqu5YrSFf1c",
"merchant_id": "merchant_1738782997",
"status": "requires_capture",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 6540,
"amount_received": null,
"connector": "nmi",
"client_secret": "pay_nbmtZ5WEPRqu5YrSFf1c_secret_q4r6QTPpGIfAFzq1pTSQ",
"created": "2025-02-05T19:16:45.353Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": null,
"email": "guest@example.com",
"phone": null,
"phone_country_code": null
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0026",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "401200",
"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": "token_E4a0G0TyXfI9zRhUKhdt",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "123",
"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": "joseph",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": null,
"phone": null,
"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": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1738783005,
"expires": 1738786605,
"secret": "epk_9e27e24364464098900da2a7c078d441"
},
"manual_retry_allowed": false,
"connector_transaction_id": "10384074477",
"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_nbmtZ5WEPRqu5YrSFf1c_1",
"payment_link": null,
"profile_id": "pro_8TCRT4W0cFxSiwrX6UZX",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_lSdgOhqb7xkLIwFG5RmF",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-05T19:31:45.353Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-05T19:16:49.957Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
3. Payments - Capture
Request -
```
curl --location 'http://localhost:8080/payments/pay_WjH16MusMwAlPgWjbkqt/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api-key}}' \
--data '{
"amount_to_capture": 65400
}'
```
Response -
```
{
"error": {
"type": "invalid_request",
"message": "amount_to_capture is greater than amount",
"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. External Connector Integration**
- `crates/router/src/connector/nmi/transformers.rs`
**Detailed Identifier Changes:**
Commit 76c34595:
Files to modify:
**crates/router/src/connector/nmi/transformers.rs**
Modify existing code
|
{"pr_number": 7200, "pr_title": "fix(connector): fix incorrect mapping of attempt status in NMI connector", "merged_at": "2025-02-10T13:04:10Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/connector/nmi/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): add support of passing metadata in adyen payment request
## 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 -->
### 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?
Make a adyen payment request by passing metadata
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_gfSvA66FtTOYRAET2roFlwpZII7Im5qV58tVCQ8nmgfvCGW34H7KOatZrmImGpJi' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"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_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4917610000000000",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"metadata": {
"order_id": "ORD-12345",
"customer_segment": "premium",
"purchase_platform": "web_store"
},
"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",
"merchant_order_reference_id" : "order_narvar12",
"browser_info": {
"os_type": "macOS",
"language": "en-GB",
"time_zone": -330,
"ip_address": "103.159.11.202",
"os_version": "10.15.7",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
"color_depth": 24,
"device_model": "Macintosh",
"java_enabled": true,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1080,
"accept_language": "en",
"java_script_enabled": true
},
"profile_id": "pro_16j8JOCurimvr2XXG9EE"
}'
```
Response
```
{
"payment_id": "pay_hzlcxXX8nyJI66W4kWqV",
"merchant_id": "merchant_1754636642",
"status": "requires_customer_action",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 1000,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_hzlcxXX8nyJI66W4kWqV_secret_nCpTSGcFPShUZCI00wx1",
"created": "2025-08-08T07:04:25.612Z",
"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": "0000",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "491761",
"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,
"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": "PiX",
"last_name": null,
"origin_zip": 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": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_hzlcxXX8nyJI66W4kWqV/merchant_1754636642/pay_hzlcxXX8nyJI66W4kWqV_1"
},
"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": 1754636665,
"expires": 1754640265,
"secret": "epk_4fc117f853654c8289fb1024aa8dbeed"
},
"manual_retry_allowed": null,
"connector_transaction_id": "SPD59ZTRRZ9TPM75",
"frm_message": null,
"metadata": {
"order_id": "ORD-12345",
"customer_segment": "premium",
"purchase_platform": "web_store"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "SPD59ZTRRZ9TPM75",
"payment_link": null,
"profile_id": "pro_BkMsi4kLNDDn7Occ4u2v",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_hwPRKWHa1C2kQQ9Y86sr",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-08T07:19:25.612Z",
"fingerprint": null,
"browser_info": {
"os_type": "macOS",
"language": "en-GB",
"time_zone": -330,
"ip_address": "103.159.11.202",
"os_version": "10.15.7",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
"color_depth": 24,
"device_model": "Macintosh",
"java_enabled": true,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1080,
"accept_language": "en",
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-08-08T07:04:26.048Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": "order_narvar12",
"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
}
```
In adyen dashboard it should show up like this:
<img width="696" height="210" alt="Screenshot 2025-08-08 at 12 50 13 PM" src="https://github.com/user-attachments/assets/5cee3d27-a810-49fe-a1d3-42fe43caac83" />
Cypress test
<img width="1912" height="1880" alt="Screenshot 2025-08-08 at 8 36 49 PM" src="https://github.com/user-attachments/assets/b012d628-f74d-4e3a-bd3c-3893bae9115a" />
## 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/adyen/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (12 changes)
**Detailed Identifier Changes:**
Commit 4434bf19:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
|
{"pr_number": 8871, "pr_title": "feat(connector): add support of passing metadata in adyen payment request", "merged_at": "2025-08-11T10:19:22Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs"]}, "change_types": {"fields_added": 12}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Update payment methods api
## 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 -->
Hotfix for https://github.com/juspay/hyperswitch/pull/9075
We need to make update payment methods API which can update the fields of the records in payment methods table. It will consume a CSV file which will have batch update entries. Currently it should only update connector_mandate_id, network_transaction_id and mandate_status.
### 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).
-->
Frequent DB updates on payment methods table due to ongoing migrations of merchants.
## 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/payment_methods/update-batch' \
--header 'api-key: test_admin' \
--form 'file=@"/Users/mrudul.vajpayee/Downloads/update_sample.csv"' \
--form 'merchant_id="merchant_1756355489"'
```
Sample output:
```
[
{
"payment_method_id": "pm_RsWnXeiOhlaVseKdk0Mm",
"status": "active",
"network_transaction_id": "063AF598E0A5C5",
"connector_mandate_details": {
"payouts": {
"mca_SbUFb1h4NfixAWFaLQeT": {
"transfer_method_id": "ARM-678ab3997b16cb7cd"
}
},
"mca_Qwuqfidvy2Lk2y0PbvFa": {
"mandate_metadata": null,
"payment_method_type": "google_pay",
"connector_mandate_id": "2D5D6F0E961E639BE063AF598E0A9A32",
"connector_mandate_status": "active",
"original_payment_authorized_amount": 20000,
"original_payment_authorized_currency": "EUR",
"connector_mandate_request_reference_id": "ytlaTEEjkONzieVl0k"
},
"mca_xHIYFXMCUsYTZIZ1rwgY": {
"mandate_metadata": null,
"payment_method_type": null,
"connector_mandate_id": "6D981A0542DDF0EBE063AF598E0A5C5E",
"connector_mandate_status": null,
"original_payment_authorized_amount": null,
"original_payment_authorized_currency": null,
"connector_mandate_request_reference_id": null
}
},
"update_status": "Success",
"line_number": 1
},
{
"payment_method_id": "pm_RsWnXeiOhlaVseKdk0Mm",
"status": "active",
"network_transaction_id": "063AF598E0A5C5",
"connector_mandate_details": {
"payouts": {
"mca_SbUFb1h4NfixAWFaLQeT": {
"transfer_method_id": "ARM-678ab3997b16cb7cd"
}
},
"mca_Qwuqfidvy2Lk2y0PbvFa": {
"mandate_metadata": null,
"payment_method_type": "google_pay",
"connector_mandate_id": "2D5D6F0E961E639BE063AF598E0A9A32",
"connector_mandate_status": "active",
"original_payment_authorized_amount": 20000,
"original_payment_authorized_currency": "EUR",
"connector_mandate_request_reference_id": "ytlaTEEjkONzieVl0k"
},
"mca_xHIYFXMCUsYTZIZ1rwgY": {
"mandate_metadata": null,
"payment_method_type": null,
"connector_mandate_id": "6D981A0542DDF0EBE063AF598E0A5C5E",
"connector_mandate_status": null,
"original_payment_authorized_amount": null,
"original_payment_authorized_currency": null,
"connector_mandate_request_reference_id": null
}
},
"update_status": "Success",
"line_number": 2
},
{
"payment_method_id": "pm_RsWnXeiOhlaVseKdk0Mm",
"status": "active",
"network_transaction_id": "063AF598E0A5C5",
"connector_mandate_details": {
"payouts": {
"mca_SbUFb1h4NfixAWFaLQeT": {
"transfer_method_id": "ARM-678ab3997b16cb7cd"
}
},
"mca_Qwuqfidvy2Lk2y0PbvFa": {
"mandate_metadata": null,
"payment_method_type": "google_pay",
"connector_mandate_id": "2D5D6F0E961E639BE063AF598E0A9A32",
"connector_mandate_status": "active",
"original_payment_authorized_amount": 20000,
"original_payment_authorized_currency": "EUR",
"connector_mandate_request_reference_id": "ytlaTEEjkONzieVl0k"
},
"mca_xHIYFXMCUsYTZIZ1rwgY": {
"mandate_metadata": null,
"payment_method_type": null,
"connector_mandate_id": "6D981A0542DDF0EBE063AF598E0A5C5E",
"connector_mandate_status": null,
"original_payment_authorized_amount": null,
"original_payment_authorized_currency": null,
"connector_mandate_request_reference_id": null
}
},
"update_status": "Success",
"line_number": 3
}
]
```
[update_sample.csv](https://github.com/user-attachments/files/22072833/update_sample.csv)
## 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/payment_methods.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_method.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payment_methods.rs`
**4. Core Business Logic**
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payment_methods/migration.rs`
**5. Type Definitions**
- `crates/router_env/src/logger/types.rs`
**6. Utils**
- `crates/router/src/routes/lock_utils.rs`
**7. Other**
- `crates/router/src/routes/app.rs`
- `crates/router/src/routes/payment_methods.rs`
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (6 changes)
- Extend existing types with new fields (80 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit 53943954:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Add:
- function: private::from
- struct: pub::PaymentMethodRecordUpdateResponse
- struct: pub::UpdatePaymentMethodRecord
- struct: pub::PaymentMethodUpdateResponse
- enum: pub::UpdateStatus
- impl: impl From<PaymentMethodUpdateResponseType> for PaymentMethodUpdateResponse
**crates/diesel_models/src/payment_method.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Add:
- mod: pub::migration
**crates/router/src/core/payment_methods/migration.rs**
Add:
- function: pub::update_payment_methods
- function: pub::update_payment_method_record
- function: private::parse_update_csv
- function: pub::validate_and_get_payment_method_records
- struct: pub::PaymentMethodsUpdateForm
- impl: impl PaymentMethodsUpdateForm
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Add:
- function: pub::update_payment_methods
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 9242, "pr_title": "feat(core): Update payment methods api", "merged_at": "2025-09-02T13:22:22Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "database": ["crates/diesel_models/src/payment_method.rs"], "domain": ["crates/hyperswitch_domain_models/src/payment_methods.rs"], "core_business": ["crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/migration.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "other": ["crates/router/src/routes/app.rs", "crates/router/src/routes/payment_methods.rs"]}, "change_types": {"structs_added": 4, "functions_added": 6, "enums_added": 1, "fields_added": 80, "imports_added": 14, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payments): add merchant order ref id filter
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
The PR
- Add merchant order reference id filter for payments list
- Fix bug for search by refund id (or payment_id), using `or` instead of `or_filter`. Earlier we were searching in whole list, ignoring the filter previously applied in the query.
However this was the only case for when we were searching dynamically for ids, it can be payment or refund id. It was producing correct result when searching for only payment id or only refund id.
### 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
Closes [#6629](https://github.com/juspay/hyperswitch/issues/6629)
## How did you test it?
Merchant Order filter is working as expected
Request
```
curl --location 'http://localhost:8080/payments/list' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer JWT' \
--data '{
"merchant_order_reference_id": "test"
}'
```
Response:
```
{
"count": 1,
"total_count": 1,
"data": [
{
"payment_id": "test_rkAjUPAeyOVH0V1JPBcg",
"merchant_id": "merchant_1732182386",
"status": "succeeded",
"amount": 19900,
"net_amount": 19900,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "stripe_test",
"client_secret": "test_rkAjUPAeyOVH0V1JPBcg_secret_s8xZQVITYn3CT5RKTiUj",
"created": "2024-11-20T22:30:10.000Z",
"currency": "USD",
"customer_id": "hs-dashboard-user",
"customer": null,
"description": "This is a sample payment",
"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": "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": "test_rkAjUPAeyOVH0V1JPBcg_1",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_7J9fiPceBUM7IMdb045X",
"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,
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": "test",
"order_tax_amount": null,
"connector_mandate_id": null
}
]
}
```
In refunds list when dynamically searching for both payment_id and refund_id, we are getting correct result now
```
curl --location 'http://localhost:8080/refunds/list' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer JWT' \
--data '{
"refund_id": "test_LlBBfgQbHHJfQxsoLiyT",
"payment_id": "test_LlBBfgQbHHJfQxsoLiyT"
}'
```
Response:
```
{
"count": 0,
"total_count": 0,
"data": []
}
```
## 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/payments/payment_intent.rs`
**3. Type Definitions**
- `crates/router/src/types/storage/dispute.rs`
- `crates/router/src/types/storage/refund.rs`
**4. Other**
- `crates/storage_impl/src/payments/payment_intent.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (4 changes)
- Add conditional logic for feature flags or filtering (3 changes)
- Modify database queries (28 changes)
**Detailed Identifier Changes:**
Commit 57e64c26:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/router/src/types/storage/dispute.rs**
Modify existing code
**crates/router/src/types/storage/refund.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_intent.rs**
Modify existing code
|
{"pr_number": 6630, "pr_title": "feat(payments): add merchant order ref id filter", "merged_at": "2024-11-25T14:06:30Z", "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/payments/payment_intent.rs"], "types": ["crates/router/src/types/storage/dispute.rs", "crates/router/src/types/storage/refund.rs"], "other": ["crates/storage_impl/src/payments/payment_intent.rs"]}, "change_types": {"fields_added": 4, "imports_added": 2, "conditionals_added": 3, "database_queries": 28}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(payment): disable payment update via client config
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
HOTFIX main pr : https://github.com/juspay/hyperswitch/pull/7970#
issue : https://github.com/juspay/hyperswitch-cloud/issues/9421
Disable payment update via client config and allow using config if needed
🔴 remove from config after some time and completely depricate update payment via client auth completely
Throw internal server error if some one tries to update via client auth (if config is not enabled)
### 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)?
-->
- Update using client auth when config is not allowed
request
```sh
curl --location 'http://localhost:8080/payments/pay_ImiqolwzntLifVgMh7eJ' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_bd649cb441c64b2495d01d9e01d2d8ce' \
--data-raw '{
"amount": 100,
"currency": "USD",
"confirm": false,
"card_cvc":"fdsa",
"capture_method": "manual",
"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": "+65",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://duck.com",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
},
"phone": {
"number": "123456789",
"country_code": "12"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
},
"phone": {
"number": "123456789",
"country_code": "12"
}
},
"request_external_three_ds_authentication": true,
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
response
```sh
{
"error": {
"type": "api",
"message": "Something went wrong",
"code": "HE_00"
}
}
```
<img width="1728" alt="Screenshot 2025-05-06 at 5 24 51 PM" src="https://github.com/user-attachments/assets/5b346efd-1bda-4231-84d7-21bdb4e78b0d" />
- Update when config is set as true
- set config as true
```sh
curl --location 'http://localhost:8080/configs/' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"key": "payment_update_enabled_for_client_auth_merchant_1746517127",
"value":"true"
}'
```
```sh
curl --location 'http://localhost:8080/payments/pay_ImiqolwzntLifVgMh7eJ' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_bd649cb441c64b2495d01d9e01d2d8ce' \
--data-raw '{
"amount": 100,
"currency": "USD",
"confirm": false,
"card_cvc":"fdsa",
"capture_method": "manual",
"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": "+65",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://duck.com",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
},
"phone": {
"number": "123456789",
"country_code": "12"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
},
"phone": {
"number": "123456789",
"country_code": "12"
}
},
"request_external_three_ds_authentication": true,
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
response
```json
{
"payment_id": "pay_ImiqolwzntLifVgMh7eJ",
"merchant_id": "merchant_1746517127",
"status": "requires_payment_method",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_ImiqolwzntLifVgMh7eJ_secret_GT1AyI1AWmBwVhfayFLk",
"created": "2025-05-06T07:41:40.672Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"payment_method": null,
"payment_method_data": 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": {
"number": "123456789",
"country_code": "12"
},
"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": {
"number": "123456789",
"country_code": "12"
},
"email": null
},
"order_details": 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": 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": {
"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_Zn3QxWmRdehEMKANcY0E",
"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-05-06T07:56:40.672Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-05-06T12:17:04.472Z",
"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
}
```
- Update using api_key should always work regardless the config
```sh
curl --location 'http://localhost:8080/payments/pay_MukWGg9LZtwHCd2Ccwxl' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_JgaeGxCbDQkTTYtHjQbkVW76PhZuwXwZOXzioNz72hpiRbdZSQDORC7J3zTQ8upo' \
--data-raw '{
"amount": 100,
"currency": "USD",
"confirm": false,
"card_cvc":"fdsa",
"capture_method": "manual",
"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": "+65",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://duck.com",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
},
"phone": {
"number": "123456789",
"country_code": "12"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
},
"phone": {
"number": "123456789",
"country_code": "12"
}
},
"request_external_three_ds_authentication": true,
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
Response `200`
```json
{
"payment_id": "pay_ImiqolwzntLifVgMh7eJ",
"merchant_id": "merchant_1746517127",
"status": "requires_payment_method",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_ImiqolwzntLifVgMh7eJ_secret_GT1AyI1AWmBwVhfayFLk",
"created": "2025-05-06T07:41:40.672Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"payment_method": null,
"payment_method_data": 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": {
"number": "123456789",
"country_code": "12"
},
"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": {
"number": "123456789",
"country_code": "12"
},
"email": null
},
"order_details": 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": 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": {
"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_Zn3QxWmRdehEMKANcY0E",
"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-05-06T07:56:40.672Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-05-06T12:17:04.472Z",
"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
}
```
## 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/helpers.rs`
- `crates/router/src/core/payments/operations/payment_update.rs`
**2. Utils**
- `crates/common_utils/src/id_type/merchant.rs`
**Code Patterns Applied:**
- Implement new functions (3 changes)
- Extend existing types with new fields (5 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 76067829:
Files to modify:
**crates/common_utils/src/id_type/merchant.rs**
Add:
- function: pub::get_payment_update_enabled_for_client_auth_key
**crates/router/src/core/payments/helpers.rs**
Add:
- function: private::get_payment_update_enabled_for_client_auth
- function: pub::allow_payment_update_enabled_for_client_auth
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
|
{"pr_number": 8012, "pr_title": "fix(payment): disable payment update via client config", "merged_at": "2025-05-13T13:37:56Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_update.rs"], "utils": ["crates/common_utils/src/id_type/merchant.rs"]}, "change_types": {"functions_added": 3, "fields_added": 5, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore(roles): remove redundant variant from PermissionGroup
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This removes the redundant `ReconOps` variant from `PermissionGroup` enum which is stored in DB. This was kept back in application for backwards compatibility. Migrations are added for this and this will not be needed anymore.
### 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
Helps in keeping a clean permission view on HS dashboard.
## How did you test it?
Locally by running migrations and viewing permission view in dashboard.
## 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. Other**
- `crates/common_enums/src/enums.rs`
- `crates/router/src/services/authorization/info.rs`
- `crates/router/src/services/authorization/permission_groups.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit 775dcc5a:
Files to modify:
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/router/src/services/authorization/info.rs**
Modify existing code
**crates/router/src/services/authorization/permission_groups.rs**
Modify existing code
|
{"pr_number": 6985, "pr_title": "chore(roles): remove redundant variant from PermissionGroup", "merged_at": "2025-02-06T14:29:12Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["crates/common_enums/src/enums.rs", "crates/router/src/services/authorization/info.rs", "crates/router/src/services/authorization/permission_groups.rs", "migrations/2025-01-03-104019_migrate_permission_group_for_recon/down.sql", "migrations/2025-01-03-104019_migrate_permission_group_for_recon/up.sql"]}, "change_types": {"database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(router): remove metadata, additional_merchant_data and connector_wallets_details from connector list api
## 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 -->
Remove metadata, additional_merchant_data and connector_wallets_details from connector list API. To prevent exposure of sensitive data.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] 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)?
-->
1. List a Merchant Connectors
```
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_3d7037d0-0377-4ef1-bf93-372bcb66ce7f/profile/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--header 'X-Merchant-Id: postman_merchant_GHAction_3d7037d0-0377-4ef1-bf93-372bcb66ce7f' \
--data ''
```
Response
```
[
{
"connector_type": "payment_processor",
"connector_name": "adyen",
"connector_label": "adyen_US_default",
"merchant_connector_id": "mca_gOkydSVpVKfHK4JUSiPg",
"profile_id": "pro_irLOHIwYUK7sG8f9armE",
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": [
"AmericanExpress",
"Discover",
"Interac",
"JCB",
"Mastercard",
"Visa",
"DinersClub",
"UnionPay",
"RuPay"
],
"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": [
"AmericanExpress",
"Discover",
"Interac",
"JCB",
"Mastercard",
"Visa",
"DinersClub",
"UnionPay",
"RuPay"
],
"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_type": "alma",
"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": "atome",
"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": "pay_bright",
"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": "atome",
"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": "walley",
"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": "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": "wallet",
"payment_method_types": [
{
"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
},
{
"payment_method_type": "swish",
"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": "mb_way",
"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": "cashapp",
"payment_experience": "display_qr_code",
"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": "mobile_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "ali_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "we_chat_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "mb_way",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": {
"type": "enable_only",
"list": [
"PLN"
]
},
"accepted_countries": {
"type": "enable_only",
"list": [
"PT"
]
},
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "gift_card",
"payment_method_types": [
{
"payment_method_type": "givex",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "pay_safe_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": "bank_redirect",
"payment_method_types": [
{
"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": "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_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": "blik",
"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": "trustly",
"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": "online_banking_czech_republic",
"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": "online_banking_finland",
"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": "online_banking_poland",
"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": "online_banking_slovakia",
"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": "voucher",
"payment_method_types": [
{
"payment_method_type": "boleto",
"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": "seven_eleven",
"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": "indomaret",
"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": "alfamart",
"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": "bank_debit",
"payment_method_types": [
{
"payment_method_type": "ach",
"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": "bacs",
"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": "card_redirect",
"payment_method_types": [
{
"payment_method_type": "momo_atm",
"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": "knet",
"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": "benefit",
"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": "bank_transfer",
"payment_method_types": [
{
"payment_method_type": "ach",
"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": "bacs",
"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": "mandiri_va",
"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": "danamon_va",
"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": "cimb_va",
"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": "bri_va",
"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": "bni_va",
"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": "bca_bank_transfer",
"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": "permata_bank_transfer",
"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": "permata_bank_transfer",
"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
}
]
}
],
"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"
}
]
```
Cypress test case
<img width="1176" alt="Screenshot 2024-11-19 at 2 53 01 PM" src="https://github.com/user-attachments/assets/70161188-804b-49a2-a1ee-aebcaf1a1aeb">
## 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/admin.rs`
**2. Type Definitions**
- `crates/router/src/types/transformers.rs`
**3. Tests**
- `cypress-tests/cypress/support/commands.js`
**4. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Detailed Identifier Changes:**
Commit 56117699:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 6583, "pr_title": "refactor(router): remove metadata, additional_merchant_data and connector_wallets_details from connector list api", "merged_at": "2024-11-20T14:48:30Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs"], "types": ["crates/router/src/types/transformers.rs"], "tests": ["cypress-tests/cypress/support/commands.js"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add outgoing payment webhooks 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 -->
This PR adds outgoing payment webhooks for v2. This PR improves the webhook delivery flow by introducing traits to enhance extensibility and modularity. Additionally, it optimizes the raise_webhooks_analytics_event process by removing an unnecessary database fetch.
### 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
Setup incoming webhooks and trigger a successful payment, to receive an outgoing webhook
- The incoming webhook to be setup to {base_url}/v2/webhooks/(merchant_id}/{profile_id}/{mca_id}
- Create Payment
```
curl --location 'http://localhost:8080/v2/payments/create-intent' \
--header 'api-key: dev_gkzPh8C1IaaBlf1Vo31QNoKUkhRuKUDYfm6zoe1LLiZL3rpOyDppUVI2nrLT9KIP' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_7MjgLAahgfPro5dOWlHk' \
--header 'Authorization: api-key=dev_gkzPh8C1IaaBlf1Vo31QNoKUkhRuKUDYfm6zoe1LLiZL3rpOyDppUVI2nrLT9KIP' \
--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"
},
"shipping": {
"address": {
"first_name": "John",
"last_name": "Dough",
"city": "Karwar",
"zip": "581301",
"state": "Karnataka"
},
"email": "example@example.com"
}
}'
```
- Confirm Payment
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0196803f8a8e7840810bf8dcc6b0fa74/confirm-intent' \
--header 'x-client-secret: cs_0196803f8aa376c282d881ceb57c6aac' \
--header 'x-profile-id: pro_7MjgLAahgfPro5dOWlHk' \
--header 'Content-Type: application/json' \
--header 'Authorization: publishable-key=pk_dev_2c342eea3f5f404bbb6938fc00bae5e7, client-secret=cs_0196803f8aa376c282d881ceb57c6aac' \
--data '{
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "John Doe",
"card_cvc": "100"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit"
}
'
```
Outgoing Payload Response
```
{
"merchant_id": "cloth_seller_pKhmzgXrMESoKLtxaSSd",
"event_id": "evt_0196803f9be67fb28967b94a04807324",
"event_type": "payment_succeeded",
"content": {
"type": "payment_details",
"object": {
"id": "12345_pay_0196803f8a8e7840810bf8dcc6b0fa74",
"status": "succeeded",
"amount": {
"order_amount": 100,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"skip_external_tax_calculation": "Skip",
"skip_surcharge_calculation": "Skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"customer_id":NULL
"connector":"stripe"
"created":"2025-04-29T06:32:50.077Z"
"payment_method_data":{...}
"payment_method_type":"card"
"payment_method_subtype":"credit"
"connector_transaction_id":"pi_3RJ7iqD5R7gDAGff0jchh4In"
"connector_reference_id":NULL
"merchant_connector_id":"mca_5Ekmol3FgPzd98j0c3wY"
"browser_info":NULL
"error":NULL
"shipping":{...}
"billing":{...}
"attempts":NULL
"connector_token_details":{...}
"payment_method_id":NULL
"next_action":NULL
"return_url":"https://google.com/success"
"authentication_type":"no_three_ds"
"authentication_type_applied":NULL
}
}
},
"timestamp": "2024-11-19T12:42:10.267Z"
}
```
Also, tested failed webhook delivery cases
## 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`
- `crates/api_models/src/webhooks.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/events.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
**4. Core Business Logic**
- `crates/router/src/core/webhooks.rs`
- `crates/router/src/core/webhooks/incoming_v2.rs`
- `crates/router/src/core/webhooks/outgoing_v2.rs`
- ... and 2 more files
**5. Other**
- `crates/router/src/db/events.rs`
- `crates/router/src/events/outgoing_webhook_logs.rs`
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (30 changes)
- Extend existing types with new fields (199 changes)
- Add conditional logic for feature flags or filtering (7 changes)
**Detailed Identifier Changes:**
Commit aa6ebf8a:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/api_models/src/webhooks.rs**
Modify existing code
**crates/diesel_models/src/events.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Add:
- function: pub::get_webhook_url_from_profile
**crates/router/src/core/webhooks.rs**
Add:
- mod: private::outgoing_v2
**crates/router/src/core/webhooks/incoming_v2.rs**
Modify existing code
**crates/router/src/core/webhooks/outgoing_v2.rs**
Add:
- function: pub::create_event_and_trigger_outgoing_webhook
- function: pub::trigger_webhook_and_raise_event
- function: private::trigger_webhook_to_merchant
- function: private::raise_webhooks_analytics_event
- function: pub::get_outgoing_webhook_request
- function: private::get_outgoing_webhook_request_inner
- function: private::build_and_send_request
- function: private::api_client_error_handler
- function: private::update_event_in_storage
- function: private::update_overall_delivery_status_in_storage
- function: private::handle_successful_delivery
- function: private::handle_failed_delivery
- function: private::foreign_from
- function: private::foreign_from
- function: private::handle_error_response
- function: private::handle_success_response
- function: private::notified_action
- function: private::not_notified_action
- function: private::notified_action
- function: private::not_notified_action
- function: private::notified_action
- function: private::not_notified_action
- function: private::get_action_handler
- struct: private::InitialAttempt
- struct: private::AutomaticRetry
- struct: private::ManualRetry
- trait: private::OutgoingWebhookResponseHandler
- trait: private::WebhookNotificationHandler
- impl: impl ForeignFrom<&api::OutgoingWebhookContent> for storage::EventMetadata
- impl: impl ForeignFrom<storage::EventMetadata> for outgoing_webhook_logs::OutgoingWebhookEventContent
- impl: impl OutgoingWebhookResponseHandler for enums::WebhookDeliveryAttempt
- impl: impl WebhookNotificationHandler for InitialAttempt
- impl: impl WebhookNotificationHandler for AutomaticRetry
- impl: impl WebhookNotificationHandler for ManualRetry
**crates/router/src/core/webhooks/types.rs**
Add:
- function: pub::get_outgoing_webhook_response_content
- struct: pub::WebhookResponse
- enum: pub::ScheduleWebhookRetry
- impl: impl WebhookResponse
**crates/router/src/core/webhooks/utils.rs**
Add:
- function: pub::increment_webhook_outgoing_received_count
- function: pub::increment_webhook_outgoing_not_received_count
- function: pub::is_outgoing_webhook_disabled
**crates/router/src/db/events.rs**
Add:
- function: private::test_mockdb_event_interface
**crates/router/src/events/outgoing_webhook_logs.rs**
Modify existing code
|
{"pr_number": 6613, "pr_title": "feat(router): add outgoing payment webhooks for v2", "merged_at": "2025-05-13T19:15:19Z", "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/webhooks.rs"], "database": ["crates/diesel_models/src/events.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/webhooks.rs", "crates/router/src/core/webhooks/incoming_v2.rs", "crates/router/src/core/webhooks/outgoing_v2.rs", "crates/router/src/core/webhooks/types.rs", "crates/router/src/core/webhooks/utils.rs"], "other": ["crates/router/src/db/events.rs", "crates/router/src/events/outgoing_webhook_logs.rs"]}, "change_types": {"structs_added": 4, "functions_added": 30, "enums_added": 1, "fields_added": 199, "imports_added": 16, "conditionals_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [adyenplatform] use YYYY format for expiry year
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Fixes https://github.com/juspay/hyperswitch/issues/9822
### 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
Fixes payout integration via Adyen's Balance platform.
## How did you test it?
<details>
<summary>1. Create payment CIT using YY expiry format</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_RuGo9yGmusS9eyKvdeLu3nCQgVFik0EZObmFY97auCs1uaH79wogRR09cNyHHCqX' \
--data-raw '{"amount":4500,"currency":"EUR","confirm":true,"profile_id":"pro_7at0tT0DBFyUfxzRPAy9","capture_method":"automatic","authentication_type":"three_ds","setup_future_usage":"off_session","connector":["adyen"],"customer_id":"cus_On6GwaZso0Dj2QET3nAk","return_url":"https://google.com","payment_method":"card","payment_method_data":{"card":{"card_number":"4111111111111111","card_exp_month":"03","card_exp_year":"30","card_cvc":"737"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","zip":"94122","country":"IT","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"metadata":{"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":2890}'
Response
{"payment_id":"pay_JdCl0HIHFOc2qcSx5NQc","merchant_id":"merchant_1681193734270","status":"succeeded","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":0,"amount_received":4500,"connector":"adyen","client_secret":"pay_JdCl0HIHFOc2qcSx5NQc_secret_DVoKapPnzOjzHiRnc1nV","created":"2025-10-14T06:25:27.061Z","currency":"EUR","customer_id":"cus_AFJVDA8UkWoMbBwe55tK","customer":{"id":"cus_AFJVDA8UkWoMbBwe55tK","name":"John Doe","email":"guest@example.com","phone":"999999999","phone_country_code":"+65"},"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":"1111","card_type":"DEBIT","card_network":"Visa","card_issuer":"JP Morgan","card_issuing_country":"INDIA","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"IT","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"order_details":null,"email":"guest@example.com","name":"John Doe","phone":"999999999","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":"debit","connector_label":null,"business_country":null,"business_label":null,"business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_AFJVDA8UkWoMbBwe55tK","created_at":1760423127,"expires":1760426727,"secret":"epk_26b163aeaf914b8fbbe22b75399e5806"},"manual_retry_allowed":null,"connector_transaction_id":"T2FG439GDZXRHBV5","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_JdCl0HIHFOc2qcSx5NQc_1","payment_link":null,"profile_id":"pro_E7pM8kGERopEKEhqwfWQ","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_2VGmRSxsisritEdiq4gc","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-10-14T07:13:37.061Z","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_channel":null,"payment_method_id":"pm_KNle3L0kL2srFlFL2Erm","network_transaction_id":"299598812743782","payment_method_status":"active","updated":"2025-10-14T06:25:28.314Z","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":"QV2WMW88WHN776V5","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,"is_stored_credential":null,"mit_category":null}
</details>
<details>
<summary>2. Process payout using stored PM ID</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_RuGo9yGmusS9eyKvdeLu3nCQgVFik0EZObmFY97auCs1uaH79wogRR09cNyHHCqX' \
--data '{"payout_method_id":"pm_1vTW0hxzQMTAPtVyyofs","amount":1,"currency":"EUR","customer_id":"cus_On6GwaZso0Dj2QET3nAk","profile_id":"pro_7at0tT0DBFyUfxzRPAy9","connector":["adyenplatform"],"confirm":true,"auto_fulfill":true}'
Response
{"payout_id":"payout_I1hJxocajs7kHTxm70cF","merchant_id":"merchant_1760422985","merchant_order_reference_id":null,"amount":1,"currency":"EUR","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":"JP Morgan","card_network":"Visa","card_type":"CREDIT","card_issuing_country":"INDIA","bank_code":"JP_JPM","last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"joseph Doe"}},"billing":{"address":{"city":"San Fransico","country":"IT","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"auto_fulfill":true,"customer_id":"cus_On6GwaZso0Dj2QET3nAk","customer":{"id":"cus_On6GwaZso0Dj2QET3nAk","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_I1hJxocajs7kHTxm70cF_secret_tBNbiKjbTZTVRpdVU80j","return_url":null,"business_country":null,"business_label":null,"description":null,"entity_type":"Individual","recurring":false,"metadata":{},"merchant_connector_id":"mca_CZH4gAh2rLYysw0dI3pb","status":"initiated","error_message":null,"error_code":null,"profile_id":"pro_7at0tT0DBFyUfxzRPAy9","created":"2025-10-14T06:30:37.877Z","connector_transaction_id":"38E95U68N9UMFWZ0","priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_1vTW0hxzQMTAPtVyyofs"}
</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. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 5e5a1522:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs**
Modify existing code
|
{"pr_number": 9823, "pr_title": "fix(connector): [adyenplatform] use YYYY format for expiry year", "merged_at": "2025-10-14T08:40:47Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [nordea] add missing metadata in connector validation
## 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 -->
in the previous pr that targeted nordea integration, metadata changes were lost due to conflicts resolutions. this pr adds that back.
### 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).
-->
dashboard does not show connector metadata. this pr fixes that.
closes https://github.com/juspay/hyperswitch/issues/8957
## 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)?
-->
on dashboard, connector metadata for nordea should load.
## 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/connector_validation.rs`
**Detailed Identifier Changes:**
Commit 3da2f822:
Files to modify:
**crates/router/src/core/connector_validation.rs**
Modify existing code
|
{"pr_number": 8958, "pr_title": "fix(connector): [nordea] add missing metadata in connector validation", "merged_at": "2025-08-18T14:48:49Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/connector_validation.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment_methods_v2): add support for network tokenization
## 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 network tokenization for v2/payment-methods
- added network tokenization support for create+confirm payment methods api v2
- introduced new type for network 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)?
-->
test cases -
enable network tokenization for profile
payment-method create api -
```
curl --location 'http://localhost:8080/v2/payment-methods' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_1Z1F459LoQzRTieDsLW2' \
--header 'api-key: dev_sewkgvR4aMq0tWNzDD6Y7IsNr9kPTS9ee19eQOGUaNLXWsqfxusLWu0ZGy2XU3pK' \
--data '{
"customer_id": "12345_cus_0194f66341a27da1af6dc6b7b86cfaeb",
"payment_method_type": "card",
"payment_method_subtype": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "2025",
"card_holder_name": "joseph Doe"
}
},
"network_tokenization":{
"enable":"Enable"
}
}'
```
verify in payment methods table.
<img width="1726" alt="Screenshot 2025-02-14 at 1 08 29 PM" src="https://github.com/user-attachments/assets/2721dce4-c1ad-4a6f-b548-73939211f9a5" />
## 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/payment_methods.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/lib.rs`
- `crates/hyperswitch_domain_models/src/network_tokenization.rs`
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
- ... and 1 more files
**3. Core Business Logic**
- `crates/router/src/core/errors.rs`
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payment_methods/network_tokenization.rs`
- ... and 1 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/Cargo.toml`
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
- ... and 2 more files
**5. Type Definitions**
- `crates/router/src/types/domain.rs`
- `crates/router/src/types/payment_methods.rs`
**6. Configuration Files**
- `crates/router/Cargo.toml`
**7. Other**
- `api-reference-v2/openapi_spec.json`
- `crates/cards/src/lib.rs`
- `crates/cards/src/validate.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (29 changes)
- Implement new functions (48 changes)
- Extend existing types with new fields (226 changes)
- Add conditional logic for feature flags or filtering (6 changes)
**Detailed Identifier Changes:**
Commit 0b972e38:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Modify existing code
**crates/cards/src/lib.rs**
Modify existing code
**crates/cards/src/validate.rs**
Add:
- function: pub::get_card_isin
- function: pub::get_extended_card_bin
- function: pub::get_card_no
- function: pub::get_last4
- function: private::from_str
- function: private::try_from
- function: private::deref
- function: private::deserialize
- struct: pub::NetworkToken
- impl: impl NetworkToken
- impl: impl FromStr for NetworkToken
- impl: impl TryFrom<String> for NetworkToken
- impl: impl Deref for NetworkToken
- impl: impl Deserialize<'de> for NetworkToken
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_card_issuer
- function: private::get_expiry_year_4_digit
- function: private::get_network_token
- function: private::get_network_token
- function: private::get_network_token_expiry_month
- function: private::get_network_token_expiry_month
- function: private::get_network_token_expiry_year
- function: private::get_network_token_expiry_year
- function: private::get_cryptogram
- function: private::get_cryptogram
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- mod: pub::network_tokenization
**crates/hyperswitch_domain_models/src/network_tokenization.rs**
Add:
- struct: pub::CardData
- struct: pub::CardData
- struct: pub::OrderData
- struct: pub::OrderData
- struct: pub::ApiPayload
- struct: pub::CardNetworkTokenResponse
- struct: pub::CardNetworkTokenResponsePayload
- struct: pub::GenerateNetworkTokenResponsePayload
- struct: pub::GetCardToken
- struct: pub::GetCardToken
- struct: pub::AuthenticationDetails
- struct: pub::TokenDetails
- struct: pub::TokenResponse
- struct: pub::DeleteCardToken
- struct: pub::DeleteCardToken
- struct: pub::NetworkTokenErrorInfo
- struct: pub::NetworkTokenErrorResponse
- struct: pub::DeleteNetworkTokenResponse
- struct: pub::CheckTokenStatus
- struct: pub::CheckTokenStatus
- struct: pub::CheckTokenStatusResponsePayload
- struct: pub::CheckTokenStatusResponse
- enum: pub::DeleteNetworkTokenStatus
- enum: pub::TokenStatus
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- function: private::saved_in_locker_default
- function: private::from
- function: private::from
- struct: pub::NetworkTokenData
- struct: pub::NetworkTokenDetails
- struct: pub::NetworkTokenDetailsPaymentMethod
- struct: pub::CardDetailsPaymentMethod
- enum: pub::PaymentMethodsData
- impl: impl From<payment_methods::CardDetail> for CardDetailsPaymentMethod
- impl: impl From<NetworkTokenDetails> for NetworkTokenDetailsPaymentMethod
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Add:
- function: private::get_card_issuer
- function: private::get_expiry_year_4_digit
- function: private::get_network_token
- function: private::get_network_token
- function: private::get_network_token_expiry_month
- function: private::get_network_token_expiry_month
- function: private::get_network_token_expiry_year
- function: private::get_network_token_expiry_year
- function: private::get_cryptogram
- function: private::get_cryptogram
**crates/router/src/core/errors.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Add:
- function: pub::network_tokenize_and_vault_the_pmd
- function: pub::populate_bin_details_for_payment_method
- struct: pub::NetworkTokenPaymentMethodDetails
**crates/router/src/core/payment_methods/network_tokenization.rs**
Remove:
- struct: pub::CardData
- struct: pub::OrderData
- struct: pub::ApiPayload
- struct: pub::CardNetworkTokenResponse
- struct: pub::CardNetworkTokenResponsePayload
- struct: pub::GetCardToken
- struct: pub::AuthenticationDetails
- struct: pub::TokenDetails
- struct: pub::TokenResponse
- struct: pub::DeleteCardToken
- struct: pub::NetworkTokenErrorInfo
- struct: pub::NetworkTokenErrorResponse
- struct: pub::DeleteNetworkTokenResponse
- struct: pub::CheckTokenStatus
- struct: pub::CheckTokenStatusResponsePayload
- struct: pub::CheckTokenStatusResponse
- enum: pub::DeleteNetworkTokenStatus
- enum: pub::TokenStatus
Add:
- function: pub::delete_network_token_from_locker_and_token_service
**crates/router/src/core/payment_methods/transformers.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Modify existing code
**crates/router/src/types/domain.rs**
Add:
- mod: private::network_tokenization
**crates/router/src/types/payment_methods.rs**
Modify existing code
|
{"pr_number": 7145, "pr_title": "feat(payment_methods_v2): add support for network tokenization", "merged_at": "2025-02-14T13:51:59Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "domain": ["crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/network_tokenization.rs", "crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/errors.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/network_tokenization.rs", "crates/router/src/core/payment_methods/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/Cargo.toml", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/adyen/transformers.rs", "crates/router/src/connector/utils.rs"], "types": ["crates/router/src/types/domain.rs", "crates/router/src/types/payment_methods.rs"], "config": ["crates/router/Cargo.toml"], "other": ["api-reference-v2/openapi_spec.json", "crates/cards/src/lib.rs", "crates/cards/src/validate.rs", "crates/router/src/routes/payment_methods.rs"]}, "change_types": {"structs_added": 29, "functions_added": 48, "enums_added": 4, "fields_added": 226, "imports_added": 16, "conditionals_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [ACI, AUTHORIZEDOTNET, BRAINTREE, FIUU, FORTE, PLACETOPAY] Supported features for feature matrix
## 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 -->
Added Feature Matrix supported payment methods, countries and currencies for ACI, Authorizedotnet, Braintree, Fiuu, Forte and Placetopay.
### 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)?
-->
- Request
```
curl --location --request GET 'http://localhost:8080/feature_matrix' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_kl7vP0fysoyX8f1O7wZiJae7n1XS5zhEJbe2zK4rtuDNCg4JMSsWhSc0GNkNKWwC' \
--header 'X-Merchant-Id: merchant_1738299466' \
--data '{
}'
```
- Response
```
{
"connector_count": 48,
"connectors": [
{
"name": "ACI",
"display_name": "ACI",
"description": "ACI Payments delivers secure, real-time electronic payment solutions for businesses, banks, and governments, enabling seamless transactions across channels.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "wallet",
"payment_method_type": "mb_way",
"payment_method_type_display_name": "MB WAY",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"ESP",
"EST",
"PRT"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "wallet",
"payment_method_type": "ali_pay",
"payment_method_type_display_name": "Alipay",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"CHN"
],
"supported_currencies": [
"CNY"
]
},
{
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_type_display_name": "Credit Card",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"AmericanExpress",
"DinersClub",
"Discover",
"JCB",
"Maestro",
"Mastercard",
"UnionPay",
"Visa"
],
"supported_countries": [
"EST",
"PRT",
"GRC",
"ZMB",
"POL",
"KHM",
"LUX",
"SVK",
"HKG",
"VNM",
"HND",
"SWE",
"LTU",
"IRL",
"NZL",
"SVN",
"ARE",
"OMN",
"BGR",
"CHN",
"LIE",
"EGY",
"AND",
"CHE",
"UKR",
"FRA",
"QAT",
"MEX",
"NGA",
"ETH",
"SLV",
"GBR",
"GIB",
"THA",
"DOM",
"SAU",
"IDN",
"MKD",
"JPN",
"CRI",
"USA",
"ISL",
"COL",
"DNK",
"MMR",
"SEN",
"ROU",
"LAO",
"URY",
"FIN",
"CYP",
"ITA",
"PAN",
"HUN",
"CZE",
"PER",
"BEL",
"GHA",
"AUT",
"HRV",
"DEU",
"GTM",
"ESP",
"LBY",
"MOZ",
"PAK",
"MYS"
],
"supported_currencies": [
"ALL",
"KPW",
"ISK",
"PLN",
"BGN",
"EGP",
"CHF",
"LKR",
"PKR",
"ILS",
"USD",
"CZK",
"DOP",
"NZD",
"SGD",
"NOK",
"VND",
"KHR",
"SEK",
"CNY",
"THB",
"COP",
"DKK",
"TRY",
"UYU",
"CRC",
"CLP",
"GBP",
"NGN",
"PEN",
"ZAR",
"HRK",
"IDR",
"MXN",
"HNL",
"UAH",
"RSD",
"PAB",
"HUF",
"SAR",
"TWD",
"JPY",
"MAD",
"MKD",
"PHP",
"MMK",
"EUR",
"QAR",
"LAK",
"RON",
"MYR",
"HKD",
"MZN",
"OMR",
"ZMW",
"ARS",
"AED",
"GHS"
]
},
{
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_type_display_name": "Debit Card",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"AmericanExpress",
"DinersClub",
"Discover",
"JCB",
"Maestro",
"Mastercard",
"UnionPay",
"Visa"
],
"supported_countries": [
"SVK",
"SAU",
"NGA",
"ESP",
"QAT",
"HKG",
"SWE",
"ZMB",
"URY",
"CRI",
"GHA",
"OMN",
"VNM",
"PER",
"CHE",
"PAK",
"DNK",
"PAN",
"CHN",
"ETH",
"MYS",
"NZL",
"ITA",
"LBY",
"KHM",
"MEX",
"ROU",
"IDN",
"JPN",
"GBR",
"MKD",
"MMR",
"HND",
"USA",
"DEU",
"MOZ",
"POL",
"BEL",
"AUT",
"PRT",
"THA",
"GIB",
"GRC",
"CZE",
"SLV",
"HUN",
"SEN",
"GTM",
"CYP",
"FRA",
"LUX",
"LAO",
"FIN",
"EGY",
"LTU",
"SVN",
"HRV",
"ARE",
"COL",
"ISL",
"EST",
"BGR",
"LIE",
"UKR",
"IRL",
"DOM",
"AND"
],
"supported_currencies": [
"ALL",
"CRC",
"COP",
"RSD",
"AED",
"MMK",
"MXN",
"ARS",
"PLN",
"NZD",
"HRK",
"SAR",
"SGD",
"GHS",
"TWD",
"BGN",
"THB",
"PHP",
"CZK",
"OMR",
"HKD",
"VND",
"GBP",
"LKR",
"ISK",
"ILS",
"NGN",
"PEN",
"TRY",
"ZMW",
"CNY",
"KPW",
"LAK",
"PKR",
"IDR",
"NOK",
"CHF",
"KHR",
"SEK",
"JPY",
"UAH",
"DKK",
"MYR",
"EGP",
"ZAR",
"CLP",
"MKD",
"QAR",
"MAD",
"RON",
"UYU",
"HNL",
"EUR",
"MZN",
"PAB",
"HUF",
"DOP",
"USD"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "interac",
"payment_method_type_display_name": "Interac",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"CAN"
],
"supported_currencies": [
"CAD",
"USD"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "sofort",
"payment_method_type_display_name": "Sofort",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"ESP",
"GBR",
"POL",
"DEU",
"ITA",
"CHE",
"NLD",
"AUT",
"BEL"
],
"supported_currencies": [
"GBP",
"CHF",
"HUF",
"EUR",
"PLN"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "giropay",
"payment_method_type_display_name": "Giropay",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"DEU"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "przelewy24",
"payment_method_type_display_name": "Przelewy24",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"POL"
],
"supported_currencies": [
"EUR",
"GBP",
"CZK",
"PLN"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "ideal",
"payment_method_type_display_name": "iDEAL",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"NLD"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "eft",
"payment_method_type_display_name": "EFT",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": null,
"supported_currencies": null
},
{
"payment_method": "bank_redirect",
"payment_method_type": "eps",
"payment_method_type_display_name": "EPS",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"AUT"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "trustly",
"payment_method_type_display_name": "Trustly",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"SWE",
"LVA",
"NOR",
"EST",
"ESP",
"DNK",
"DEU",
"NLD",
"GBR",
"AUT",
"LTU",
"FIN"
],
"supported_currencies": [
"DKK",
"SEK",
"NOK",
"EUR",
"CZK",
"GBP"
]
},
{
"payment_method": "pay_later",
"payment_method_type": "klarna",
"payment_method_type_display_name": "Klarna",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"NLD",
"NOR",
"POL",
"BEL",
"FIN",
"GRC",
"CZE",
"IRL",
"SWE",
"GBR",
"DNK",
"DEU",
"CAN",
"CHE",
"NZL",
"AUS",
"AUT",
"ITA",
"ESP",
"PRT",
"USA",
"FRA"
],
"supported_currencies": [
"CAD",
"CHF",
"DKK",
"NZD",
"NOK",
"USD",
"SEK",
"AUD",
"GBP",
"PLN",
"EUR"
]
}
],
"supported_webhook_flows": []
},
{
"name": "AUTHORIZEDOTNET",
"display_name": "Authorize.net",
"description": " Authorize.net supports payment processing by helping small businesses accept credit card and eCheck payments online, in person on the go.",
"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": [
"AmericanExpress",
"Discover",
"JCB",
"Mastercard",
"Visa"
],
"supported_countries": [
"USA",
"CAN"
],
"supported_currencies": [
"CAD",
"USD"
]
},
{
"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": [
"AmericanExpress",
"Discover",
"JCB",
"Mastercard",
"Visa"
],
"supported_countries": [
"USA",
"CAN"
],
"supported_currencies": [
"CAD",
"USD"
]
},
{
"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": [
"DEU",
"TWN",
"OMN",
"TUR",
"ZAF",
"KAZ",
"BHR",
"PRT",
"CZE",
"NZL",
"URY",
"EST",
"JOR",
"SAU",
"SWE",
"FIN",
"HUN",
"IDN",
"THA",
"PAN",
"BEL",
"DZA",
"ISR",
"ESP",
"VNM",
"ARG",
"POL",
"BRA",
"IND",
"ITA",
"SGP",
"MYS",
"ASM",
"HRV",
"BLR",
"MEX",
"UKR",
"QAT",
"GBR",
"ROU",
"PAK",
"KEN",
"PHL",
"USA",
"ATG",
"LBN",
"BGR",
"EGY",
"LVA",
"AGO",
"AUS",
"RUS",
"COL",
"CHE",
"AUT",
"ARE",
"LKA",
"LTU",
"DNK",
"SVK",
"LUX",
"JPN",
"NLD",
"NOR",
"DOM",
"ALB",
"AZE",
"FRA",
"PER",
"IRL",
"CHL",
"CAN",
"GRC",
"KWT",
"HKG"
],
"supported_currencies": [
"NZD",
"NOK",
"DKK",
"SEK",
"CHF",
"GBP",
"EUR",
"USD",
"AUD",
"PLN",
"CAD"
]
},
{
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_type_display_name": "Apple Pay",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"ITA",
"CHE",
"ARG",
"LTU",
"ISR",
"VNM",
"EST",
"IRL",
"JPN",
"MLT",
"MNE",
"ECU",
"MAR",
"GBR",
"NZL",
"IMN",
"CHL",
"DNK",
"GTM",
"MAC",
"FRA",
"AUT",
"FRO",
"SRB",
"BGR",
"AZE",
"ARE",
"NOR",
"HND",
"SVK",
"ALB",
"COL",
"FIN",
"PRT",
"POL",
"UKR",
"URY",
"KWT",
"SGP",
"ARM",
"ROU",
"CYP",
"HRV",
"DOM",
"MEX",
"GGY",
"CZE",
"TWN",
"ISL",
"HUN",
"BRA",
"AUS",
"MCO",
"SLV",
"DEU",
"LVA",
"BHR",
"CRI",
"GEO",
"PER",
"QAT",
"ZAF",
"USA",
"GRC",
"NLD",
"PAN",
"SVN",
"CAN",
"SWE",
"MDA",
"LIE",
"MYS",
"LUX",
"BEL",
"PRY",
"KAZ",
"SAU",
"HKG",
"GRL",
"ESP"
],
"supported_currencies": [
"EGP",
"PYG",
"QAR",
"INR",
"AED",
"CLP",
"GTQ",
"UAH",
"COP",
"HNL",
"BRL",
"HKD",
"KWD",
"MAD",
"NOK",
"PEN",
"RON",
"VND",
"PLN",
"JPY",
"GHS",
"KZT",
"ZAR",
"ISK",
"CZK",
"KRW",
"EUR",
"CAD",
"AUD",
"HUF",
"SAR",
"SGD",
"CRC",
"DKK",
"USD",
"MYR",
"SEK",
"THB",
"TWD",
"GEL",
"ILS",
"NZD",
"GBP",
"MXN"
]
}
],
"supported_webhook_flows": [
"payments",
"refunds"
]
},
{
"name": "BRAINTREE",
"display_name": "Braintree",
"description": "Braintree, a PayPal service, offers a full-stack payment platform that simplifies accepting payments in your app or website, supporting various payment methods including credit cards and PayPal.",
"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": [
"AmericanExpress",
"Discover",
"JCB",
"UnionPay",
"Mastercard",
"Visa"
],
"supported_countries": [
"SVK",
"PRT",
"MYS",
"FIN",
"SGP",
"JEY",
"CAN",
"ESP",
"HKG",
"LUX",
"SMR",
"FRA",
"CZE",
"AUS",
"POL",
"CHE",
"LIE",
"MCO",
"AUT",
"DEU",
"IMN",
"HRV",
"GGY",
"NZL",
"IRL",
"ITA",
"GBR",
"LVA",
"GRC",
"BGR",
"NOR",
"BEL",
"LTU",
"HUN",
"MLT",
"DNK",
"USA",
"EST",
"NLD",
"CYP",
"ROU",
"SVN",
"AND",
"GIB",
"SWE"
],
"supported_currencies": [
"SRD",
"FJD",
"BMD",
"GTQ",
"TTD",
"DZD",
"MDL",
"ISK",
"ZWL",
"NGN",
"CRC",
"JPY",
"KZT",
"UAH",
"CAD",
"AED",
"QAR",
"PAB",
"GIP",
"SLL",
"BWP",
"NOK",
"ZAR",
"SZL",
"MWK",
"HUF",
"UZS",
"FKP",
"PHP",
"MUR",
"BRL",
"RWF",
"MYR",
"MVR",
"CNY",
"MNT",
"TRY",
"MKD",
"STD",
"SBD",
"CLP",
"SOS",
"TJS",
"AUD",
"BBD",
"BDT",
"BIF",
"CVE",
"AZN",
"AOA",
"IDR",
"KES",
"GEL",
"SYP",
"MOP",
"ETB",
"SEK",
"DOP",
"XOF",
"BZD",
"BSD",
"EGP",
"HKD",
"CHF",
"KYD",
"UGX",
"HNL",
"USD",
"BAM",
"THB",
"GHS",
"AWG",
"CZK",
"NAD",
"NIO",
"PYG",
"SVC",
"LKR",
"YER",
"RUB",
"KHR",
"BYN",
"VES",
"XCD",
"XAF",
"HTG",
"SAR",
"BOB",
"SHP",
"PKR",
"TZS",
"TOP",
"BND",
"GMD",
"EUR",
"UYU",
"KRW",
"DKK",
"GYD",
"COP",
"MAD",
"SCR",
"ILS",
"MXN",
"VND",
"LAK",
"WST",
"INR",
"LBP",
"BGN",
"VUV",
"PEN",
"DJF",
"JMD",
"ARS",
"GBP",
"NPR",
"KMF",
"KGS",
"PLN",
"MZN",
"LRD",
"ZMW",
"XPF",
"GNF",
"LSL",
"SGD",
"TWD",
"RSD",
"RON",
"NZD",
"PGK",
"AMD",
"HRK"
]
},
{
"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": [
"AmericanExpress",
"Discover",
"JCB",
"UnionPay",
"Mastercard",
"Visa"
],
"supported_countries": [
"DEU",
"CHE",
"DNK",
"CZE",
"GBR",
"BEL",
"USA",
"GGY",
"POL",
"CAN",
"AUS",
"ROU",
"NOR",
"FIN",
"IRL",
"MCO",
"FRA",
"LIE",
"LTU",
"PRT",
"SGP",
"HKG",
"IMN",
"SWE",
"EST",
"ITA",
"MLT",
"SVK",
"NLD",
"NZL",
"AND",
"HRV",
"GRC",
"SVN",
"JEY",
"MYS",
"LVA",
"CYP",
"AUT",
"HUN",
"ESP",
"SMR",
"LUX",
"BGR",
"GIB"
],
"supported_currencies": [
"GIP",
"TTD",
"GYD",
"BND",
"GTQ",
"LAK",
"UYU",
"ISK",
"GMD",
"KHR",
"BYN",
"QAR",
"AWG",
"MXN",
"NPR",
"KGS",
"SRD",
"SCR",
"CVE",
"FKP",
"PHP",
"AZN",
"SGD",
"BWP",
"RSD",
"NGN",
"BBD",
"NAD",
"BOB",
"CRC",
"BSD",
"MUR",
"RWF",
"XCD",
"HRK",
"XPF",
"SEK",
"MDL",
"INR",
"SYP",
"XAF",
"ARS",
"KYD",
"MZN",
"AED",
"KRW",
"GEL",
"NOK",
"BMD",
"MWK",
"TJS",
"SOS",
"JMD",
"DJF",
"CLP",
"PEN",
"WST",
"BIF",
"MKD",
"GHS",
"MAD",
"VES",
"DKK",
"HUF",
"LKR",
"TRY",
"GBP",
"TOP",
"CZK",
"SAR",
"XOF",
"KMF",
"LRD",
"HTG",
"PYG",
"RON",
"BGN",
"FJD",
"VUV",
"MNT",
"PLN",
"SHP",
"UAH",
"BZD",
"CHF",
"SBD",
"BRL",
"TWD",
"RUB",
"CNY",
"GNF",
"JPY",
"ZAR",
"AMD",
"EGP",
"IDR",
"BDT",
"LBP",
"AOA",
"HKD",
"THB",
"MYR",
"ZMW",
"SLL",
"HNL",
"KES",
"UZS",
"MVR",
"PAB",
"DZD",
"CAD",
"NZD",
"NIO",
"LSL",
"STD",
"TZS",
"COP",
"YER",
"EUR",
"ZWL",
"ETB",
"PKR",
"KZT",
"PGK",
"BAM",
"UGX",
"SVC",
"MOP",
"SZL",
"VND",
"USD",
"DOP",
"ILS",
"AUD"
]
}
],
"supported_webhook_flows": [
"payments",
"refunds"
]
},
{
"name": "FIUU",
"display_name": "Fiuu",
"description": "Fiuu, formerly known as Razer Merchant Services, is a leading online payment gateway in Southeast Asia, offering secure and seamless payment solutions for businesses of all sizes, including credit and debit cards, e-wallets, and bank transfers.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "bank_redirect",
"payment_method_type": "online_banking_fpx",
"payment_method_type_display_name": "Online Banking FPX",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"MYS"
],
"supported_currencies": [
"MYR"
]
},
{
"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",
"JCB",
"DinersClub",
"UnionPay",
"Mastercard",
"Discover"
],
"supported_countries": [
"IDN",
"VNM",
"CHN",
"SGP",
"TWN",
"HKG",
"THA",
"MYS",
"PHL"
],
"supported_currencies": [
"IDR",
"PHP",
"MYR",
"CNY",
"SGD",
"VND",
"THB",
"TWD",
"HKD"
]
},
{
"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",
"JCB",
"DinersClub",
"UnionPay",
"Mastercard",
"Discover"
],
"supported_countries": [
"PHL",
"MYS",
"SGP",
"IDN",
"TWN",
"HKG",
"THA",
"VNM",
"CHN"
],
"supported_currencies": [
"HKD",
"IDR",
"MYR",
"CNY",
"SGD",
"THB",
"VND",
"TWD",
"PHP"
]
},
{
"payment_method": "real_time_payment",
"payment_method_type": "duit_now",
"payment_method_type_display_name": "DuitNow",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"MYS"
],
"supported_currencies": [
"MYR"
]
},
{
"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": [
"MYS"
],
"supported_currencies": [
"MYR"
]
},
{
"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": [
"MYS"
],
"supported_currencies": [
"MYR"
]
}
],
"supported_webhook_flows": [
"payments",
"refunds"
]
},
{
"name": "FORTE",
"display_name": "Forte",
"description": "CSG Forte offers a unified payments platform, enabling businesses to securely process credit cards, debit cards, ACH/eCheck transactions, and more, with advanced fraud prevention and seamless integration.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"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": [
"AmericanExpress",
"Discover",
"DinersClub",
"JCB",
"Mastercard",
"Visa"
],
"supported_countries": [
"USA",
"CAN"
],
"supported_currencies": [
"USD",
"CAD"
]
},
{
"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": [
"AmericanExpress",
"Discover",
"DinersClub",
"JCB",
"Mastercard",
"Visa"
],
"supported_countries": [
"CAN",
"USA"
],
"supported_currencies": [
"USD",
"CAD"
]
}
],
"supported_webhook_flows": []
},
{
"name": "PLACETOPAY",
"display_name": "PlacetoPay",
"description": "PlacetoPay is a Latin American financial technology company's online payment platform, offering various payment methods and integrations for businesses",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_type_display_name": "Debit Card",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"AmericanExpress",
"DinersClub",
"Mastercard",
"Visa"
],
"supported_countries": [
"PRI",
"URY",
"CRI",
"CHE",
"ECU",
"BEL",
"COL",
"HND",
"MEX",
"PAN"
],
"supported_currencies": [
"USD",
"CLP",
"COP"
]
},
{
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_type_display_name": "Credit Card",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"AmericanExpress",
"DinersClub",
"Mastercard",
"Visa"
],
"supported_countries": [
"PAN",
"ECU",
"CHE",
"MEX",
"HND",
"CRI",
"COL",
"URY",
"BEL",
"PRI"
],
"supported_currencies": [
"CLP",
"USD",
"COP"
]
}
],
"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`
- [ ] 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/aci.rs`
- `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs`
- `crates/hyperswitch_connectors/src/connectors/braintree.rs`
- ... and 3 more files
**2. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**3. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
- ... and 1 more files
**Code Patterns Applied:**
- Implement new functions (18 changes)
- Extend existing types with new fields (170 changes)
**Detailed Identifier Changes:**
Commit 32bbad90:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/aci.rs**
Remove:
- impl: impl ConnectorSpecifications for Aci
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Aci
**crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs**
Remove:
- function: private::validate_connector_against_payment_request
- impl: impl ConnectorSpecifications for Authorizedotnet
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Authorizedotnet
**crates/hyperswitch_connectors/src/connectors/braintree.rs**
Remove:
- function: private::validate_connector_against_payment_request
- impl: impl ConnectorSpecifications for Braintree
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Braintree
**crates/hyperswitch_connectors/src/connectors/fiuu.rs**
Remove:
- function: private::validate_connector_against_payment_request
- impl: impl ConnectorSpecifications for Fiuu
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Fiuu
**crates/hyperswitch_connectors/src/connectors/forte.rs**
Remove:
- function: private::validate_connector_against_payment_request
- impl: impl ConnectorValidation for Forte
- impl: impl ConnectorSpecifications for Forte
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorValidation for Forte
- impl: impl ConnectorSpecifications for Forte
**crates/hyperswitch_connectors/src/connectors/placetopay.rs**
Remove:
- function: private::validate_connector_against_payment_request
- impl: impl ConnectorValidation for Placetopay
- impl: impl ConnectorSpecifications for Placetopay
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorValidation for Placetopay
- impl: impl ConnectorSpecifications for Placetopay
|
{"pr_number": 7854, "pr_title": "feat(connector): [ACI, AUTHORIZEDOTNET, BRAINTREE, FIUU, FORTE, PLACETOPAY] Supported features for feature matrix", "merged_at": "2025-05-12T16:21:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "refund"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/aci.rs", "crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs", "crates/hyperswitch_connectors/src/connectors/braintree.rs", "crates/hyperswitch_connectors/src/connectors/fiuu.rs", "crates/hyperswitch_connectors/src/connectors/forte.rs", "crates/hyperswitch_connectors/src/connectors/placetopay.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"functions_added": 18, "fields_added": 170, "imports_added": 10}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add support for overcapture
## 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 -->
**Overcapture** allows a merchant to capture more than the originally authorized amount for a transaction. In most cases, this is controlled by a connector-level configuration. However, some connectors (such as Stripe) also allow merchants to explicitly request overcapture via the Payments API.
**Proposed Solution:**
1. **When `confirm = false` and capture is manual** →
`payment_intent.enable_overcapture = request.enable_overcapture`
2. **When `confirm = true` and capture is manual** →
* If `request.enable_overcapture` is present →
`payment_intent.enable_overcapture = request.enable_overcapture`
* If not present →
`payment_intent.enable_overcapture = profile.always_enable_overcapture`
3. Some connectors return a flag (e.g., `is_overcapture_enabled`) in the authorization response along with the maximum capturable amount. We store this in the payment attempt and expose it in the payments response.
4. If the connector does not return either the flag or the capturable amount, we fall back to mapping `payment_intent.enable_overcapture` to the `is_overcapture_enabled` flag in the payment attempt. This ensures overcapture is treated as supported whenever the merchant has enabled it at the connector level.
Overcapture is integrated for Stripe and Adyen
### 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)?
-->
<details>
<summary> Configure Always-On Overcapture and Execute Stripe Payment </summary>
Update profile to always enable overcapture
```
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_6ce5b010-70e5-4dd0-a6bc-3ac01eaa3cd2/business_profile/pro_rn8ZFoa2KfpUzAKNoSno' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_py7dOTdNEVlLr9VIZQyCHseeqbfi1VTWcREDapd6DzPiLrjIjuvHI47rOpiFRMGY' \
--data '{
"always_enable_overcapture": true
}'
```
Response
```
{"merchant_id":"postman_merchant_GHAction_6ce5b010-70e5-4dd0-a6bc-3ac01eaa3cd2","profile_id":"pro_rn8ZFoa2KfpUzAKNoSno","profile_name":"US_default","return_url":"https://duck.com/success","enable_payment_response_hash":true,"payment_response_hash_key":"lZdGfbaacey4V87OxDmJwE4yyCEx2TahL0tUcEN3ycgbIev3EU0enx6kgBYGq9CB","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":null,"payment_created_enabled":true,"payment_succeeded_enabled":true,"payment_failed_enabled":true,"payment_statuses_enabled":null,"refund_statuses_enabled":null,"payout_statuses_enabled":null},"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,"is_pre_network_tokenization_enabled":false,"acquirer_configs":null,"is_iframe_redirection_enabled":null,"merchant_category_code":null,"merchant_country_code":null,"dispute_polling_interval":null,"always_enable_overcapture":true}
```
Do a payment via stripe
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_py7dOTdNEVlLr9VIZQyCHseeqbfi1VTWcREDapd6DzPiLrjIjuvHI47rOpiFRMGY' \
--data '{
"amount":90,
"currency": "USD",
"confirm": true,
"capture_method": "manual",
"customer_id": "aaaa",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "371449635398431",
"card_exp_month": "03",
"card_exp_year": "30",
"card_cvc": "7373"
}
},
"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 (The feature has to be enabled at stripe)
```
{"payment_id":"pay_wfYKfjNxA2mn1TbjSWSO","merchant_id":"postman_merchant_GHAction_6ce5b010-70e5-4dd0-a6bc-3ac01eaa3cd2","status":"failed","amount":90,"net_amount":90,"shipping_cost":null,"amount_capturable":90,"amount_received":null,"connector":"stripe","client_secret":"pay_wfYKfjNxA2mn1TbjSWSO_secret_QbqxoHGZjAIZXuYI6JH6","created":"2025-08-21T10:38:07.323Z","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":"manual","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":"30","card_holder_name":null,"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":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":"payment_intent_invalid_parameter","error_message":"This account is not eligible for the requested card features. See https://stripe.com/docs/payments/flexible-payments for more details.","unified_code":"UE_9000","unified_message":"Something went wrong","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":"aaaa","created_at":1755772687,"expires":1755776287,"secret":"epk_105fb4bbbf34472bae0ce371b1fb9253"},"manual_retry_allowed":true,"connector_transaction_id":"pi_3RyVsiAGHc77EJXX0uo45xUt","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_rn8ZFoa2KfpUzAKNoSno","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_35aOuEPFEq2yIkyUwLd5","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-21T10:53:07.323Z","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_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-21T10:38:09.129Z","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":true,"is_overcapture_enabled":null}
```
Override the profile config by passing enable_overcapture = false in the payments request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_py7dOTdNEVlLr9VIZQyCHseeqbfi1VTWcREDapd6DzPiLrjIjuvHI47rOpiFRMGY' \
--data '{
"amount":90,
"currency": "USD",
"confirm": true,
"capture_method": "manual",
"enable_overcapture": false,
"customer_id": "aaaa",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "371449635398431",
"card_exp_month": "03",
"card_exp_year": "30",
"card_cvc": "7373"
}
},
"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_zWQJsuoG4qI2MT8gb8k9","merchant_id":"postman_merchant_GHAction_6ce5b010-70e5-4dd0-a6bc-3ac01eaa3cd2","status":"requires_capture","amount":90,"net_amount":90,"shipping_cost":null,"amount_capturable":90,"amount_received":null,"connector":"stripe","client_secret":"pay_zWQJsuoG4qI2MT8gb8k9_secret_uRgFe5562QNcNnMfCOlU","created":"2025-08-21T10:55:02.663Z","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":"manual","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":"30","card_holder_name":null,"payment_checks":{"cvc_check":"pass","address_line1_check":null,"address_postal_code_check":null},"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"aaaa","created_at":1755773702,"expires":1755777302,"secret":"epk_b8ef720edd5a47a4b35b0edec5300d9c"},"manual_retry_allowed":false,"connector_transaction_id":"pi_3RyW95AGHc77EJXX36ci5XYK","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":"pi_3RyW95AGHc77EJXX36ci5XYK","payment_link":null,"profile_id":"pro_rn8ZFoa2KfpUzAKNoSno","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_35aOuEPFEq2yIkyUwLd5","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-21T11:10:02.663Z","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_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-21T10:55:03.751Z","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":false,"is_overcapture_enabled":false}
```
Try capturing amount greater than auth amount. This must throw an error
```
curl --location 'http://localhost:8080/payments/pay_zWQJsuoG4qI2MT8gb8k9/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_py7dOTdNEVlLr9VIZQyCHseeqbfi1VTWcREDapd6DzPiLrjIjuvHI47rOpiFRMGY' \
--data '{
"amount_to_capture": 100
}'
```
Response
```
{"error":{"type":"invalid_request","message":"amount_to_capture is greater than amount","code":"IR_06"}}
```
</details>
<details>
<summary>Verify Overcapture Support in Adyen Payments</summary>
1. Create a manual payment with Adyen of authorization amount 90
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_89TTZdDLDA3Puic3xo10YGMmufBXe94BuS0sXqYjIV0hnNt9SfAiczVFXaueVaCZ' \
--data '{
"amount":90,
"currency": "USD",
"confirm": true,
"capture_method": "manual",
"enable_overcapture": true,
"customer_id": "aaaa",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "371449635398431",
"card_exp_month": "03",
"card_exp_year": "30",
"card_cvc": "7373"
}
},
"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_hukB7wTi9fIFrYMx9MJe","merchant_id":"postman_merchant_GHAction_c47479b4-7f24-48d5-84bd-04323099e49c","status":"requires_customer_action","amount":90,"net_amount":90,"shipping_cost":null,"amount_capturable":90,"amount_received":null,"connector":"adyen","client_secret":"pay_hukB7wTi9fIFrYMx9MJe_secret_y1tbonfUSgq6VZhKf3P5","created":"2025-08-21T11:10:27.902Z","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":"manual","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":"30","card_holder_name":null,"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":"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_hukB7wTi9fIFrYMx9MJe/postman_merchant_GHAction_c47479b4-7f24-48d5-84bd-04323099e49c/pay_hukB7wTi9fIFrYMx9MJe_1"},"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":"aaaa","created_at":1755774627,"expires":1755778227,"secret":"epk_fb1990165d05435eae00e6aba5f28820"},"manual_retry_allowed":null,"connector_transaction_id":"RBJS3TMVFQV4S675","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":"RBJS3TMVFQV4S675","payment_link":null,"profile_id":"pro_MBqvF5FEe1NDrV049zob","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_zEWkkYzFqtgUUSBsKgGT","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-21T11:25:27.901Z","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_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-21T11:10:28.324Z","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":true,"is_overcapture_enabled":true}
```
Complete the 3ds flow
Psync
```
{"payment_id":"pay_hukB7wTi9fIFrYMx9MJe","merchant_id":"postman_merchant_GHAction_c47479b4-7f24-48d5-84bd-04323099e49c","status":"requires_capture","amount":90,"net_amount":90,"shipping_cost":null,"amount_capturable":90,"amount_received":null,"connector":"adyen","client_secret":"pay_hukB7wTi9fIFrYMx9MJe_secret_y1tbonfUSgq6VZhKf3P5","created":"2025-08-21T11:10:27.902Z","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":"manual","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":"30","card_holder_name":null,"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":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"RBJS3TMVFQV4S675","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_hukB7wTi9fIFrYMx9MJe_1","payment_link":null,"profile_id":"pro_MBqvF5FEe1NDrV049zob","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_zEWkkYzFqtgUUSBsKgGT","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-21T11:25:27.901Z","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_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-21T11:11:31.543Z","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":true,"is_overcapture_enabled":true}
```
Do a capture for 100 dollars
```
curl --location 'http://localhost:8080/payments/pay_hukB7wTi9fIFrYMx9MJe/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_89TTZdDLDA3Puic3xo10YGMmufBXe94BuS0sXqYjIV0hnNt9SfAiczVFXaueVaCZ' \
--data '{
"amount_to_capture": 100
}'
```
Response
```
{"payment_id":"pay_hukB7wTi9fIFrYMx9MJe","merchant_id":"postman_merchant_GHAction_c47479b4-7f24-48d5-84bd-04323099e49c","status":"processing","amount":90,"net_amount":90,"shipping_cost":null,"amount_capturable":90,"amount_received":0,"connector":"adyen","client_secret":"pay_hukB7wTi9fIFrYMx9MJe_secret_y1tbonfUSgq6VZhKf3P5","created":"2025-08-21T11:10:27.902Z","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":"manual","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":"30","card_holder_name":null,"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":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"RBJS3TMVFQV4S675","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_hukB7wTi9fIFrYMx9MJe_1","payment_link":null,"profile_id":"pro_MBqvF5FEe1NDrV049zob","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_zEWkkYzFqtgUUSBsKgGT","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-21T11:25:27.901Z","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_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-21T11:12:03.352Z","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":true,"is_overcapture_enabled":true}
```
Setup the webhooks and you must receive a capture webhook with amount - 100 dollars after this do a Psync
```
{"payment_id":"pay_QFEVpcrIswPKgbhCeaun","merchant_id":"postman_merchant_GHAction_3c5d9f94-26fb-404e-bcaf-94294c12dcb8","status":"succeeded","amount":90,"net_amount":90,"shipping_cost":null,"amount_capturable":90,"amount_received":100,"connector":"adyen","client_secret":"pay_QFEVpcrIswPKgbhCeaun_secret_apGfzZZF3Iarb01284Nw","created":"2025-08-21T09:02:27.251Z","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":"manual","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":"30","card_holder_name":null,"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":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"NWQZPH6S6RW6DXV5","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_QFEVpcrIswPKgbhCeaun_1","payment_link":null,"profile_id":"pro_njovZk0qLxU6P9O5gqbN","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_H6LnXN9zPMDnZQNLJEMf","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-21T09:17:27.251Z","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_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-21T09:13:21.869Z","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,"request_overcapture":true,"overcapture_applied":true}
```
</details>
<img width="487" height="443" alt="Screenshot 2025-08-25 at 2 43 14 PM" src="https://github.com/user-attachments/assets/2f76f02c-c309-4d2f-89a2-bf7d38f84658" />
Adyen Cypress test
<img width="836" height="1122" alt="Screenshot 2025-08-25 at 3 23 26 PM" src="https://github.com/user-attachments/assets/2250dcb1-88dc-4c0d-afec-7366ca237287" />
## 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
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- New Features
- Introduced optional overcapture on payments; responses now indicate if overcapture is enabled.
- Added Business Profile setting to default overcapture for all payments.
- Enabled overcapture support for Stripe and Adyen; surfaces capturable/captured minor amounts when available.
- Validation
- Overcapture disallowed with automatic capture; improved status handling for partial and over-capture scenarios.
- API
- OpenAPI updated with new request/response fields for overcapture.
- Infrastructure
- Added database columns to track overcapture on payment intents, attempts, and business profiles.
<!-- 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. API Request/Response Models**
- `crates/api_models/src/admin.rs`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/payment_intent.rs`
- ... and 2 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
- `crates/hyperswitch_domain_models/src/payments.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- ... and 3 more files
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payments/helpers.rs`
- `crates/router/src/core/payments/operations/payment_capture.rs`
- ... and 6 more files
**5. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs`
- ... and 4 more files
**6. Type Definitions**
- `crates/common_types/src/primitive_wrappers.rs`
- `crates/router/src/types.rs`
- `crates/router/src/types/api/admin.rs`
**7. Utils**
- `crates/router/src/utils/user/sample_data.rs`
**8. Tests**
- `crates/router/tests/payments.rs`
- `crates/router/tests/payments2.rs`
- `cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js`
- ... and 3 more files
**9. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `crates/router/src/db/events.rs`
- `crates/storage_impl/src/mock_db/payment_attempt.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (26 changes)
- Extend existing types with new fields (205 changes)
- Add conditional logic for feature flags or filtering (15 changes)
**Detailed Identifier Changes:**
Commit 04a8cc44:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/connector_enums.rs**
Add:
- function: pub::is_overcapture_supported_by_connector
**crates/common_types/src/primitive_wrappers.rs**
Add:
- function: pub::is_true
- function: private::to_sql
- function: private::from_sql
- function: private::default
- function: private::from
- function: private::from
- function: private::deref
- function: private::to_sql
- function: private::from_sql
- function: private::default
- function: pub::new
- function: private::default
- function: private::deref
- function: private::to_sql
- function: private::from_sql
- struct: pub::AlwaysEnableOvercaptureBool
- struct: pub::EnableOvercaptureBool
- struct: pub::OvercaptureEnabledBool
- impl: impl AlwaysEnableOvercaptureBool
- impl: impl diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for AlwaysEnableOvercaptureBool
- impl: impl diesel::deserialize::FromSql<diesel::sql_types::Bool, DB> for AlwaysEnableOvercaptureBool
- impl: impl Default for AlwaysEnableOvercaptureBool
- impl: impl From<bool> for EnableOvercaptureBool
- impl: impl From<AlwaysEnableOvercaptureBool> for EnableOvercaptureBool
- impl: impl Deref for EnableOvercaptureBool
- impl: impl diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for EnableOvercaptureBool
- impl: impl diesel::deserialize::FromSql<diesel::sql_types::Bool, DB> for EnableOvercaptureBool
- impl: impl Default for EnableOvercaptureBool
- impl: impl OvercaptureEnabledBool
- impl: impl Default for OvercaptureEnabledBool
- impl: impl Deref for OvercaptureEnabledBool
- impl: impl diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for OvercaptureEnabledBool
- impl: impl diesel::deserialize::FromSql<diesel::sql_types::Bool, DB> for OvercaptureEnabledBool
**crates/diesel_models/src/business_profile.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/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs**
Add:
- function: pub::get_maximum_capturable_amount
- struct: pub::PaymentRequestDetails
- struct: pub::StripeOvercaptureResponse
- enum: pub::StripeRequestOvercaptureBool
- enum: pub::StripeOvercaptureStatus
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments.rs**
Add:
- function: pub::get_enable_overcapture_bool_if_connector_supports
**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**
Add:
- function: pub::is_overcapture_enabled
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Add:
- function: pub::validate_overcapture_request
**crates/router/src/core/payments/operations/payment_capture.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/db/events.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/src/utils/user/sample_data.rs**
Modify existing code
**crates/router/tests/connectors/utils.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
|
{"pr_number": 8949, "pr_title": "feat(router): add support for overcapture", "merged_at": "2025-09-09T09:37:16Z", "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"], "database": ["crates/diesel_models/src/business_profile.rs", "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"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "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", "crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_capture.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"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/utils.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/common_types/src/primitive_wrappers.rs", "crates/router/src/types.rs", "crates/router/src/types/api/admin.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "tests": ["crates/router/tests/payments.rs", "crates/router/tests/payments2.rs", "cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js", "cypress-tests/cypress/e2e/configs/Payment/Adyen.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/spec/Payment/00031-Overcapture.cy.js"], "other": ["api-reference/v1/openapi_spec_v1.json", "crates/router/src/db/events.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "migrations/2025-09-08-832974_overcapture_flags_to_payment_intent_attempt_and_profile/down.sql", "migrations/2025-09-08-832974_overcapture_flags_to_payment_intent_attempt_and_profile/up.sql"]}, "change_types": {"structs_added": 5, "functions_added": 26, "enums_added": 2, "fields_added": 205, "imports_added": 3, "conditionals_added": 15}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Payment Intent and MCA changes for split payments
## 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 split_txns_enabled field to business_profile DB, create+update API calls
- Add split_txns_enabled field in PaymentIntent
- PML changes to filter payment methods based on split_enabled in MCA and split_txns_enabled in Intent
### 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 #9047
## 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. Business Profile Create Request (split_txns_enabled)
```
curl --location 'http://localhost:8080/v2/profiles' \
--header 'x-merchant-id: cloth_seller_v2_5WeDFMHDxeA6s3I9WReI' \
--header 'Authorization: admin-api-key=test_admin' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
"profile_name": "businesss",
"return_url": "https://google.com/success",
...
"split_txns_enabled": "enable"
}'
```
Response:
```json
{
"merchant_id": "cloth_seller_v2_5WeDFMHDxeA6s3I9WReI",
"id": "pro_ayVzG5Zr33W31ArJk7CK",
"profile_name": "businesss",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "c94j5uGyFCAIU1N24p3mVl9DKLrSCN0xslChyzawzX1gwvSynCgpX6vS39JuA0J9",
"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,
"payment_statuses_enabled": null,
"refund_statuses_enabled": null,
"payout_statuses_enabled": null
},
"metadata": 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_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,
"order_fulfillment_time": 900,
"order_fulfillment_time_origin": "create",
"tax_connector_id": null,
"is_tax_connector_enabled": false,
"is_network_tokenization_enabled": false,
"should_collect_cvv_during_payment": 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,
"is_debit_routing_enabled": false,
"merchant_business_country": null,
"is_iframe_redirection_enabled": null,
"is_external_vault_enabled": null,
"external_vault_connector_details": null,
"merchant_category_code": null,
"merchant_country_code": null,
"split_txns_enabled": "enable"
}
```
2. Payment Intent Create Request
```
curl --location 'http://localhost:8080/v2/payments/create-intent' \
--header 'api-key: dev_xjdI9HLJv4OJIab8VojIjDWbXN3i4a50fzUaxgaQjtP3vwL3WmQVwNbgNmA9M5DV' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_dPNtC5bK3lNxBYt7kyk4' \
--header 'Authorization: api-key=dev_xjdI9HLJv4OJIab8VojIjDWbXN3i4a50fzUaxgaQjtP3vwL3WmQVwNbgNmA9M5DV' \
--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_0198e54d6c3b7871bcfde4a50ee43b88"
}'
```
```json
{
"id": "12345_pay_0198e54f328775408faf14fc2c47651a",
"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_0198e54f32b07003a723ffba50f47fea",
"profile_id": "pro_dPNtC5bK3lNxBYt7kyk4",
"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_0198e54d6c3b7871bcfde4a50ee43b88",
"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",
"split_txns_enabled": "true",
"expires_on": "2025-08-26T07:52:09.530Z",
"frm_metadata": null,
"request_external_three_ds_authentication": "Skip"
}
```
## 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`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/payment_intent.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
- `crates/hyperswitch_domain_models/src/payments.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payments/transformers.rs`
**5. Type Definitions**
- `crates/router/src/types/api/admin.rs`
**6. Other**
- `api-reference/v2/openapi_spec_v2.json`
- `crates/common_enums/src/enums.rs`
- `crates/openapi/src/openapi_v2.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Extend existing types with new fields (40 changes)
**Detailed Identifier Changes:**
Commit 81b340d3:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::SplitTxnsEnabled
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/services/kafka/payment_intent.rs**
Modify existing code
**crates/router/src/services/kafka/payment_intent_event.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code
|
{"pr_number": 9049, "pr_title": "feat(router): Payment Intent and MCA changes for split payments", "merged_at": "2025-09-01T13:47:28Z", "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"], "database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router/src/types/api/admin.rs"], "other": ["api-reference/v2/openapi_spec_v2.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/services/kafka/payment_intent.rs", "crates/router/src/services/kafka/payment_intent_event.rs", "v2_compatible_migrations/2025-08-25-090221_add-split-txns-enabled-in-payment-intent/down.sql", "v2_compatible_migrations/2025-08-25-090221_add-split-txns-enabled-in-payment-intent/up.sql", "v2_compatible_migrations/2025-08-29-040411_add-split-txns-enabled-in-business-profile/down.sql", "v2_compatible_migrations/2025-08-29-040411_add-split-txns-enabled-in-business-profile/up.sql"]}, "change_types": {"enums_added": 1, "fields_added": 40}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore(cypress): bump cypress to `v14.2.0`
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [x] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Update cypress to latest version `14.2.0`
### 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?
Cypress Tests should pass
<img width="723" alt="image" src="https://github.com/user-attachments/assets/591bb9aa-0d8d-42b8-8210-fadc8eba817b" />
## 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**
- `cypress-tests/package-lock.json`
- `cypress-tests/package.json`
|
{"pr_number": 7640, "pr_title": "chore(cypress): bump cypress to `v14.2.0`", "merged_at": "2025-03-26T11:42:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"tests": ["cypress-tests/package-lock.json", "cypress-tests/package.json"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): [ARCHIPEL] Change connector fields that are currently implemented as required in the code to optional
… implemented as required in the code to optional (#8342)
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for [8342](https://github.com/juspay/hyperswitch/pull/8342)
### 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. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs`
**Code Patterns Applied:**
- Implement new functions (3 changes)
- Extend existing types with new fields (6 changes)
**Detailed Identifier Changes:**
Commit 66d845b6:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs**
Add:
- function: private::from
|
{"pr_number": 8364, "pr_title": "fix(connector): [ARCHIPEL] Change connector fields that are currently implemented as required in the code to optional", "merged_at": "2025-06-17T09:29:52Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs"]}, "change_types": {"functions_added": 3, "fields_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): add template code for stripebilling
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
connector integration template code for stripe billing.
Issue: This PR closes the issue #7212
### 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)?
-->
No testing required since its a template code
## 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. 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/common_enums/src/connector_enums.rs`
- `crates/hyperswitch_connectors/src/connectors.rs`
- `crates/hyperswitch_connectors/src/connectors/stripebilling.rs`
- ... and 9 more files
**3. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/transformers.rs`
**4. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**5. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (78 changes)
- Extend existing types with new fields (154 changes)
**Detailed Identifier Changes:**
Commit af8778e0:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::stripebilling
**crates/hyperswitch_connectors/src/connectors/stripebilling.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::Stripebilling
- impl: impl Stripebilling
- impl: impl api::Payment for Stripebilling
- impl: impl api::PaymentSession for Stripebilling
- impl: impl api::ConnectorAccessToken for Stripebilling
- impl: impl api::MandateSetup for Stripebilling
- impl: impl api::PaymentAuthorize for Stripebilling
- impl: impl api::PaymentSync for Stripebilling
- impl: impl api::PaymentCapture for Stripebilling
- impl: impl api::PaymentVoid for Stripebilling
- impl: impl api::Refund for Stripebilling
- impl: impl api::RefundExecute for Stripebilling
- impl: impl api::RefundSync for Stripebilling
- impl: impl api::PaymentToken for Stripebilling
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Stripebilling
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Stripebilling
- impl: impl ConnectorCommon for Stripebilling
- impl: impl ConnectorValidation for Stripebilling
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Stripebilling
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Stripebilling
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Stripebilling
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Stripebilling
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Stripebilling
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Stripebilling
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Stripebilling
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Stripebilling
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Stripebilling
- impl: impl webhooks::IncomingWebhook for Stripebilling
- impl: impl ConnectorSpecifications for Stripebilling
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/stripebilling/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::StripebillingRouterData
- struct: pub::StripebillingPaymentsRequest
- struct: pub::StripebillingCard
- struct: pub::StripebillingAuthType
- struct: pub::StripebillingPaymentsResponse
- struct: pub::StripebillingRefundRequest
- struct: pub::RefundResponse
- struct: pub::StripebillingErrorResponse
- enum: pub::StripebillingPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for StripebillingRouterData<T>
- impl: impl TryFrom<&StripebillingRouterData<&PaymentsAuthorizeRouterData>> for StripebillingPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for StripebillingAuthType
- impl: impl From<StripebillingPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, StripebillingPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&StripebillingRouterData<&RefundsRouterData<F>>> for StripebillingRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
- impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/configs.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/core/payments/connector_integration_v2_impls.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::stripebilling
**crates/router/tests/connectors/stripebilling.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::StripebillingTest
- impl: impl ConnectorActions for StripebillingTest
- impl: impl utils::Connector for StripebillingTest
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 7228, "pr_title": "feat(connector): add template code for stripebilling", "merged_at": "2025-03-03T10:35:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/connector_integration_v2_impls.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/stripebilling.rs", "crates/hyperswitch_connectors/src/connectors/stripebilling/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/sample_auth.toml", "crates/router/tests/connectors/stripebilling.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", "crates/hyperswitch_interfaces/src/configs.rs"]}, "change_types": {"structs_added": 10, "functions_added": 78, "enums_added": 2, "fields_added": 154, "imports_added": 20}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): introduce `feature` and `feature_data` to gsm
## 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 pull request includes a number of changes to the `gsm` module across multiple files to introduce new features and improve the existing code structure. The most important changes include the addition of new fields and enums, refactoring of existing enums, and introducing domain models for gsm.
### Changes to `gsm` module:
* `crates/api_models/src/gsm.rs`:
* Added new fields `alternate_network_possible` and `feature` to `GsmCreateRequest`, `GsmUpdateRequest`, and `GsmResponse` structs.
* `step_up_possible` and `clear_pan_possible` are made as optional in api contract these are retry feature specific data
and might not be present for other features.
* `crates/common_enums/src/enums.rs`:
* Added new enum`GsmFeature` to handle GSM decision and feature data.
* Remove `Requeue` as feature us not yet implemented
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
### Create gsm rule without passing feature and feature data
```
curl --location 'http://localhost:8080/gsm' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector": "adyenplatform",
"flow": "auth",
"sub_flow": "sub_auth",
"code": "501",
"message": "Server Error",
"status": "failed",
"router_error": "Internal Server Error",
"decision": "retry",
"step_up_possible": true,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"clear_pan_possible": true,
"alternate_network_possible": false
}'
```
```
{
"connector": "adyenplatform",
"flow": "auth",
"sub_flow": "sub_auth",
"code": "501",
"message": "Server Error",
"status": "failed",
"router_error": "Internal Server Error",
"decision": "retry",
"step_up_possible": true,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"clear_pan_possible": true,
"feature": "retry",
"feature_data": {
"retry": {
"step_up_possible": true,
"clear_pan_possible": true,
"alternate_network_possible": false,
"decision": "retry"
}
}
}
```
```
curl --location 'http://localhost:8080/gsm' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector": "stripe",
"flow": "auth",
"sub_flow": "sub_auth",
"code": "501",
"message": "Server Error",
"status": "failed",
"router_error": "Internal Server Error",
"decision": "do_default",
"step_up_possible": false,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"clear_pan_possible": true
}'
```
```
curl --location 'http://localhost:8080/gsm' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector": "stripe",
"flow": "auth",
"sub_flow": "sub_auth",
"code": "501",
"message": "Server Error",
"status": "failed",
"router_error": "Internal Server Error",
"decision": "do_default",
"step_up_possible": false,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"clear_pan_possible": true
}'
```
Db entry
<img width="2334" height="239" alt="image" src="https://github.com/user-attachments/assets/fd177675-dd2f-41d5-abf4-3b6c28411cda" />
### Update rule `"clear_pan_possible": false`
```
curl --location 'http://localhost:8080/gsm/update' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector": "stripe",
"flow": "auth",
"sub_flow": "sub_auth",
"code": "501",
"message": "Server Error",
"status": "failed",
"router_error": "Internal Server Error",
"decision": "do_default",
"step_up_possible": false,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"clear_pan_possible": false
}'
```
```
{
"connector": "stripe",
"flow": "auth",
"sub_flow": "sub_auth",
"code": "501",
"message": "Server Error",
"status": "failed",
"router_error": "Internal Server Error",
"decision": "do_default",
"step_up_possible": false,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"clear_pan_possible": false,
"feature": "retry",
"feature_data": {
"retry": {
"step_up_possible": false,
"clear_pan_possible": false,
"alternate_network_possible": false,
"decision": "do_default"
}
}
}
```
### Test case of existing records
(manually create db entries like the existing ones and try to update it)
db entry showing feature and feature_data to be null
<img width="1310" height="312" alt="image" src="https://github.com/user-attachments/assets/8a1af508-2899-4c56-a112-af37363542c5" />
-> update call will `"clear_pan_possible": true`
```
curl --location 'http://localhost:8080/gsm/update' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector": "novalnet",
"flow": "Authorize",
"sub_flow": "sub_flow",
"code": "525002",
"message": "Personal Identity Card Number not correct",
"status": "Failure",
"router_error": "Internal Server Error",
"decision": "retry",
"step_up_possible": false,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"clear_pan_possible": true
}'
```
```
{
"connector": "novalnet",
"flow": "Authorize",
"sub_flow": "sub_flow",
"code": "525002",
"message": "Personal Identity Card Number not correct",
"status": "Failure",
"router_error": "Internal Server Error",
"decision": "retry",
"step_up_possible": false,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"clear_pan_possible": true,
"feature": "retry",
"feature_data": {
"retry": {
"step_up_possible": false,
"clear_pan_possible": true,
"alternate_network_possible": false,
"decision": "retry"
}
}
}
```
DB entry after update
<img width="1267" height="326" alt="image" src="https://github.com/user-attachments/assets/421c4fe9-eb73-409b-9810-e7101be63bba" />
### Test case for the new change where in which we pass feature and feature data in the request
```
curl --location 'http://localhost:8080/gsm' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector": "stripe",
"flow": "auth",
"sub_flow": "sub_auth",
"code": "501",
"message": "Server Error",
"status": "failed",
"router_error": "Internal Server Error",
"decision": "do_default",
"step_up_possible": true,
"clear_pan_possible": true,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"feature": "retry",
"feature_data": {
"retry": {
"step_up_possible": false,
"clear_pan_possible": false,
"alternate_network_possible": false,
"decision": "do_default"
}
}
}'
```
```
{
"connector": "stripe",
"flow": "auth",
"sub_flow": "sub_auth",
"code": "501",
"message": "Server Error",
"status": "failed",
"router_error": "Internal Server Error",
"decision": "do_default",
"step_up_possible": false,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"clear_pan_possible": false,
"feature": "retry",
"feature_data": {
"retry": {
"step_up_possible": false,
"clear_pan_possible": false,
"alternate_network_possible": false,
"decision": "do_default"
}
}
}
```
<img width="1221" height="336" alt="image" src="https://github.com/user-attachments/assets/8bd9e48b-4f7b-492a-aacc-9d6d8fd969c4" />
We can see that step_up_possible and clear_pan_possible has been passed as true in the root level whereas it has been passed as false in the feature_data. And in the application response clear_pan_possible and step_up_possible is false in both the places as the values in the feature_data takes precedence.
Note :-
Same goes for db state and update gsm call
-> Update call
```
curl --location 'http://localhost:8080/gsm/update' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector": "stripe",
"flow": "auth",
"sub_flow": "sub_auth",
"code": "501",
"message": "Server Error",
"status": "failed",
"router_error": "Internal Server Error",
"decision": "do_default",
"step_up_possible": false,
"clear_pan_possible": false,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"feature": "retry",
"feature_data": {
"retry": {
"step_up_possible": true,
"clear_pan_possible": true,
"alternate_network_possible": false,
"decision": "do_default"
}
}
}'
```
```
{
"connector": "stripe",
"flow": "auth",
"sub_flow": "sub_auth",
"code": "501",
"message": "Server Error",
"status": "failed",
"router_error": "Internal Server Error",
"decision": "do_default",
"step_up_possible": true,
"unified_code": "5xx",
"unified_message": "Error",
"error_category": "frm_decline",
"clear_pan_possible": true,
"feature": "retry",
"feature_data": {
"retry": {
"step_up_possible": true,
"clear_pan_possible": true,
"alternate_network_possible": false,
"decision": "do_default"
}
}
}
```
<img width="1359" height="333" alt="image" src="https://github.com/user-attachments/assets/9e3252ab-4905-4113-a963-999dd6157932" />
-> Test a retry payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-feature: router-custom' \
--header 'x-tenant-id: hyperswitch' \
--header 'api-key: dev_NZClQhIklvWYnqEzfkfdzGOynCohMCTnkbYrPN0HPkQbm6rTnngnthX51kLWDIn2' \
--data-raw '{
"amount": 1000000,
"amount_to_capture": 1000000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"setup_future_usage": "on_session",
"capture_on": "2022-09-10T10:11:12Z",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"customer_id": "cu_1753886032",
"return_url": "http://127.0.0.1:4040",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX",
"last_name": "ss"
},
"email": "raj@gmail.com"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "125.0.0.1"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```
{
"payment_id": "pay_cLWcRqZDJcOaiN3oyxJh",
"merchant_id": "merchant_1753885328",
"status": "succeeded",
"amount": 1000000,
"net_amount": 1000000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000000,
"connector": "cybersource",
"client_secret": "pay_cLWcRqZDJcOaiN3oyxJh_secret_CCZupjoT0zDE6m4s1OCu",
"created": "2025-07-30T14:32:41.449Z",
"currency": "USD",
"customer_id": "cu_1753885961",
"customer": {
"id": "cu_1753885961",
"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": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"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": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": {
"avs_response": {
"code": "X",
"codeRaw": "I1"
},
"card_verification": null
},
"authentication_data": null
},
"billing": null
},
"payment_token": "token_eWHrgeRsB1CJo79hTJVt",
"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",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": "ss"
},
"phone": null,
"email": "raj@gmail.com"
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "http://127.0.0.1:4040/",
"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": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cu_1753885961",
"created_at": 1753885961,
"expires": 1753889561,
"secret": "epk_fa14f011aa934fb29ae59ecdcf6cdd86"
},
"manual_retry_allowed": false,
"connector_transaction_id": "7538859630876495904805",
"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_cLWcRqZDJcOaiN3oyxJh_2",
"payment_link": null,
"profile_id": "pro_OMlZtENVSWshV7Mh9NPv",
"surcharge_details": null,
"attempt_count": 2,
"merchant_decision": null,
"merchant_connector_id": "mca_jAKVTh39vFjuD4LN7ZuX",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-30T14:47:41.449Z",
"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-07-30T14:32:43.450Z",
"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
}
```
## 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/gsm.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/gsm.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/gsm.rs`
- `crates/hyperswitch_domain_models/src/lib.rs`
**4. Core Business Logic**
- `crates/router/src/core/gsm.rs`
- `crates/router/src/core/payments/helpers.rs`
- `crates/router/src/core/payments/retry.rs`
- ... and 2 more files
**5. Type Definitions**
- `crates/common_types/src/domain.rs`
- `crates/router/src/types/transformers.rs`
**6. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/common_enums/src/enums.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (12 changes)
- Extend existing types with new fields (116 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 1fa20a9a:
Files to modify:
**crates/api_models/src/gsm.rs**
Remove:
- enum: pub::GsmDecision
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::GsmDecision
- enum: pub::GsmFeature
**crates/common_types/src/domain.rs**
Add:
- function: pub::get_retry_feature_data
- function: pub::get_decision
- function: pub::is_step_up_possible
- function: pub::is_clear_pan_possible
- function: pub::is_alternate_network_possible
- function: pub::get_decision
- struct: pub::RetryFeatureData
- enum: pub::GsmFeatureData
- impl: impl GsmFeatureData
- impl: impl RetryFeatureData
**crates/diesel_models/src/gsm.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/gsm.rs**
Add:
- function: private::try_from
- function: private::try_from
- function: private::try_from
- struct: pub::GatewayStatusMap
- struct: pub::GatewayStatusMappingUpdate
- impl: impl TryFrom<GatewayStatusMap> for diesel_models::gsm::GatewayStatusMappingNew
- impl: impl TryFrom<GatewayStatusMappingUpdate> for diesel_models::gsm::GatewayStatusMappingUpdate
- impl: impl TryFrom<diesel_models::gsm::GatewayStatusMap> for GatewayStatusMap
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- mod: pub::gsm
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/gsm.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/retry.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/db/gsm.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Add:
- function: private::foreign_from
- impl: impl ForeignFrom<gsm_api_types::GsmCreateRequest> for hyperswitch_domain_models::gsm::GatewayStatusMap
- impl: impl ForeignFrom<&gsm_api_types::GsmCreateRequest> for common_types::domain::GsmFeatureData
|
{"pr_number": 7771, "pr_title": "feat(router): introduce `feature` and `feature_data` to gsm", "merged_at": "2025-07-31T10:59:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/gsm.rs"], "database": ["crates/diesel_models/src/gsm.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/gsm.rs", "crates/hyperswitch_domain_models/src/lib.rs"], "core_business": ["crates/router/src/core/gsm.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payouts/helpers.rs", "crates/router/src/core/payouts/retry.rs"], "types": ["crates/common_types/src/domain.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/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/db/gsm.rs", "crates/router/src/db/kafka_store.rs", "migrations/2025-04-07-133030_add_feature_data_column_to_gsm/down.sql", "migrations/2025-04-07-133030_add_feature_data_column_to_gsm/up.sql"]}, "change_types": {"structs_added": 3, "functions_added": 12, "enums_added": 3, "fields_added": 116, "imports_added": 8, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
revert: implement `NameType` for name validation (#6734)
This reverts commit 1100dcc6053990cf832c00cf29db700d77f78480.
## 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 -->
This PR revert #6734 in main
Reason: digit couldn't be added to nickname because nickname have the same validation as cardholder 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).
-->
## 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/customers.rs`
- `crates/api_models/src/mandates.rs`
- `crates/api_models/src/payment_methods.rs`
- ... and 3 more files
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/address.rs`
- `crates/hyperswitch_domain_models/src/bulk_tokenization.rs`
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
- ... and 2 more files
**3. Core Business Logic**
- `crates/router/src/core/customers.rs`
- `crates/router/src/core/locker_migration.rs`
- `crates/router/src/core/payment_methods.rs`
- ... and 11 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs`
- ... and 34 more files
**5. Type Definitions**
- `crates/common_utils/src/types.rs`
- `crates/router/src/compatibility/stripe/customers/types.rs`
- `crates/router/src/compatibility/stripe/payment_intents/types.rs`
- ... and 3 more files
**6. Utils**
- `crates/router/src/utils.rs`
**7. Tests**
- `crates/cards/tests/basic.rs`
- `crates/router/tests/payments.rs`
- `crates/router/tests/payments2.rs`
**Code Patterns Applied:**
- Implement new functions (8 changes)
- Extend existing types with new fields (249 changes)
- Add conditional logic for feature flags or filtering (2 changes)
|
{"pr_number": 7717, "pr_title": "revert: implement `NameType` for name validation (#6734)", "merged_at": "2025-04-03T13:50:46Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["card"]}, "hierarchy": {"api_models": ["crates/api_models/src/customers.rs", "crates/api_models/src/mandates.rs", "crates/api_models/src/payment_methods.rs", "crates/api_models/src/payments.rs", "crates/api_models/src/payments/additional_info.rs", "crates/api_models/src/payouts.rs"], "domain": ["crates/hyperswitch_domain_models/src/address.rs", "crates/hyperswitch_domain_models/src/bulk_tokenization.rs", "crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_request_types/fraud_check.rs"], "core_business": ["crates/router/src/core/customers.rs", "crates/router/src/core/locker_migration.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/network_tokenization.rs", "crates/router/src/core/payment_methods/tokenize.rs", "crates/router/src/core/payment_methods/tokenize/card_executor.rs", "crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs", "crates/router/src/core/payment_methods/transformers.rs", "crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payouts/helpers.rs", "crates/router/src/core/unified_authentication_service.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/netcetera/netcetera_types.rs", "crates/router/src/connector/payone/transformers.rs", "crates/router/src/connector/riskified/transformers/api.rs", "crates/router/src/connector/signifyd/transformers/api.rs", "crates/router/src/connector/stripe/transformers.rs", "crates/router/src/connector/stripe/transformers/connect.rs", "crates/router/src/connector/utils.rs", "crates/router/tests/connectors/aci.rs", "crates/router/tests/connectors/adyen.rs", "crates/router/tests/connectors/airwallex.rs", "crates/router/tests/connectors/bitpay.rs", "crates/router/tests/connectors/bluesnap.rs", "crates/router/tests/connectors/coinbase.rs", "crates/router/tests/connectors/cryptopay.rs", "crates/router/tests/connectors/cybersource.rs", "crates/router/tests/connectors/fiserv.rs", "crates/router/tests/connectors/forte.rs", "crates/router/tests/connectors/iatapay.rs", "crates/router/tests/connectors/multisafepay.rs", "crates/router/tests/connectors/opennode.rs", "crates/router/tests/connectors/payme.rs", "crates/router/tests/connectors/rapyd.rs", "crates/router/tests/connectors/trustpay.rs", "crates/router/tests/connectors/utils.rs", "crates/router/tests/connectors/worldline.rs"], "types": ["crates/common_utils/src/types.rs", "crates/router/src/compatibility/stripe/customers/types.rs", "crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs", "crates/router/src/types/api/payments.rs", "crates/router/src/types/transformers.rs"], "utils": ["crates/router/src/utils.rs"], "tests": ["crates/cards/tests/basic.rs", "crates/router/tests/payments.rs", "crates/router/tests/payments2.rs"]}, "change_types": {"functions_added": 8, "fields_added": 249, "imports_added": 7, "conditionals_added": 2}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(core): [CARD TESTING GUARD] Added Card Testing Guard Config response in case of NULL
## 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 -->
In our current implementation of `Card Testing Guard`, the `card_testing_guard_config` can be `NULL`
for existing profiles. That has been fixed in this PR to return the default values for `card_testing_guard_config` in case the underlying data is `NULL`
### 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).
-->
Issue Link: https://github.com/juspay/hyperswitch/issues/7598
## 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**
**Business Profile Retrieve**
-Request
```
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_28c1525e-4f97-4f53-82a2-7ea63214a26a/business_profile/pro_N8dPPL3N4soUk236Rbq2' \
--header 'api-key: test_admin'
```
-Response
```
{
"merchant_id": "postman_merchant_GHAction_28c1525e-4f97-4f53-82a2-7ea63214a26a",
"profile_id": "pro_N8dPPL3N4soUk236Rbq2",
"profile_name": "US_default",
"return_url": "https://duck.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "M59W9wzwjThfjmSUuTqagO3k9SaN74rA8BFa4NMGBTRCgzwl7Y9gBNgAAKl0FqHe",
"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": null,
"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
}
```
**Cypress Tests**

## 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/business_profile.rs`
**2. Core Business Logic**
- `crates/router/src/core/admin.rs`
**3. Type Definitions**
- `crates/router/src/types/api/admin.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (9 changes)
**Detailed Identifier Changes:**
Commit 73eb467d:
Files to modify:
**crates/diesel_models/src/business_profile.rs**
Add:
- function: private::default
- impl: impl Default for CardTestingGuardConfig
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code
|
{"pr_number": 7478, "pr_title": "fix(core): [CARD TESTING GUARD] Added Card Testing Guard Config response in case of NULL", "merged_at": "2025-04-21T08:49:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/admin.rs"], "types": ["crates/router/src/types/api/admin.rs"]}, "change_types": {"functions_added": 1, "fields_added": 9, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(success_based): add support for exploration
## 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 -->
Original PR - https://github.com/juspay/hyperswitch/pull/8158
### 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. API Request/Response Models**
- `crates/api_models/src/open_router.rs`
- `crates/api_models/src/routing.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/routing.rs`
**3. Configuration Files**
- `api-reference/hyperswitch_intelligent_router_open_api_spec.yml`
**4. Other**
- `api-reference/openapi_spec.json`
- `crates/external_services/src/grpc_client/dynamic_routing/success_rate_client.rs`
- `proto/success_rate.proto`
**Code Patterns Applied:**
- Extend existing types with new fields (11 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 65490ea2:
Files to modify:
**crates/api_models/src/open_router.rs**
Modify existing code
**crates/api_models/src/routing.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
|
{"pr_number": 8160, "pr_title": "refactor(success_based): add support for exploration", "merged_at": "2025-05-28T06:51:15Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"api_models": ["crates/api_models/src/open_router.rs", "crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/payments/routing.rs"], "config": ["api-reference/hyperswitch_intelligent_router_open_api_spec.yml"], "other": ["api-reference/openapi_spec.json", "crates/external_services/src/grpc_client/dynamic_routing/success_rate_client.rs", "proto/success_rate.proto"]}, "change_types": {"enums_added": 1, "fields_added": 11, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore: resolve v2 warnings in api_models
## 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 resolves the v2 warnings generated in api_models.
### 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`
- [ ] 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`
- `crates/api_models/src/events/payment.rs`
- `crates/api_models/src/events/refund.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 8bca14e9:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/events/payment.rs**
Remove:
- impl: impl ApiEventMetric for CustomerPaymentMethodsListResponse
Add:
- impl: impl ApiEventMetric for payment_methods::CustomerPaymentMethodsListResponse
**crates/api_models/src/events/refund.rs**
Modify existing code
**crates/api_models/src/payment_methods.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
|
{"pr_number": 7353, "pr_title": "chore: resolve v2 warnings in api_models", "merged_at": "2025-04-30T11:34:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs", "crates/api_models/src/events/payment.rs", "crates/api_models/src/events/refund.rs", "crates/api_models/src/payment_methods.rs", "crates/api_models/src/payments.rs"]}, "change_types": {"functions_added": 1, "fields_added": 1, "imports_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): add functionality for transforming QR image color
## 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 functionality to
- Create QR image data URI for a given hex color
- Send back the border color and display text message along with the QR data in `NextActionData` - which is consumed by SDK to take next action
Described in #7405
### 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
DuitNow is a realtime payment system which works by scanning QR codes. Displaying these QR codes has certain guidelines mentioned here - https://docs.developer.paynet.my/branding/duitnow/DuitNow%20Brand.pdf
This PR sends required data in the confirm API response which is consumed by SDK.
## How did you test it?
Tested locally by creating payment links and proceeding with DuitNow payment method.
<details>
<summary>Create a payment link (ensure DuitNow is enabled)</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_mdkyMYu7o5AvOHSe81Y5MYanl7eTn9rFTRg7DdMvIsJm88Iq5QtXrSihb94pVXmW' \
--data-raw '{"customer_id":"cus_AuvaBi0Ga8Wqx0AyKrYd","profile_id":"pro_7ez6O5T557WOZlcVlidL","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"}},"amount":100,"currency":"MYR","payment_link":true,"capture_method":"automatic","billing":{"address":{"line1":"1467","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"MY","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"}},"email":"john.doe@example.co.in","session_expiry":100000,"return_url":"https://example.com","payment_link_config":{"theme":"#003264","display_sdk_only":true,"hide_card_nickname_field":true,"payment_button_colour":"#FFA445","custom_message_for_card_terms":"Pour vérifier votre compte, un montant de 0,00 € sera débité lorsque vous aurez cliqué sur le bouton « Confirmer »","payment_button_text":"Confirmer","payment_button_text_colour":"#003264","skip_status_screen":true,"background_colour":"#F9F9F9"}}'
Response
{"payment_id":"pay_o8k60sUsjHfrG7a4gExy","merchant_id":"merchant_1741062746","status":"requires_payment_method","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":null,"client_secret":"pay_o8k60sUsjHfrG7a4gExy_secret_OVVV51kpUYJUdtXFJz1l","created":"2025-03-04T06:11:28.748Z","currency":"MYR","customer_id":"cus_AuvaBi0Ga8Wqx0AyKrYd","customer":{"id":"cus_AuvaBi0Ga8Wqx0AyKrYd","name":"John Nether","email":"john.doe@example.co.in","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":"automatic","payment_method":null,"payment_method_data":null,"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"MY","line1":"1467","line2":null,"line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":"john.doe@example.co.in","name":"John Nether","phone":"6168205362","return_url":"https://example.com/","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":{"customer_id":"cus_AuvaBi0Ga8Wqx0AyKrYd","created_at":1741068688,"expires":1741072288,"secret":"epk_2abaa6e62d0d4b43af67b73aa52160c9"},"manual_retry_allowed":null,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":{"link":"http://localhost:8080/payment_link/merchant_1741062746/pay_o8k60sUsjHfrG7a4gExy?locale=en","secure_link":null,"payment_link_id":"plink_PLK7sgcmehAkqs93KUAq"},"profile_id":"pro_7ez6O5T557WOZlcVlidL","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-03-05T09:58:08.746Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-04T06:11:28.763Z","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}
</details>
<details>
<summary>Select and proceed with DuitNow</summary>
<img width="498" alt="Screenshot 2025-03-04 at 11 41 48 AM" src="https://github.com/user-attachments/assets/80b2efcf-db64-49e1-ab9e-ac97ab10be6b" />
</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/payments.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/transformers.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs`
- `crates/hyperswitch_connectors/src/constants.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
**4. Type Definitions**
- `crates/router/src/compatibility/stripe/payment_intents/types.rs`
- `crates/router/src/compatibility/stripe/setup_intents/types.rs`
**5. Utils**
- `crates/common_utils/src/errors.rs`
**6. Other**
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (23 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 0e16e1b2:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_utils/src/errors.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/constants.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: pub::new_colored_from_data
- function: pub::parse_hex_color
**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/core/payments/transformers.rs**
Modify existing code
|
{"pr_number": 7414, "pr_title": "feat(connector): add functionality for transforming QR image color", "merged_at": "2025-03-04T11:14:11Z", "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"], "connectors": ["crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/constants.rs", "crates/hyperswitch_connectors/src/utils.rs"], "types": ["crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs"], "utils": ["crates/common_utils/src/errors.rs"], "other": ["api-reference/openapi_spec.json"]}, "change_types": {"functions_added": 2, "fields_added": 23, "imports_added": 1, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): [Card Testing Guard] Implement Card Testing Guard
## 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 -->
**Problem Statement:**
Card testing attacks involve fraudsters using stolen credit card details to make small transactions on e-commerce sites using different combinations of CVC to verify if the CVC is valid. Successful transactions indicate the card is active and the CVC is valid, while failed ones are discarded. This is done to avoid detection before committing larger fraudulent purchases.
**Solution:**
We have implemented three rules for detecting and preventing this card testing attacks:
I) Card <> IP Blocking for Merchant : If there are X number of unsuccessful payment attempts from a single IP Address for a specific merchant, then that combination of Card <> IP will be blocked for that merchant for a particular duration.
II) Card Blocking for Guest Users for Merchant: If there are X number of unsuccessful payment attempts for a single card, then guest user payments will be blocked for that card and that merchant for a particular duration. Logged in customers will still be able to use that card for payment.
III) Customer ID Blocking for Merchant: If there are X number of unsuccessful payment attempts from a single Customer ID, then that customer ID will be blocked from making any payments for a particular duration.
These unsuccessful payment thresholds and duration for blocking is configurable and stored in database.
Whether the merchants want these rules to be enabled/disabled, that is also configurable.
**Implementation:**
The attacker gets the ```client_secret``` from the payment intent create call which happens through our SDK, and uses the ```client_secret``` to hit the /confirm API repeatedly with different sets of card numbers and CVC.
A method ```validate_request_with_state``` has been created in the ```GetTracker``` trait which enforces the three above mentioned rules depending on the business_profile config. The `validate_request_with_state method` internally calls `validate_card_ip_blocking_for_business_profile` method, `validate_guest_user_card_blocking_for_business_profile` method and `validate_customer_id_blocking_for_business_profile` method for performing the below validations:
I) Card<>IP Blocking: A fingerprint is generated for the card which is unique to the ```business_profile``` (by using a hash key which is unique to the profile and stored as ```card_testing_secret_key``` in ```business_profile```). This is done so that the cards are blocked at a profile level. The IP Address is fetched from the payment intent create request, and then for each unsuccessful payment attempt, the value of the redis key CardFingerprint<>IP is increased by 1, and after it reaches a certain threshold, it is blocked.
II) Guest User Card Blocking: A fingerprint is generated for the card which is unique to the ```business_profile``` (by using a hash key which is unique to the profile and stored as ```card_testing_secret_key``` in ```business_profile```). This is done so that the cards are not blocked at a profile level. For each unsuccessful payment attempt, the value of the redis key CardFingerprint is increased by 1, and after it reaches a certain threshold, it is blocked, but only for guest users. Logged in customers can still make payments with that card.
III) Customer ID Blocking: The ```customer_id``` is fetched from the payment intent create call request, and then for each unsuccessful payment attempt, the value of redis key CardFingerprint<>Profile is increased by 1, and after it reaches a certain threshold, it is blocked.
### 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).
-->
## 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**
**Step By Step Guide to Test:**
1. Use Adyen Connector to test the curls (because for Adyen, only a specific CVC works for test cards)
2. Update Business Profile to set `card_ip_blocking_status` as `enabled`, `guest_user_card_blocking_status` as `disabled` and `customer_id_blocking_status` as `disabled`
3. Now that card_ip_blocking is enabled, start hitting the endpoints repeatedly with incorrect CVC to make the payments fail (Use curl provided below). After X attempts (determined by `card_ip_blocking_threshold`), the payment attempt will be blocked.
4. Update Business Profile to set `card_ip_blocking_status` as `disabled`, `guest_user_card_blocking_status` as `enabled` and `customer_id_blocking_status` as `disabled`
5. Now that guest_user_card_blocking is enabled, start hitting the endpoints repeatedly with incorrect CVC to make the payments fail (Use curl provided below). After X attempts (determined by `guest_user_card_blocking_threshold`), the payment attempt will be blocked.
6. Update Business Profile to set `card_ip_blocking_status` as `disabled`, `guest_user_card_blocking_status` as `disabled` and `customer_id_blocking_status` as `enabled`
7. Now that customer_id_blocking is enabled, start hitting the endpoints repeatedly with incorrect CVC to make the payments fail (Use curl provided below). After X attempts (determined by `customer_id_blocking_threshold`), the payment attempt will be blocked.
**Update Business Profile (For enabling card_ip_blocking)**
-Request
```
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_20cfc2e0-4fb3-4fde-a322-a5d4412b1596/business_profile/pro_VvEqQhEZBLj6WGrH4efC' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
"profile_name": "Update5",
"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": {
"display_billing_details": true,
"hide_card_nickname_field": true
},
"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,
"card_testing_guard_config": {
"card_ip_blocking_status": "enabled",
"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
}
}'
```
-Response
```
{
"merchant_id": "postman_merchant_GHAction_20cfc2e0-4fb3-4fde-a322-a5d4412b1596",
"profile_id": "pro_VvEqQhEZBLj6WGrH4efC",
"profile_name": "Update5",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "5C72AqxtJV2P2YfLQoIF7L72uuz9srr3H290cKiA8pEaR0H7kPWqmC8fB6Y8Xe4Y",
"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": {
"domain_name": null,
"theme": null,
"logo": null,
"seller_name": null,
"sdk_layout": null,
"display_sdk_only": null,
"enabled_saved_payment_method": null,
"hide_card_nickname_field": true,
"show_card_form_by_default": null,
"transaction_details": null,
"background_image": null,
"details_layout": null,
"payment_button_text": null,
"business_specific_configs": null,
"allowed_domains": null,
"branding_visibility": 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,
"is_click_to_pay_enabled": false,
"authentication_product_ids": null,
"card_testing_guard_config": {
"card_ip_blocking_status": "enabled",
"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
}
}
```
**1. Card <> IP Blocking (Below Threshold)**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_DXWmMAIEepKhfTAZd13oawyvbN7eNbPHY16nLqlZynQOAOcqdKRWBstt5cQSS7LO' \
--data-raw '{
"amount": 12345,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 12345,
"customer_id": "abcd",
"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": "4212345678901237",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "John Smith",
"card_cvc": "739"
}
},
"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": "9123456789",
"country_code": "+91"
}
},
"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": "9123456789",
"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.6"
}
}'
```
-Response
```
{
"payment_id": "pay_tVK43iCoFLj3giMpq1aR",
"merchant_id": "postman_merchant_GHAction_7522c600-57f2-4a82-b4f4-9df401d240ab",
"status": "failed",
"amount": 12345,
"net_amount": 12345,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_tVK43iCoFLj3giMpq1aR_secret_slmMPbx0VVLowhjqrwF9",
"created": "2025-01-27T07:16:16.548Z",
"currency": "USD",
"customer_id": "abcd",
"customer": {
"id": "abcd",
"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": "1237",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "421234",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "John Smith",
"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": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "9123456789",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "9123456789",
"country_code": "+91"
},
"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": "24",
"error_message": "CVC Declined",
"unified_code": "UE_9000",
"unified_message": "Something went wrong",
"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": "abcd",
"created_at": 1737962176,
"expires": 1737965776,
"secret": "epk_76f0a10b19ad4a91bd597b75680b4afb"
},
"manual_retry_allowed": true,
"connector_transaction_id": "D3W4SJB5J4P8CX65",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_6nc1JRTymtljmHmhnTEt",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_wpJDRDrWhfV2oZR77bFX",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-27T07:31:16.548Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "125.0.0.6",
"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-27T07:16:19.648Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**2. Card <> IP Blocking (After threshold)**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_DXWmMAIEepKhfTAZd13oawyvbN7eNbPHY16nLqlZynQOAOcqdKRWBstt5cQSS7LO' \
--data-raw '{
"amount": 12345,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 12345,
"customer_id": "abcd",
"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": "4212345678901237",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "John Smith",
"card_cvc": "739"
}
},
"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": "9123456789",
"country_code": "+91"
}
},
"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": "9123456789",
"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.6"
}
}'
```
-Response
```
{
"error": {
"type": "invalid_request",
"message": "Blocked due to suspicious activity",
"code": "IR_16"
}
}
```
**3. Guest User Card Blocking (Below Threshold)**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_DXWmMAIEepKhfTAZd13oawyvbN7eNbPHY16nLqlZynQOAOcqdKRWBstt5cQSS7LO' \
--data-raw '{
"amount": 12345,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 12345,
"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": "4212345678901237",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "John Smith",
"card_cvc": "739"
}
},
"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": "9123456789",
"country_code": "+91"
}
},
"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": "9123456789",
"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.6"
}
}'
```
-Response
```
{
"payment_id": "pay_6FU271N4pLzdJAxJEr49",
"merchant_id": "postman_merchant_GHAction_7522c600-57f2-4a82-b4f4-9df401d240ab",
"status": "failed",
"amount": 12345,
"net_amount": 12345,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_6FU271N4pLzdJAxJEr49_secret_wvcjDfb9IucJ4G2m9P0O",
"created": "2025-01-27T07:20:24.599Z",
"currency": "USD",
"customer_id": null,
"customer": {
"id": null,
"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": "1237",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "421234",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "John Smith",
"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": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "9123456789",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "9123456789",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"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": "24",
"error_message": "CVC Declined",
"unified_code": "UE_9000",
"unified_message": "Something went wrong",
"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": true,
"connector_transaction_id": "NTQV5DFG3XPPT9V5",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_6nc1JRTymtljmHmhnTEt",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_wpJDRDrWhfV2oZR77bFX",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-27T07:35:24.599Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "125.0.0.6",
"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-27T07:20:26.282Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**4. Guest User Card Blocking (After Threshold & Guest User)**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_DXWmMAIEepKhfTAZd13oawyvbN7eNbPHY16nLqlZynQOAOcqdKRWBstt5cQSS7LO' \
--data-raw '{
"amount": 12345,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 12345,
"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": "4212345678901237",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "John Smith",
"card_cvc": "739"
}
},
"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": "9123456789",
"country_code": "+91"
}
},
"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": "9123456789",
"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.6"
}
}'
```
-Response
```
{
"error": {
"type": "invalid_request",
"message": "Blocked due to suspicious activity",
"code": "IR_16"
}
}
```
**5. Customer ID Blocking (Below Threshold)**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_DXWmMAIEepKhfTAZd13oawyvbN7eNbPHY16nLqlZynQOAOcqdKRWBstt5cQSS7LO' \
--data-raw '{
"amount": 12345,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 12345,
"customer_id": "abcd",
"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": "4212345678901237",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "John Smith",
"card_cvc": "739"
}
},
"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": "9123456789",
"country_code": "+91"
}
},
"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": "9123456789",
"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.6"
}
}'
```
-Response
```
{
"payment_id": "pay_k631dMCrATBssb71COuI",
"merchant_id": "postman_merchant_GHAction_7522c600-57f2-4a82-b4f4-9df401d240ab",
"status": "failed",
"amount": 12345,
"net_amount": 12345,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_k631dMCrATBssb71COuI_secret_P5VvWWn8owaGR9cONsTA",
"created": "2025-01-27T07:23:44.184Z",
"currency": "USD",
"customer_id": "abcd",
"customer": {
"id": "abcd",
"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": "1237",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "421234",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "John Smith",
"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": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "9123456789",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "9123456789",
"country_code": "+91"
},
"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": "24",
"error_message": "CVC Declined",
"unified_code": "UE_9000",
"unified_message": "Something went wrong",
"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": "abcd",
"created_at": 1737962624,
"expires": 1737966224,
"secret": "epk_365d150a51ac498a8be408a0e048fe9a"
},
"manual_retry_allowed": true,
"connector_transaction_id": "BMF7X5SNLCWNM9V5",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_6nc1JRTymtljmHmhnTEt",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_wpJDRDrWhfV2oZR77bFX",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-27T07:38:44.184Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "125.0.0.6",
"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-27T07:23:45.746Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**6. Customer ID Blocking (After Threshold)**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_DXWmMAIEepKhfTAZd13oawyvbN7eNbPHY16nLqlZynQOAOcqdKRWBstt5cQSS7LO' \
--data-raw '{
"amount": 12345,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 12345,
"customer_id": "abcd",
"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": "4212345678901237",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "John Smith",
"card_cvc": "739"
}
},
"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": "9123456789",
"country_code": "+91"
}
},
"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": "9123456789",
"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.6"
}
}'
```
-Response
```
{
"error": {
"type": "invalid_request",
"message": "Blocked due to suspicious activity",
"code": "IR_16"
}
}
```
**Cypress Tests**

## 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`
- `crates/hyperswitch_domain_models/src/card_testing_guard_data.rs`
- `crates/hyperswitch_domain_models/src/lib.rs`
**4. Core Business Logic**
- `crates/router/src/core.rs`
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/card_testing_guard.rs`
- ... and 19 more files
**5. Type Definitions**
- `crates/router/src/types/api/admin.rs`
- `crates/router/src/types/transformers.rs`
**6. Utils**
- `crates/common_utils/src/consts.rs`
**7. Tests**
- `crates/router/src/services/card_testing_guard.rs`
- `migrations/2025-01-27-113914_add_card_testing_guard_config_column_to_business_profile/down.sql`
- `migrations/2025-01-27-113914_add_card_testing_guard_config_column_to_business_profile/up.sql`
**8. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/openapi/src/openapi.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (15 changes)
- Extend existing types with new fields (284 changes)
- Add conditional logic for feature flags or filtering (15 changes)
**Detailed Identifier Changes:**
Commit 2451e9b7:
Files to modify:
**crates/api_models/src/admin.rs**
Add:
- struct: pub::CardTestingGuardConfig
- enum: pub::CardTestingGuardStatus
**crates/common_utils/src/consts.rs**
Modify existing code
**crates/diesel_models/src/business_profile.rs**
Add:
- struct: pub::CardTestingGuardConfig
**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/hyperswitch_domain_models/src/card_testing_guard_data.rs**
Add:
- struct: pub::CardTestingGuardData
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- mod: pub::card_testing_guard_data
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/consts.rs**
Modify existing code
**crates/router/src/core.rs**
Add:
- mod: pub::card_testing_guard
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/card_testing_guard.rs**
Add:
- mod: pub::utils
**crates/router/src/core/card_testing_guard/utils.rs**
Add:
- function: pub::validate_card_testing_guard_checks
- function: pub::generate_fingerprint
- function: pub::increment_blocked_count_in_cache
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Add:
- function: pub::validate_card_ip_blocking_for_business_profile
- function: pub::validate_guest_user_card_blocking_for_business_profile
- function: pub::validate_customer_id_blocking_for_business_profile
- function: pub::validate_blocking_threshold
**crates/router/src/core/payments/operations.rs**
Add:
- function: private::validate_request_with_state
**crates/router/src/core/payments/operations/payment_approve.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_cancel.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_capture.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_complete_authorize.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Add:
- function: private::validate_request_with_state
**crates/router/src/core/payments/operations/payment_create.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_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_session.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_start.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_status.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
**crates/router/src/core/payments/operations/payments_incremental_authorization.rs**
Modify existing code
**crates/router/src/core/payments/operations/tax_calculation.rs**
Modify existing code
**crates/router/src/services.rs**
Add:
- mod: pub::card_testing_guard
**crates/router/src/services/card_testing_guard.rs**
Add:
- function: private::get_redis_connection
- function: pub::set_blocked_count_in_cache
- function: pub::get_blocked_count_from_cache
- function: pub::increment_blocked_count_in_cache
**crates/router/src/types/api/admin.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Add:
- function: private::foreign_from
- function: private::foreign_from
- impl: impl ForeignFrom<api_models::admin::CardTestingGuardConfig> for diesel_models::business_profile::CardTestingGuardConfig
- impl: impl ForeignFrom<diesel_models::business_profile::CardTestingGuardConfig> for api_models::admin::CardTestingGuardConfig
|
{"pr_number": 7108, "pr_title": "feat(core): [Card Testing Guard] Implement Card Testing Guard ", "merged_at": "2025-02-25T01:14:06Z", "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", "crates/hyperswitch_domain_models/src/card_testing_guard_data.rs", "crates/hyperswitch_domain_models/src/lib.rs"], "core_business": ["crates/router/src/core.rs", "crates/router/src/core/admin.rs", "crates/router/src/core/card_testing_guard.rs", "crates/router/src/core/card_testing_guard/utils.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations.rs", "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_complete_authorize.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_post_session_tokens.rs", "crates/router/src/core/payments/operations/payment_reject.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/payment_session.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/payments_incremental_authorization.rs", "crates/router/src/core/payments/operations/tax_calculation.rs"], "types": ["crates/router/src/types/api/admin.rs", "crates/router/src/types/transformers.rs"], "utils": ["crates/common_utils/src/consts.rs"], "tests": ["crates/router/src/services/card_testing_guard.rs", "migrations/2025-01-27-113914_add_card_testing_guard_config_column_to_business_profile/down.sql", "migrations/2025-01-27-113914_add_card_testing_guard_config_column_to_business_profile/up.sql"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/consts.rs", "crates/router/src/services.rs"]}, "change_types": {"structs_added": 3, "functions_added": 15, "enums_added": 1, "fields_added": 284, "imports_added": 17, "conditionals_added": 15}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): fix `hipay` test cases
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
Fixing the failed cypress test cases for `HiPay` connector.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Was asked to fix the test cases.
## 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)?
-->
### After Fixes
<img width="724" alt="image" src="https://github.com/user-attachments/assets/770b3cfc-5cb9-47c5-a011-c3872bb8d238" />
<!--img width="724" alt="image" src="https://github.com/user-attachments/assets/bd5b5eb0-5638-49f2-ab75-842d9ec1e191" />
<img width="518" alt="image" src="https://github.com/user-attachments/assets/b174985e-8720-46ff-9cc8-7fbd16d26df9" />
<img width="456" alt="image" src="https://github.com/user-attachments/assets/3ad83d72-2bc5-4543-bd5f-9d37880b33bd" />
<img width="455" alt="image" src="https://github.com/user-attachments/assets/a894c149-1d01-4e30-91b6-03bbea9e8785" /-->
## 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/configs/Payment/Hipay.js`
**Code Patterns Applied:**
- Extend existing types with new fields (151 changes)
|
{"pr_number": 8563, "pr_title": "ci(cypress): fix `hipay` test cases", "merged_at": "2025-07-09T07:59:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Hipay.js"]}, "change_types": {"fields_added": 151}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(multitenancy): add a fallback for get commands in redis
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Enhancement
## Description
<!-- Describe your changes in detail -->
- Add a fallback for Redis gets with prefix
- Add a Domain type for Redis for the correctness of adding a prefix
## 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 keep the tenant data isolated from each other, We are using a prefix for Redis keys i.e A key which would be saved as card123 without multitenancy would be saved as public:card123 with Multitenancy.
If the user makes a payment on the older pod where MultiTenancy is disabled and client_secret is saved without a prefix, Now if the confirm calls goes to the pod where Multitenancy is enabled the Payment would fail with Unauthorized. This is just one of the instances where the payments would fail.
## 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)?
-->
NA
## 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
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/api_locking.rs`
- `crates/router/src/core/health_check.rs`
- `crates/router/src/core/payment_methods/cards.rs`
- ... and 10 more files
**2. External Connector Integration**
- `crates/router/src/db/merchant_connector_account.rs`
- `crates/router/src/routes/dummy_connector/utils.rs`
**3. Type Definitions**
- `crates/redis_interface/src/types.rs`
**4. Utils**
- `crates/router/src/utils/currency.rs`
- `crates/router/src/utils/user.rs`
- `crates/router/src/utils/user/two_factor_auth.rs`
- ... and 1 more files
**5. Tests**
- `crates/router/tests/cache.rs`
**6. Configuration Files**
- `crates/redis_interface/Cargo.toml`
- `crates/router/Cargo.toml`
**7. Other**
- `crates/drainer/src/health_check.rs`
- `crates/drainer/src/stream.rs`
- `crates/redis_interface/src/commands.rs`
- ... and 9 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (10 changes)
- Extend existing types with new fields (35 changes)
- Modify database queries (4 changes)
**Detailed Identifier Changes:**
Commit 3cba4aad:
Files to modify:
**crates/drainer/src/health_check.rs**
Modify existing code
**crates/drainer/src/stream.rs**
Modify existing code
**crates/redis_interface/src/commands.rs**
Modify existing code
**crates/redis_interface/src/types.rs**
Add:
- function: pub::tenant_aware_key
- function: pub::tenant_unaware_key
- function: private::from
- struct: pub::RedisKey
- impl: impl RedisKey
- impl: impl From<T> for RedisKey
**crates/router/src/core/api_locking.rs**
Modify existing code
**crates/router/src/core/health_check.rs**
Modify existing code
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
**crates/router/src/core/payment_methods/vault.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_confirm.rs**
Modify existing code
**crates/router/src/core/payments/types.rs**
Modify existing code
**crates/router/src/core/payouts/helpers.rs**
Modify existing code
**crates/router/src/core/pm_auth.rs**
Modify existing code
**crates/router/src/core/poll.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/db/ephemeral_key.rs**
Modify existing code
**crates/router/src/db/merchant_connector_account.rs**
Modify existing code
**crates/router/src/routes/dummy_connector/core.rs**
Modify existing code
**crates/router/src/routes/dummy_connector/utils.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Modify existing code
**crates/router/src/services/authentication/blacklist.rs**
Modify existing code
**crates/router/src/services/authorization.rs**
Modify existing code
**crates/router/src/services/openidconnect.rs**
Modify existing code
**crates/router/src/utils/currency.rs**
Modify existing code
**crates/router/src/utils/user.rs**
Modify existing code
**crates/router/src/utils/user/two_factor_auth.rs**
Modify existing code
**crates/router/tests/cache.rs**
Modify existing code
**crates/scheduler/src/db/queue.rs**
Modify existing code
**crates/scheduler/src/utils.rs**
Modify existing code
**crates/storage_impl/src/lib.rs**
Modify existing code
**crates/storage_impl/src/redis/cache.rs**
Modify existing code
**crates/storage_impl/src/redis/kv_store.rs**
Modify existing code
|
{"pr_number": 7044, "pr_title": "fix(multitenancy): add a fallback for get commands in redis", "merged_at": "2025-01-16T11:11:32Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user", "card"]}, "hierarchy": {"core_business": ["crates/router/src/core/api_locking.rs", "crates/router/src/core/health_check.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/vault.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/types.rs", "crates/router/src/core/payouts/helpers.rs", "crates/router/src/core/pm_auth.rs", "crates/router/src/core/poll.rs", "crates/router/src/core/webhooks/incoming.rs", "crates/router/src/routes/dummy_connector/core.rs"], "connectors": ["crates/router/src/db/merchant_connector_account.rs", "crates/router/src/routes/dummy_connector/utils.rs"], "types": ["crates/redis_interface/src/types.rs"], "utils": ["crates/router/src/utils/currency.rs", "crates/router/src/utils/user.rs", "crates/router/src/utils/user/two_factor_auth.rs", "crates/scheduler/src/utils.rs"], "tests": ["crates/router/tests/cache.rs"], "config": ["crates/redis_interface/Cargo.toml", "crates/router/Cargo.toml"], "other": ["crates/drainer/src/health_check.rs", "crates/drainer/src/stream.rs", "crates/redis_interface/src/commands.rs", "crates/router/src/db/ephemeral_key.rs", "crates/router/src/routes/payment_methods.rs", "crates/router/src/services/authentication/blacklist.rs", "crates/router/src/services/authorization.rs", "crates/router/src/services/openidconnect.rs", "crates/scheduler/src/db/queue.rs", "crates/storage_impl/src/lib.rs", "crates/storage_impl/src/redis/cache.rs", "crates/storage_impl/src/redis/kv_store.rs"]}, "change_types": {"structs_added": 1, "functions_added": 10, "fields_added": 35, "imports_added": 1, "database_queries": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connectors): [Adyen] remove redundant enums
## 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 -->
In Adyen: Removed enums variants with the same renamed name. Affected payment methods include
-> Lawson
-> MiniStop
-> FamilyMart
-> Seicomart
-> PayEasy
This PR doesn't cause any change to the payment request sent to Adyen.
## 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)?
-->
To verify the changes made in this PR, initiate a payment using any of the listed vouchers and ensure that the Adyen with redirect_to_url response.
<details>
<summary> 1. Lawson </summary>
```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_mVIUZkvqkVBfHNj6IkoHdezgCbW8HQcDoZVnVMkjm59bIKBm40qe8szRYSbNrSgM' \
--data-raw '{
"amount": 1000,
"currency": "JPY",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "voucher",
"payment_method_type": "lawson",
"payment_method_data": {
"voucher": {
"lawson": {}
}
},
"billing": {
"address": {
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "635253163",
"country_code": "+81"
},
"email": "someone@kk.com"
}
}'
```
Response
```json
{"payment_id":"pay_agr67IytaxyDfWDsnpXM","merchant_id":"postman_merchant_GHAction_abe7c2a8-b651-4afd-857e-47de8dcb59e0","status":"requires_customer_action","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":1000,"amount_received":null,"connector":"adyen","client_secret":"pay_agr67IytaxyDfWDsnpXM_secret_e7cWiaDDNy815hCXwA3T","created":"2025-03-24T05:28:57.974Z","currency":"JPY","customer_id":null,"customer":{"id":null,"name":null,"email":null,"phone":null,"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":"voucher","payment_method_data":{"voucher":{"seven_eleven":{"first_name":null,"last_name":null,"email":null,"phone_number":null}},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":null,"country":null,"line1":null,"line2":null,"line3":null,"zip":null,"state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"635253163","country_code":"+81"},"email":"someone@kk.com"},"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_agr67IytaxyDfWDsnpXM/postman_merchant_GHAction_abe7c2a8-b651-4afd-857e-47de8dcb59e0/pay_agr67IytaxyDfWDsnpXM_1"},"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"lawson","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":"QXF343VMB3DWCCV5","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"QXF343VMB3DWCCV5","payment_link":null,"profile_id":"pro_B5nviptrAsQPF94dJVxM","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_lZcHWAIRX6u8CymJZYZT","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-24T05:43:57.974Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-24T05:29:01.533Z","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,"issuer_error_code":null,"issuer_error_message":null}
```
</details>
<details>
<summary> 2. Mini Stop </summary>
```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_W3e5hTU3erUs5i5f8jAOQimLhI3rtfDjQeQWx59TBYeHZcYVzdST1b9BazfzLCiS' \
--data-raw '{
"amount": 1000,
"currency": "JPY",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "voucher",
"payment_method_type": "mini_stop",
"payment_method_data": {
"voucher": {
"mini_stop": {}
}
},
"billing": {
"address": {
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "635253163",
"country_code": "+81"
},
"email": "someone@kk.com"
}
}'
```
Response
```json
{"payment_id":"pay_3aqcAzjLWXJLyc6zoYNk","merchant_id":"postman_merchant_GHAction_edf0ac37-15e4-4799-9789-dbf7c89c7613","status":"requires_customer_action","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":1000,"amount_received":null,"connector":"adyen","client_secret":"pay_3aqcAzjLWXJLyc6zoYNk_secret_8vxdX1EtP437ngOJMraT","created":"2025-03-24T05:56:30.461Z","currency":"JPY","customer_id":null,"customer":{"id":null,"name":null,"email":null,"phone":null,"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":"voucher","payment_method_data":{"voucher":{"seven_eleven":{"first_name":null,"last_name":null,"email":null,"phone_number":null}},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":null,"country":null,"line1":null,"line2":null,"line3":null,"zip":null,"state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"635253163","country_code":"+81"},"email":"someone@kk.com"},"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_3aqcAzjLWXJLyc6zoYNk/postman_merchant_GHAction_edf0ac37-15e4-4799-9789-dbf7c89c7613/pay_3aqcAzjLWXJLyc6zoYNk_1"},"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"mini_stop","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":"ZH3NNVR7KN5JVHV5","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"ZH3NNVR7KN5JVHV5","payment_link":null,"profile_id":"pro_hGC37BBwj8Cv75xxqlgk","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3zNQt5SN5xuDD4hwBXvV","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-24T06:11:30.461Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-24T05:56:35.443Z","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,"issuer_error_code":null,"issuer_error_message":null}
```
</details>
<details>
<summary> 3. Family Mart</summary>
```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_W3e5hTU3erUs5i5f8jAOQimLhI3rtfDjQeQWx59TBYeHZcYVzdST1b9BazfzLCiS' \
--data-raw '{
"amount": 1000,
"currency": "JPY",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "voucher",
"payment_method_type": "family_mart",
"payment_method_data": {
"voucher": {
"family_mart": {}
}
},
"billing": {
"address": {
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "635253163",
"country_code": "+81"
},
"email": "someone@kk.com"
}
}'
```
Response
```json
{"payment_id":"pay_2Y4jklwXhABpbODpFQDL","merchant_id":"postman_merchant_GHAction_edf0ac37-15e4-4799-9789-dbf7c89c7613","status":"requires_customer_action","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":1000,"amount_received":null,"connector":"adyen","client_secret":"pay_2Y4jklwXhABpbODpFQDL_secret_7Ir4QLnCFGDctILMQHVS","created":"2025-03-24T05:58:23.666Z","currency":"JPY","customer_id":null,"customer":{"id":null,"name":null,"email":null,"phone":null,"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":"voucher","payment_method_data":{"voucher":{"seven_eleven":{"first_name":null,"last_name":null,"email":null,"phone_number":null}},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":null,"country":null,"line1":null,"line2":null,"line3":null,"zip":null,"state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"635253163","country_code":"+81"},"email":"someone@kk.com"},"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_2Y4jklwXhABpbODpFQDL/postman_merchant_GHAction_edf0ac37-15e4-4799-9789-dbf7c89c7613/pay_2Y4jklwXhABpbODpFQDL_1"},"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"family_mart","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":"D5GBGKVMB3DWCCV5","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"D5GBGKVMB3DWCCV5","payment_link":null,"profile_id":"pro_hGC37BBwj8Cv75xxqlgk","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3zNQt5SN5xuDD4hwBXvV","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-24T06:13:23.666Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-24T05:58:28.227Z","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,"issuer_error_code":null,"issuer_error_message":null}
```
</details>
<details>
<summary>4. Seicomart </summary>
```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_W3e5hTU3erUs5i5f8jAOQimLhI3rtfDjQeQWx59TBYeHZcYVzdST1b9BazfzLCiS' \
--data-raw '{
"amount": 1000,
"currency": "JPY",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "voucher",
"payment_method_type": "seicomart",
"payment_method_data": {
"voucher": {
"seicomart": {}
}
},
"billing": {
"address": {
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "635253163",
"country_code": "+81"
},
"email": "someone@kk.com"
}
}'
```
Response
```json
{"payment_id":"pay_x3C9vn2kxxBXu8mDm1Qm","merchant_id":"postman_merchant_GHAction_edf0ac37-15e4-4799-9789-dbf7c89c7613","status":"requires_customer_action","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":1000,"amount_received":null,"connector":"adyen","client_secret":"pay_x3C9vn2kxxBXu8mDm1Qm_secret_FllBly68xznXB0dQcbDf","created":"2025-03-24T06:06:24.368Z","currency":"JPY","customer_id":null,"customer":{"id":null,"name":null,"email":null,"phone":null,"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":"voucher","payment_method_data":{"voucher":{"seven_eleven":{"first_name":null,"last_name":null,"email":null,"phone_number":null}},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":null,"country":null,"line1":null,"line2":null,"line3":null,"zip":null,"state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"635253163","country_code":"+81"},"email":"someone@kk.com"},"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_x3C9vn2kxxBXu8mDm1Qm/postman_merchant_GHAction_edf0ac37-15e4-4799-9789-dbf7c89c7613/pay_x3C9vn2kxxBXu8mDm1Qm_1"},"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"seicomart","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":"QNGXJKTTVDBJVHV5","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"QNGXJKTTVDBJVHV5","payment_link":null,"profile_id":"pro_hGC37BBwj8Cv75xxqlgk","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3zNQt5SN5xuDD4hwBXvV","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-24T06:21:24.368Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-24T06:06:28.749Z","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,"issuer_error_code":null,"issuer_error_message":null}
```
</details>
<details>
<summary>5. PayEasy </summary>
```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_W3e5hTU3erUs5i5f8jAOQimLhI3rtfDjQeQWx59TBYeHZcYVzdST1b9BazfzLCiS' \
--data-raw '{
"amount": 1000,
"currency": "JPY",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "voucher",
"payment_method_type": "pay_easy",
"payment_method_data": {
"voucher": {
"pay_easy": {}
}
},
"billing": {
"address": {
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "635253163",
"country_code": "+81"
},
"email": "someone@kk.com"
}
}'
```
Response
```json
{"payment_id":"pay_GaDjARqqiedZLVkS37dO","merchant_id":"postman_merchant_GHAction_edf0ac37-15e4-4799-9789-dbf7c89c7613","status":"requires_customer_action","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":1000,"amount_received":null,"connector":"adyen","client_secret":"pay_GaDjARqqiedZLVkS37dO_secret_7h0wTHAIx66GfNGkyhHU","created":"2025-03-24T06:07:37.357Z","currency":"JPY","customer_id":null,"customer":{"id":null,"name":null,"email":null,"phone":null,"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":"voucher","payment_method_data":{"voucher":{"seven_eleven":{"first_name":null,"last_name":null,"email":null,"phone_number":null}},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":null,"country":null,"line1":null,"line2":null,"line3":null,"zip":null,"state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"635253163","country_code":"+81"},"email":"someone@kk.com"},"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_GaDjARqqiedZLVkS37dO/postman_merchant_GHAction_edf0ac37-15e4-4799-9789-dbf7c89c7613/pay_GaDjARqqiedZLVkS37dO_1"},"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"pay_easy","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":"JPL35LT8KKFSXC75","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"JPL35LT8KKFSXC75","payment_link":null,"profile_id":"pro_hGC37BBwj8Cv75xxqlgk","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3zNQt5SN5xuDD4hwBXvV","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-24T06:22:37.357Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-24T06:07:42.188Z","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,"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`
- [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. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
**Detailed Identifier Changes:**
Commit 68aa4854:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
|
{"pr_number": 7601, "pr_title": "fix(connectors): [Adyen] remove redundant enums ", "merged_at": "2025-03-26T10:26:02Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [NETCETERA] fix response field for netcetera authentication response
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Currently we are not recieving field **_three_ds_requestor_challenge_ind_** in Netcetera's authentication response since the struct is incorrectly declared in the transformers file.
1. **_three_ds_requestor_challenge_ind_** is currently a part of _**NetceteraAuthenticationSuccessResponse**_ enum, but it should be a field inside **_authenitcation_request_**
2. **_three_ds_requestor_challenge_ind_** has type optional string currently, but it should be a vector of string (ref documentation - https://3dss.netcetera.com/3dsserver/doc/2.5.2.1/3ds-authentication)
**Current structure**
```
NetceteraAuthenticationSuccessResponse{
....
three_ds_requestor_challenge_ind: Option<String>
...}
```
**Correct structure**
```
NetceteraAuthenticationSuccessResponse{
....
authentication_request: {
three_ds_requestor_challenge_ind: Option<Vector<String>>,
}
...}
```
This PR introduces the above fix in the struct.
### 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 netcetera's challenge via local hyperswitch sdk.
As expected, we are now able to get **_three_ds_requestor_challenge_ind_** field in the NetceteraAuthenticationSuccessResponse.
<img width="2560" height="135" alt="Screenshot 2025-08-06 at 4 29 03 PM" src="https://github.com/user-attachments/assets/45fee6c0-b785-4f3e-abb2-0d74468d2024" />
## 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/netcetera/transformers.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit 30b45226:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs**
Add:
- struct: pub::AuthenticationRequest
|
{"pr_number": 8850, "pr_title": "fix(connector): [NETCETERA] fix response field for netcetera authentication response", "merged_at": "2025-08-06T13:40:16Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs"]}, "change_types": {"structs_added": 1, "fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): add support for upi_intent and upi_qr
## Type of Change
<!-- Put an `x` in the boxes that apply -->
Add support for UPI Intent uri information in payment responses by introducing a new next action type that properly handles UPI intent URIs from the Unified Connector Service (UCS).
Add UpiQr payment method type with exhaustive pattern matching across all connectors.
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
- Add SdkUpiIntentInformation struct and NextActionData variant for URI responses
- Add UpiQr payment method type with exhaustive pattern matching across all connectors
### 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)?
-->
<details>
<summary>Enable UCS Config</summary>
**Request**
```bash
curl --location 'http://localhost:8080/v2/configs/' \
--header 'Authorization: admin-api-key=-' \
--header 'Content-Type: application/json' \
--header 'api-key: -' \
--data '{
"key": "ucs_enabled",
"value": "true"
}'
```
</details>
<details>
<summary>Enable UCS Config - Authorize</summary>
**Request**
```bash
curl --location 'http://localhost:8080/v2/configs/' \
--header 'Content-Type: application/json' \
--header 'Authorization: admin-api-key=-' \
--header 'api-key: -' \
--data '{
"key": "ucs_rollout_config_cloth_seller1759845350_tC1lH69Qgy3zCcC7ODE2_razorpay_upi_Authorize",
"value": "1.0"
}'
```
</details>
<details>
<summary>Payments - create+confirm</summary>
**Request**
```json
{
"amount_details": {
"order_amount": 100,
"currency": "INR"
},
"merchant_connector_details": {
"connector_name": "razorpay",
"merchant_connector_creds": {
"auth_type": "-",
"api_key": "-",
"key1": "-"
}
},
"capture_method": "automatic",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method_data": {
"upi": {
"upi_intent": {
//"vpa_id": "success@razorpay"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IN",
"first_name": "Swangi",
"last_name": "Kumari"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "swangi.kumari@juspay.in"
}
},
"merchant_reference_id": "{{$timestamp}}",
"payment_method_subtype": "upi_intent",
"payment_method_type": "upi",
"return_raw_connector_response": true
}
```
</details>
<details>
<summary>Payment Response</summary>
**Response**
```json
{
"id": "12345_pay_0199bf084f0679e3adfe80128df0e8a1",
"status": "requires_customer_action",
"amount": {
"order_amount": 100,
"currency": "INR",
"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": 100,
"amount_captured": 100
},
"customer_id": null,
"connector": "razorpay",
"created": "2025-10-07T14:16:56.841Z",
"modified_at": "2025-10-07T14:17:00.767Z",
"payment_method_data": {
"billing": {
"address": {
"city": "San Fransico",
"country": "IN",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "Swangi",
"last_name": "Kumari",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "swangi.kumari@juspay.in"
}
},
"payment_method_type": "upi",
"payment_method_subtype": "upi_intent",
"connector_transaction_id": "pay_RQc3oRG2vz1RlV",
"connector_reference_id": "order_RQc3oHOo2AieDT",
"merchant_connector_id": null,
"browser_info": null,
"error": null,
"shipping": null,
"billing": null,
"attempts": null,
"connector_token_details": null,
"payment_method_id": null,
"next_action": {
"type": "sdk_upi_intent_information",
"sdk_uri": "upi://pay?pa=upi@razopay&pn=MWSolutions&tr=bLsnV4bsu3xDjOS&tn=razorpay&am=1&cu=INR&mc=5411"
},
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"authentication_type_applied": "no_three_ds",
"is_iframe_redirection_enabled": null,
"merchant_reference_id": "1759846617",
"raw_connector_response": "{\"razorpay_payment_id\":\"pay_RQc3oRG2vz1RlV\",\"link\":\"upi://pay?pa=upi@razopay&pn=MWSolutions&tr=bLsnV4bsu3xDjOS&tn=razorpay&am=1&cu=INR&mc=5411\"}",
"feature_metadata": null,
"metadata": 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 **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/payments/additional_info.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.rs`
- `crates/router/src/core/payments/transformers.rs`
- `crates/router/src/core/unified_connector_service.rs`
- ... and 1 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyen.rs`
- `crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs`
- ... and 4 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/transformers.rs`
**6. Utils**
- `crates/kgraph_utils/src/mca.rs`
- `crates/kgraph_utils/src/transformers.rs`
- `crates/payment_methods/src/helpers.rs`
**7. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/common_enums/src/enums.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (2 changes)
- Extend existing types with new fields (8 changes)
**Detailed Identifier Changes:**
Commit 5c7a6073:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::UpiQrData
- struct: pub::SdkUpiIntentInformation
**crates/api_models/src/payments/additional_info.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_enums/src/transformers.rs**
Modify existing code
**crates/euclid/src/frontend/dir/enums.rs**
Modify existing code
**crates/euclid/src/frontend/dir/lowering.rs**
Modify existing code
**crates/euclid/src/frontend/dir/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/klarna.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- struct: pub::UpiQrData
**crates/kgraph_utils/src/mca.rs**
Modify existing code
**crates/kgraph_utils/src/transformers.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/helpers.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/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/unified_connector_service.rs**
Modify existing code
**crates/router/src/core/unified_connector_service/transformers.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 9716, "pr_title": "feat(core): add support for upi_intent and upi_qr", "merged_at": "2025-10-13T13:09:37Z", "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/payments/additional_info.rs"], "domain": ["crates/hyperswitch_domain_models/src/payment_method_data.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/unified_connector_service.rs", "crates/router/src/core/unified_connector_service/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/adyen.rs", "crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs", "crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/klarna.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs"], "types": ["crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs", "crates/router/src/types/transformers.rs"], "utils": ["crates/kgraph_utils/src/mca.rs", "crates/kgraph_utils/src/transformers.rs", "crates/payment_methods/src/helpers.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/euclid/src/frontend/dir/enums.rs", "crates/euclid/src/frontend/dir/lowering.rs", "crates/euclid/src/frontend/dir/transformers.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 3, "functions_added": 2, "fields_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(payments_v2): use batch encryption for intent create and confirm intent
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Refactoring
## Description
<!-- Describe your changes in detail -->
This PR adds batch encryption for the payment intent create and payment intent confirm apis. This also refactors the `to_encryptable` operation to fix a small bug which considers the inner type and ignores the annotated types in certain conditions.
This PR also adds a domain type for address which will be used across the application instead of the api models ( which is the current scenerio ). This will be used in the subsequent PRs.
## 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).
-->
In higher environments, the encryption and decryption happens via the key manager service which is an external api call. If we are encrypting every field of a domain model individually, this would take a lot of network calls and add latency. So we are batch encrypting them.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
- Check the sanity of payments v2
- Create a payment
- Confirm the payment
- Retrieve the payment
All the above should return 200 status code
## 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
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/address.rs`
- `crates/hyperswitch_domain_models/src/lib.rs`
- `crates/hyperswitch_domain_models/src/payments.rs`
- ... and 1 more files
**2. Core Business Logic**
- `crates/router/src/core/payments/operations/payment_confirm_intent.rs`
- `crates/router/src/core/payments/operations/payment_create_intent.rs`
- `crates/router/src/core/payments/transformers.rs`
**3. Other**
- `crates/router_derive/src/macros/to_encryptable.rs`
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (9 changes)
- Extend existing types with new fields (65 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 108b1603:
Files to modify:
**crates/hyperswitch_domain_models/src/address.rs**
Add:
- function: pub::unify_address
- function: pub::get_optional_full_name
- function: pub::unify_address_details
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- struct: pub::Address
- struct: pub::AddressDetails
- struct: pub::PhoneDetails
- impl: impl masking::SerializableSecret for Address
- impl: impl Address
- impl: impl AddressDetails
- impl: impl From<api_models::payments::Address> for Address
- impl: impl From<api_models::payments::AddressDetails> for AddressDetails
- impl: impl From<api_models::payments::PhoneDetails> for PhoneDetails
- impl: impl From<Address> for api_models::payments::Address
- impl: impl From<AddressDetails> for api_models::payments::AddressDetails
- impl: impl From<PhoneDetails> for api_models::payments::PhoneDetails
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- mod: pub::address
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create_intent.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router_derive/src/macros/to_encryptable.rs**
Modify existing code
|
{"pr_number": 6589, "pr_title": "refactor(payments_v2): use batch encryption for intent create and confirm intent", "merged_at": "2024-11-26T09:10:41Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/address.rs", "crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs"], "core_business": ["crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_create_intent.rs", "crates/router/src/core/payments/transformers.rs"], "other": ["crates/router_derive/src/macros/to_encryptable.rs"]}, "change_types": {"structs_added": 3, "functions_added": 9, "fields_added": 65, "imports_added": 11, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat: Kv changes for V2 feature
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
#8389
- Added Kv Redis support to - payment_intent V2, payment_attempt V2 models
- Added enable Kv route for v2 merchant-account
added enable kv api for v2 merchant account
`
curl --location 'https://<host>/v2/merchant-accounts/:mid/kv' \
--header 'Authorization: admin-api-key=***' \
--header 'x-organization-id:***' \
--header 'Content-Type: application/json' \
--data '{"kv_enabled" : true}'
`
### 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)?
-->
Locally tested kv writes and drainer functionality
## 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/kv.rs`
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/payment_intent.rs`
**2. Core Business Logic**
- `crates/router/src/routes/dummy_connector/core.rs`
**3. External Connector Integration**
- `crates/router/src/routes/dummy_connector.rs`
**4. Configuration Files**
- `crates/drainer/Cargo.toml`
- `crates/hyperswitch_interfaces/Cargo.toml`
**5. Other**
- `crates/router/src/lib.rs`
- `crates/router/src/routes/admin.rs`
- `crates/router/src/routes/app.rs`
- ... and 5 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (7 changes)
- Extend existing types with new fields (177 changes)
- Add conditional logic for feature flags or filtering (3 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit d2740f03:
Files to modify:
**crates/diesel_models/src/kv.rs**
Add:
- struct: pub::PaymentAttemptUpdateMems
**crates/diesel_models/src/payment_attempt.rs**
Add:
- function: pub::apply_changeset
- impl: impl PaymentAttemptUpdateInternal
**crates/diesel_models/src/payment_intent.rs**
Add:
- function: pub::apply_changeset
- impl: impl PaymentIntentUpdateInternal
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes/admin.rs**
Add:
- function: pub::merchant_account_toggle_kv
- function: pub::merchant_account_kv_status
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- impl: impl DummyConnector
**crates/router/src/routes/dummy_connector.rs**
Modify existing code
**crates/router/src/routes/dummy_connector/core.rs**
Modify existing code
**crates/storage_impl/src/customers.rs**
Add:
- function: pub::get_global_id_label
- function: pub::get_merchant_scoped_id_label
- mod: private::label
**crates/storage_impl/src/lib.rs**
Add:
- function: private::unique_constraints
- function: private::table_name
- impl: impl UniqueConstraints for diesel_models::PaymentAttempt
**crates/storage_impl/src/payments/payment_attempt.rs**
Add:
- function: pub::get_profile_id_connector_transaction_label
- function: pub::get_global_id_label
- mod: private::label
**crates/storage_impl/src/payments/payment_intent.rs**
Modify existing code
**crates/storage_impl/src/redis/kv_store.rs**
Modify existing code
|
{"pr_number": 8198, "pr_title": "feat: Kv changes for V2 feature", "merged_at": "2025-06-26T14:22:59Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/kv.rs", "crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/payment_intent.rs"], "core_business": ["crates/router/src/routes/dummy_connector/core.rs"], "connectors": ["crates/router/src/routes/dummy_connector.rs"], "config": ["crates/drainer/Cargo.toml", "crates/hyperswitch_interfaces/Cargo.toml"], "other": ["crates/router/src/lib.rs", "crates/router/src/routes/admin.rs", "crates/router/src/routes/app.rs", "crates/storage_impl/src/customers.rs", "crates/storage_impl/src/lib.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "crates/storage_impl/src/payments/payment_intent.rs", "crates/storage_impl/src/redis/kv_store.rs"]}, "change_types": {"structs_added": 1, "functions_added": 7, "fields_added": 177, "imports_added": 10, "conditionals_added": 3, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(migration): add connector_customer updation support to batch PM update API
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for https://github.com/juspay/hyperswitch/pull/9791
### 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. API Request/Response Models**
- `crates/api_models/src/payment_methods.rs`
**2. Core Business Logic**
- `crates/router/src/core/payment_methods/migration.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (11 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit cce3ded4:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/migration.rs**
Add:
- function: private::build_connector_customer_update
|
{"pr_number": 9812, "pr_title": "feat(migration): add connector_customer updation support to batch PM update API", "merged_at": "2025-10-13T11:58:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "core_business": ["crates/router/src/core/payment_methods/migration.rs"]}, "change_types": {"functions_added": 1, "fields_added": 11, "imports_added": 2, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [SANTANDER] Added Boleto Payment Method
## 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 Authorize/PSync/IncomingWebhooks flow for Boleto Payment Method in Santander Connector
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
https://developer.santander.com.br/api/user-guide/issuance-of-bills#/api/documentacao/issuance-of-bills/
## 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 integration and it cannot be tested. (Awaiting on creds)
## 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. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
- ... and 4 more files
**4. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**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`
- `crates/common_enums/src/enums.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (19 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (335 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 63857a86:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::DocumentKind
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/santander.rs**
Add:
- function: private::get_webhook_object_from_body
- function: private::verify_webhook_source
- mod: pub::santander_constants
**crates/hyperswitch_connectors/src/connectors/santander/transformers.rs**
Add:
- struct: pub::SantanderPSyncBoletoRequest
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
|
{"pr_number": 9008, "pr_title": "feat(connector): [SANTANDER] Added Boleto Payment Method", "merged_at": "2025-09-03T13:16:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/payment_method_data.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/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/santander.rs", "crates/hyperswitch_connectors/src/connectors/santander/transformers.rs", "crates/hyperswitch_connectors/src/utils.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": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 19, "functions_added": 8, "enums_added": 16, "fields_added": 335, "imports_added": 7, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(routing): Fixed 5xx error logs in dynamic routing metrics
## 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 -->
A 5xx error log in DR metrics was spamming in alerts.
Have removed the log
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
make a payment with dynamic routing enabled
5xx error log now converted to 4xx
<img width="1056" alt="image" src="https://github.com/user-attachments/assets/df763221-d26b-47a0-927a-83a5d38d0457" />
## 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. Core Business Logic**
- `crates/router/src/core/routing/helpers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (32 changes)
- Add conditional logic for feature flags or filtering (6 changes)
**Detailed Identifier Changes:**
Commit 049fcdb3:
Files to modify:
**crates/router/src/core/routing/helpers.rs**
Modify existing code
|
{"pr_number": 7335, "pr_title": "fix(routing): Fixed 5xx error logs in dynamic routing metrics", "merged_at": "2025-02-21T18:31:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/routing/helpers.rs"]}, "change_types": {"fields_added": 32, "conditionals_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): [worldpayvantiv] dispute validations and statuses
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
1. Allow Accept Liability/ Submit Evidence during pre-arbitration and when the dispute is in challenge state
2. Remove the list_dispute_supported_connectors flag from prod as vantiv's prod url for the same is unknow
3. Extensively handle the dispute status from vantiv
## 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)?
-->
Accept liability for a challenged dispute
```
curl --location --request POST 'http://localhost:8080/disputes/accept/dp_VqlX1fzaUZRUmnMhcruo' \
--header 'Accept: application/json' \
--header 'api-key: dev_nGgYoHlpzKHfrpHfI9hAX8BOctOASqkCX8RCMglZ5Ro5BhLGmczY0WjoD1udVuDh'
```
Response
```
{"dispute_id":"dp_uSGRmdV28ok7AG4CBgm4","payment_id":"12345","attempt_id":"12345_1","amount":"52000","currency":"USD","dispute_stage":"pre_arbitration","dispute_status":"dispute_challenged","connector":"worldpayvantiv","connector_status":"Pre-Arbitration","connector_dispute_id":"10193081007","connector_reason":"Collaboration Flow - Processing Error - Duplicate Processing","connector_reason_code":"12.6.1","challenge_required_by":"2026-07-10T00:00:00.000Z","connector_created_at":"2025-07-10T00:00:00.000Z","connector_updated_at":null,"created_at":"2025-08-06T18:17:47.052Z","profile_id":"pro_TBRJM4Wv6IWCco5U7SmU","merchant_connector_id":"mca_g7Vm6N4QDsht1Os6gZ7j"}
```
Do a Dsync
```
{"dispute_id":"dp_uSGRmdV28ok7AG4CBgm4","payment_id":"12345","attempt_id":"12345_1","amount":"52000","currency":"USD","dispute_stage":"pre_arbitration","dispute_status":"dispute_accepted","connector":"worldpayvantiv","connector_status":"Pre-Arbitration","connector_dispute_id":"10193081007","connector_reason":"Collaboration Flow - Processing Error - Duplicate Processing","connector_reason_code":"12.6.1","challenge_required_by":"2026-07-10T00:00:00.000Z","connector_created_at":"2025-07-10T00:00:00.000Z","connector_updated_at":null,"created_at":"2025-08-06T18:17:47.052Z","profile_id":"pro_TBRJM4Wv6IWCco5U7SmU","merchant_connector_id":"mca_g7Vm6N4QDsht1Os6gZ7j"}
```
Cannot create a successful submit evidence call because of the test case unavailablity
Try submitting evidence to a challenged dispute
```
{"dispute_id":"dp_uSGRmdV28ok7AG4CBgm4","payment_id":"12345","attempt_id":"12345_1","amount":"52000","currency":"USD","dispute_stage":"pre_arbitration","dispute_status":"dispute_challenged","connector":"worldpayvantiv","connector_status":"Pre-Arbitration","connector_dispute_id":"10193081007","connector_reason":"Collaboration Flow - Processing Error - Duplicate Processing","connector_reason_code":"12.6.1","challenge_required_by":"2026-07-10T00:00:00.000Z","connector_created_at":"2025-07-10T00:00:00.000Z","connector_updated_at":null,"created_at":"2025-08-06T18:17:47.052Z","profile_id":"pro_TBRJM4Wv6IWCco5U7SmU","merchant_connector_id":"mca_g7Vm6N4QDsht1Os6gZ7j"}
```
Response
```
{"dispute_id":"dp_uSGRmdV28ok7AG4CBgm4","payment_id":"12345","attempt_id":"12345_1","amount":"52000","currency":"USD","dispute_stage":"pre_arbitration","dispute_status":"dispute_challenged","connector":"worldpayvantiv","connector_status":"Pre-Arbitration","connector_dispute_id":"10193081007","connector_reason":"Collaboration Flow - Processing Error - Duplicate Processing","connector_reason_code":"12.6.1","challenge_required_by":"2026-07-10T00:00:00.000Z","connector_created_at":"2025-07-10T00:00:00.000Z","connector_updated_at":null,"created_at":"2025-08-06T18:17:47.052Z","profile_id":"pro_TBRJM4Wv6IWCco5U7SmU","merchant_connector_id":"mca_g7Vm6N4QDsht1Os6gZ7j"}
```
## 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/disputes.rs`
- `crates/router/src/core/utils.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs`
**3. Configuration Files**
- `config/deployments/production.toml`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (4 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 1b2a98ce:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs**
Modify existing code
**crates/router/src/core/disputes.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Modify existing code
|
{"pr_number": 8862, "pr_title": "fix(router): [worldpayvantiv] dispute validations and statuses", "merged_at": "2025-08-07T08:13:17Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "merchant", "connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/disputes.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs"], "config": ["config/deployments/production.toml"]}, "change_types": {"functions_added": 2, "fields_added": 4, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [paysafe] introduce applepay encrypt and predecrypt flow
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
this pr adds comprehensive apple pay support to the paysafe connector, enabling merchants to process apple pay transactions through paysafe's payment gateway
- dynamic account id detection for apple pay for both encrypt and decrypt flows
- payment via apple pay in paysafe happens in 2 steps:
- payment initiate: hits `/paymenthandles` endpoint (happens in preprocessing step) with all the necessary apple data
- payment confirm: hits `/payments` endpoint with the payment handle token to complete the payment
### 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`
-->
the pr includes connector metadata enhancements and preprocessing flow modifications.
## 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).
-->
expanding payment method support to include apple pay for paysafe 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)?
-->
>[!NOTE]
> To test it locally, the base URL should be `https` and not `http`.
<details>
<summary>MCA</summary>
```bash
curl --location 'https://base_url/account/postman_merchant_GHAction_1757583450/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_Pvdq3IlcMf857bnbRpKevrNjeNEvoU7e66n5nwBHCCcsI9mSzrtyafBeQ7FuKArE' \
--data '{
"connector_type": "payment_processor",
"connector_name": "paysafe",
"business_country": "US",
"business_label": "default",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "api_key",
"key1": "key1"
},
"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,
"card_networks": [
"AmericanExpress",
"Discover",
"Interac",
"JCB",
"Mastercard",
"Visa",
"DinersClub",
"UnionPay",
"RuPay"
]
},
{
"payment_method_type": "debit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true,
"card_networks": [
"AmericanExpress",
"Discover",
"Interac",
"JCB",
"Mastercard",
"Visa",
"DinersClub",
"UnionPay",
"RuPay"
]
}
]
},
{
"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
}
]
}
],
"metadata": {
"account_id": {
"apple_pay": {
"USD": {
"encrypt": "1003013960",
"decrypt": "1003013960"
}
}
},
"apple_pay_combined": {
"manual": {
"payment_request_data": {
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_capabilities": [
"supports3DS"
],
"label": "apple"
},
"session_token_data": {
"certificate": "certificate",
"certificate_keys": "certificate_keys",
"merchant_identifier": "merchant.merchant.identifier",
"display_name": "Apple Pay",
"initiative": "web",
"initiative_context": "example.com",
"merchant_business_country": "US",
"payment_processing_details_at": "Connector"
}
}
}
},
"additional_merchant_data": null,
"status": "active",
"pm_auth_config": null,
"connector_wallets_details": {
"apple_pay_combined": {
"manual": {
"payment_request_data": {
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_capabilities": [
"supports3DS"
],
"label": "apple"
},
"session_token_data": {
"certificate": "certificate",
"certificate_keys": "certificate_keys",
"display_name": "Apple Pay",
"initiative": "web",
"initiative_context": "example.com",
"merchant_business_country": "US",
"payment_processing_details_at": "Connector"
}
}
}
}
}'
```
```json
{
"connector_type": "payment_processor",
"connector_name": "paysafe",
"connector_label": "paysafe_US_default",
"merchant_connector_id": "mca_IpxHuANMVZ1qWbcGRcil",
"profile_id": "pro_pdMcyhMaLhxejyxdm4Gh",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "ap**ey",
"key1": "k**1"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": [
"AmericanExpress",
"Discover",
"Interac",
"JCB",
"Mastercard",
"Visa",
"DinersClub",
"UnionPay",
"RuPay"
],
"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": [
"AmericanExpress",
"Discover",
"Interac",
"JCB",
"Mastercard",
"Visa",
"DinersClub",
"UnionPay",
"RuPay"
],
"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
}
]
}
],
"connector_webhook_details": null,
"metadata": {
"account_id": {
"card": {
"USD": {
"no_three_ds": "123456",
"three_ds": "123456"
},
"EUR": {
"no_three_ds": "123456",
"three_ds": "123456"
}
},
"wallet": {
"apple_pay": {
"USD": {
"encrypt": "123456",
"decrypt": "123456"
}
}
}
},
"apple_pay_combined": {
"manual": {
"payment_request_data": {
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_capabilities": [
"supports3DS"
],
"label": "apple"
},
"session_token_data": {
"certificate": "certificate",
"certificate_keys": "certificate_keys",
"merchant_identifier": "merchant.merchant.identifier",
"display_name": "Apple Pay",
"initiative": "web",
"initiative_context": "example.com",
"merchant_business_country": "US",
"payment_processing_details_at": "Connector"
}
}
}
},
"additional_merchant_data": null,
"status": "active",
"pm_auth_config": null,
"connector_wallets_details": {
"apple_pay_combined": {
"manual": {
"payment_request_data": {
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_capabilities": [
"supports3DS"
],
"label": "apple"
},
"session_token_data": {
"certificate": "certificate",
"certificate_keys": "certificate_keys",
"display_name": "Apple Pay",
"initiative": "web",
"initiative_context": "example.com",
"merchant_business_country": "US",
"payment_processing_details_at": "Connector"
}
}
}
}
}
```
</details>
<details>
<summary>Payment Initiate</summary>
```bash
curl --location 'https://base_url/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_easrii6Oqqq9fjnj4AQw7tkdKDf9bfo8cIEa9IfUj8nl7LbLjMQD1cM9UeK6jnLb' \
--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_AOWndR0v1zIfq8T8Ff7h",
"merchant_id": "postman_merchant_GHAction_1758644632",
"status": "requires_payment_method",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_AOWndR0v1zIfq8T8Ff7h_secret_Tjst2yhf6Z5Ju7C3fGnT",
"created": "2025-09-23T17:06:52.717Z",
"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": 1758647212,
"expires": 1758650812,
"secret": "epk_aee57839c2554a47bd89f221608987ef"
},
"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_X9nYDTDvLffn5ZFzovVC",
"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-09-23T17:21:52.717Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-09-23T17:06:52.746Z",
"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,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
</details>
<details>
<summary>Session call</summary>
```bash
curl --location 'https://base_url/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_8bc73f9c3edb44f7b8a4c9f08fa49169' \
--data '{
"payment_id": "pay_AOWndR0v1zIfq8T8Ff7h",
"wallets": [],
"client_secret": "pay_AOWndR0v1zIfq8T8Ff7h_secret_Tjst2yhf6Z5Ju7C3fGnT"
}'
```
```json
{
"payment_id": "pay_AOWndR0v1zIfq8T8Ff7h",
"client_secret": "pay_AOWndR0v1zIfq8T8Ff7h_secret_Tjst2yhf6Z5Ju7C3fGnT",
"session_token": [
{
"wallet_name": "apple_pay",
"session_token_data": {
"epoch_timestamp": 1758647230798,
"expires_at": 1758650830798,
"merchant_session_identifier": "SS..C3",
"nonce": "3ed97144",
"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"
},
"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
}
]
}
```
</details>
<details>
<summary>Payment Confirm (Encrypt)</summary>
```bash
curl --location 'https://base_url/payments/pay_AOWndR0v1zIfq8T8Ff7h/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_easrii6Oqqq9fjnj4AQw7tkdKDf9bfo8cIEa9IfUj8nl7LbLjMQD1cM9UeK6jnLb' \
--data '{
"confirm": true,
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": {
"application_primary_account_number": "48..60",
"application_expiration_month": "01",
"application_expiration_year": "31",
"payment_data": {
"online_payment_cryptogram": "A..=",
"eci_indicator": "7"
}
},
"payment_method": {
"display_name": "Visa 4228",
"network": "Visa",
"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_AOWndR0v1zIfq8T8Ff7h",
"merchant_id": "postman_merchant_GHAction_1758644632",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "paysafe",
"client_secret": "pay_AOWndR0v1zIfq8T8Ff7h_secret_Tjst2yhf6Z5Ju7C3fGnT",
"created": "2025-09-23T17:06:52.717Z",
"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": "Visa",
"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": "c847c066-1d83-4b8c-9b2e-1a72559849c1",
"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_X9nYDTDvLffn5ZFzovVC",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_i61PcZcv8kyTX059WELX",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-23T17:21:52.717Z",
"fingerprint": null,
"browser_info": {
"os_type": 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-09-23T17:07:45.459Z",
"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,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
</details>
<details>
<summary>Payment Initiate</summary>
```bash
curl --location 'https://base_url/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_easrii6Oqqq9fjnj4AQw7tkdKDf9bfo8cIEa9IfUj8nl7LbLjMQD1cM9UeK6jnLb' \
--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_mBfTZrLSPhmdcPGo6cwg",
"merchant_id": "postman_merchant_GHAction_1758644632",
"status": "requires_payment_method",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_mBfTZrLSPhmdcPGo6cwg_secret_rnqK1jqamjwpYrBxNqRx",
"created": "2025-09-23T17:10:35.122Z",
"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": 1758647435,
"expires": 1758651035,
"secret": "epk_7c990250150a4b80bab9366a184d17ae"
},
"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_X9nYDTDvLffn5ZFzovVC",
"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-09-23T17:25:35.122Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-09-23T17:10:35.142Z",
"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,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
</details>
<details>
<summary>Session call</summary>
```bash
curl --location 'https://base_url/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_8bc73f9c3edb44f7b8a4c9f08fa49169' \
--data '{
"payment_id": "pay_mBfTZrLSPhmdcPGo6cwg",
"wallets": [],
"client_secret": "pay_mBfTZrLSPhmdcPGo6cwg_secret_rnqK1jqamjwpYrBxNqRx"
}'
```
```json
{
"payment_id": "pay_mBfTZrLSPhmdcPGo6cwg",
"client_secret": "pay_mBfTZrLSPhmdcPGo6cwg_secret_rnqK1jqamjwpYrBxNqRx",
"session_token": [
{
"wallet_name": "apple_pay",
"session_token_data": {
"epoch_timestamp": 1758647447788,
"expires_at": 1758651047788,
"merchant_session_identifier": "SS..C3",
"nonce": "8de2c3ef",
"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"
},
"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
}
]
}
```
</details>
<details>
<summary>Payment Confirm (Decrypt)</summary>
```bash
curl --location 'https://base_url/payments/pay_mBfTZrLSPhmdcPGo6cwg/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_easrii6Oqqq9fjnj4AQw7tkdKDf9bfo8cIEa9IfUj8nl7LbLjMQD1cM9UeK6jnLb' \
--data '{
"confirm": true,
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "ey...n0=",
"payment_method": {
"display_name": "Visa 4228",
"network": "Visa",
"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_mBfTZrLSPhmdcPGo6cwg",
"merchant_id": "postman_merchant_GHAction_1758644632",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "paysafe",
"client_secret": "pay_mBfTZrLSPhmdcPGo6cwg_secret_rnqK1jqamjwpYrBxNqRx",
"created": "2025-09-23T17:10:35.122Z",
"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": "Visa",
"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": "3becc659-ad98-4e6a-9e72-5290eb80e214",
"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_X9nYDTDvLffn5ZFzovVC",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_i61PcZcv8kyTX059WELX",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-23T17:25:35.122Z",
"fingerprint": null,
"browser_info": {
"os_type": 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-09-23T17:11:20.313Z",
"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,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
</details>
<details>
<summary>WASM changes</summary>
<img width="618" height="858" alt="image" src="https://github.com/user-attachments/assets/7d0439bb-dd00-4bdc-95da-1334ef4c9fa0" />
</details>
<details>
<summary>Dashboard changes</summary>
<img width="1001" height="204" alt="image" src="https://github.com/user-attachments/assets/e3ee4b50-b27f-4c20-be92-24e23415d85a" />
<img width="569" height="464" alt="image" src="https://github.com/user-attachments/assets/d71fe988-85b5-4f2d-8d94-8131b86a61b7" />
<img width="570" height="994" alt="image" src="https://github.com/user-attachments/assets/718b5878-e609-4c68-b56b-e0a7596eaa54" />
<img width="656" height="162" alt="image" src="https://github.com/user-attachments/assets/9631030a-b128-4480-baaa-00225d4c0033" />
<img width="567" height="154" alt="image" src="https://github.com/user-attachments/assets/9e680eac-c108-493e-82e3-701191f34c44" />
<img width="830" height="224" alt="image" src="https://github.com/user-attachments/assets/97446ac7-d03c-4e1e-80a2-44786b082e12" />
</details>
> [!IMPORTANT]
> Connector decryption flow is not fully implemented yet.
## 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`
**2. External Connector Integration**
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- ... and 4 more files
**3. Type Definitions**
- `crates/common_types/src/payments.rs`
**4. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**5. 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 (14 changes)
- Implement new functions (6 changes)
- Extend existing types with new fields (143 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 2e0da5c0:
Files to modify:
**crates/common_types/src/payments.rs**
Add:
- function: pub::get_expiry_date_as_yymm
**crates/connector_configs/src/connector.rs**
Add:
- struct: pub::AccountIdConfigForApplePay
**crates/hyperswitch_connectors/src/connectors/paysafe.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs**
Add:
- function: private::get_apple_pay_decrypt_data
- function: private::try_from
- struct: pub::ApplePayAccountDetails
- struct: pub::PaysafeApplepayPayment
- struct: pub::PaysafeApplePayPaymentToken
- struct: pub::PaysafeApplePayToken
- struct: pub::PaysafeApplePayEncryptedData
- struct: pub::PaysafeApplePayDecryptedDataWrapper
- struct: pub::PaysafeApplePayDecryptedData
- struct: pub::PaysafeApplePayDecryptedPaymentData
- struct: pub::PaysafeApplePayHeader
- struct: pub::PaysafeApplePayPaymentMethod
- struct: pub::PaysafeApplePayBillingContact
- struct: private::DecryptedApplePayTokenData
- struct: private::DecryptedApplePayTokenHeader
- enum: pub::PaysafeApplePayPaymentData
- impl: impl TryFrom<(
&ApplePayWalletData,
&PaysafeRouterData<&PaymentsPreProcessingRouterData>,
)> for PaysafeApplepayPayment
**crates/payment_methods/src/configs/payment_connector_required_fields.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
|
{"pr_number": 9358, "pr_title": "feat(connector): [paysafe] introduce applepay encrypt and predecrypt flow", "merged_at": "2025-09-24T16:58:56Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.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/paysafe.rs", "crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs"], "types": ["crates/common_types/src/payments.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": 14, "functions_added": 6, "enums_added": 1, "fields_added": 143, "imports_added": 2, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix: remove straight through routing from routing approach
## 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 -->
remove straight through routing from routing approach so that it does not break in stagger.
main PR - https://github.com/juspay/hyperswitch/pull/8695
### 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 a 3ds payment -
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_BNOaWRzwyZ3hMAbhRNtp9t6Mx7ZSVyK5gPvd1bavl0FWehvrHlre1eMifYA244TE' \
--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",
"profile_id": "pro_EfD8EtQQSPZxXStG6B7x",
"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://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"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": "US",
"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"
},
"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"
}
}'
```
Response -
```
{"payment_id":"pay_cxuXzSFzA510Gox7FvOb","merchant_id":"merchant_1749723893","status":"requires_customer_action","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":6540,"amount_received":0,"connector":"stripe","client_secret":"pay_cxuXzSFzA510Gox7FvOb_secret_CD8AxMM0f2GNxg7HhsYI","created":"2025-07-18T13:19:06.827Z","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":"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":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":"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":null,"email":"guest@example.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":{"type":"redirect_to_url","redirect_to_url":"http://localhost:8080/payments/redirect/pay_cxuXzSFzA510Gox7FvOb/merchant_1749723893/pay_cxuXzSFzA510Gox7FvOb_1"},"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":1752844746,"expires":1752848346,"secret":"epk_3b3dcd853b144ef89c9015bb3922ccb0"},"manual_retry_allowed":null,"connector_transaction_id":"pi_3RmEBrD5R7gDAGff0FoubzWv","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pi_3RmEBrD5R7gDAGff0FoubzWv","payment_link":null,"profile_id":"pro_EfD8EtQQSPZxXStG6B7x","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_SdftCCtpClu32qA6oijC","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-18T13:34:06.827Z","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-07-18T13:19:08.211Z","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}
```
DB -
<img width="1166" height="1008" alt="image" src="https://github.com/user-attachments/assets/6a8da012-0fd0-434f-8ee5-40c771bd5fe9" />
After redirection success, preform sync
```
curl --location 'http://localhost:8080/payments/pay_cxuXzSFzA510Gox7FvOb' \
--header 'Accept: application/json' \
--header 'api-key: dev_BNOaWRzwyZ3hMAbhRNtp9t6Mx7ZSVyK5gPvd1bavl0FWehvrHlre1eMifYA244TE'
```
Response -
```
{"payment_id":"pay_cxuXzSFzA510Gox7FvOb","merchant_id":"merchant_1749723893","status":"succeeded","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":0,"amount_received":6540,"connector":"stripe","client_secret":"pay_cxuXzSFzA510Gox7FvOb_secret_CD8AxMM0f2GNxg7HhsYI","created":"2025-07-18T13:19:06.827Z","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":"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":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":"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":null,"email":"guest@example.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":null,"manual_retry_allowed":false,"connector_transaction_id":"pi_3RmEBrD5R7gDAGff0FoubzWv","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pi_3RmEBrD5R7gDAGff0FoubzWv","payment_link":null,"profile_id":"pro_EfD8EtQQSPZxXStG6B7x","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_SdftCCtpClu32qA6oijC","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-18T13:34:06.827Z","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-07-18T13:20:59.369Z","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}
```
## 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/payments/routing.rs`
**2. Other**
- `crates/common_enums/src/enums.rs`
**Code Patterns Applied:**
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit c4452e29:
Files to modify:
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Modify existing code
|
{"pr_number": 8694, "pr_title": "fix: remove straight through routing from routing approach", "merged_at": "2025-07-21T11:07:17Z", "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/routing.rs"], "other": ["crates/common_enums/src/enums.rs"]}, "change_types": {"database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(open_router): call elimination routing of open router if enabled instead of dynamo
## 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 pull request introduces significant updates to the dynamic routing logic, focusing on enhancing the success-based routing mechanism and improving the integration with the "open router" service. Key changes include the addition of a new helper method, refactoring of existing methods for better clarity, and updates to the routing logic to streamline decision-making.
### Enhancements to Dynamic Routing Logic:
* Added a new method `is_success_rate_routing_enabled` in `DynamicRoutingAlgorithmRef` to determine if success-based routing is enabled, improving readability and encapsulation. (`crates/api_models/src/routing.rs`)
* Modified the `perform_open_routing` function to consolidate success-based and elimination routing into a single API call, simplifying the logic for deciding gateways. (`crates/router/src/core/payments/routing.rs`) [[1]](diffhunk://#diff-f9f43be4eb6b360f7b6962459a4943e79db89c6c253da0c3ad2b5096ea78cd9bR1519-R1532) [[2]](diffhunk://#diff-f9f43be4eb6b360f7b6962459a4943e79db89c6c253da0c3ad2b5096ea78cd9bR1553-R1556)
### Integration with Open Router:
* Introduced a new helper function `update_gateway_score_helper_with_open_router` to handle gateway score updates when routing through the open router. This replaces the previous `push_metrics_with_update_window_for_success_based_routing` in relevant contexts. (`crates/router/src/core/routing/helpers.rs`) [[1]](diffhunk://#diff-ea48d33e52b2cb7edbbba1d236b55f946fdb2c178f8c76f4226818b3630c4658L708-R720) [[2]](diffhunk://#diff-ea48d33e52b2cb7edbbba1d236b55f946fdb2c178f8c76f4226818b3630c4658L744-R740)
* Renamed methods like `update_success_rate_score_with_open_router` to `update_gateway_score_with_open_router` and `perform_success_based_routing_with_open_router` to `perform_decide_gateway_call_with_open_router` for better alignment with their functionality. (`crates/router/src/core/payments/routing.rs`) [[1]](diffhunk://#diff-f9f43be4eb6b360f7b6962459a4943e79db89c6c253da0c3ad2b5096ea78cd9bL1545-R1543) [[2]](diffhunk://#diff-f9f43be4eb6b360f7b6962459a4943e79db89c6c253da0c3ad2b5096ea78cd9bL1651-R1661) [[3]](diffhunk://#diff-f9f43be4eb6b360f7b6962459a4943e79db89c6c253da0c3ad2b5096ea78cd9bL1730-R1738)
### Refactor and Cleanup:
* Refactored the `payment_response_update_tracker` function to include conditional logic for routing decisions based on the open router's configuration, ensuring better error handling and logging. (`crates/router/src/core/payments/operations/payment_response.rs`) [[1]](diffhunk://#diff-7f827636ccd9cbd48fa4f306d5aeba4f02f4011dacc6de6c87fadde2ed19f882R2150-R2162) [[2]](diffhunk://#diff-7f827636ccd9cbd48fa4f306d5aeba4f02f4011dacc6de6c87fadde2ed19f882R2204)
* Reintroduced the `push_metrics_with_update_window_for_success_based_routing` function with a more focused implementation, while retaining the original logic for backward compatibility. (`crates/router/src/core/routing/helpers.rs`)
These changes collectively improve the maintainability, readability, and functionality of the dynamic routing system, particularly in scenarios involving success-based routing and open router integration.
### 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)?
-->
Since the feature cannot be deployed in main pod, this can be tested through custom pod which I can help with
## 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/routing.rs`
**2. Core Business Logic**
- `crates/router/src/core/errors.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/operations/payment_response.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Implement new functions (7 changes)
- Extend existing types with new fields (8 changes)
- Add conditional logic for feature flags or filtering (7 changes)
**Detailed Identifier Changes:**
Commit bab64eef:
Files to modify:
**crates/api_models/src/routing.rs**
Add:
- function: pub::is_success_rate_routing_enabled
**crates/router/src/core/errors.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Add:
- function: pub::update_gateway_score_helper_with_open_router
|
{"pr_number": 7961, "pr_title": "refactor(open_router): call elimination routing of open router if enabled instead of dynamo", "merged_at": "2025-05-12T14:19:41Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment"]}, "hierarchy": {"api_models": ["crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/errors.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/routing/helpers.rs"]}, "change_types": {"functions_added": 7, "fields_added": 8, "conditionals_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): pass card network for external 3DS from additional_payment_method_data
## 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 -->
- card network fetch from db was not being populated in payment call resulting in sending the default value which failed the payment
- util function have been added to collect the card network from additional_payment_method_data
- ucaf_indicator is being populated for mastercard
- profile generic update is made optional to not update the force_3ds_challenge if it is passed as null
- External authentication is disabled for Datatrans
### 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 MCA(Cybersource):
- Create MCA(Netcetera):
- Create a payment call (enable external 3ds):
```
{
"amount": 499,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "test_rec7",
"email": "guest@example.com",
"request_external_three_ds_authentication": true,
"customer_acceptance": {
"acceptance_type": "online"
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5512459816707531",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "Sakil Mostak",
"card_cvc": "737"
}
},
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here is some \n there is some \n none is some? \n ",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "CA",
"first_name": "Sakil",
"last_name": "Mostak"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"authentication_type": "three_ds"
}
```
Response should have the following data:
```
{
"payment_id": "pay_DJzWCB8vpM2nl6tti5q5",
"merchant_id": "merchant_1741687051",
"status": "requires_customer_action",
"amount": 499,
"net_amount": 499,
"shipping_cost": null,
"amount_capturable": 499,
"amount_received": null,
"connector": "cybersource",
"client_secret": "pay_DJzWCB8vpM2nl6tti5q5_secret_JwlJcjRW9Q5TRrlNKNrf",
"created": "2025-03-11T10:43:06.966Z",
"currency": "USD",
"customer_id": "test_rec7",
"customer": {
"id": "test_rec7",
"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": "7531",
"card_type": null,
"card_network": "Mastercard",
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "551245",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "Sakil Mostak",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_eappafndmAWU8SvNsaoy",
"shipping": null,
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here is some \n there is some \n none is some? \n ",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "CA",
"first_name": "Sakil",
"last_name": "Mostak"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"order_details": null,
"email": "guest@example.com",
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "three_ds_invoke",
"three_ds_data": {
"three_ds_authentication_url": "http://localhost:8080/payments/pay_DJzWCB8vpM2nl6tti5q5/3ds/authentication",
"three_ds_authorize_url": "http://localhost:8080/payments/pay_DJzWCB8vpM2nl6tti5q5/merchant_1741687051/authorize/cybersource",
"three_ds_method_details": {
"three_ds_method_key": "threeDSMethodData",
"three_ds_method_data_submission": true,
"three_ds_method_data": "eyJ0aHJlZURTTWV0aG9kTm90aWZpY2F0aW9uVVJMIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS8zZHMtbWV0aG9kLW5vdGlmaWNhdGlvbi11cmwiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6ImVkNmQ4Y2M1LWU2YTgtNDg4ZC05NDI4LWM2ZDRkZWY2ZDFlNiJ9",
"three_ds_method_url": "https://ndm-prev.3dss-non-prod.cloud.netcetera.com/acs/3ds-method"
},
"poll_config": {
"poll_id": "external_authentication_pay_DJzWCB8vpM2nl6tti5q5",
"delay_in_secs": 2,
"frequency": 5
},
"message_version": "2.3.1",
"directory_server_id": "A000000004"
}
},
"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": "test_rec7",
"created_at": 1741689786,
"expires": 1741693386,
"secret": "epk_71a1ecdc177e48a2af0172ad2bb14fc8"
},
"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_IauTXmHo2gR6Cufm1fXK",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_qJi1npMpCWiTuiL0rGOK",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": {
"authentication_flow": null,
"electronic_commerce_indicator": null,
"status": "pending",
"ds_transaction_id": "ed6d8cc5-e6a8-488d-9428-c6d4def6d1e6",
"version": "2.3.1",
"error_code": null,
"error_message": null
},
"external_3ds_authentication_attempted": true,
"expires_on": "2025-03-11T10:58:06.966Z",
"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-03-11T10:43:07.760Z",
"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"
}
```
- Create Challenge
```
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": "{{client_secret}}",
"device_channel": "BRW",
"threeds_method_comp_ind": "Y"
}'
```
- Response should contain following data:
```
{
"trans_status": "Y",
"acs_url": null,
"challenge_request": null,
"acs_reference_number": null,
"acs_trans_id": null,
"three_dsserver_trans_id": "ed6d8cc5-e6a8-488d-9428-c6d4def6d1e6",
"acs_signed_content": null,
"three_ds_requestor_url": "https://google.com"
}
```
- Authorize from Netcetera:
```
curl --location --request POST '{{baseurl}}/payments/{{payment_id}}/{{merchant_id}}/authorize/checkout' \
--header 'api-key:{{api_Key}}'
```
- Retrieve the transaction, the status should be succeeded in response, below is an example:
```
{
"payment_id": "pay_lTIv7ZbWr5Y237CqHXxq",
"merchant_id": "merchant_1741687051",
"status": "succeeded",
"amount": 499,
"net_amount": 499,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 499,
"connector": "cybersource",
"client_secret": "pay_lTIv7ZbWr5Y237CqHXxq_secret_cYx3O8cQMGUR2O1RVta9",
"created": "2025-03-11T10:28:34.005Z",
"currency": "USD",
"customer_id": "test_rec7",
"customer": {
"id": "test_rec7",
"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": "7531",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "551245",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "Sakil Mostak",
"payment_checks": {
"avs_response": {
"code": "X",
"codeRaw": "I1"
},
"card_verification": null
},
"authentication_data": null
},
"billing": null
},
"payment_token": "token_P8rNgP3WpYuJWLRgRWaz",
"shipping": null,
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here is some \n there is some \n none is some? \n ",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "CA",
"first_name": "Sakil",
"last_name": "Mostak"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"order_details": null,
"email": "guest@example.com",
"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": "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": "7416889232566498604807",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_lTIv7ZbWr5Y237CqHXxq_1",
"payment_link": null,
"profile_id": "pro_IauTXmHo2gR6Cufm1fXK",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_qJi1npMpCWiTuiL0rGOK",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": {
"authentication_flow": "frictionless",
"electronic_commerce_indicator": null,
"status": "success",
"ds_transaction_id": "19329442-7532-4e25-bc88-a5f1d99c1f5e",
"version": "2.3.1",
"error_code": null,
"error_message": null
},
"external_3ds_authentication_attempted": true,
"expires_on": "2025-03-11T10:43:34.005Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_Wfs6CcChddyjlx99kQKU",
"payment_method_status": "active",
"updated": "2025-03-11T10:28:43.771Z",
"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"
}
```
## 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/business_profile.rs`
**2. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payments/transformers.rs`
**3. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (4 changes)
**Detailed Identifier Changes:**
Commit 5cdfe832:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_card_network_from_additional_payment_method_data
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
|
{"pr_number": 7473, "pr_title": "fix(router): pass card network for external 3DS from additional_payment_method_data", "merged_at": "2025-03-11T15:06:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs"]}, "change_types": {"functions_added": 2, "fields_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connector): [AUTHORIZEDOTNET] Add metadata information to connector request
## 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 is for code changes which sends the metadata passed in payment intent create to authorizedotnet as request payload, as per merchant requirements.
The merchant receives a receipt of the transaction through email, which contains the metadata passed by the merchant in payment intent create request.

### 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).
-->
All flows have been tested as per the authorizedotnet developer docs:
https://developer.authorize.net/api/reference/index.html#payment-transactions-charge-a-credit-card
## 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**
**1. Authorize (Manual)**
- Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_0vV4HvaBn68pmZTvXLzU9V7hR79lgEjiarEG2IDxveccjZ6ypKjpPaRrdeQRHhKu' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "manual",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"customer_id": "StripeCustomer1",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "likhin",
"last_name": "bopanna"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "likhin",
"last_name": "bopanna"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"count_tickets": 1,
"transaction_number": "5590045"
}
}'
```
- Response
```
{
"payment_id": "pay_aMR57wTed0e8hKIvqEXk",
"merchant_id": "postman_merchant_GHAction_4bc8cb40-6e2b-4474-a4ba-662cce1e8224",
"status": "requires_capture",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 6540,
"amount_received": null,
"connector": "authorizedotnet",
"client_secret": "pay_aMR57wTed0e8hKIvqEXk_secret_7ClGeHihtfOkLr17zmY6",
"created": "2025-01-08T12:18:38.236Z",
"currency": "USD",
"customer_id": "StripeCustomer1",
"customer": {
"id": "StripeCustomer1",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"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": "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": "likhin",
"last_name": "bopanna"
},
"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": "likhin",
"last_name": "bopanna"
},
"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": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer1",
"created_at": 1736338718,
"expires": 1736342318,
"secret": "epk_a3fa4b96efa94fbe817dd39b634b4b10"
},
"manual_retry_allowed": false,
"connector_transaction_id": "80033079979",
"frm_message": null,
"metadata": {
"count_tickets": 1,
"transaction_number": "5590045"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "80033079979",
"payment_link": null,
"profile_id": "pro_54auzGTSaZOQ9xIUOEn8",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_tFxUMA2vfBlte3s7jSw7",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-08T12:33:38.236Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-01-08T12:18:40.884Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**2. Capture (Manual)**
- Request
```
curl --location 'http://localhost:8080/payments/pay_aMR57wTed0e8hKIvqEXk/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_0vV4HvaBn68pmZTvXLzU9V7hR79lgEjiarEG2IDxveccjZ6ypKjpPaRrdeQRHhKu' \
--data '{
"amount_to_capture": 6540,
"statement_descriptor_name": "Joseph",
"statement_descriptor_suffix": "JS"
}'
```
- Response
```
{
"payment_id": "pay_aMR57wTed0e8hKIvqEXk",
"merchant_id": "postman_merchant_GHAction_4bc8cb40-6e2b-4474-a4ba-662cce1e8224",
"status": "succeeded",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6540,
"connector": "authorizedotnet",
"client_secret": "pay_aMR57wTed0e8hKIvqEXk_secret_7ClGeHihtfOkLr17zmY6",
"created": "2025-01-08T12:18:38.236Z",
"currency": "USD",
"customer_id": "StripeCustomer1",
"customer": {
"id": "StripeCustomer1",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"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": "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": "likhin",
"last_name": "bopanna"
},
"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": "likhin",
"last_name": "bopanna"
},
"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": 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": "80033079979",
"frm_message": null,
"metadata": {
"count_tickets": 1,
"transaction_number": "5590045"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "80033079979",
"payment_link": null,
"profile_id": "pro_54auzGTSaZOQ9xIUOEn8",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_tFxUMA2vfBlte3s7jSw7",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-08T12:33:38.236Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-01-08T12:20:16.395Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**3. Authorize + Capture**
- Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_0vV4HvaBn68pmZTvXLzU9V7hR79lgEjiarEG2IDxveccjZ6ypKjpPaRrdeQRHhKu' \
--data-raw '{
"amount": 6550,
"currency": "USD",
"confirm": true,
"business_country": "US",
"business_label": "default",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6550,
"customer_id": "StripeCustomer1",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "01",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "sundari",
"last_name": "sundari"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "sundari",
"last_name": "sundari"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"count_tickets": 1,
"transaction_number": "5590045"
}
}'
```
- Response
```
{
"payment_id": "pay_EbFXhSWxwVQ0996FxZdt",
"merchant_id": "postman_merchant_GHAction_4bc8cb40-6e2b-4474-a4ba-662cce1e8224",
"status": "succeeded",
"amount": 6550,
"net_amount": 6550,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6550,
"connector": "authorizedotnet",
"client_secret": "pay_EbFXhSWxwVQ0996FxZdt_secret_3J0fmk53qE22LeKiGIGx",
"created": "2025-01-08T12:21:59.998Z",
"currency": "USD",
"customer_id": "StripeCustomer1",
"customer": {
"id": "StripeCustomer1",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "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": "01",
"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": "sundari",
"last_name": "sundari"
},
"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": "sundari",
"last_name": "sundari"
},
"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": "debit",
"connector_label": "authorizedotnet_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer1",
"created_at": 1736338919,
"expires": 1736342519,
"secret": "epk_a1b2ad7e39a14673a4e01692f76e5193"
},
"manual_retry_allowed": false,
"connector_transaction_id": "80033080191",
"frm_message": null,
"metadata": {
"count_tickets": 1,
"transaction_number": "5590045"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "80033080191",
"payment_link": null,
"profile_id": "pro_54auzGTSaZOQ9xIUOEn8",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_tFxUMA2vfBlte3s7jSw7",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-08T12:36:59.998Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-01-08T12:22:02.624Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**4. PSync**
- Request
```
curl --location 'http://localhost:8080/payments/pay_EbFXhSWxwVQ0996FxZdt?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_0vV4HvaBn68pmZTvXLzU9V7hR79lgEjiarEG2IDxveccjZ6ypKjpPaRrdeQRHhKu'
```
- Response
```
{
"payment_id": "pay_EbFXhSWxwVQ0996FxZdt",
"merchant_id": "postman_merchant_GHAction_4bc8cb40-6e2b-4474-a4ba-662cce1e8224",
"status": "succeeded",
"amount": 6550,
"net_amount": 6550,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6550,
"connector": "authorizedotnet",
"client_secret": "pay_EbFXhSWxwVQ0996FxZdt_secret_3J0fmk53qE22LeKiGIGx",
"created": "2025-01-08T12:21:59.998Z",
"currency": "USD",
"customer_id": "StripeCustomer1",
"customer": {
"id": "StripeCustomer1",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "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": "01",
"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": "sundari",
"last_name": "sundari"
},
"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": "sundari",
"last_name": "sundari"
},
"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": "debit",
"connector_label": "authorizedotnet_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "80033080191",
"frm_message": null,
"metadata": {
"count_tickets": 1,
"transaction_number": "5590045"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "80033080191",
"payment_link": null,
"profile_id": "pro_54auzGTSaZOQ9xIUOEn8",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_tFxUMA2vfBlte3s7jSw7",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-08T12:36:59.998Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-01-08T12:22:02.624Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**5. Refund**
- Request
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_0vV4HvaBn68pmZTvXLzU9V7hR79lgEjiarEG2IDxveccjZ6ypKjpPaRrdeQRHhKu' \
--data '{
"payment_id": "pay_LdFELbsSHWr31UxLX51l",
"amount": 5000,
"reason": "Customer returned product",
"refund_type": "scheduled",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
- Response
```
{
"refund_id": "ref_ht8iD8smYnJl5sDF0BEn",
"payment_id": "pay_LdFELbsSHWr31UxLX51l",
"amount": 5000,
"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-01-08T12:31:33.642Z",
"updated_at": "2025-01-08T12:31:33.642Z",
"connector": "authorizedotnet",
"profile_id": "pro_54auzGTSaZOQ9xIUOEn8",
"merchant_connector_id": "mca_tFxUMA2vfBlte3s7jSw7",
"split_refunds": null
}
```
**6. RSync**
- Request
```
curl --location 'http://localhost:8080/refunds/ref_ht8iD8smYnJl5sDF0BEn' \
--header 'Accept: application/json' \
--header 'api-key: dev_0vV4HvaBn68pmZTvXLzU9V7hR79lgEjiarEG2IDxveccjZ6ypKjpPaRrdeQRHhKu'
```
- Response
```
{
"refund_id": "ref_ht8iD8smYnJl5sDF0BEn",
"payment_id": "pay_LdFELbsSHWr31UxLX51l",
"amount": 5000,
"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-01-08T12:31:33.642Z",
"updated_at": "2025-01-08T12:31:33.642Z",
"connector": "authorizedotnet",
"profile_id": "pro_54auzGTSaZOQ9xIUOEn8",
"merchant_connector_id": "mca_tFxUMA2vfBlte3s7jSw7",
"split_refunds": null
}
```
**7. Cancel/Void**
- Request
```
curl --location 'http://localhost:8080/payments/pay_LdFELbsSHWr31UxLX51l/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_0vV4HvaBn68pmZTvXLzU9V7hR79lgEjiarEG2IDxveccjZ6ypKjpPaRrdeQRHhKu' \
--data '{"cancellation_reason":"requested_by_customer"}'
```
- Response
```
{
"payment_id": "pay_wM2Pf7TjLVabcAj41aDz",
"merchant_id": "postman_merchant_GHAction_4bc8cb40-6e2b-4474-a4ba-662cce1e8224",
"status": "cancelled",
"amount": 5000,
"net_amount": 5000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "authorizedotnet",
"client_secret": "pay_wM2Pf7TjLVabcAj41aDz_secret_vjFJJKmyoVaNqOmQ0Bge",
"created": "2025-01-08T12:29:07.232Z",
"currency": "USD",
"customer_id": "StripeCustomer1",
"customer": {
"id": "StripeCustomer1",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"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": "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": "likhin",
"last_name": "bopanna"
},
"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": "likhin",
"last_name": "bopanna"
},
"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": "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": "80033080543",
"frm_message": null,
"metadata": {
"count_tickets": 1,
"transaction_number": "5590045"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "80033080543",
"payment_link": null,
"profile_id": "pro_54auzGTSaZOQ9xIUOEn8",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_tFxUMA2vfBlte3s7jSw7",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-08T12:44:07.232Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-01-08T12:29:28.533Z",
"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`
- [ ] 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/authorizedotnet/transformers.rs`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (14 changes)
**Detailed Identifier Changes:**
Commit ea188867:
Files to modify:
**crates/router/src/connector/authorizedotnet/transformers.rs**
Add:
- function: private::foreign_try_from
- struct: pub::UserFields
- struct: pub::UserField
- impl: impl ForeignTryFrom<Value> for Vec<UserField>
Commit 8237e2d4:
Files to modify:
**crates/router/src/connector/authorizedotnet/transformers.rs**
Add:
- function: private::foreign_try_from
- struct: pub::UserFields
- struct: pub::UserField
- impl: impl ForeignTryFrom<Value> for Vec<UserField>
|
{"pr_number": 7011, "pr_title": "refactor(connector): [AUTHORIZEDOTNET] Add metadata information to connector request", "merged_at": "2025-02-05T14:48:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/connector/authorizedotnet/transformers.rs"]}, "change_types": {"structs_added": 2, "functions_added": 1, "fields_added": 14, "imports_added": 3}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
refactor(connector): [Rapyd] fix amount conversion framework
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
fix amount conversion framework for Rapyd
According to doc - https://docs.rapyd.net/en/create-payment.html , amount should be of FloatType (BaseUnit).
hotfix for -[7466]( https://github.com/juspay/hyperswitch/pull/7466)
### 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?
We can not test it, as we dont have credentials for Rapyd connector
## 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. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/rapyd.rs`
- `crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (6 changes)
**Detailed Identifier Changes:**
Commit 537f65f1:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/rapyd.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs**
Modify existing code
|
{"pr_number": 7515, "pr_title": "refactor(connector): [Rapyd] fix amount conversion framework", "merged_at": "2025-03-13T08:50:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "connector"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/rapyd.rs", "crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs"]}, "change_types": {"functions_added": 1, "fields_added": 6, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Paysafe] Integrate no 3ds card
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Integrate Paysafe connector - No 3ds Cards
Flows
- Payment
- Psync
- Capture
- Void
- Refund
- Refund Sync
### 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 MCA for Paysafe connector
```
curl --location 'http://localhost:8080/account/merchant_1756845023/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: _' \
--data '{
"connector_type": "payment_processor",
"connector_name": "paysafe",
"business_country": "US",
"business_label": "food",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "**",
"key1": "***"
},
"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": {
"report_group" : "Hello",
"merchant_config_currency":"USD",
"account_id": "_____"
}
}'
```
Create a Payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: _' \
--data '{
"amount": 1500,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "aaaa",
"payment_method": "card",
"payment_method_type": "credit",
"profile_id": "pro_Dpwkpk5tMI4H6ZdYjpEW",
"payment_method_data": {
"card": {
"card_number": "4530910000012345",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Joseph",
"card_cvc": "111"
}
},
"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"
}
},
"shipping": {
"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"
}
},
"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"
}
}'
```
Response
```
{
"payment_id": "pay_PGOFJN06yH9nEglswyFF",
"merchant_id": "merchant_1756845023",
"status": "succeeded",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1500,
"connector": "paysafe",
"client_secret": "pay_PGOFJN06yH9nEglswyFF_secret_UdTEHyTjQIGYtgESFnqe",
"created": "2025-09-02T20:31:17.873Z",
"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": "card",
"payment_method_data": {
"card": {
"last4": "2345",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "453091",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Joseph",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"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": 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": null
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "aaaa",
"created_at": 1756845077,
"expires": 1756848677,
"secret": "epk_6ed44431aa3048fc87756aba02f4deb7"
},
"manual_retry_allowed": false,
"connector_transaction_id": "09ef3d4c-ef25-4234-b6a7-f0e074b16fa0",
"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_Dpwkpk5tMI4H6ZdYjpEW",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_pliYtewxLmWuyNqYCjxg",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-02T20:46:17.873Z",
"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-09-02T20:31:19.281Z",
"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
}
```
Create a Payment with capture_method as manual
- Response
```
{
"payment_id": "pay_NtJnAOrMkNpnmUFaSP3P",
"merchant_id": "merchant_1756845023",
"status": "requires_capture",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 1500,
"amount_received": null,
"connector": "paysafe",
"client_secret": "pay_NtJnAOrMkNpnmUFaSP3P_secret_ScE2jv35Tp7z2ors0vSN",
"created": "2025-09-02T20:59:00.726Z",
"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": "manual",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "2345",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "453091",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Joseph",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"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": 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": null
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "aaaa",
"created_at": 1756846740,
"expires": 1756850340,
"secret": "epk_725012e7f4524681a43c922269d96501"
},
"manual_retry_allowed": false,
"connector_transaction_id": "7b6151d0-a81c-4dea-8c65-72053993f1a0",
"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_Dpwkpk5tMI4H6ZdYjpEW",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_pliYtewxLmWuyNqYCjxg",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-02T21:14:00.726Z",
"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-09-02T20:59:02.385Z",
"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
}
```
Capture the payment
Response
```
{
"payment_id": "pay_NtJnAOrMkNpnmUFaSP3P",
"merchant_id": "merchant_1756845023",
"status": "succeeded",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1500,
"connector": "paysafe",
"client_secret": "pay_NtJnAOrMkNpnmUFaSP3P_secret_ScE2jv35Tp7z2ors0vSN",
"created": "2025-09-02T20:59:00.726Z",
"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": "manual",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "2345",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "453091",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Joseph",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"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": 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": null
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "f1063df1-4f29-433c-a97f-f9b3d32dac5d",
"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_Dpwkpk5tMI4H6ZdYjpEW",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_pliYtewxLmWuyNqYCjxg",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-02T21:14:00.726Z",
"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-09-02T20:59:27.495Z",
"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
}
```
Make one more payment with capture method manual
- Then void it
Response
```
{
"payment_id": "pay_TaErSsfUWajhzursc4jS",
"merchant_id": "merchant_1756845023",
"status": "cancelled",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "paysafe",
"client_secret": "pay_TaErSsfUWajhzursc4jS_secret_l7P3CWNj0vzLmXG6TNiT",
"created": "2025-09-02T21:00:32.402Z",
"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": "manual",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "2345",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "453091",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Joseph",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"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": 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": 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": "requested_by_customer",
"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": "2951a54a-c923-48d4-9738-5e16bb440b3e",
"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_Dpwkpk5tMI4H6ZdYjpEW",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_pliYtewxLmWuyNqYCjxg",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-02T21:15:32.402Z",
"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-09-02T21:00:35.862Z",
"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
}
```
Refunds
Refunds can only be triggered after sometime, as the payment take some time to settle.
according to doc - This process is typically handled in an overnight batch.
Cypress
<img width="740" height="826" alt="Screenshot 2025-09-04 at 4 45 29 PM" src="https://github.com/user-attachments/assets/1ffe7b71-bc3d-4350-8af9-b7b3cd879b2b" />
<img width="957" height="852" alt="Screenshot 2025-09-08 at 3 57 46 PM" src="https://github.com/user-attachments/assets/e7f144c2-8c20-44b0-84a5-e2b531ec59a4" />
## 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`
- `crates/router/src/core/payments.rs`
**2. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/common_config.rs`
- `crates/connector_configs/src/connector.rs`
- ... and 10 more files
**3. Type Definitions**
- `crates/router/src/types/api/feature_matrix.rs`
**4. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Paysafe.js`
- `cypress-tests/cypress/e2e/configs/Payment/Utils.js`
**5. Configuration Files**
- `config/deployments/production.toml`
**6. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
**Code Patterns Applied:**
- Define new data structures (13 changes)
- Implement new functions (28 changes)
- Extend existing types with new fields (571 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 439936da:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/common_config.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paysafe.rs**
Remove:
- function: private::validate_mandate_payment
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Paysafe
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Paysafe
Add:
- function: private::build_request
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Paysafe
- impl: impl api::PaymentsPreProcessing for Paysafe
- impl: impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResponseData> for Paysafe
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Paysafe
**crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs**
Add:
- function: private::from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::from
- struct: pub::PaysafeConnectorMetadataObject
- struct: pub::PaysafePaymentHandleRequest
- struct: pub::ReturnLink
- struct: pub::PaysafePaymentHandleResponse
- struct: pub::PaysafeMeta
- struct: pub::PaysafeCardExpiry
- struct: pub::PaysafeCaptureRequest
- struct: pub::VoidResponse
- struct: pub::Error
- struct: pub::FieldError
- enum: pub::LinkType
- enum: pub::PaysafePaymentType
- enum: pub::TransactionType
- enum: pub::PaysafePaymentHandleStatus
- enum: pub::PaysafeSettlementStatus
- enum: pub::PaysafeVoidStatus
- impl: impl From<(MinorUnit, T)> for PaysafeRouterData<T>
- impl: impl TryFrom<&Option<SecretSerdeValue>> for PaysafeConnectorMetadataObject
- impl: impl TryFrom<&PaysafeRouterData<&PaymentsPreProcessingRouterData>> for PaysafePaymentHandleRequest
- impl: impl TryFrom<
ResponseRouterData<
F,
PaysafePaymentHandleResponse,
PaymentsPreProcessingData,
PaymentsResponseData,
>,
> for RouterData<F, PaymentsPreProcessingData, PaymentsResponseData>
- impl: impl TryFrom<
ResponseRouterData<F, PaysafePaymentsResponse, PaymentsAuthorizeData, PaymentsResponseData>,
> for RouterData<F, PaymentsAuthorizeData, PaymentsResponseData>
- impl: impl TryFrom<&PaysafeRouterData<&PaymentsCaptureRouterData>> for PaysafeCaptureRequest
- impl: impl TryFrom<ResponseRouterData<F, PaysafeSettlementResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&PaysafeRouterData<&PaymentsCancelRouterData>> for PaysafeCaptureRequest
- impl: impl From<PaysafeVoidStatus> for common_enums::AttemptStatus
- impl: impl amount
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_payment_method_data
**crates/router/src/core/connector_validation.rs**
Modify existing code
**crates/router/src/core/payments.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": 9127, "pr_title": "feat(connector): [Paysafe] Integrate no 3ds card", "merged_at": "2025-09-08T16:13:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/connector_validation.rs", "crates/router/src/core/payments.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/common_config.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/paysafe.rs", "crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/src/types/connector_transformers.rs", "crates/test_utils/src/connector_auth.rs"], "types": ["crates/router/src/types/api/feature_matrix.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Paysafe.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js"], "config": ["config/deployments/production.toml"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json"]}, "change_types": {"structs_added": 13, "functions_added": 28, "enums_added": 6, "fields_added": 571, "imports_added": 8, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(customers_v2): include minor fixes for customer v2 flows
## 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 includes minor fixes suggested in my previous PR #6836. This PR includes the following changes:
- Import `CustomerUpdateRequestInternal` instead of fully qualifying it.
- Renames the `fetch_domain_model_and_update_and_generate_delete_customer_response()` method to `redact_customer_details_and_generate_response()`.
- Includes the `customer_id` field in `PaymentsConfirmIntentResponse` and `PaymentsRetrieveResponse` API models.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
This PR adds the `customer_id` field in the `PaymentsConfirmIntentResponse` and `PaymentsRetrieveResponse` API models. This does not affect any API contract for v1 APIs.
## 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).
-->
Addresses minor fixes in customers v2 APIs.
## 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 the `customer_id` field in being included in `PaymentsConfirmIntentResponse` and `PaymentsRetrieveResponse` API models, I tried out the payment confirm intent v2 and payment intent retrieve v2 endpoint and confirmed that the `customer_id` field is being included and populated correctly.
## 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/customer.rs`
- `crates/api_models/src/payments.rs`
**2. Core Business Logic**
- `crates/router/src/core/customers.rs`
- `crates/router/src/core/payments/transformers.rs`
**3. Other**
- `api-reference-v2/openapi_spec.json`
**Code Patterns Applied:**
- Implement new functions (3 changes)
- Extend existing types with new fields (4 changes)
**Detailed Identifier Changes:**
Commit 5cdeaf8e:
Files to modify:
**crates/api_models/src/events/customer.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/router/src/core/customers.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
|
{"pr_number": 6876, "pr_title": "refactor(customers_v2): include minor fixes for customer v2 flows", "merged_at": "2024-12-20T08:30:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/customer.rs", "crates/api_models/src/payments.rs"], "core_business": ["crates/router/src/core/customers.rs", "crates/router/src/core/payments/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json"]}, "change_types": {"functions_added": 3, "fields_added": 4, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
docs(openapi): update /relay request example
## 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 -->
Update open-api spec of /relay request to make the data untagged enum.
### 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="1616" alt="image" src="https://github.com/user-attachments/assets/4ba7d3d6-9fcd-4a29-a7ff-62f0a5abda22" />
## 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**
- `api-reference/openapi_spec.json`
- `crates/openapi/src/routes/relay.rs`
**Detailed Identifier Changes:**
Commit d8494034:
Files to modify:
**crates/openapi/src/routes/relay.rs**
Modify existing code
|
{"pr_number": 6942, "pr_title": "docs(openapi): update /relay request example", "merged_at": "2024-12-26T10:48:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"other": ["api-reference/openapi_spec.json", "crates/openapi/src/routes/relay.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Add support for retries with clear pan and network token payment method data
## 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 to retry a transaction with clear PAN or Network Token
- added support for clear pan retry with same connector when previous attempt failed with payment method data - network token.
- refactored `make_pm_data` which does fetch payment method data from locker and construction of payment method data domain types.
- refactored `make_pm_data` for reducing locker calls during retries. by adding vault_data which holds payment method data from previous attempt.
### 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).
-->
## 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 -
1 - enable network tokenization, auto retries for profile
2 - make a setup future usage= on_session payment.
3 - make saved card payment (with payment token) (payment will happen with network token + cryptogram) with adyen, if it fails, a retry will happen with card data fetched from locker with same connector.
verification - 2 payment attempts will be created for that payment intent id. 1st attempt payment method data would be network token and 2nd would be card
Curl for test case added to the [issue](https://github.com/juspay/hyperswitch/issues/6925)
## 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`
- `crates/api_models/src/gsm.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/gsm.rs`
- `crates/diesel_models/src/schema.rs`
- ... and 1 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
- `crates/hyperswitch_domain_models/src/payments.rs`
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/gsm.rs`
- `crates/router/src/core/payment_methods.rs`
- ... and 25 more files
**5. Type Definitions**
- `crates/router/src/types/api/admin.rs`
- `crates/router/src/types/transformers.rs`
**6. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `migrations/2024-12-10-091820_add-clear-pan-possible-to-gsm/down.sql`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (14 changes)
- Extend existing types with new fields (161 changes)
- Add conditional logic for feature flags or filtering (6 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 44eec7a9:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/gsm.rs**
Modify existing code
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/gsm.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/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- function: pub::is_network_token_payment_method_data
**crates/hyperswitch_domain_models/src/payments.rs**
Add:
- function: pub::get_updated_vault_data
- function: pub::get_card_vault_data
- function: pub::get_network_token_data
- struct: pub::CardAndNetworkTokenData
- enum: pub::VaultOperation
- enum: pub::VaultData
- impl: impl VaultOperation
- impl: impl VaultData
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/gsm.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Add:
- function: private::get_vault_operation
- function: private::set_vault_operation
**crates/router/src/core/payments/helpers.rs**
Add:
- function: pub::decide_payment_method_retrieval_action
- function: pub::determine_standard_vault_action
- function: pub::retrieve_card_with_permanent_token_for_external_authentication
- function: pub::fetch_network_token_details_from_locker
- enum: pub::VaultFetchAction
**crates/router/src/core/payments/operations.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_approve.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_cancel.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_capture.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_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_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create_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/payments/retry.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 6905, "pr_title": "feat(router): Add support for retries with clear pan and network token payment method data", "merged_at": "2025-03-03T09:21:24Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "connector", "session"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs", "crates/api_models/src/gsm.rs"], "database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/gsm.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/payments.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/gsm.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.rs", "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_create.rs", "crates/router/src/core/payments/operations/payment_create_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/payments/retry.rs"], "types": ["crates/router/src/types/api/admin.rs", "crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "migrations/2024-12-10-091820_add-clear-pan-possible-to-gsm/down.sql", "migrations/2024-12-10-091820_add-clear-pan-possible-to-gsm/up.sql", "migrations/2025-02-27-171444_add-clear-pan-retries-enabled-to-profile/down.sql", "migrations/2025-02-27-171444_add-clear-pan-retries-enabled-to-profile/up.sql"]}, "change_types": {"structs_added": 1, "functions_added": 14, "enums_added": 3, "fields_added": 161, "imports_added": 5, "conditionals_added": 6, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): add extended authorization to profile update and add supported payment method types
## 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 -->
Enable configuration of extended authorization through the profile update call, and include supported payment methods and payment method types for extended authorization.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] 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)?
-->
Enable extended authorization with profile update and check the DB if the value is updated
```sh
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_e8cb56a4-d7d8-4b59-b473-ea6c73407b9e/business_profile/pro_l2YKZKI9wJBFXtc00kqX' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_pr8cBJl1V1iongZwdaz0MSLFtzg36x2ID74MUNxqVrk88OxaD1FCDEAcoqyhqSjB' \
--data '{
"always_request_extended_authorization": true
}'
```
Response
```
{
"merchant_id": "postman_merchant_GHAction_e8cb56a4-d7d8-4b59-b473-ea6c73407b9e",
"profile_id": "pro_l2YKZKI9wJBFXtc00kqX",
"profile_name": "US_default",
"return_url": "https://duck.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "lNke1zXXGcOLQPxJjn70npaHDAoHLnvdotbtX3KOL0Vb4Cq7ozVFB23qOaLdN7HB",
"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": null,
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true,
"payment_statuses_enabled": null,
"refund_statuses_enabled": null,
"payout_statuses_enabled": null
},
"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": true,
"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,
"is_pre_network_tokenization_enabled": false,
"acquirer_configs": null,
"is_iframe_redirection_enabled": null,
"merchant_category_code": null,
"merchant_country_code": null,
"dispute_polling_interval": null
}
```
DB
<img width="935" height="694" alt="Screenshot 2025-09-02 at 1 19 42 PM" src="https://github.com/user-attachments/assets/ce0adbac-1ca7-4138-81ed-03525038da16" />
## 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/admin.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. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (3 changes)
**Detailed Identifier Changes:**
Commit e3084289:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
|
{"pr_number": 9237, "pr_title": "fix(core): add extended authorization to profile update and add supported payment method types ", "merged_at": "2025-09-03T08:31:41Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/admin.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs"]}, "change_types": {"fields_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Add dummy billing connector auth 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 -->
Added a dummy billing connector whose conector type is **billing processor** to support recovery flow.
### 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 request:**-
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_SZpigRAzbQDYfnzh4Pid' \
--header 'x-profile-id: pro_AFjVC7IPd74sIhEy4ZVV' \
--header 'Authorization: admin-api-key=test_admin' \
--header 'api-key: ••••••' \
--data '{
"connector_type": "billing_processor",
"connector_name": "stripe_billing_test",
"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"
},
"frm_configs": null,
"connector_webhook_details": {
"merchant_secret": ""
},
"profile_id": "pro_AFjVC7IPd74sIhEy4ZVV"
}'
```
### Response:-
```
{
"connector_type": "billing_processor",
"connector_name": "stripe_billing_test",
"connector_label": "stripe_billing_test_business",
"id": "mca_9uYYwrC2gaHI5j15oq10",
"profile_id": "pro_AFjVC7IPd74sIhEy4ZVV",
"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
}
]
}
],
"connector_webhook_details": {
"merchant_secret": "",
"additional_secret": null
},
"metadata": {
"status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay",
"account_name": "transaction_processing",
"acquirer_bin": "438309",
"pricing_type": "fixed_price",
"acquirer_merchant_id": "00002000000"
},
"disabled": false,
"frm_configs": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null,
"feature_metadata": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
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`
**2. Core Business Logic**
- `crates/router/src/core/admin.rs`
**3. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
**4. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/transformers.rs`
**5. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit bca8979a:
Files to modify:
**crates/api_models/src/enums.rs**
Modify existing code
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**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": 7819, "pr_title": "feat(connector): Add dummy billing connector auth flow", "merged_at": "2025-04-23T07:00:54Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/enums.rs"], "core_business": ["crates/router/src/core/admin.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [BITPAY] Fixed Currency Conversion
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Changed currency from MinorUnit to FloatMajorUnit
### 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?
**Postman Tests**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_vq4nNVowBOHmT3h8FYoeDtYV55oIY5tlGAoCeiUHdgm7YEnyFLTGUGI3AMAObHAJ' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data '{
"amount": 6540,
"currency": "USD",
"confirm": true,
"profile_id": "pro_Mj45Ntp2QcUJHFKxvDfs",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
}
}'
```
**Redirection Screenshot**
<img width="1728" alt="Screenshot 2025-02-25 at 7 58 49 PM" src="https://github.com/user-attachments/assets/ac037f82-d655-4ef1-bff7-f63465491520" />
## 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/bitpay.rs`
- `crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (8 changes)
**Detailed Identifier Changes:**
Commit 5d242861:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/bitpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs**
Modify existing code
|
{"pr_number": 7378, "pr_title": "fix(connector): [BITPAY] Fixed Currency Conversion", "merged_at": "2025-03-03T09:07:19Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "card"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/bitpay.rs", "crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs"]}, "change_types": {"functions_added": 1, "fields_added": 8, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [Fiuu] populate error_code and error_desc for redirection flows if they're not present in PSync
## 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 Fiuu connector to properly handle and return `error_code` and `error_message` for failed FPX transactions. The connector was previously receiving error information during redirection back to Hyperswitch but was not populating these fields in API responses after redirection back to Hyperswitch during Payment Sync (PSync) operations.
**Changes made:**
- Updated Fiuu connector's FPX transaction handling to capture and store error_code and error_message from redirection responses
- Modified PSync logic to properly propagate error information to payment API response
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files 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 addresses a critical gap in error handling for FPX transactions through the Fiuu connector. Currently, when FPX transactions fail, the error details provided during redirection are not being captured and made available through the Hyperswitch API or webhooks. This makes it difficult for merchants to understand why transactions failed and provide appropriate feedback to their customers.
## 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 for testing -
<details>
<summary>1. Add Fiuu connector and enable FPX</summary>
cURL
curl --location --request POST 'http://localhost:8080/account/merchant_1747931797/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-feature: integ-custom' \
--header 'api-key: dev_8GkaY93JFWEP8zYOBlUmFePPfckcnGW5qdoLLXxb3jSqYOwt0ZhTNTpIFoLVLfo4' \
--data '{"connector_type":"payment_processor","connector_name":"fiuu","connector_label":"fiuu_payments","connector_account_details":{"auth_type":"SignatureKey","api_key":"A","key1":"B","api_secret":"C"},"test_mode":true,"disabled":false,"payment_methods_enabled":[{"payment_method":"card","payment_method_types":[{"payment_method_type":"debit","payment_experience":null,"card_networks":["Visa"],"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"credit","payment_experience":null,"card_networks":["Visa"],"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":"online_banking_fpx","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}]}]}'
</details>
<details>
<summary>2. Create a payment link with MYR currency</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_8GkaY93JFWEP8zYOBlUmFePPfckcnGW5qdoLLXxb3jSqYOwt0ZhTNTpIFoLVLfo4' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_Wz8ND2QMGUTQCZBgO4Jx","profile_id":"pro_POJq22KThTEaouJM0sv7","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"}},"amount":1000,"currency":"MYR","confirm":false,"payment_link":true,"setup_future_usage":"off_session","billing":{"address":{},"email":"random@juspay.in"},"return_url":"https://www.example.com","payment_link_config":{"background_image":{"url":"https://img.freepik.com/free-photo/abstract-blue-geometric-shapes-background_24972-1841.jpg","position":"bottom","size":"cover"}}}'
Response
{"payment_id":"pay_yPdYbjvEUbc7FFYKG2QF","merchant_id":"merchant_1747931797","status":"requires_payment_method","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":null,"client_secret":"pay_yPdYbjvEUbc7FFYKG2QF_secret_VHqHmGCJjjQpSeyewAxN","created":"2025-05-23T10:36:41.060Z","currency":"MYR","customer_id":"cus_Wz8ND2QMGUTQCZBgO4Jx","customer":{"id":"cus_Wz8ND2QMGUTQCZBgO4Jx","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":"off_session","off_session":null,"capture_on":null,"capture_method":null,"payment_method":null,"payment_method_data":null,"payment_token":null,"shipping":null,"billing":{"address":null,"phone":null,"email":"random@juspay.in"},"order_details":null,"email":null,"name":null,"phone":null,"return_url":"https://www.example.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":"cus_Wz8ND2QMGUTQCZBgO4Jx","created_at":1747996601,"expires":1748000201,"secret":"epk_a10b3bda47314b72ab41296146b73e6a"},"manual_retry_allowed":null,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":{"link":"http://localhost:8080/payment_link/merchant_1747931797/pay_yPdYbjvEUbc7FFYKG2QF?locale=es-ES","secure_link":null,"payment_link_id":"plink_ACAHjaujoqHWhJQrulhC"},"profile_id":"pro_POJq22KThTEaouJM0sv7","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-05-23T10:51:41.055Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-05-23T10:36:41.080Z","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>
3. Proceed with the FPX payment and mark it as a failure
<details>
<summary>4. Retrieve the payment - Response to have `error_code` and `error_message`</summary>
cURL
curl --location --request GET 'http://localhost:8080/payments/pay_yPdYbjvEUbc7FFYKG2QF?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_8GkaY93JFWEP8zYOBlUmFePPfckcnGW5qdoLLXxb3jSqYOwt0ZhTNTpIFoLVLfo4'
Response
{"payment_id":"pay_yPdYbjvEUbc7FFYKG2QF","merchant_id":"merchant_1747931797","status":"failed","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"fiuu","client_secret":"pay_yPdYbjvEUbc7FFYKG2QF_secret_VHqHmGCJjjQpSeyewAxN","created":"2025-05-23T10:36:41.060Z","currency":"MYR","customer_id":"cus_Wz8ND2QMGUTQCZBgO4Jx","customer":{"id":"cus_Wz8ND2QMGUTQCZBgO4Jx","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":"on_session","off_session":null,"capture_on":null,"capture_method":null,"payment_method":"bank_redirect","payment_method_data":{"bank_redirect":{"type":"BankRedirectResponse","bank_name":"affin_bank"},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":null,"phone":null,"email":"random@juspay.in"},"order_details":null,"email":null,"name":null,"phone":null,"return_url":"https://www.example.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":"FPX_1B","error_message":"Buyer Failed To Provide The Necessary Info To Login IB Login Page","unified_code":"UE_9000","unified_message":"Something went wrong","payment_experience":null,"payment_method_type":"online_banking_fpx","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":"30994873","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":{"link":"http://localhost:8080/payment_link/merchant_1747931797/pay_yPdYbjvEUbc7FFYKG2QF?locale=es-ES","secure_link":null,"payment_link_id":"plink_ACAHjaujoqHWhJQrulhC"},"profile_id":"pro_POJq22KThTEaouJM0sv7","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_D52A4XabkFvmpjJMgiUd","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-05-23T10:51:41.055Z","fingerprint":null,"browser_info":{"os_type":"macOS","language":"en-US","time_zone":-330,"ip_address":"::1","os_version":"10.15.7","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15","color_depth":24,"device_model":"Macintosh","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,"accept_language":"en-US,en;q=0.9","java_script_enabled":true},"payment_method_id":"pm_RhSibHsj5rRz9sav6phs","payment_method_status":"inactive","updated":"2025-05-23T10:46:22.127Z","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
<!-- 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/fiuu/transformers.rs`
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (27 changes)
- Modify database queries (4 changes)
**Detailed Identifier Changes:**
Commit e272e7ab:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Add:
- function: private::try_from
- struct: private::ErrorInputs
- struct: private::ErrorDetails
- struct: pub::FiuuPaymentRedirectResponse
- impl: impl TryFrom<ErrorInputs> for ErrorDetails
|
{"pr_number": 8124, "pr_title": "fix(connector): [Fiuu] populate error_code and error_desc for redirection flows if they're not present in PSync", "merged_at": "2025-05-23T12:12:54Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs"]}, "change_types": {"structs_added": 3, "functions_added": 1, "fields_added": 27, "database_queries": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Deutschebank] Add Access Token Error struct
## 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 includes following changes
1. Added Access Token Error struct for Deutschebank
DeutscheBank connector can send error of following type in case of Access Token issues
https://testmerch.directpos.de/rest-api/apidoc/v2.1/index.html#api-securityAccessTokenError

This needs to be handled by the code
2. Added Fiuu configs for config/config.example.toml, config/docker_compose.toml
### 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. Pass Incorrect "grant_type" in DeutschebankAccessTokenRequest

2. Make /payments with Deutschebank
```
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_onBnlgwJQe91cieJ4UdFhS8ezGa09i8ALPy9NaRpPE1BH7rkGE0WSIJTxZGPJ8AO' \
--data-raw '{
"amount": 1234,
"currency": "EUR",
"confirm": true,
"profile_id": null,
"customer_id": "customer123",
"email": "something@example.com",
"capture_method": "manual",
"payment_method": "bank_debit",
"payment_method_type": "sepa",
"payment_method_data": {
"bank_debit": {
"sepa_bank_debit": {
"iban": "DE87123456781234567890"
}
}
},
"billing": {
"address": {
"first_name": "joseph",
"last_name": "doe"
}
},
"customer_acceptance": {
"acceptance_type": "offline"
},
"setup_future_usage": "on_session"
}'
```
### Response
**Before**
<img width="1201" alt="Screenshot 2025-01-28 at 13 21 33" src="https://github.com/user-attachments/assets/a6133415-0e89-4457-84fd-075f71f05fbe" />
**After**
<img width="1201" alt="Screenshot 2025-01-28 at 13 21 45" src="https://github.com/user-attachments/assets/95caa650-86e6-4289-bd5f-c321ca0b3b6a" />
<img width="1201" alt="Screenshot 2025-01-28 at 13 21 55" src="https://github.com/user-attachments/assets/064f8c53-d683-4e13-bad1-0413e6e8c35c" />
## 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/deutschebank.rs`
- `crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs`
**2. Configuration Files**
- `config/config.example.toml`
- `config/docker_compose.toml`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Extend existing types with new fields (14 changes)
**Detailed Identifier Changes:**
Commit 57084eff:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/deutschebank.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs**
Remove:
- struct: pub::DeutschebankErrorResponse
Add:
- struct: pub::PaymentsErrorResponse
- enum: pub::DeutschebankError
Commit 22072fd7:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/deutschebank.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs**
Remove:
- struct: pub::DeutschebankErrorResponse
Add:
- struct: pub::PaymentsErrorResponse
- enum: pub::DeutschebankError
|
{"pr_number": 7127, "pr_title": "feat(connector): [Deutschebank] Add Access Token Error struct", "merged_at": "2025-02-05T15:34:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/deutschebank.rs", "crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs"], "config": ["config/config.example.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 2, "enums_added": 1, "fields_added": 14}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
fix(core): Fix Applepay/Gpay for Trustpay
## 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 -->
Hotfix raised against: https://github.com/juspay/hyperswitch/pull/8881
### 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)?
-->
Payments Create
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_izwUb76c3qmeJJSgPxfqXzA7J728ss4o7EY0FdWlwyQIw3xhIxUAv1GKZGIoYWLw' \
--data-raw '{
"amount": 6100,
"currency": "USD",
"confirm": false,
"business_country": "US",
"business_label": "default",
"amount_to_capture": 6100,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"return_url": "https://google.com/",
"email": "something@gmail.com",
"setup_future_usage": "on_session",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"customer_id": "cu_1747653129",
"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"
}
}
}
```
Response
```
{
"payment_id": "pay_OluPb5CwYfHKZOofzB5I",
"merchant_id": "merchant_1754664301",
"status": "requires_payment_method",
"amount": 6500,
"net_amount": 6500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_OluPb5CwYfHKZOofzB5I_secret_k4QIAxGM5V5Okc4RMLIV",
"created": "2025-08-08T15:04:58.988Z",
"currency": "USD",
"customer_id": "test_fb",
"customer": {
"id": "test_fb",
"name": "Joseph Doe",
"email": "something@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": {
"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": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"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": "test_fb",
"created_at": 1754665498,
"expires": 1754669098,
"secret": "epk_c3d7311b50d2474c927d089153109bd4"
},
"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": {
"payment_description": "this is the apple pay recurring payment",
"regular_billing": {
"label": "pay to hyperswitchs merchant",
"recurring_payment_start_date": "2027-09-10T10:11:12.000Z",
"recurring_payment_end_date": "2027-09-10T10:11:12.000Z",
"recurring_payment_interval_unit": "year",
"recurring_payment_interval_count": 1
},
"billing_agreement": "billing starts from the above mentioned start date",
"management_url": "https://applepaydemo.apple.com/"
}
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_8zw2mkU5ZzZHUfqYFtx2",
"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-08-08T15:19:58.988Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-08-08T15:04:59.033Z",
"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,
"enable_partial_authorization": null
}
```
Session Create Call
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'x-browser-name: Safari' \
--header 'x-client-platform: web' \
--header 'x-merchant-domain: hyperswitch-demo-store.netlify.app' \
--header 'api-key: pk_dev_53b837ea9757471ebf7ab7ac908add0e' \
--data '{
"payment_id": "pay_4MSU93Srz6glicm51zuR",
"wallets": [],
"client_secret": "pay_4MSU93Srz6glicm51zuR_secret_CJTeNGnHxgvBH5kyg6xc"
}'
```
Session Response
```
{
"payment_id": "pay_4MSU93Srz6glicm51zuR",
"client_secret": "pay_4MSU93Srz6glicm51zuR_secret_CJTeNGnHxgvBH5kyg6xc",
"session_token": [
{
"wallet_name": "apple_pay",
"session_token_data": null,
"payment_request_data": null,
"connector": "trustpay",
"delayed_session_token": true,
"sdk_next_action": {
"next_action": "confirm"
},
"connector_reference_id": null,
"connector_sdk_public_key": null,
"connector_merchant_id": null
},
{
"wallet_name": "google_pay",
"delayed_session_token": true,
"connector": "trustpay",
"sdk_next_action": {
"next_action": "confirm"
}
}
]
}
```
Confirm Case
```
curl --location 'http://localhost:8080/payments/pay_4MSU93Srz6glicm51zuR/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_53b837ea9757471ebf7ab7ac908add0e' \
--data '{
"client_secret": "pay_4MSU93Srz6glicm51zuR_secret_CJTeNGnHxgvBH5kyg6xc",
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay_third_party_sdk": {}
}
}
}'
```
Confirm Response
```
{
"payment_id": "pay_4MSU93Srz6glicm51zuR",
"merchant_id": "merchant_1754664301",
"status": "requires_customer_action",
"amount": 6100,
"net_amount": 6100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "trustpay",
"client_secret": "pay_4MSU93Srz6glicm51zuR_secret_CJTeNGnHxgvBH5kyg6xc",
"created": "2025-08-08T15:05:23.278Z",
"currency": "USD",
"customer_id": "cu_1747653129",
"customer": {
"id": "cu_1747653129",
"name": "Joseph Doe",
"email": "something@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {},
"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",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": null,
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"next_action": {
"type": "third_party_sdk_session_token",
"session_token": {
"wallet_name": "apple_pay",
"session_token_data": {
"secrets": {
"display": "dkaHcqUegL8Z8r1TY3i-3CvMhhugW0zBlbhAHb9MiQW1mpgIlR9uZ8XK5_3e0eEdeqt7ex9T1GCHTa-v0CXXO8yFjXFYzOvQpGOJu8jhsJPoh7sdU20n8LMYoSfUOxxx",
"payment": "qkqoQaucCzAaQS37WmM8AtvoviohY7D9-jKfTIngWGYjCVVjf0D6KEjjHJc01JNl3gOCqwBU2ojxk2ntRWsDja_OgSmEwSTy0w-L5bsTtkuom66n_mz8wFbK7HwA6Pbq"
}
},
"payment_request_data": {
"country_code": "IN",
"currency_code": "USD",
"total": {
"label": "juspay.in",
"type": null,
"amount": "61.00"
},
"merchant_capabilities": [
"supports3DS"
],
"supported_networks": [
"visa",
"masterCard",
"maestro"
],
"merchant_identifier": null
},
"connector": "trustpay",
"delayed_session_token": true,
"sdk_next_action": {
"next_action": "sync"
},
"connector_reference_id": null,
"connector_sdk_public_key": null,
"connector_merchant_id": 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": "trustpay_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": "fo6mF0U6IuOejr6BU5ymiA",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_8zw2mkU5ZzZHUfqYFtx2",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_46VoXY1k1qrEp2u8SW44",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-08T15:20:23.278Z",
"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_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-08-08T15:07:28.716Z",
"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,
"enable_partial_authorization": null
}
```
--------------------------------------------------------------------------------------------
GooglePay
Create Call
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_izwUb76c3qmeJJSgPxfqXzA7J728ss4o7EY0FdWlwyQIw3xhIxUAv1GKZGIoYWLw' \
--data-raw '{
"amount": 6100,
"currency": "USD",
"confirm": false,
"business_country": "US",
"business_label": "default",
"amount_to_capture": 6100,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"return_url": "https://google.com/",
"email": "something@gmail.com",
"setup_future_usage": "on_session",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"customer_id": "cu_1747653129",
"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"
}
}
}
```
Response
```
{
"payment_id": "pay_tfPQ5nAGzc3VPOxlN0lg",
"merchant_id": "merchant_1754664301",
"status": "requires_payment_method",
"amount": 6500,
"net_amount": 6500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_tfPQ5nAGzc3VPOxlN0lg_secret_WubijRpU0FZgk7GDvLTq",
"created": "2025-08-08T15:10:11.112Z",
"currency": "USD",
"customer_id": "test_fb",
"customer": {
"id": "test_fb",
"name": "Joseph Doe",
"email": "something@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": {
"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": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"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": "test_fb",
"created_at": 1754665811,
"expires": 1754669411,
"secret": "epk_f4e63e8f6e764dfc8c50c6a0c1841bd4"
},
"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": {
"payment_description": "this is the apple pay recurring payment",
"regular_billing": {
"label": "pay to hyperswitchs merchant",
"recurring_payment_start_date": "2027-09-10T10:11:12.000Z",
"recurring_payment_end_date": "2027-09-10T10:11:12.000Z",
"recurring_payment_interval_unit": "year",
"recurring_payment_interval_count": 1
},
"billing_agreement": "billing starts from the above mentioned start date",
"management_url": "https://applepaydemo.apple.com/"
}
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_8zw2mkU5ZzZHUfqYFtx2",
"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-08-08T15:25:11.112Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-08-08T15:10:11.123Z",
"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,
"enable_partial_authorization": null
}
```
Session Resquest
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'x-browser-name: Safari' \
--header 'x-client-platform: web' \
--header 'x-merchant-domain: hyperswitch-demo-store.netlify.app' \
--header 'api-key: pk_dev_53b837ea9757471ebf7ab7ac908add0e' \
--data '{
"payment_id": "pay_tfPQ5nAGzc3VPOxlN0lg",
"wallets": [],
"client_secret": "pay_tfPQ5nAGzc3VPOxlN0lg_secret_WubijRpU0FZgk7GDvLTq"
}'
```
Session Response
```
{
"payment_id": "pay_tfPQ5nAGzc3VPOxlN0lg",
"client_secret": "pay_tfPQ5nAGzc3VPOxlN0lg_secret_WubijRpU0FZgk7GDvLTq",
"session_token": [
{
"wallet_name": "apple_pay",
"session_token_data": null,
"payment_request_data": null,
"connector": "trustpay",
"delayed_session_token": true,
"sdk_next_action": {
"next_action": "confirm"
},
"connector_reference_id": null,
"connector_sdk_public_key": null,
"connector_merchant_id": null
},
{
"wallet_name": "google_pay",
"delayed_session_token": true,
"connector": "trustpay",
"sdk_next_action": {
"next_action": "confirm"
}
}
]
}
```
Confirm
Request
```
curl --location 'http://localhost:8080/payments/pay_tfPQ5nAGzc3VPOxlN0lg/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_53b837ea9757471ebf7ab7ac908add0e' \
--data '{
"client_secret": "pay_tfPQ5nAGzc3VPOxlN0lg_secret_WubijRpU0FZgk7GDvLTq",
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay_third_party_sdk": {}
}
}
}'
```
Response
```
{
"payment_id": "pay_tfPQ5nAGzc3VPOxlN0lg",
"merchant_id": "merchant_1754664301",
"status": "requires_customer_action",
"amount": 6500,
"net_amount": 6500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "trustpay",
"client_secret": "pay_tfPQ5nAGzc3VPOxlN0lg_secret_WubijRpU0FZgk7GDvLTq",
"created": "2025-08-08T15:10:11.112Z",
"currency": "USD",
"customer_id": "test_fb",
"customer": {
"id": "test_fb",
"name": "Joseph Doe",
"email": "something@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": {},
"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",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"next_action": {
"type": "third_party_sdk_session_token",
"session_token": {
"wallet_name": "google_pay",
"merchant_info": {
"merchant_id": "BCR2DN6TZ7NIH23I",
"merchant_name": "juspay.in"
},
"shipping_address_required": false,
"email_required": false,
"shipping_address_parameters": {
"phone_number_required": false
},
"allowed_payment_methods": [
{
"type": "CARD",
"parameters": {
"allowed_auth_methods": [
"PAN_ONLY",
"CRYPTOGRAM_3DS"
],
"allowed_card_networks": [
"MASTERCARD",
"VISA"
],
"assurance_details_required": true
},
"tokenization_specification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "trustpay",
"gateway_merchant_id": "4107721441"
}
}
}
],
"transaction_info": {
"country_code": "IN",
"currency_code": "USD",
"total_price_status": "FINAL",
"total_price": "65.00"
},
"delayed_session_token": true,
"connector": "trustpay",
"sdk_next_action": {
"next_action": "sync"
},
"secrets": {
"display": "hR_aG2qx6agfcULydAeX-oUeFPcuxOrLR5j1vYD17yG4_31H3gbm9hUcj7kQXIkkJxYFukY5HvMod9r_z5gS1ueLolq2BhN3bNn4IZHv5xDdCbhNbwpj_uZDRlNN6YUh",
"payment": "yXtiIRTwWkrBsCTddsdZd24h3kCvSUuZ6KHPdoQQkfuwry_EKIFb0ur6vlCi5_YK6mtugMJV0ppT3jX3vEMXho1UdXIbUh8-2pYuPJnIzH7Iy2N0GxC3JcOzHE_4koxZ"
}
}
},
"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": null,
"manual_retry_allowed": null,
"connector_transaction_id": "nRKRaGuBoWDTzcEA9SaB2w",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": {
"payment_description": "this is the apple pay recurring payment",
"regular_billing": {
"label": "pay to hyperswitchs merchant",
"recurring_payment_start_date": "2027-09-10T10:11:12.000Z",
"recurring_payment_end_date": "2027-09-10T10:11:12.000Z",
"recurring_payment_interval_unit": "year",
"recurring_payment_interval_count": 1
},
"billing_agreement": "billing starts from the above mentioned start date",
"management_url": "https://applepaydemo.apple.com/"
}
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_8zw2mkU5ZzZHUfqYFtx2",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_46VoXY1k1qrEp2u8SW44",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-08T15:25:11.112Z",
"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_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-08-08T15:10:36.654Z",
"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,
"enable_partial_authorization": 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/payments.rs`
**Detailed Identifier Changes:**
Commit 7e816b69:
Files to modify:
**crates/router/src/core/payments.rs**
Modify existing code
|
{"pr_number": 8882, "pr_title": "fix(core): Fix Applepay/Gpay for Trustpay", "merged_at": "2025-08-08T16:18:53Z", "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"}
|
chore(ci): update postman ci credentials
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [x] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
The S3 Source File Name in Postman Collection Runner Workflow has been changed because the Connector Auth File has been updated.
### 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 connector auth file has been updated, so updating the S3 source file name is required.
## How can we 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)?
-->
Stripe Test cases on Jenkins 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`
- [ ] 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**
- `.github/workflows/postman-collection-runner.yml`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
|
{"pr_number": 8172, "pr_title": "chore(ci): update postman ci credentials", "merged_at": "2025-05-29T15:47:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"config": [".github/workflows/postman-collection-runner.yml"]}, "change_types": {"fields_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(connector): [ADYEN] Add support to ideal Mandate Webhook
## 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 -->
For iDEAL, Adyen sends the recurringDetailReference in the webhook with event_code: RECURRING_CONTRACT, instead of including it in the Authorize response. Since we currently don’t process this webhook, MIT transactions were failing.
This PR adds support to consume the required webhook and populate the mandate_reference for the connector.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<img width="1327" height="1041" alt="Screenshot 2025-09-10 at 6 26 08 PM" src="https://github.com/user-attachments/assets/3faa2fd6-d738-4f11-a1d2-3acfda8bd641" />
<details>
<summary>1. CIT</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CoVfWWunx2jBbvW4URDcFIQbtkLf6tIOVsxhA28soDf2lK61jZO6wKZlf4KPNsyk' \
--data-raw '{
"amount": 1000,
"currency": "EUR",
"customer_id": "cus_uRI2lJdRQIDIpNdoqeAa",
"description": "Initial payment for mandate setup demo",
"confirm": true,
"capture_method": "automatic",
"return_url": "https://example.com/mandate_return_demo",
"authentication_type": "no_three_ds",
"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"
}
}
},
"browser_info": {
"color_depth": 24,
"java_enabled": true,
"java_script_enabled": true,
"language": "en-US",
"screen_height": 1080,
"screen_width": 1920,
"time_zone": -330,
"ip_address": "127.0.0.1",
"accept_header": "application/json, text/plain, */*",
"user_agent": "Hyperswitch .NET SDK Sample CIT Demo v1.0"
},
"setup_future_usage": "off_session",
"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"
}
},
"mandate_data": {
"customer_acceptance": {
"acceptance_type": "offline"
},
"mandate_type": {
"multi_use": {
"amount": 0,
"currency": "EUR"
}
}
}
}
'
```
Response
```
{"payment_id":"pay_2LZG5tHzYvPyOOR1Xbmu","merchant_id":"merchant_1757442025","status":"requires_customer_action","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":1000,"amount_received":null,"connector":"adyen","client_secret":"pay_2LZG5tHzYvPyOOR1Xbmu_secret_pILtys8LO3GAaRwU2L6Y","created":"2025-09-10T07:50:21.244Z","currency":"EUR","customer_id":"cus_uRI2lJdRQIDIpNdoqeAa","customer":{"id":"cus_uRI2lJdRQIDIpNdoqeAa","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"Initial payment for mandate setup demo","refunds":null,"disputes":null,"mandate_id":"man_0huG0cMjNC11gBVaWysa","mandate_data":{"update_mandate_id":null,"customer_acceptance":{"acceptance_type":"offline","accepted_at":null,"online":null},"mandate_type":{"multi_use":{"amount":0,"currency":"EUR","start_date":null,"end_date":null,"metadata":null}}},"setup_future_usage":"off_session","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":null,"billing":null,"order_details":null,"email":null,"name":null,"phone":null,"return_url":"https://example.com/mandate_return_demo","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_2LZG5tHzYvPyOOR1Xbmu/merchant_1757442025/pay_2LZG5tHzYvPyOOR1Xbmu_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":"cus_uRI2lJdRQIDIpNdoqeAa","created_at":1757490621,"expires":1757494221,"secret":"epk_46ef6866e1d64a4e856d126302fd3117"},"manual_retry_allowed":null,"connector_transaction_id":"DR2X5PQVP73XH575","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":"DR2X5PQVP73XH575","payment_link":null,"profile_id":"pro_Yip6BE3g6PqvCQp83K5V","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_9M29rGQTRj0zvjCZjk9Y","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-09-10T08:05:21.243Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Hyperswitch .NET SDK Sample CIT Demo v1.0","color_depth":24,"java_enabled":true,"screen_width":1920,"accept_header":"application/json, text/plain, */*","screen_height":1080,"java_script_enabled":true},"payment_channel":null,"payment_method_id":"pm_Ua3pck2g2GwgwDlnk0br","network_transaction_id":null,"payment_method_status":null,"updated":"2025-09-10T07:50:24.320Z","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,"enable_partial_authorization":null}
```
</details>
<details>
<summary>2. MIT</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_CoVfWWunx2jBbvW4URDcFIQbtkLf6tIOVsxhA28soDf2lK61jZO6wKZlf4KPNsyk' \
--data '
{
"amount": 1000,
"currency": "EUR",
"connector": ["adyen"],
"customer_id": "cus_uRI2lJdRQIDIpNdoqeAa",
"description": "Subsequent Mandate Test Payment (MIT from New CIT Demo)",
"confirm": true,
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "pm_Ua3pck2g2GwgwDlnk0br"
}
}'
```
Response
```
{"payment_id":"pay_InZ1XZOoqtUp8IhrxmG9","merchant_id":"merchant_1757442025","status":"succeeded","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":0,"amount_received":1000,"connector":"adyen","client_secret":"pay_InZ1XZOoqtUp8IhrxmG9_secret_IF9UnV8rjWdC9McCst9r","created":"2025-09-10T07:51:15.798Z","currency":"EUR","customer_id":"cus_uRI2lJdRQIDIpNdoqeAa","customer":{"id":"cus_uRI2lJdRQIDIpNdoqeAa","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"Subsequent Mandate Test Payment (MIT from New CIT Demo)","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":true,"capture_on":null,"capture_method":null,"payment_method":"bank_redirect","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":"ideal","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_uRI2lJdRQIDIpNdoqeAa","created_at":1757490675,"expires":1757494275,"secret":"epk_5dec7b8ff5ac4aa4ab5f2245cfeb9e83"},"manual_retry_allowed":false,"connector_transaction_id":"QKDXM2J3R76ZRN75","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_InZ1XZOoqtUp8IhrxmG9_1","payment_link":null,"profile_id":"pro_Yip6BE3g6PqvCQp83K5V","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_9M29rGQTRj0zvjCZjk9Y","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-09-10T08:06:15.798Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_Ua3pck2g2GwgwDlnk0br","network_transaction_id":null,"payment_method_status":"active","updated":"2025-09-10T07:51:16.976Z","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":"TZ2545RJCKBTB5W5","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}
```
</details>
## 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. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (12 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 19debb64:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
|
{"pr_number": 9347, "pr_title": "feat(connector): [ADYEN] Add support to ideal Mandate Webhook", "merged_at": "2025-09-11T14:32:09Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs"]}, "change_types": {"fields_added": 12, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Gigadat] integrate interac bank redirect payment method
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Implement payments, psync and refunds flow for Gigadat
### 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?
Tested using mock server
Create mca for Gigadat
```
curl --location 'http://localhost:8080/account/merchant_1758701666/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_uhygCOBanQSOQkTpXmNryzdiJbf9SKUvNWAQG0cVbtuFjfzwxte8xWr9N3EtTmks' \
--data '{
"connector_type": "payment_processor",
"business_country": "US",
"business_label": "food",
"connector_name": "gigadat",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "_",
"key1": "_",
"api_secret" : "_"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "interac",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"site" : "https://google.com/"
}
}
'
```
2. Create interac payment method
```
{
"amount": 1500,
"currency": "CAD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "aaaa",
"profile_id": "pro_PWARez1e6xNJ9JgXgmgu",
"authentication_type": "three_ds",
"payment_method": "bank_redirect",
"payment_method_type": "interac",
"payment_method_data": {
"bank_redirect": {
"interac": {}
}
},
"billing": {
"address": {
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"city": "Downtown Core",
"state": "Central Indiana America",
"zip": "039393",
"country": "CA",
"first_name": "Swangi",
"last_name": "Kumari"
},
"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"
}
}
```
Response
```
{
"payment_id": "pay_8VkI5Udmj7k2PyZHwvEZ",
"merchant_id": "merchant_1758701666",
"status": "requires_customer_action",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 1500,
"amount_received": null,
"connector": "gigadat",
"client_secret": "pay_8VkI5Udmj7k2PyZHwvEZ_secret_lfEVqcrXUtTsyuPiNllV",
"created": "2025-09-24T09:34:43.061Z",
"currency": "CAD",
"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": "bank_redirect",
"payment_method_data": {
"bank_redirect": {
"type": "BankRedirectResponse",
"bank_name": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Downtown Core",
"country": "CA",
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"zip": "039393",
"state": "Central Indiana America",
"first_name": "Swangi",
"last_name": "Kumari",
"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_8VkI5Udmj7k2PyZHwvEZ/merchant_1758701666/pay_8VkI5Udmj7k2PyZHwvEZ_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "interac",
"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": 1758706483,
"expires": 1758710083,
"secret": "epk_f6fec077f5324182b567bac694e7a356"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pay_8VkI5Udmj7k2PyZHwvEZ_1",
"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_PWARez1e6xNJ9JgXgmgu",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_kDGqP2nExsX1Mx3qtjtt",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-24T09:49:43.061Z",
"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-09-24T09:34:43.091Z",
"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,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": 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/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/common_config.rs`
- `crates/connector_configs/src/connector.rs`
- ... and 9 more files
**3. Type Definitions**
- `crates/router/src/types/api/feature_matrix.rs`
**4. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**5. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
- ... and 1 more files
**6. Other**
- `.github/CODEOWNERS`
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
**Code Patterns Applied:**
- Define new data structures (7 changes)
- Implement new functions (4 changes)
- Extend existing types with new fields (87 changes)
**Detailed Identifier Changes:**
Commit 93b97ef5:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/common_config.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/gigadat.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs**
Add:
- function: private::try_from
- struct: pub::GigadatConnectorMetadataObject
- impl: impl TryFrom<&Option<pii::SecretSerdeValue>> for GigadatConnectorMetadataObject
**crates/payment_methods/src/configs/payment_connector_required_fields.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
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 9525, "pr_title": "feat(connector): [Gigadat] integrate interac bank redirect payment method", "merged_at": "2025-09-25T07:17:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/connector_validation.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/common_config.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/gigadat.rs", "crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/src/types/connector_transformers.rs", "crates/test_utils/src/connector_auth.rs"], "types": ["crates/router/src/types/api/feature_matrix.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"], "other": [".github/CODEOWNERS", "api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json"]}, "change_types": {"structs_added": 7, "functions_added": 4, "enums_added": 1, "fields_added": 87, "imports_added": 9}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(webhooks): move webhook acknowledge config to cover early deserialization errors
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for https://github.com/juspay/hyperswitch/pull/9508
### 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/webhooks/incoming.rs`
**Detailed Identifier Changes:**
Commit 1761e87b:
Files to modify:
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
|
{"pr_number": 9533, "pr_title": "fix(webhooks): move webhook acknowledge config to cover early deserialization errors", "merged_at": "2025-09-24T07:26:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/webhooks/incoming.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment-methods): [Proxy] add saved card flow for proxy payments
## 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 saved card flow for proxy payments:
- Card metadata is collected in the request along with tokens (bin_number and last_four digits for Card Number)
- Card Bin API is used to fetch data against card like card_network and issuer using bin number
- Card metadata is stored in payment method table along with tokens
- This component works along with Proxy Payments (needs confirm-intent/external-vault-proxy)
- Internally no locker is used since we don't store raw card data
- Data for subsequent payments (tokens) are fetched from payment method table
- Only cvc and card_holder_name is collected in subsequent payment with saved card
### Additional Changes
- [x] This PR modifies the API contract
First payment to save card in `confirm-intent/external-vault-proxy`:
```
"payment_method_data": {
"vault_data_card": {
"card_number": "tok_sandbox_ZgPN54WU8y8tDjc6qfEs",
"card_exp_month": "04",
"card_exp_year": "29",
"card_cvc": "tok_sandbox_3EniLX4zKbwxV1PPZFopd",
"bin_number": "424242",
"last_four": "4242",
"card_holder_name": "john doe"
}
},
```
Subsequent payment with saved card in `confirm-intent/external-vault-proxy`:
```
"payment_method_data": {
"vault_token": {
"card_cvc": "737"
}
},
```
- [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)?
-->
This PR is dependent in proxy module. Need the whole module to be present for testing.
## 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/payment_methods.rs`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_method.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
- `crates/hyperswitch_domain_models/src/payment_methods.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- ... and 1 more files
**4. Core Business Logic**
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payment_methods/vault.rs`
- `crates/router/src/core/payments.rs`
- ... and 4 more files
**5. Type Definitions**
- `crates/router/src/types/api/payment_methods.rs`
**6. Other**
- `api-reference/v2/openapi_spec_v2.json`
- `crates/common_enums/src/enums.rs`
- `crates/openapi/src/openapi_v2.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (19 changes)
- Extend existing types with new fields (177 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 73dfa5e4:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Add:
- struct: pub::ProxyCardDetails
- struct: pub::ExternalVaultTokenData
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- function: pub::is_success
**crates/diesel_models/src/payment_method.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- function: private::from
- function: private::from
- impl: impl From<api_models::payments::VaultToken> for VaultToken
- impl: impl From<ExternalVaultCard> for payment_methods::ProxyCardDetails
**crates/hyperswitch_domain_models/src/payment_methods.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/vault.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Add:
- function: pub::create_payment_method_card_core
- function: pub::create_payment_method_proxy_card_core
- function: private::convert_to_additional_payment_method_data
- function: private::get_external_vault_token_data
- function: private::populate_bin_details_for_payment_method
- function: private::convert_to_additional_payment_method_data
- function: private::get_external_vault_token_data
- function: pub::create_payment_method_for_confirm
- function: pub::get_external_vault_token
- function: private::convert_from_saved_payment_method_data
**crates/router/src/core/payment_methods/vault.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations.rs**
Add:
- function: private::update_payment_method
**crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs**
Add:
- function: private::create_or_fetch_payment_method
- function: private::update_payment_method
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Modify existing code
**crates/router/src/core/unified_connector_service.rs**
Modify existing code
**crates/router/src/types/api/payment_methods.rs**
Modify existing code
|
{"pr_number": 8964, "pr_title": "feat(payment-methods): [Proxy] add saved card flow for proxy payments", "merged_at": "2025-08-20T11:34:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "token", "card"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs", "crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_method.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/payment_methods.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/vault.rs"], "core_business": ["crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/unified_connector_service.rs"], "types": ["crates/router/src/types/api/payment_methods.rs"], "other": ["api-reference/v2/openapi_spec_v2.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi_v2.rs", "v2_compatible_migrations/2025-07-29-080133_add-external_vault_token_data-column-to-payment-methods/down.sql", "v2_compatible_migrations/2025-07-29-080133_add-external_vault_token_data-column-to-payment-methods/up.sql"]}, "change_types": {"structs_added": 4, "functions_added": 19, "fields_added": 177, "imports_added": 4, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(themes): Add ability to update email config for themes
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
* Modified the `UpdateThemeRequest` API to include `email_config` for updating email theme configurations.
* Removed `lineage` from `UploadFileRequest` API.
### 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 https://github.com/juspay/hyperswitch-control-center/issues/2932
## 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)?
-->
* Created a tenant-level theme using `POST /user/theme`:
* **Don't use tenant level theme to test this, use org or lower to test. Or else, this will affect all the users.**
```bash
curl -X POST http://localhost:8080/user/theme \
-H "Content-Type: application/json" \
-H "Authorization: Bearer test_admin" \
-d '{
"lineage": {
"entity_type": "tenant",
"tenant_id": "public"
},
"theme_name": "Test Theme",
"theme_data": {
"settings": {
"colors": {
"primary": "#000000"
},
"buttons": {
"primary": {
"hoverBackgroundColor": "#000000"
}
}
}
},
"email_config": {
"primary_color": "#000000",
"foreground_color": "#000000",
"background_color": "#000000",
"entity_name": "Test Entity",
"entity_logo_url": "https://example.com/logo.png"
}
}'
```
Expected Response:
```json
{
"theme_id": "7b3d316a-e31c-4dd6-99ee-d33ce1b9c6ec",
"theme_name": "Test Theme",
"entity_type": "tenant",
"tenant_id": "public",
"org_id": null,
"merchant_id": null,
"profile_id": null,
"email_config": {
"primary_color": "#000000",
"foreground_color": "#000000",
"background_color": "#000000",
"entity_name": "Test Entity",
"entity_logo_url": "https://example.com/logo.png"
},
"theme_data": {
"settings": {
"colors": {
"primary": "#000000"
},
"buttons": {
"primary": {
"hoverBackgroundColor": "#000000"
}
}
},
"urls": null
}
}
```
* Updated the theme data and email configuration using `PUT /user/theme/{theme_id}`:
```bash
curl -X PUT http://localhost:8080/user/theme/7b3d316a-e31c-4dd6-99ee-d33ce1b9c6ec \
-H "Content-Type: application/json" \
-H "Authorization: Bearer test_admin" \
-d '{
"theme_data": {
"settings": {
"colors": {
"primary": "#FFFFFF"
},
"buttons": {
"primary": {
"hoverBackgroundColor": "#FFFFFF"
}
}
}
},
"email_config": {
"primary_color": "#FFFFFF",
"foreground_color": "#FFFFFF",
"background_color": "#FFFFFF",
"entity_name": "Test Entity Updated",
"entity_logo_url": "https://example.com/logo_updated.png"
}
}'
```
Expected Response:
```json
{
"theme_id": "7b3d316a-e31c-4dd6-99ee-d33ce1b9c6ec",
"theme_name": "Test Theme",
"entity_type": "tenant",
"tenant_id": "public",
"org_id": null,
"merchant_id": null,
"profile_id": null,
"email_config": {
"primary_color": "#FFFFFF",
"foreground_color": "#FFFFFF",
"background_color": "#FFFFFF",
"entity_name": "Test Entity Updated",
"entity_logo_url": "https://example.com/logo_updated.png"
},
"theme_data": {
"settings": {
"colors": {
"primary": "#FFFFFF"
},
"buttons": {
"primary": {
"hoverBackgroundColor": "#FFFFFF"
}
}
},
"urls": null
}
}
```
* Verified the email configuration update in the `themes` database 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`
- [ ] 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/theme.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/user/theme.rs`
- `crates/diesel_models/src/user/theme.rs`
**3. Core Business Logic**
- `crates/router/src/core/user/theme.rs`
**4. Other**
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/db/user/theme.rs`
- `crates/router/src/routes/user/theme.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (11 changes)
- Extend existing types with new fields (23 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 564de627:
Files to modify:
**crates/api_models/src/user/theme.rs**
Modify existing code
**crates/diesel_models/src/query/user/theme.rs**
Add:
- function: pub::update_by_theme_id
**crates/diesel_models/src/user/theme.rs**
Add:
- function: private::from
- struct: pub::ThemeUpdateInternal
- enum: pub::ThemeUpdate
- impl: impl From<ThemeUpdate> for ThemeUpdateInternal
**crates/router/src/core/user/theme.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::update_theme_by_theme_id
**crates/router/src/db/user/theme.rs**
Add:
- function: private::update_theme_by_theme_id
- function: private::update_theme_by_theme_id
**crates/router/src/routes/user/theme.rs**
Modify existing code
|
{"pr_number": 8033, "pr_title": "feat(themes): Add ability to update email config for themes", "merged_at": "2025-05-16T14:17:51Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/user/theme.rs"], "database": ["crates/diesel_models/src/query/user/theme.rs", "crates/diesel_models/src/user/theme.rs"], "core_business": ["crates/router/src/core/user/theme.rs"], "other": ["crates/router/src/db/kafka_store.rs", "crates/router/src/db/user/theme.rs", "crates/router/src/routes/user/theme.rs"]}, "change_types": {"structs_added": 1, "functions_added": 11, "enums_added": 1, "fields_added": 23, "imports_added": 4, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(config): enabled platform feature on sandbox
## 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 -->
Enabled platform feature on sandbox
With this change, users (org_admins) can create platform organizations and a default platform merchant account in the platform organization.
```toml
[platform]
enabled = true # Enable or disable platform features
allow_connected_merchants = false # Enable or disable connected merchant account features
```
### 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`
-->
`config/deployments/sandbox.toml`
`config/config.example.toml`
## 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 on integ, now enabling for sandbox
## 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. Configuration Files**
- `config/config.example.toml`
- `config/deployments/sandbox.toml`
|
{"pr_number": 8580, "pr_title": "feat(config): enabled platform feature on sandbox", "merged_at": "2025-07-15T07:50:56Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user"]}, "hierarchy": {"config": ["config/config.example.toml", "config/deployments/sandbox.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(analytics): add new filters, dimensions and metrics for authentication analytics
## 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 support for filters and dimensions for authentication analytics.
Filters added:
- AuthenticationConnector
- MessageVersion
Dimensions added:
- AuthenticationStatus,
- TransactionStatus,
- ErrorMessage,
- AuthenticationConnector,
- MessageVersion,
New metrics added:
- AuthenticationErrorMessage
- AuthenticationFunnel
### 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).
-->
Get better insights into authentication data.
## 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 curls:
#### AuthenticationErrorMessage:
```bash
curl --location 'http://localhost:8080/analytics/v1/metrics/auth_events' \
--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: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--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": "2025-02-01T18:30:00Z",
"endTime": "2025-02-28T09:22:00Z"
},
"source": "BATCH",
"timeSeries": {
"granularity": "G_ONEDAY"
},
"groupByNames": [
"error_message"
],
"metrics": [
"authentication_error_message"
],
"delta": true
}
]'
```
Sample Output:
```json
{
"queryData": [
{
"authentication_count": null,
"authentication_attempt_count": null,
"authentication_success_count": null,
"challenge_flow_count": null,
"challenge_attempt_count": null,
"challenge_success_count": null,
"frictionless_flow_count": null,
"frictionless_success_count": null,
"error_message_count": 1,
"authentication_funnel": null,
"authentication_status": null,
"trans_status": null,
"error_message": "Failed to authenticate",
"authentication_connector": null,
"message_version": null,
"time_range": {
"start_time": "2025-02-10T00:00:00.000Z",
"end_time": "2025-02-10T23:00:00.000Z"
},
"time_bucket": "2025-02-10 00:00:00"
},
{
"authentication_count": null,
"authentication_attempt_count": null,
"authentication_success_count": null,
"challenge_flow_count": null,
"challenge_attempt_count": null,
"challenge_success_count": null,
"frictionless_flow_count": null,
"frictionless_success_count": null,
"error_message_count": 1,
"authentication_funnel": null,
"authentication_status": null,
"trans_status": null,
"error_message": "Something went wrong",
"authentication_connector": null,
"message_version": null,
"time_range": {
"start_time": "2025-02-20T00:00:00.000Z",
"end_time": "2025-02-20T23:00:00.000Z"
},
"time_bucket": "2025-02-20 00:00:00"
}
],
"metaData": [
{
"total_error_message_count": 2
}
]
}
```
#### Authentication Funnel:
```bash
curl --location 'http://localhost:8080/analytics/v1/metrics/auth_events' \
--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: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--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": "2025-02-01T18:30:00Z",
"endTime": "2025-02-28T09:22:00Z"
},
"source": "BATCH",
"timeSeries": {
"granularity": "G_ONEDAY"
},
"filters": {
"authentication_status": [
"success", "failed"
]
},
"metrics": [
"authentication_funnel"
],
"delta": true
}
]'
```
Sample Output:
```json
{
"queryData": [
{
"authentication_count": null,
"authentication_attempt_count": null,
"authentication_success_count": null,
"challenge_flow_count": null,
"challenge_attempt_count": null,
"challenge_success_count": null,
"frictionless_flow_count": null,
"frictionless_success_count": null,
"error_message_count": null,
"authentication_funnel": 3,
"authentication_status": null,
"trans_status": null,
"error_message": null,
"authentication_connector": null,
"message_version": null,
"time_range": {
"start_time": "2025-02-11T00:00:00.000Z",
"end_time": "2025-02-11T23:00:00.000Z"
},
"time_bucket": "2025-02-11 00:00:00"
},
{
"authentication_count": null,
"authentication_attempt_count": null,
"authentication_success_count": null,
"challenge_flow_count": null,
"challenge_attempt_count": null,
"challenge_success_count": null,
"frictionless_flow_count": null,
"frictionless_success_count": null,
"error_message_count": null,
"authentication_funnel": 64,
"authentication_status": null,
"trans_status": null,
"error_message": null,
"authentication_connector": null,
"message_version": null,
"time_range": {
"start_time": "2025-02-10T00:00:00.000Z",
"end_time": "2025-02-10T23:00:00.000Z"
},
"time_bucket": "2025-02-10 00:00:00"
},
{
"authentication_count": null,
"authentication_attempt_count": null,
"authentication_success_count": null,
"challenge_flow_count": null,
"challenge_attempt_count": null,
"challenge_success_count": null,
"frictionless_flow_count": null,
"frictionless_success_count": null,
"error_message_count": null,
"authentication_funnel": 11,
"authentication_status": null,
"trans_status": null,
"error_message": null,
"authentication_connector": null,
"message_version": null,
"time_range": {
"start_time": "2025-02-20T00:00:00.000Z",
"end_time": "2025-02-20T23:00:00.000Z"
},
"time_bucket": "2025-02-20 00:00:00"
}
],
"metaData": [
{
"total_error_message_count": 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.rs`
- `crates/api_models/src/analytics/auth_events.rs`
- `crates/api_models/src/events.rs`
**2. Database Layer (Queries & Schema)**
- `crates/analytics/src/query.rs`
**3. Core Business Logic**
- `crates/analytics/src/auth_events/core.rs`
- `crates/analytics/src/core.rs`
**4. Type Definitions**
- `crates/analytics/src/auth_events/types.rs`
**5. Utils**
- `crates/analytics/src/utils.rs`
**6. Other**
- `crates/analytics/src/auth_events.rs`
- `crates/analytics/src/auth_events/accumulator.rs`
- `crates/analytics/src/auth_events/filters.rs`
- ... and 16 more files
**Code Patterns Applied:**
- Define new data structures (9 changes)
- Implement new functions (17 changes)
- Extend existing types with new fields (148 changes)
- Add conditional logic for feature flags or filtering (15 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit 7473182b:
Files to modify:
**crates/analytics/src/auth_events.rs**
Add:
- mod: pub::filters
- mod: pub::types
**crates/analytics/src/auth_events/accumulator.rs**
Add:
- function: private::add_metrics_bucket
- function: private::collect
- struct: pub::AuthenticationErrorMessageAccumulator
- impl: impl AuthEventMetricAccumulator for AuthenticationErrorMessageAccumulator
**crates/analytics/src/auth_events/core.rs**
Modify existing code
**crates/analytics/src/auth_events/filters.rs**
Add:
- function: pub::get_auth_events_filter_for_dimension
- struct: pub::AuthEventFilterRow
- trait: pub::AuthEventFilterAnalytics
**crates/analytics/src/auth_events/metrics.rs**
Add:
- mod: private::authentication_error_message
- mod: private::authentication_funnel
**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**
Add:
- function: private::load_metrics
- struct: pub::AuthenticationErrorMessage
- impl: impl super::AuthEventMetric<T> for AuthenticationErrorMessage
**crates/analytics/src/auth_events/metrics/authentication_funnel.rs**
Add:
- function: private::load_metrics
- struct: pub::AuthenticationFunnel
- impl: impl super::AuthEventMetric<T> for AuthenticationFunnel
**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/auth_events/types.rs**
Add:
- function: private::set_filter_clause
- impl: impl QueryFilter<T> for AuthEventFilters
**crates/analytics/src/clickhouse.rs**
Add:
- function: private::try_into
- impl: impl super::auth_events::filters::AuthEventFilterAnalytics for ClickhouseClient
- impl: impl TryInto<AuthEventFilterRow> for serde_json::Value
**crates/analytics/src/core.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**
Add:
- function: private::from_row
- function: private::from_row
- impl: impl super::auth_events::metrics::AuthEventMetricAnalytics for SqlxClient
- impl: impl super::auth_events::filters::AuthEventFilterAnalytics for SqlxClient
- impl: impl FromRow<'a, PgRow> for super::auth_events::metrics::AuthEventMetricRow
- impl: impl FromRow<'a, PgRow> for super::auth_events::filters::AuthEventFilterRow
**crates/analytics/src/utils.rs**
Add:
- function: pub::get_auth_event_dimensions
**crates/api_models/src/analytics.rs**
Add:
- struct: pub::GetAuthEventFilterRequest
- struct: pub::AuthEventFiltersResponse
- struct: pub::AuthEventFilterValue
- struct: pub::AuthEventMetricsResponse
- struct: pub::AuthEventsAnalyticsMetadata
**crates/api_models/src/analytics/auth_events.rs**
Add:
- function: private::from
- struct: pub::AuthEventFilters
- struct: pub::AuthenticationErrorMessage
- impl: impl From<AuthEventDimensions> for NameDescription
**crates/api_models/src/events.rs**
Add:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for AuthEventMetricsResponse<T>
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/router/src/analytics.rs**
Add:
- function: pub::get_merchant_auth_events_filters
|
{"pr_number": 7451, "pr_title": "feat(analytics): add new filters, dimensions and metrics for authentication analytics", "merged_at": "2025-03-06T16:53:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector", "transaction"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics.rs", "crates/api_models/src/analytics/auth_events.rs", "crates/api_models/src/events.rs"], "database": ["crates/analytics/src/query.rs"], "core_business": ["crates/analytics/src/auth_events/core.rs", "crates/analytics/src/core.rs"], "types": ["crates/analytics/src/auth_events/types.rs"], "utils": ["crates/analytics/src/utils.rs"], "other": ["crates/analytics/src/auth_events.rs", "crates/analytics/src/auth_events/accumulator.rs", "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/clickhouse.rs", "crates/analytics/src/lib.rs", "crates/analytics/src/sqlx.rs", "crates/common_enums/src/enums.rs", "crates/router/src/analytics.rs"]}, "change_types": {"structs_added": 9, "functions_added": 17, "fields_added": 148, "imports_added": 33, "conditionals_added": 15, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat: added create endpoint for dynamic_routing
### **Summary**
This PR introduces the **`/create`** endpoints for dynamic routing algorithm types (Success-Based and Elimination), allowing merchants to initialize and register dynamic routing logic via a new payload-capable flow. The implementation includes support for optional configuration payloads and integration with the existing routing setup framework.
---
### **Key Changes**
**New Features**
* **New endpoint**:
* `POST /{profile_id}/dynamic_routing/success_based/create`
* `POST /{profile_id}/dynamic_routing/elimination/create`
* **Payload Support**: Optional payloads for `SuccessBasedRoutingConfig` and `EliminationRoutingConfig` can now be passed to configure algorithms during creation.
* **`CreateDynamicRoutingWrapper`** added to handle request data (profile ID, feature flag, optional payload).
* **`DynamicRoutingPayload` enum** introduced with tagged serialization for extensibility.
**Core Logic Additions**
* **`create_specific_dynamic_routing`** method introduced to encapsulate algorithm creation logic based on feature + payload.
* **`enable_dynamic_routing_algorithm`** and **`enable_specific_routing_algorithm`** now accept optional payloads to use custom configs during setup.
* **New helper**: `create_specific_dynamic_routing_setup()` handles inserting the provided configuration payload into the DB, avoiding fallback to defaults.
**Flow and API Updates**
* `Flow::CreateDynamicRouting` added for observability and authorization context.
* `ApiEventMetric` trait implemented for `CreateDynamicRoutingWrapper`.
---
**Curls and Responses**
1. Flow for success_based
(i)Request : Success Based
```
curl --location 'http://localhost:8080/account/merchant_1755085769/business_profile/pro_W03vsc3viNBMsEb2BAGF/dynamic_routing/success_based/create?enable=dynamic_connector_selection' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_bhW5F52tburClYJFA3MhY5QHVD0EjpDPHoROKdB1NLfap0tBhRrH2QiQ5NQfIpHB' \
--data '{
"decision_engine_configs": {
"defaultLatencyThreshold": 90,
"defaultBucketSize": 200,
"defaultHedgingPercent": 5,
"subLevelInputConfig": [
{
"paymentMethodType": "card",
"paymentMethod": "credit",
"bucketSize": 250,
"hedgingPercent": 1
}
]
}
}'
```
Response:
```
{
"id": "routing_STHAfh9Dyiy3BPLIUQAS",
"profile_id": "pro_W03vsc3viNBMsEb2BAGF",
"name": "Success rate based dynamic routing algorithm",
"kind": "dynamic",
"description": "",
"created_at": 1755086316,
"modified_at": 1755086316,
"algorithm_for": "payment",
"decision_engine_routing_id": null
}
```
(ii)Request : Activate
```
curl --location 'http://localhost:8080/routing/routing_STHAfh9Dyiy3BPLIUQAS/activate' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_bhW5F52tburClYJFA3MhY5QHVD0EjpDPHoROKdB1NLfap0tBhRrH2QiQ5NQfIpHB' \
--data '{}'
```
Response:
```
{
"id": "routing_STHAfh9Dyiy3BPLIUQAS",
"profile_id": "pro_W03vsc3viNBMsEb2BAGF",
"name": "Success rate based dynamic routing algorithm",
"kind": "dynamic",
"description": "",
"created_at": 1755086316,
"modified_at": 1755086316,
"algorithm_for": "payment",
"decision_engine_routing_id": null
}
```
(iii)Request: volume_split
```
curl --location --request POST 'http://localhost:8080/account/merchant_1755085769/business_profile/pro_W03vsc3viNBMsEb2BAGF/dynamic_routing/set_volume_split?split=100' \
--header 'api-key: dev_bhW5F52tburClYJFA3MhY5QH*****DPHoROKdB1NLfap0tBhRrH2QiQ5NQfIpHB'
```
Response:
```
{
"routing_type": "dynamic",
"split": 100
}
```
(iv)Request: Payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_bhW5F52tburClYJFA3MhY5QHVD0EjpDPHoROKdB1NLfap0tBhRrH2QiQ5NQfIpHB' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"amount_to_capture": 6540,
"confirm": true,
"profile_id": "pro_W03vsc3viNBMsEb2BAGF",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "no_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",
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "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
}'
```
2. Flow of elimination
Resquest : Elimination
```
curl --location 'http://localhost:8080/account/merchant_1755085769/business_profile/pro_W03vsc3viNBMsEb2BAGF/dynamic_routing/elimination/create?enable=dynamic_connector_selection' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_bhW5F52tburClYJFA3MhY5QHVD0EjpDPHoROKdB1NLfap0tBhRrH2QiQ5NQfIpHB' \
--data '{
"decision_engine_configs": {
"threshold": 0.35
}
}'
```
Response:
```
{
"id": "routing_TNPpQ8FtYXyVmBx408it",
"profile_id": "pro_W03vsc3viNBMsEb2BAGF",
"name": "Elimination based dynamic routing algorithm",
"kind": "dynamic",
"description": "",
"created_at": 1755086640,
"modified_at": 1755086640,
"algorithm_for": "payment",
"decision_engine_routing_id": null
}
```
Request : activate
```
curl --location 'http://localhost:8080/routing/routing_TNPpQ8FtYXyVmBx408it/activate' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_bhW5F52tburClYJFA3MhY5QHVD0EjpDPHoROKdB1NLfap0tBhRrH2QiQ5NQfIpHB' \
--data '{}'
```
Response:
```
{
"id": "routing_TNPpQ8FtYXyVmBx408it",
"profile_id": "pro_W03vsc3viNBMsEb2BAGF",
"name": "Elimination based dynamic routing algorithm",
"kind": "dynamic",
"description": "",
"created_at": 1755086640,
"modified_at": 1755086640,
"algorithm_for": "payment",
"decision_engine_routing_id": null
}
```
Request: volume_split
```
curl --location --request POST 'http://localhost:8080/account/merchant_1755085769/business_profile/pro_W03vsc3viNBMsEb2BAGF/dynamic_routing/set_volume_split?split=100' \
--header 'api-key: dev_bhW5F52tburClYJFA3MhY5QHVD0EjpDPHoROKd*****p0tBhRrH2QiQ5NQfIpHB'
```
Response:
```
{
"routing_type": "dynamic",
"split": 100
}
```
(iv) Request: Payment
|
To implement this **payment** 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/routing.rs`
- `crates/router/src/core/routing/helpers.rs`
**3. Type Definitions**
- `crates/router_env/src/logger/types.rs`
**4. Utils**
- `crates/router/src/routes/lock_utils.rs`
**5. Other**
- `crates/router/src/routes/app.rs`
- `crates/router/src/routes/routing.rs`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (7 changes)
- Extend existing types with new fields (76 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 58abb604:
Files to modify:
**crates/api_models/src/events/routing.rs**
Add:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for CreateDynamicRoutingWrapper
**crates/api_models/src/routing.rs**
Add:
- function: pub::update_feature
- struct: pub::CreateDynamicRoutingQuery
- struct: pub::CreateDynamicRoutingWrapper
- enum: pub::DynamicRoutingPayload
**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**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/routing.rs**
Add:
- function: pub::create_success_based_routing
- function: pub::create_elimination_routing
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 8755, "pr_title": "feat: added create endpoint for dynamic_routing", "merged_at": "2025-08-19T07:52:25Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/routing.rs", "crates/api_models/src/routing.rs"], "core_business": ["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"], "other": ["crates/router/src/routes/app.rs", "crates/router/src/routes/routing.rs"]}, "change_types": {"structs_added": 2, "functions_added": 7, "enums_added": 1, "fields_added": 76, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Novalnet] Add zero auth mandate
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [X] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
1. Added zero auth mandates for Novalnet
2. Made changes so that `create_webhook_url` fn can accept `merchant_connector_account_id` instead of `connector_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).
-->
## 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. Zero auth mandate for novalnet
Note:
Skipping no3ds test cases as it is not supported by novalnet cc: [@Likhin Bopanna](https://github.com/likhinbopanna)
<img width="819" alt="Screenshot 2024-12-05 at 13 57 38" src="https://github.com/user-attachments/assets/b042ef05-e03e-4e3c-a4e3-0b8c0a24d693">
Tested manually
https://docs.google.com/document/d/1i4SSX837Dh9ipfOz24bDwJF8osR_UPmfPLWUbLP3bh0/edit?usp=sharing
2. Webhooks
Webhooks working as expected for /payments. Tested locally.
<img width="685" alt="Screenshot 2024-11-28 at 13 46 36" src="https://github.com/user-attachments/assets/ec18e0d0-2cdc-430a-bbd1-02946f91049d">
## 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. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/helpers.rs`
- `crates/router/src/core/payments/transformers.rs`
- ... and 2 more files
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/novalnet.rs`
- `crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
**4. Tests**
- `cypress-tests/cypress/e2e/PaymentUtils/Novalnet.js`
**Code Patterns Applied:**
- Implement new functions (16 changes)
- Extend existing types with new fields (152 changes)
**Detailed Identifier Changes:**
Commit 7b306a90:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/novalnet.rs**
Add:
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
**crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs**
Add:
- function: private::get_test_mode
- function: private::try_from
- enum: pub::NovalNetAmount
- impl: impl TryFrom<&SetupMandateRouterData> for NovalnetPaymentsRequest
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_return_url
- function: private::get_webhook_url
- function: private::get_optional_language_from_browser_info
**crates/hyperswitch_domain_models/src/router_request_types.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/transformers.rs**
Modify existing code
**crates/router/src/core/relay/utils.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Modify existing code
|
{"pr_number": 6631, "pr_title": "feat(connector): [Novalnet] Add zero auth mandate", "merged_at": "2025-01-10T09:44:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/relay/utils.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/novalnet.rs", "crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs"], "tests": ["cypress-tests/cypress/e2e/PaymentUtils/Novalnet.js"]}, "change_types": {"functions_added": 16, "enums_added": 1, "fields_added": 152}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat: list for dynamic routing
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR introduces support for listing both static and dynamic routing algorithms under a unified API interface. To accomplish this, it refactors how routing algorithms are represented and parsed, introducing clear separation between `StaticRoutingAlgorithm` and `DynamicRoutingAlgorithm`. The new enum `RoutingAlgorithmWrapper` is used to encapsulate both types.
Dynamic routing strategies like `EliminationBasedAlgorithm`, `SuccessBasedAlgorithm`, and `ContractBasedAlgorithm` are now modeled and tracked similarly to static rules, allowing for consistent listing and configuration.
## Outcomes
- Enables unified listing of static and dynamic routing algorithms linked to a business profile.
- Enhances the routing engine’s flexibility to support multiple dynamic strategies (e.g., success-based, elimination-based).
- Provides type-safe and structured handling of dynamic routing configurations.
- Prepares the system for future expansion (e.g., integration of new algorithm types).
- Improves API and database alignment by enabling dynamic routing references per profile.
## Diff Hunk Explanation
### `api_models/src/routing.rs`
- Added `StaticRoutingAlgorithm`, `DynamicRoutingAlgorithm`, and `RoutingAlgorithmWrapper` enums to distinguish algorithm types.
- Updated various structs to use `StaticRoutingAlgorithm` instead of the generic `RoutingAlgorithm`.
- Introduced serde wrappers with `#[serde(untagged)]` for backward-compatible JSON parsing.
### `api_models/src/events/routing.rs`
- Registered new types like `RoutingVolumeSplit` for event logging via `ApiEventMetric`.
### `router/src/core/routing.rs`
- In `retrieve_linked_routing_config`, extended logic to resolve dynamic routing references and list their metadata.
- Dynamic algorithms from the profile are resolved and listed alongside static algorithms.
### `router/src/core/routing/helpers.rs`
- Updated connector validation to work with `StaticRoutingAlgorithm`.
- Added support to validate connectors within dynamic strategies indirectly via wrapper types.
### `router/src/core/payments/routing.rs`
- Adjusted runtime routing execution to handle `StaticRoutingAlgorithm`.
- Ensured routing output from interpreters is correctly matched and handled.
### `transformers.rs`, `admin.rs`, `payments.rs`, and `stripe/types.rs`
- Refactored references and conversions to use the newly introduced `StaticRoutingAlgorithm`.
### 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)?
-->
### Curls for testing the flows:
1. Create a static rule:
```
curl --location 'http://127.0.0.1:8080/routing' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_IpYFqCd4DHf7x4ER1GBQrW0mHOZzam3pYyuP2tSRb6q7qvTw7jvEjF7UzjwFPXWu' \
--data '
{
"name": "Priority rule with fallback",
"description": "It is my ADVANCED config",
"profile_id": "pro_INSNcGnV7dSldWXpW1GE",
"algorithm": {
"type": "advanced",
"data": {
"defaultSelection": {
"type": "priority",
"data": [
{
"connector": "stripe",
"merchant_connector_id": "mca_gtMC3BG1m6YTX0j8hwUU"
}
]
},
"rules": [
{
"name": "cybersource first",
"connectorSelection": {
"type": "priority",
"data": [
{
"connector": "stripe",
"merchant_connector_id": "mca_gtMC3BG1m6YTX0j8hwUU"
}
]
},
"statements": [
{
"condition": [
{
"lhs": "billing_country",
"comparison": "equal",
"value": {
"type": "enum_variant",
"value": "Netherlands"
},
"metadata": {}
},
{
"lhs": "amount",
"comparison": "greater_than",
"value": {
"type": "number",
"value": 1000
},
"metadata": {}
}
],
"nested": null
}
]
}
],
"metadata": {}
}
}
}
'
```
2. Retrive the rule using id
```
curl --location 'http://127.0.0.1:8080/routing/routing_v2x2BWS0Rf3QKsyc8GUU' \
--header 'api-key: dev_IpYFqCd4DHf7x4ER1GBQrW0mHOZzam3pYyuP2tSRb6q7qvTw7jvEjF7UzjwFPXWu'
```
Response
```
{
"id": "routing_v2x2BWS0Rf3QKsyc8GUU",
"profile_id": "pro_INSNcGnV7dSldWXpW1GE",
"name": "Priority rule with fallback",
"description": "It is my ADVANCED config",
"algorithm": {
"type": "advanced",
"data": {
"defaultSelection": {
"type": "priority",
"data": [
{
"connector": "stripe",
"merchant_connector_id": "mca_gtMC3BG1m6YTX0j8hwUU"
}
]
},
"rules": [
{
"name": "cybersource first",
"connectorSelection": {
"type": "priority",
"data": [
{
"connector": "stripe",
"merchant_connector_id": "mca_gtMC3BG1m6YTX0j8hwUU"
}
]
},
"statements": [
{
"condition": [
{
"lhs": "billing_country",
"comparison": "equal",
"value": {
"type": "enum_variant",
"value": "Netherlands"
},
"metadata": {}
},
{
"lhs": "amount",
"comparison": "greater_than",
"value": {
"type": "number",
"value": 1000
},
"metadata": {}
}
],
"nested": null
}
]
}
],
"metadata": {}
}
},
"created_at": 1747996597,
"modified_at": 1747996597,
"algorithm_for": "payment"
}
```
3. Toggle SR routing
```
curl --location --request POST 'http://localhost:8080/account/merchant_1747967454/business_profile/pro_INSNcGnV7dSldWXpW1GE/dynamic_routing/success_based/toggle?enable=dynamic_connector_selection' \
--header 'api-key: dev_IpYFqCd4DHf7x4ER1GBQrW0mHOZzam3pYyuP2tSRb6q7qvTw7jvEjF7UzjwFPXWu'
```
4. Retrieve it using the routing id:
```
curl --location 'http://127.0.0.1:8080/routing/routing_XP894HcdwYPJqCQjQqJV' \
--header 'api-key: dev_IpYFqCd4DHf7x4ER1GBQrW0mHOZzam3pYyuP2tSRb6q7qvTw7jvEjF7UzjwFPXWu'
```
Response:
```
{
"id": "routing_XP894HcdwYPJqCQjQqJV",
"profile_id": "pro_INSNcGnV7dSldWXpW1GE",
"name": "Success rate based dynamic routing algorithm",
"description": "",
"algorithm": {
"params": [
"PaymentMethod"
],
"config": {
"min_aggregates_size": 2,
"default_success_rate": 100.0,
"max_aggregates_size": 3,
"current_block_threshold": {
"duration_in_mins": 5,
"max_total_count": 2
},
"specificity_level": "merchant"
}
},
"created_at": 1747967494,
"modified_at": 1747967494,
"algorithm_for": "payment"
}
```
5. Toggle elimination routing
```
curl --location --request POST 'http://localhost:8080/account/merchant_1747967454/business_profile/pro_INSNcGnV7dSldWXpW1GE/dynamic_routing/elimination/toggle?enable=dynamic_connector_selection' \
--header 'api-key: dev_IpYFqCd4DHf7x4ER1GBQrW0mHOZzam3pYyuP2tSRb6q7qvTw7jvEjF7UzjwFPXWu'
```
6. Retrieve it using the routing id:
```
curl --location 'http://127.0.0.1:8080/routing/routing_XP894HcdwYPJqCQjQqJV' \
--header 'api-key: dev_IpYFqCd4DHf7x4ER1GBQrW0mHOZzam3pYyuP2tSRb6q7qvTw7jvEjF7UzjwFPXWu'
```
Response:
```
{
"id": "routing_ZlQZoyVildA7HusIfehn",
"profile_id": "pro_INSNcGnV7dSldWXpW1GE",
"name": "Elimination based dynamic routing algorithm",
"description": "",
"algorithm": {
"params": [
"PaymentMethod"
],
"elimination_analyser_config": {
"bucket_size": 5,
"bucket_leak_interval_in_secs": 60
}
},
"created_at": 1747968281,
"modified_at": 1747968281,
"algorithm_for": "payment"
}
```
5. Toggle contract based routing
```
curl --location 'http://localhost:8080/account/merchant_1747967454/business_profile/pro_INSNcGnV7dSldWXpW1GE/dynamic_routing/contracts/toggle?enable=dynamic_connector_selection' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_IpYFqCd4DHf7x4ER1GBQrW0mHOZzam3pYyuP2tSRb6q7qvTw7jvEjF7UzjwFPXWu' \
--data '
{
"config": null,
"label_info": null
}'
```
6. Retrieve it using the routing id:
```
curl --location 'http://127.0.0.1:8080/routing/routing_XP894HcdwYPJqCQjQqJV' \
--header 'api-key: dev_IpYFqCd4DHf7x4ER1GBQrW0mHOZzam3pYyuP2tSRb6q7qvTw7jvEjF7UzjwFPXWu'
```
Response:
```
{
"id": "routing_C13lGF4NR613rAyuUsuZ",
"profile_id": "pro_INSNcGnV7dSldWXpW1GE",
"name": "Contract based dynamic routing algorithm",
"description": "",
"algorithm": {
"config": null,
"label_info": null
},
"created_at": 1747998023,
"modified_at": 1747998023,
"algorithm_for": "payment"
}
```
7. Volume between routing types
```
curl --location --request POST 'http://localhost:8080/account/merchant_1747967454/business_profile/pro_INSNcGnV7dSldWXpW1GE/dynamic_routing/set_volume_split?split=100' \
--header 'api-key: dev_IpYFqCd4DHf7x4ER1GBQrW0mHOZzam3pYyuP2tSRb6q7qvTw7jvEjF7UzjwFPXWu'
```
Response
```
{
"routing_type": "dynamic",
"split": 100
}
```
8. List active configs
toggle SR, toggle ER
create a static rule and activate it
```
curl --location 'http://localhost:8080/routing/active' \
--header 'api-key: dev_IpYFqCd4DHf7x4ER1GBQrW0mHOZzam3pYyuP2tSRb6q7qvTw7jvEjF7UzjwFPXWu'
```
Response
3 values should come
```
[
{
"id": "routing_j9omIKybJb6jw2PIwFhQ",
"profile_id": "pro_INSNcGnV7dSldWXpW1GE",
"name": "Priority rule with fallback",
"kind": "advanced",
"description": "It is my ADVANCED config",
"created_at": 1748005058,
"modified_at": 1748005058,
"algorithm_for": "payment",
"decision_engine_routing_id": null
},
{
"id": "routing_ZlQZoyVildA7HusIfehn",
"profile_id": "pro_INSNcGnV7dSldWXpW1GE",
"name": "Elimination based dynamic routing algorithm",
"kind": "dynamic",
"description": "",
"created_at": 1747968281,
"modified_at": 1747968281,
"algorithm_for": "payment",
"decision_engine_routing_id": null
},
{
"id": "routing_4E6HvDyeOUJKs3ncGDk7",
"profile_id": "pro_INSNcGnV7dSldWXpW1GE",
"name": "Contract based dynamic routing algorithm",
"kind": "dynamic",
"description": "",
"created_at": 1748005049,
"modified_at": 1748005049,
"algorithm_for": "payment",
"decision_engine_routing_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. API Request/Response Models**
- `crates/api_models/src/admin.rs`
- `crates/api_models/src/events/routing.rs`
- `crates/api_models/src/payouts.rs`
- ... and 1 more files
**2. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/routing.rs`
- ... and 3 more files
**3. Type Definitions**
- `crates/router/src/compatibility/stripe/payment_intents/types.rs`
- `crates/router/src/compatibility/stripe/setup_intents/types.rs`
- `crates/router/src/types/api/routing.rs`
- ... and 1 more files
**4. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/openapi/src/openapi.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (5 changes)
- Add conditional logic for feature flags or filtering (6 changes)
**Detailed Identifier Changes:**
Commit a6546950:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/events/routing.rs**
Add:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for RoutingVolumeSplit
**crates/api_models/src/payouts.rs**
Modify existing code
**crates/api_models/src/routing.rs**
Remove:
- enum: pub::RoutingAlgorithm
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.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/core/admin.rs**
Modify existing code
**crates/router/src/core/payments.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/core/routing/transformers.rs**
Modify existing code
**crates/router/src/types/api/routing.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Remove:
- impl: impl ForeignFrom<ConnectorSelection> for routing_types::RoutingAlgorithm
Add:
- impl: impl ForeignFrom<ConnectorSelection> for routing_types::StaticRoutingAlgorithm
|
{"pr_number": 8111, "pr_title": "feat: list for dynamic routing", "merged_at": "2025-05-27T10:32:49Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs", "crates/api_models/src/events/routing.rs", "crates/api_models/src/payouts.rs", "crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/admin.rs", "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", "crates/router/src/core/routing/transformers.rs"], "types": ["crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs", "crates/router/src/types/api/routing.rs", "crates/router/src/types/transformers.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": {"functions_added": 1, "enums_added": 3, "fields_added": 5, "imports_added": 1, "conditionals_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connectors): [Nexixpay] send cvv in nexixpay requests
## 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 -->
Mandatorily send cvv to nexixpay card payments.
### 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/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: **' \
--data-raw '{
"amount": 3545,
"currency": "EUR",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4349 9401 9900 4549",
"card_exp_month": "05",
"card_exp_year": "26",
"card_cvc": "396"
}
},
"confirm": true,
"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",
"description": "Its my first payment request",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"country": "BR",
"zip": "94122",
"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": "BR",
"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": 3545,
"account_name": "transaction_processing"
}
],
"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"
},
"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
}'
```
## 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/nexixpay/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (3 changes)
**Detailed Identifier Changes:**
Commit a00855a4:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs**
Modify existing code
|
{"pr_number": 9459, "pr_title": "fix(connectors): [Nexixpay] send cvv in nexixpay requests", "merged_at": "2025-09-21T17:12:17Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs"]}, "change_types": {"fields_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): disable payouts in PR check
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Disable payouts in github ci check
### 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
Checks are failing because of connector error
## 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. Tests**
- `.github/workflows/cypress-tests-runner.yml`
|
{"pr_number": 6729, "pr_title": "ci(cypress): disable payouts in PR check ", "merged_at": "2024-12-03T11:08:51Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"tests": [".github/workflows/cypress-tests-runner.yml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(cypress): address cybersource redirection inconsistency
## 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 -->
- enabled video recording for tests that fail
- cybersource connector in github ci, randomly goes through `frictionless` flow without challenge which results in certain expected elements to go missing resulting in respective tests to fail
- this pr forces cybersource to use `frictionless` card for 3ds
- remove `adyenplatform` connector from running in github ci
closes #7058
### 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
## 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 issue is not reproducible in local but only in github ci. so, the ci check should never fail!
<img width="465" alt="image" src="https://github.com/user-attachments/assets/bb724420-251d-45dd-96bd-9be307bdc99c" />
## 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/.gitignore`
- `cypress-tests/cypress.config.js`
- ... and 3 more files
**Code Patterns Applied:**
- Extend existing types with new fields (7 changes)
- Add conditional logic for feature flags or filtering (3 changes)
|
{"pr_number": 7057, "pr_title": "fix(cypress): address cybersource redirection inconsistency", "merged_at": "2025-01-21T07:06:52Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector", "card"]}, "hierarchy": {"tests": [".github/workflows/cypress-tests-runner.yml", "cypress-tests/.gitignore", "cypress-tests/cypress.config.js", "cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js", "cypress-tests/cypress/support/e2e.js", "cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {"fields_added": 7, "conditionals_added": 3}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): [SCRIPT] Update template generating script and updated connector doc
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [x] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
updated add_connector.sh script, to make a entry in required places.
### 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. External Connector Integration**
- `add_connector_updated.md`
- `scripts/add_connector.sh`
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (18 changes)
- Extend existing types with new fields (87 changes)
- Add conditional logic for feature flags or filtering (1 changes)
|
{"pr_number": 7301, "pr_title": "fix(connector): [SCRIPT] Update template generating script and updated connector doc", "merged_at": "2025-02-19T21:09:17Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"connectors": ["add_connector_updated.md", "scripts/add_connector.sh"]}, "change_types": {"structs_added": 4, "functions_added": 18, "enums_added": 1, "fields_added": 87, "conditionals_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
chore(dashboard): update dashboard toml
## 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 -->
Updated dashboard.toml to reflect the latest dashboard changes for open-source users.

### 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?
Test by running these commands locally
**docker-compose up -d**
```curl http://localhost:9000/dashboard/config/feature\?domain\= ```
<!--
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. Configuration Files**
- `config/dashboard.toml`
|
{"pr_number": 7703, "pr_title": "chore(dashboard): update dashboard toml", "merged_at": "2025-04-04T09:43:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"config": ["config/dashboard.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(subscriptions): add route for creating subscription intent
## Summary
Add **Subscriptions API (v1/OLAP)** entrypoint to create a _subscription intent_ and optionally create/attach a customer, returning a `client_secret` and basic subscription payload.
- New route: `POST /subscription/create` (behind `olap` + `v1`)
- Creates a `subscription` row (using existing table) and generates a `client_secret`
- Optionally **gets or creates** a `Customer` from inline `customer` payload or `customer_id`
- Persists optional `mca_id` on the subscription row (used later for connector selection)
- Returns a typed `CreateSubscriptionResponse` with `subscription`, `client_secret`, `merchant_id`, `mca_id`, and optional `customer`, `invoice` (placeholder)
## Endpoints
### Create Subscription Intent
`POST /subscription/create`
**Auth**
- API key (HeaderAuth) + JWT (`Permission::ProfileRoutingWrite`)
**Request Body**
```json
{
"customer_id": "{{customer_id}}"
}
```
**Behavior**
- Generates `sub_<random>` for subscription row id
- If `customer_id` provided → fetch; else if `customer` has any PII fields → **create customer** (encrypting PII); else → `400 CustomerNotFound`
- Persists subscription with:
- `id`
- `subscription_id` = `null` (placeholder, to be set later)
- `mca_id` (if provided)
- `client_secret` = generated via `SubscriptionNew::generate_client_secret()`
- `merchant_id`, `customer_id`
- `billing_processor`, `payment_method_id`, `metadata` = `null` (placeholders)
- Returns `200` with response below
**Success Response**
```json
{
"id": "subscription_f8Ng47rKaB296XHolKKG",
"merchant_reference_id": null,
"status": "Created",
"plan_id": null,
"profile_id": "pro_UjmcM35TVpYh9Zb3LaZV",
"client_secret": "subscription_f8Ng47rKaB296XHolKKG_secret_0fz5A3aa4NTcdiQF5W7i",
"merchant_id": "merchant_1758146582",
"coupon_code": null,
"customer_id": "cus_jtJ8WHTHnsguskpiorEt"
}
```
---
## Implementation Notes
- **Core**
- `crates/router/src/core/subscription.rs` – service handler
- `crates/router/src/core/subscription/utils.rs` – helpers, request/response types
- **Routing**
- `crates/router/src/routes/subscription.rs` – web handler (`/subscription/create`)
- `crates/router/src/routes/app.rs` – `Subscription::server()` scope under `/subscription`
- `crates/router/src/lib.rs` – wire route
- **Domain / DTO**
- `hyperswitch_domain_models::router_request_types::CustomerDetails` now `Serialize`/`Deserialize`
- `hyperswitch_domain_models::customer::Customer` derives `Serialize` (v1)
- **Storage**
- Uses existing `subscription` table and `SubscriptionNew::generate_client_secret()`
- No new migrations introduced in this PR
- **Customer flow**
- If not found, creates via encrypted batch operation; respects merchant key store and storage scheme
---
## Testing
```
curl --location 'http://localhost:8080/subscription/create' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_UjmcM35TVpYh9Zb3LaZV' \
--header 'api-key: dev_pPBMnOEL5SJnMfxxp2bh4du87ESZoMJNtUmn3oIS8kpCNfUJAZ2a8F832n1je5zQ' \
--data '{
"customer_id": "cus_jtJ8WHTHnsguskpiorEt"
}'
```
Response:
```
{
"id": "subscription_f8Ng47rKaB296XHolKKG",
"merchant_reference_id": null,
"status": "Created",
"plan_id": null,
"profile_id": "pro_UjmcM35TVpYh9Zb3LaZV",
"client_secret": "subscription_f8Ng47rKaB296XHolKKG_secret_0fz5A3aa4NTcdiQF5W7i",
"merchant_id": "merchant_1758146582",
"coupon_code": null,
"customer_id": "cus_jtJ8WHTHnsguskpiorEt"
}
```
---
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/lib.rs`
- `crates/api_models/src/subscription.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/subscription.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
- ... and 1 more files
**3. Core Business Logic**
- `crates/router/src/core.rs`
- `crates/router/src/core/subscription.rs`
**4. Type Definitions**
- `crates/router_env/src/logger/types.rs`
**5. Utils**
- `crates/common_utils/src/events.rs`
- `crates/common_utils/src/id_type.rs`
- `crates/common_utils/src/id_type/subscription.rs`
- ... and 1 more files
**6. Other**
- `crates/common_enums/src/enums.rs`
- `crates/router/src/lib.rs`
- `crates/router/src/routes.rs`
- ... and 5 more files
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (6 changes)
- Extend existing types with new fields (45 changes)
- Modify database queries (6 changes)
**Detailed Identifier Changes:**
Commit d32b4619:
Files to modify:
**crates/api_models/src/lib.rs**
Add:
- mod: pub::subscription
**crates/api_models/src/subscription.rs**
Add:
- function: pub::new
- struct: pub::CreateSubscriptionRequest
- struct: pub::CreateSubscriptionResponse
- enum: pub::SubscriptionStatus
- impl: impl CreateSubscriptionResponse
- impl: impl ApiEventMetric for CreateSubscriptionResponse
- impl: impl ApiEventMetric for CreateSubscriptionRequest
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_utils/src/events.rs**
Modify existing code
**crates/common_utils/src/id_type.rs**
Add:
- mod: private::subscription
**crates/common_utils/src/id_type/subscription.rs**
Add:
- function: private::get_api_event_type
- impl: impl crate::events::ApiEventMetric for SubscriptionId
**crates/diesel_models/src/query/subscription.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/subscription.rs**
Add:
- function: pub::generate_and_set_client_secret
**crates/router/src/core.rs**
Add:
- mod: pub::subscription
**crates/router/src/core/subscription.rs**
Add:
- function: pub::create_subscription
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes.rs**
Add:
- mod: pub::subscription
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- struct: pub::Subscription
- impl: impl Subscription
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/subscription.rs**
Add:
- function: pub::create_subscription
**crates/router/src/services/authorization/permissions.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 9123, "pr_title": "feat(subscriptions): add route for creating subscription intent", "merged_at": "2025-09-18T12:36:03Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/lib.rs", "crates/api_models/src/subscription.rs"], "database": ["crates/diesel_models/src/query/subscription.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs", "crates/diesel_models/src/subscription.rs"], "core_business": ["crates/router/src/core.rs", "crates/router/src/core/subscription.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/events.rs", "crates/common_utils/src/id_type.rs", "crates/common_utils/src/id_type/subscription.rs", "crates/router/src/routes/lock_utils.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/lib.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/subscription.rs", "crates/router/src/services/authorization/permissions.rs", "migrations/2025-09-17-165505_update_subscription_table_with_merchant_ref_id/down.sql", "migrations/2025-09-17-165505_update_subscription_table_with_merchant_ref_id/up.sql"]}, "change_types": {"structs_added": 4, "functions_added": 6, "enums_added": 1, "fields_added": 45, "imports_added": 20, "database_queries": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): language consumption from locale in payment and payout links
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Fix the locale handling in the payment and payout links translation functionality to properly support language-location combinations like `es-ES`. Currently, the system is using the full locale value from the `Accept-Language` header without parsing it, causing translations for such locales to fail when the header includes region information.
The fix extracts the base language code from locale strings containing region identifiers to ensure proper translation mapping (e.g., `es-ES` will now correctly map to `es` translations).
### 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 PR fixes issue #7981 where the translation system fails to properly handle locale codes with region identifiers in the `Accept-Language` header.
When users send requests with headers like `Accept-Language: es-ES`, the system was using the full string (`es-ES`) for translation lookup instead of extracting the base language code (`es`). This caused Spanish translations to default to English because no exact match for `es-ES` was found in the translation data.
By parsing the locale string and extracting just the language part, we ensure that users receive translations in their requested language regardless of whether they include region information.
## 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. Create a payment link with es-ES in Accept-Language header</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: es-ES' \
--header 'api-key: dev_tizBo0XFMZBNZ3jWBlkrc6C81CiCdliXrLXFoAg2fTgoTmKvOIk2oAP43Gwb3AGK' \
--data-raw '{"customer_id":"cus_Wz8ND2QMGUTQCZBgO4Jx_1","profile_id":"pro_DC4DZ899zblYKajNmd0K","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"}},"amount":10,"currency":"EUR","confirm":false,"payment_link":true,"setup_future_usage":"off_session","capture_method":"automatic","billing":{"address":{},"email":"random@juspay.in"},"return_url":"https://example.com","payment_link_config":{"theme":"#111111","background_image":{"url":"https://img.freepik.com/free-photo/abstract-blue-geometric-shapes-background_24972-1841.jpg","position":"bottom","size":"cover"}}}'
Response
{"payment_id":"pay_zjyjvsTOPQKx0sYDzkzq","merchant_id":"merchant_1746522436","status":"requires_payment_method","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":null,"client_secret":"pay_zjyjvsTOPQKx0sYDzkzq_secret_hD6KQpqlkWdk9wTPPDIB","created":"2025-05-09T08:09:43.323Z","currency":"EUR","customer_id":"cus_Wz8ND2QMGUTQCZBgO4Jx_1","customer":{"id":"cus_Wz8ND2QMGUTQCZBgO4Jx_1","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":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":null,"payment_method_data":null,"payment_token":null,"shipping":null,"billing":{"address":null,"phone":null,"email":"random@juspay.in"},"order_details":null,"email":null,"name":null,"phone":null,"return_url":"https://example.com/","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":{"customer_id":"cus_Wz8ND2QMGUTQCZBgO4Jx_1","created_at":1746778183,"expires":1746781783,"secret":"epk_f853d34ab7444310b3a54b0704e34867"},"manual_retry_allowed":null,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":{"link":"http://localhost:8080/payment_link/merchant_1746522436/pay_zjyjvsTOPQKx0sYDzkzq?locale=es-ES","secure_link":null,"payment_link_id":"plink_FAtpjPaeg4T5UjMsVBeg"},"profile_id":"pro_DC4DZ899zblYKajNmd0K","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-05-09T08:24:43.318Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-05-09T08:09:43.343Z","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}
<img width="1509" alt="Screenshot 2025-05-09 at 1 51 02 PM" src="https://github.com/user-attachments/assets/f70bbdfe-d375-4b1b-a1c5-53ed012adfab" />
</details>
<details>
<summary>2. Create a payout link</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_tizBo0XFMZBNZ3jWBlkrc6C81CiCdliXrLXFoAg2fTgoTmKvOIk2oAP43Gwb3AGK' \
--data '{"amount":1,"currency":"EUR","customer_id":"cus_Wz8ND2QMGUTQCZBgO4Jx","description":"Its my first payout request","entity_type":"Individual","confirm":false,"auto_fulfill":true,"session_expiry":1000000,"priority":"instant","profile_id":"pro_DC4DZ899zblYKajNmd0K","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":"93d4cfee-cfcd-4be0-b750-049c98a1f220","merchant_id":"merchant_1746522436","amount":1,"currency":"EUR","connector":null,"payout_type":null,"payout_method_data":null,"billing":null,"auto_fulfill":true,"customer_id":"cus_Wz8ND2QMGUTQCZBgO4Jx","customer":{"id":"cus_Wz8ND2QMGUTQCZBgO4Jx","name":null,"email":"abc@example.com","phone":null,"phone_country_code":null},"client_secret":"payout_93d4cfee-cfcd-4be0-b750-049c98a1f220_secret_UllSmh3B4jG5IMkov2ft","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_DC4DZ899zblYKajNmd0K","created":"2025-05-09T08:11:21.214Z","connector_transaction_id":null,"priority":"instant","payout_link":{"payout_link_id":"payout_link_DkmRGHGOrm12ZZRvYH5o","link":"http://localhost:8080/payout_link/merchant_1746522436/93d4cfee-cfcd-4be0-b750-049c98a1f220?locale=en"},"email":"abc@example.com","name":null,"phone":null,"phone_country_code":null,"unified_code":null,"unified_message":null,"payout_method_id":null}
<img width="1505" alt="Screenshot 2025-05-09 at 1 50 16 PM" src="https://github.com/user-attachments/assets/4f85519e-50b4-407a-9be9-9498b1b8f09d" />
</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. Core Business Logic**
- `crates/router/src/core/payment_link/locale.js`
**2. Configuration Files**
- `crates/router/locales/en-GB.yml`
- `crates/router/locales/fr-BE.yml`
**3. Other**
- `crates/router/src/services/api/generic_link_response/context.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (1 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 04da2dda:
Files to modify:
**crates/router/src/services/api/generic_link_response/context.rs**
Add:
- function: private::get_language
|
{"pr_number": 7993, "pr_title": "fix(core): language consumption from locale in payment and payout links", "merged_at": "2025-05-12T15:38:24Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payment_link/locale.js"], "config": ["crates/router/locales/en-GB.yml", "crates/router/locales/fr-BE.yml"], "other": ["crates/router/src/services/api/generic_link_response/context.rs"]}, "change_types": {"functions_added": 2, "fields_added": 1, "imports_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(kafka): add payment_intent payment_attempt and refund kafka events for v2
## 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 -->
Added payment_intent payment_attempt and refund kafka events for v2
Other changes:
* populate connector_metadata in AuthorizaRouterData in 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).
-->
## 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)?
-->
Made a payment and refund and verified if proper events are logged into Kafka.
<img width="1728" alt="Screenshot 2025-06-12 at 9 48 33 AM" src="https://github.com/user-attachments/assets/91286bfd-8c83-4cb4-85cb-a672efb81daa" />
<img width="1728" alt="Screenshot 2025-06-12 at 9 48 18 AM" src="https://github.com/user-attachments/assets/2fe52584-a28d-44b7-acfb-936805775fab" />
<img width="1728" alt="Screenshot 2025-06-12 at 9 48 52 AM" src="https://github.com/user-attachments/assets/2c3b085a-7b87-41e1-80e1-28266a091fb6" />
## 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/payments.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments/transformers.rs`
**4. Other**
- `crates/common_enums/src/enums.rs`
- `crates/masking/src/secret.rs`
- `crates/masking/src/serde.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (7 changes)
- Extend existing types with new fields (562 changes)
**Detailed Identifier Changes:**
Commit 305ca9bd:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- function: pub::is_off_session
- impl: impl FutureUsage
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/masking/src/secret.rs**
Add:
- function: pub::as_ref
**crates/masking/src/serde.rs**
Add:
- impl: impl SerializableSecret for &T
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/services/kafka/payment_attempt.rs**
Add:
- function: private::key
- struct: pub::KafkaPaymentAttempt
**crates/router/src/services/kafka/payment_attempt_event.rs**
Add:
- function: private::key
- struct: pub::KafkaPaymentAttemptEvent
**crates/router/src/services/kafka/payment_intent.rs**
Remove:
- struct: pub::KafkaPaymentIntent
Add:
- struct: pub::KafkaPaymentIntent
**crates/router/src/services/kafka/payment_intent_event.rs**
Modify existing code
**crates/router/src/services/kafka/refund.rs**
Remove:
- function: private::event_type
- impl: impl super::KafkaMessage for KafkaRefund<'_>
**crates/router/src/services/kafka/refund_event.rs**
Modify existing code
|
{"pr_number": 8328, "pr_title": "feat(kafka): add payment_intent payment_attempt and refund kafka events for v2", "merged_at": "2025-06-19T07:08:22Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "refund"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments.rs"], "core_business": ["crates/router/src/core/payments/transformers.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/masking/src/secret.rs", "crates/masking/src/serde.rs", "crates/router/src/services/kafka/payment_attempt.rs", "crates/router/src/services/kafka/payment_attempt_event.rs", "crates/router/src/services/kafka/payment_intent.rs", "crates/router/src/services/kafka/payment_intent_event.rs", "crates/router/src/services/kafka/refund.rs", "crates/router/src/services/kafka/refund_event.rs"]}, "change_types": {"structs_added": 3, "functions_added": 7, "fields_added": 562, "imports_added": 27}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add `apply_three_ds_strategy` in payments confirm 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 -->
add `apply_three_ds_strategy` in payments confirm flow
In payments confirm flow, we are calling apply_three_ds_strategy which would decide the three ds strategy based on the rule configuration
1. authentication_type - three_ds / no_three_ds
2. exemption_type - low_value / tra
3. force_challenge - true / false
This pull request introduces enhancements to the 3DS (Three-Domain Secure) decision-making process and integrates it with payment operations. The changes include new utility methods, updates to the payment flow, and the addition of 3DS decision rule handling. Below is a summary of the most important changes, grouped by theme:
### Enhancements to 3DS Decision Rule Handling
* Added a utility method `should_force_3ds_challenge` in the `ThreeDSDecision` enum to determine if a 3DS challenge is required (`crates/common_types/src/three_ds_decision_rule_engine.rs`).
* Introduced the function `get_three_ds_decision_rule_output` to retrieve 3DS decision outputs based on routing algorithms and payment data (`crates/router/src/core/three_ds_decision_rule.rs`). [[1]](diffhunk://#diff-36a9dcbf3a5766e0c2628821e20b541ba23c0766130d6ca0efed6be74eb8c2e3R29-R49) [[2]](diffhunk://#diff-36a9dcbf3a5766e0c2628821e20b541ba23c0766130d6ca0efed6be74eb8c2e3L62-R76)
### Integration of 3DS Decision Logic into Payment Operations
* Implemented the `apply_three_ds_authentication_strategy` method in the `Domain` trait to apply 3DS decision logic during payment processing (`crates/router/src/core/payments/operations.rs`).
* Updated the payment confirmation flow to invoke the `apply_three_ds_authentication_strategy` method, integrating 3DS decision-making into the payment lifecycle (`crates/router/src/core/payments.rs`).
### Utility Methods and Data Transformations
* Added a method `get_additional_card_info` in the `AdditionalPaymentData` enum to extract card-related information (`crates/api_models/src/payments.rs`).
* Implemented `ForeignFrom` and `ForeignInto` traits to map `ThreeDSDecision` to `AuthenticationType` and `ScaExemptionType`, enabling seamless data transformations (`crates/router/src/core/payments/transformers.rs`).
### Business Profile Enhancements
* Added a method `get_acquirer_details_from_network` in the `Profile` struct to retrieve acquirer configurations based on card networks (`crates/hyperswitch_domain_models/src/business_profile.rs`).
* Updated imports in business profile files to include the `AcquirerConfig` type for handling acquirer configurations (`crates/hyperswitch_domain_models/src/business_profile.rs`).
### 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`
5. `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)?
-->
Tested manually
1. Create a three_ds_decision rule (when amount = 100, currency = USD apply rule = challenge_requested)
CURL
```
curl --location '{{BASE_URL}}/routing' \
--header 'api-key: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"name": "Three DS Decision Rule for exemption",
"description": "This is a three_ds_decision_rule",
"profile_id": "{{PROFILE_ID}}",
"transaction_type": "three_ds_authentication",
"algorithm": {
"type": "three_ds_decision_rule",
"data": {
"defaultSelection": {
"decision": "no_three_ds"
},
"rules": [
{
"name": "rule_1",
"connectorSelection": {
"decision": "challenge_requested"
},
"statements": [
{
"condition": [
{
"lhs": "amount",
"comparison": "equal",
"value": {
"type": "number",
"value": 100
},
"metadata": {}
},
{
"lhs": "currency",
"comparison": "equal",
"value": {
"type": "enum_variant",
"value": "USD"
},
"metadata": {}
}
]
}
]
}
],
"metadata": {}
}
}
}'
```
Response
```
{
"id": "routing_11C0vsn4mvGQ5nM7dvlz",
"profile_id": "pro_51GGuHECEK1EKuRIo2d0",
"name": "Three DS Decision Rule for exemption",
"kind": "three_ds_decision_rule",
"description": "This is a three_ds_decision_rule",
"created_at": 1750245027,
"modified_at": 1750245027,
"algorithm_for": "three_ds_authentication",
"decision_engine_routing_id": null
}
```
2. Activate the rule for profile using the routing_id
CURL
```
curl --location '{{BASE_URL}}/routing/{{ROUTING_ID}}/activate' \
--header 'X-Profile-Id: {{PROFILE_ID}}' \
--header 'api-key: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"transaction_type": "three_ds_authentication"
}'
```
Response
```
{
"id": "routing_11C0vsn4mvGQ5nM7dvlz",
"profile_id": "pro_51GGuHECEK1EKuRIo2d0",
"name": "Three DS Decision Rule for exemption",
"kind": "three_ds_decision_rule",
"description": "This is a three_ds_decision_rule",
"created_at": 1750245027,
"modified_at": 1750245027,
"algorithm_for": "three_ds_authentication",
"decision_engine_routing_id": null
}
```
3. Create a payment without passing authentication_type in the payments request
CURL
```
curl --location '{{BASE_URL}}/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{API_KEY}}' \
--data-raw '{
"amount": 100,
"currency": "USD",
"confirm": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "test-sai1",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"return_url": "https://google.com"
}'
```
4. Confirm the payments to observe authentication_type is set to three_ds and force_3ds_challenge = true
CURL
```
curl --location '{{BASE_URL}}/payments/{{PAYMENT_ID}}/confirm' \
--header 'api-key: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "5512459816707531",
"card_exp_month": "04",
"card_exp_year": "2029",
"card_holder_name": "John Smith",
"card_cvc": "238",
"card_network": "Visa"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "CA",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "125.0.0.1"
}
}'
```
Response
```
{
"payment_id": "pay_31a7PiucamxlIzSWjJ4m",
"merchant_id": "merchant_1750226882",
"status": "failed",
"amount": 100,
"net_amount": 200,
"shipping_cost": 100,
"amount_capturable": 0,
"amount_received": null,
"connector": "cybersource",
"client_secret": "pay_31a7PiucamxlIzSWjJ4m_secret_PdavIP5oJDTUY3R3QIlC",
"created": "2025-06-18T12:33:31.673Z",
"currency": "USD",
"customer_id": "test-sai1",
"customer": {
"id": "test-sai1",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "7531",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "551245",
"card_extended_bin": null,
"card_exp_month": "04",
"card_exp_year": "2029",
"card_holder_name": "John Smith",
"payment_checks": null,
"authentication_data": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "CA",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
}
},
"payment_token": "token_eNIImzU8lu4RRMSskWlr",
"shipping": null,
"billing": null,
"order_details": [
{
"brand": null,
"amount": 0,
"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://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": "INVALID_ACCOUNT",
"error_message": "Decline - Invalid account number",
"unified_code": "UE_9000",
"unified_message": "Something went wrong",
"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": true,
"connector_transaction_id": "7502500170936765404807",
"frm_message": null,
"metadata": {},
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": {
"order_category": "pay"
},
"braintree": null,
"adyen": null
},
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_51GGuHECEK1EKuRIo2d0",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_j98pNklqW2RA5KVkkBAD",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-18T12:48:31.673Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": "nl-NL",
"time_zone": 0,
"ip_address": "125.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_method_id": null,
"payment_method_status": null,
"updated": "2025-06-18T12:33:37.581Z",
"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
}
```
## 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/business_profile.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/operations.rs`
- `crates/router/src/core/payments/operations/payment_confirm.rs`
- ... and 2 more files
**4. Type Definitions**
- `crates/common_types/src/three_ds_decision_rule_engine.rs`
**Code Patterns Applied:**
- Implement new functions (8 changes)
- Extend existing types with new fields (25 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 786fe699:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- function: pub::get_additional_card_info
- impl: impl AdditionalPaymentData
**crates/common_types/src/three_ds_decision_rule_engine.rs**
Add:
- function: pub::should_force_3ds_challenge
- impl: impl ThreeDSDecision
**crates/hyperswitch_domain_models/src/business_profile.rs**
Add:
- function: pub::get_acquirer_details_from_network
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations.rs**
Add:
- function: private::apply_three_ds_authentication_strategy
**crates/router/src/core/payments/operations/payment_confirm.rs**
Add:
- function: private::apply_three_ds_authentication_strategy
**crates/router/src/core/payments/transformers.rs**
Add:
- function: private::foreign_from
- function: private::foreign_from
- impl: impl ForeignFrom<common_types::three_ds_decision_rule_engine::ThreeDSDecision> for common_enums::AuthenticationType
- impl: impl ForeignFrom<common_types::three_ds_decision_rule_engine::ThreeDSDecision> for Option<common_enums::ScaExemptionType>
**crates/router/src/core/three_ds_decision_rule.rs**
Modify existing code
|
{"pr_number": 8357, "pr_title": "feat(router): add `apply_three_ds_strategy` in payments confirm flow", "merged_at": "2025-06-23T14:32:10Z", "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/business_profile.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/three_ds_decision_rule.rs"], "types": ["crates/common_types/src/three_ds_decision_rule_engine.rs"]}, "change_types": {"functions_added": 8, "fields_added": 25, "imports_added": 1, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [NETCETERA] use `prod` instead of `prev` in base_url for production config
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
use `prod` instead of `prev` in base_url for production config
### 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)?
-->
PROD Base URL change only, No test cases 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. Configuration Files**
- `config/deployments/production.toml`
|
{"pr_number": 7381, "pr_title": "fix(connector): [NETCETERA] use `prod` instead of `prev` in base_url for production config", "merged_at": "2025-02-26T16:30:58Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"config": ["config/deployments/production.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): fix required fields for mandates supported connectors
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
The required fields were not added for mandates for some connectors. Those fields have been configured as `required` in this PR.
Connectors I have checked for : Aci, Adyen, Authorizeddotnet, Globalpay, Multisafepay, Worldpay, Nexinets, Noon, Novalnet, Payme, Stripe, Bankofamerica, Cybersource, Wellsfargo
### 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. Worldpay**
- **A) Create Payment**
- Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_MA7DHjl9k4izCsQ42Vh7VJEKQeNy78RkGjIISOOrAbu78sRnpwuuuJmmipITEyae' \
--data-raw '{
"amount":1001,
"currency": "USD",
"confirm": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1001,
"customer_id": "StripeCustomer",
"setup_future_usage": "off_session",
"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": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "CA",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "CA",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"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": "127.2.2.0",
"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_HZXVkB3Sgivp05S4ZNb5",
"merchant_id": "postman_merchant_GHAction_2df9b020-7ee8-4a4f-bbe8-fcfea85b6e97",
"status": "requires_confirmation",
"amount": 1001,
"net_amount": 1001,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_HZXVkB3Sgivp05S4ZNb5_secret_vcAhY1ZDv6o3JUXQGD1O",
"created": "2024-12-30T10:47:52.494Z",
"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": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_mTYGZbORdGoUVjWd3HIB",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"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": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "CA",
"line3": "CA",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1735555672,
"expires": 1735559272,
"secret": "epk_598e7f9c98c5408bb9713a296458924e"
},
"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_FXQzfrQDc9z2aCNJY9SG",
"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": "2024-12-30T11:02:52.494Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.2.2.0",
"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-30T10:47:52.525Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
- **B) List Payment Method Merchant**
- Request
```
curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_HZXVkB3Sgivp05S4ZNb5_secret_vcAhY1ZDv6o3JUXQGD1O' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_6934f023b7e340578a6802a69b225f1e'
```
- Response
```
{
"redirect_url": "https://duck.com/success",
"currency": "USD",
"payment_methods": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": [
{
"card_network": "Visa",
"surcharge_details": null,
"eligible_connectors": [
"worldpay"
]
},
{
"card_network": "Mastercard",
"surcharge_details": null,
"eligible_connectors": [
"worldpay"
]
}
],
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": {
"payment_method_data.card.card_exp_month": {
"required_field": "payment_method_data.card.card_exp_month",
"display_name": "card_exp_month",
"field_type": "user_card_expiry_month",
"value": null
},
"billing.address.zip": {
"required_field": "billing.address.zip",
"display_name": "zip",
"field_type": "user_address_pincode",
"value": "94122"
},
"billing.address.country": {
"required_field": "billing.address.country",
"display_name": "country",
"field_type": {
"user_address_country": {
"options": [
"AF",
"AU",
"AW",
"AZ",
"BS",
"BH",
"BD",
"BB",
"BZ",
"BM",
"BT",
"BO",
"BA",
"BW",
"BR",
"BN",
"BG",
"BI",
"KH",
"CA",
"CV",
"KY",
"CL",
"CO",
"KM",
"CD",
"CR",
"CZ",
"DZ",
"DK",
"DJ",
"ST",
"DO",
"EC",
"EG",
"SV",
"ER",
"ET",
"FK",
"FJ",
"GM",
"GE",
"GH",
"GI",
"GT",
"GN",
"GY",
"HT",
"HN",
"HK",
"HU",
"IS",
"IN",
"ID",
"IR",
"IQ",
"IE",
"IL",
"IT",
"JM",
"JP",
"JO",
"KZ",
"KE",
"KW",
"LA",
"LB",
"LS",
"LR",
"LY",
"LT",
"MO",
"MK",
"MG",
"MW",
"MY",
"MV",
"MR",
"MU",
"MX",
"MD",
"MN",
"MA",
"MZ",
"MM",
"NA",
"NZ",
"NI",
"NG",
"KP",
"NO",
"AR",
"PK",
"PG",
"PY",
"PE",
"UY",
"PH",
"PL",
"GB",
"QA",
"OM",
"RO",
"RU",
"RW",
"WS",
"SG",
"ST",
"ZA",
"KR",
"LK",
"SH",
"SD",
"SR",
"SZ",
"SE",
"CH",
"SY",
"TW",
"TJ",
"TZ",
"TH",
"TT",
"TN",
"TR",
"UG",
"UA",
"US",
"UZ",
"VU",
"VE",
"VN",
"ZM",
"ZW"
]
}
},
"value": "US"
},
"payment_method_data.card.card_exp_year": {
"required_field": "payment_method_data.card.card_exp_year",
"display_name": "card_exp_year",
"field_type": "user_card_expiry_year",
"value": null
},
"payment_method_data.card.card_number": {
"required_field": "payment_method_data.card.card_number",
"display_name": "card_number",
"field_type": "user_card_number",
"value": null
}
},
"surcharge_details": null,
"pm_auth_connector": null
},
{
"payment_method_type": "debit",
"payment_experience": null,
"card_networks": [
{
"card_network": "Mastercard",
"surcharge_details": null,
"eligible_connectors": [
"worldpay"
]
},
{
"card_network": "Visa",
"surcharge_details": null,
"eligible_connectors": [
"worldpay"
]
}
],
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": {
"payment_method_data.card.card_number": {
"required_field": "payment_method_data.card.card_number",
"display_name": "card_number",
"field_type": "user_card_number",
"value": null
},
"payment_method_data.card.card_exp_year": {
"required_field": "payment_method_data.card.card_exp_year",
"display_name": "card_exp_year",
"field_type": "user_card_expiry_year",
"value": null
},
"payment_method_data.card.card_exp_month": {
"required_field": "payment_method_data.card.card_exp_month",
"display_name": "card_exp_month",
"field_type": "user_card_expiry_month",
"value": null
},
"billing.address.country": {
"required_field": "billing.address.country",
"display_name": "country",
"field_type": {
"user_address_country": {
"options": [
"AF",
"AU",
"AW",
"AZ",
"BS",
"BH",
"BD",
"BB",
"BZ",
"BM",
"BT",
"BO",
"BA",
"BW",
"BR",
"BN",
"BG",
"BI",
"KH",
"CA",
"CV",
"KY",
"CL",
"CO",
"KM",
"CD",
"CR",
"CZ",
"DZ",
"DK",
"DJ",
"ST",
"DO",
"EC",
"EG",
"SV",
"ER",
"ET",
"FK",
"FJ",
"GM",
"GE",
"GH",
"GI",
"GT",
"GN",
"GY",
"HT",
"HN",
"HK",
"HU",
"IS",
"IN",
"ID",
"IR",
"IQ",
"IE",
"IL",
"IT",
"JM",
"JP",
"JO",
"KZ",
"KE",
"KW",
"LA",
"LB",
"LS",
"LR",
"LY",
"LT",
"MO",
"MK",
"MG",
"MW",
"MY",
"MV",
"MR",
"MU",
"MX",
"MD",
"MN",
"MA",
"MZ",
"MM",
"NA",
"NZ",
"NI",
"NG",
"KP",
"NO",
"AR",
"PK",
"PG",
"PY",
"PE",
"UY",
"PH",
"PL",
"GB",
"QA",
"OM",
"RO",
"RU",
"RW",
"WS",
"SG",
"ST",
"ZA",
"KR",
"LK",
"SH",
"SD",
"SR",
"SZ",
"SE",
"CH",
"SY",
"TW",
"TJ",
"TZ",
"TH",
"TT",
"TN",
"TR",
"UG",
"UA",
"US",
"UZ",
"VU",
"VE",
"VN",
"ZM",
"ZW"
]
}
},
"value": "US"
},
"billing.address.zip": {
"required_field": "billing.address.zip",
"display_name": "zip",
"field_type": "user_address_pincode",
"value": "94122"
}
},
"surcharge_details": null,
"pm_auth_connector": null
}
]
}
],
"mandate_payment": null,
"merchant_name": "NewAge Retailer",
"show_surcharge_breakup_screen": false,
"payment_type": "new_mandate",
"request_external_three_ds_authentication": false,
"collect_shipping_details_from_wallets": false,
"collect_billing_details_from_wallets": false,
"is_tax_calculation_enabled": false
}
```
**2. Multisafepay**
- **A) Create Payment**
- Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_uaN1P2yDTIvML6tuSZabswFxSGfDz2xK63AoXpDeO6lEisiftVuZwXEpIxc4cGgH' \
--data-raw '{
"amount":1001,
"currency": "USD",
"confirm": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1001,
"customer_id": "StripeCustomer",
"setup_future_usage": "off_session",
"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": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "CA",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "CA",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"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": "127.2.2.0",
"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_CXaeXrSELBOHKt8WwrzN",
"merchant_id": "postman_merchant_GHAction_4a25406a-bc96-4cfb-ae31-79d35d47eb57",
"status": "requires_confirmation",
"amount": 1001,
"net_amount": 1001,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_CXaeXrSELBOHKt8WwrzN_secret_ZC42GH8feee79hkRIptR",
"created": "2024-12-30T10:58:02.272Z",
"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": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_bFixxgfXyxtUjbRgGicv",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"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": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "CA",
"line3": "CA",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1735556282,
"expires": 1735559882,
"secret": "epk_c7c9dd7c672e45c1b61fbea9a77d0c2a"
},
"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_wMwY5DYf61LpJu0wYwB1",
"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": "2024-12-30T11:13:02.272Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.2.2.0",
"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-30T10:58:02.310Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
- **B) List Payment Method Merchant**
- Request
```
curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_CXaeXrSELBOHKt8WwrzN_secret_ZC42GH8feee79hkRIptR' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_3bf61b76e332498a80708f11a3b017a2'
```
- Response
```
{
"redirect_url": "https://duck.com/success",
"currency": "USD",
"payment_methods": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": [
{
"payment_experience_type": "redirect_to_url",
"eligible_connectors": [
"multisafepay"
]
}
],
"card_networks": null,
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": {
"billing.address.city": {
"required_field": "payment_method_data.billing.address.city",
"display_name": "city",
"field_type": "user_address_city",
"value": "San Fransico"
},
"billing.address.last_name": {
"required_field": "payment_method_data.billing.address.last_name",
"display_name": "billing_last_name",
"field_type": "user_billing_name",
"value": "Doe"
},
"billing.address.zip": {
"required_field": "payment_method_data.billing.address.zip",
"display_name": "zip",
"field_type": "user_address_pincode",
"value": "94122"
},
"billing.address.line2": {
"required_field": "payment_method_data.billing.address.line2",
"display_name": "line2",
"field_type": "user_address_line2",
"value": "CA"
},
"billing.address.first_name": {
"required_field": "payment_method_data.billing.address.first_name",
"display_name": "billing_first_name",
"field_type": "user_billing_name",
"value": "joseph"
},
"billing.address.state": {
"required_field": "payment_method_data.billing.address.state",
"display_name": "state",
"field_type": "user_address_state",
"value": "California"
},
"billing.address.country": {
"required_field": "payment_method_data.billing.address.country",
"display_name": "country",
"field_type": {
"user_address_country": {
"options": [
"ALL"
]
}
},
"value": "US"
},
"billing.address.line1": {
"required_field": "payment_method_data.billing.address.line1",
"display_name": "line1",
"field_type": "user_address_line1",
"value": "1467"
}
},
"surcharge_details": null,
"pm_auth_connector": null
}
]
},
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": [
{
"card_network": "Mastercard",
"surcharge_details": null,
"eligible_connectors": [
"multisafepay"
]
},
{
"card_network": "Visa",
"surcharge_details": null,
"eligible_connectors": [
"multisafepay"
]
}
],
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": {
"billing.address.city": {
"required_field": "payment_method_data.billing.address.city",
"display_name": "city",
"field_type": "user_address_city",
"value": "San Fransico"
},
"billing.address.country": {
"required_field": "payment_method_data.billing.address.country",
"display_name": "country",
"field_type": {
"user_address_country": {
"options": [
"ALL"
]
}
},
"value": "US"
},
"billing.address.line2": {
"required_field": "payment_method_data.billing.address.line2",
"display_name": "line2",
"field_type": "user_address_line2",
"value": "CA"
},
"billing.address.line1": {
"required_field": "payment_method_data.billing.address.line1",
"display_name": "line1",
"field_type": "user_address_line1",
"value": "1467"
},
"payment_method_data.card.card_number": {
"required_field": "payment_method_data.card.card_number",
"display_name": "card_number",
"field_type": "user_card_number",
"value": null
},
"billing.address.first_name": {
"required_field": "payment_method_data.billing.address.first_name",
"display_name": "card_holder_name",
"field_type": "user_full_name",
"value": "joseph"
},
"payment_method_data.card.card_exp_month": {
"required_field": "payment_method_data.card.card_exp_month",
"display_name": "card_exp_month",
"field_type": "user_card_expiry_month",
"value": null
},
"payment_method_data.card.card_cvc": {
"required_field": "payment_method_data.card.card_cvc",
"display_name": "card_cvc",
"field_type": "user_card_cvc",
"value": null
},
"billing.address.zip": {
"required_field": "payment_method_data.billing.address.zip",
"display_name": "zip",
"field_type": "user_address_pincode",
"value": "94122"
},
"payment_method_data.card.card_exp_year": {
"required_field": "payment_method_data.card.card_exp_year",
"display_name": "card_exp_year",
"field_type": "user_card_expiry_year",
"value": null
},
"billing.address.last_name": {
"required_field": "payment_method_data.billing.address.last_name",
"display_name": "card_holder_name",
"field_type": "user_full_name",
"value": "Doe"
}
},
"surcharge_details": null,
"pm_auth_connector": null
},
{
"payment_method_type": "debit",
"payment_experience": null,
"card_networks": [
{
"card_network": "Mastercard",
"surcharge_details": null,
"eligible_connectors": [
"multisafepay"
]
},
{
"card_network": "Visa",
"surcharge_details": null,
"eligible_connectors": [
"multisafepay"
]
}
],
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": {
"billing.address.line1": {
"required_field": "payment_method_data.billing.address.line1",
"display_name": "line1",
"field_type": "user_address_line1",
"value": "1467"
},
"payment_method_data.card.card_exp_month": {
"required_field": "payment_method_data.card.card_exp_month",
"display_name": "card_exp_month",
"field_type": "user_card_expiry_month",
"value": null
},
"payment_method_data.card.card_number": {
"required_field": "payment_method_data.card.card_number",
"display_name": "card_number",
"field_type": "user_card_number",
"value": null
},
"billing.address.city": {
"required_field": "payment_method_data.billing.address.city",
"display_name": "city",
"field_type": "user_address_city",
"value": "San Fransico"
},
"billing.address.first_name": {
"required_field": "payment_method_data.billing.address.first_name",
"display_name": "card_holder_name",
"field_type": "user_full_name",
"value": "joseph"
},
"billing.address.zip": {
"required_field": "payment_method_data.billing.address.zip",
"display_name": "zip",
"field_type": "user_address_pincode",
"value": "94122"
},
"billing.address.last_name": {
"required_field": "payment_method_data.billing.address.last_name",
"display_name": "card_holder_name",
"field_type": "user_full_name",
"value": "Doe"
},
"billing.address.country": {
"required_field": "payment_method_data.billing.address.country",
"display_name": "country",
"field_type": {
"user_address_country": {
"options": [
"ALL"
]
}
},
"value": "US"
},
"billing.address.line2": {
"required_field": "payment_method_data.billing.address.line2",
"display_name": "line2",
"field_type": "user_address_line2",
"value": "CA"
},
"payment_method_data.card.card_exp_year": {
"required_field": "payment_method_data.card.card_exp_year",
"display_name": "card_exp_year",
"field_type": "user_card_expiry_year",
"value": null
},
"payment_method_data.card.card_cvc": {
"required_field": "payment_method_data.card.card_cvc",
"display_name": "card_cvc",
"field_type": "user_card_cvc",
"value": null
}
},
"surcharge_details": null,
"pm_auth_connector": null
}
]
}
],
"mandate_payment": null,
"merchant_name": "NewAge Retailer",
"show_surcharge_breakup_screen": false,
"payment_type": "new_mandate",
"request_external_three_ds_authentication": false,
"collect_shipping_details_from_wallets": false,
"collect_billing_details_from_wallets": false,
"is_tax_calculation_enabled": false
}
```
**Cypress Tests**
No3DSAutoCapture

**No3DSManualCapture**

**3DSAutoCapture**

**3DSManualCapture**

**SingleUseMandate**

**MultiUseMandate**

## 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/configs/defaults/payment_connector_required_fields.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (8 changes)
**Detailed Identifier Changes:**
Commit ee5003e1:
Files to modify:
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Modify existing code
Commit 878717ea:
Files to modify:
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Modify existing code
|
{"pr_number": 6930, "pr_title": "fix(connector): fix required fields for mandates supported connectors", "merged_at": "2025-03-26T12:15:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/configs/defaults/payment_connector_required_fields.rs"]}, "change_types": {"fields_added": 8}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
feat(connector): [Xendit] Template PR
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Template code added for new connector Xendit
https://developers.xendit.co/api-reference
### 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/6597
## How did you test it?
Since this is template PR, no testing is 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. API Request/Response Models**
- `crates/api_models/src/connector_enums.rs`
**2. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/hyperswitch_connectors/src/connectors.rs`
- ... and 8 more files
**3. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/transformers.rs`
**4. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**5. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 3 more files
**6. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (78 changes)
- Extend existing types with new fields (158 changes)
**Detailed Identifier Changes:**
Commit 9bc363f1:
Files to modify:
**crates/api_models/src/connector_enums.rs**
Modify existing code
**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::xendit
**crates/hyperswitch_connectors/src/connectors/xendit.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::Xendit
- impl: impl Xendit
- impl: impl api::Payment for Xendit
- impl: impl api::PaymentSession for Xendit
- impl: impl api::ConnectorAccessToken for Xendit
- impl: impl api::MandateSetup for Xendit
- impl: impl api::PaymentAuthorize for Xendit
- impl: impl api::PaymentSync for Xendit
- impl: impl api::PaymentCapture for Xendit
- impl: impl api::PaymentVoid for Xendit
- impl: impl api::Refund for Xendit
- impl: impl api::RefundExecute for Xendit
- impl: impl api::RefundSync for Xendit
- impl: impl api::PaymentToken for Xendit
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Xendit
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Xendit
- impl: impl ConnectorCommon for Xendit
- impl: impl ConnectorValidation for Xendit
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Xendit
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Xendit
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Xendit
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Xendit
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Xendit
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Xendit
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Xendit
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Xendit
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Xendit
- impl: impl webhooks::IncomingWebhook for Xendit
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/xendit/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::XenditRouterData
- struct: pub::XenditPaymentsRequest
- struct: pub::XenditCard
- struct: pub::XenditAuthType
- struct: pub::XenditPaymentsResponse
- struct: pub::XenditRefundRequest
- struct: pub::RefundResponse
- struct: pub::XenditErrorResponse
- enum: pub::XenditPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for XenditRouterData<T>
- impl: impl TryFrom<&XenditRouterData<&PaymentsAuthorizeRouterData>> for XenditPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for XenditAuthType
- impl: impl From<XenditPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, XenditPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&XenditRouterData<&RefundsRouterData<F>>> for XenditRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
- impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/configs.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/tests/connectors/xendit.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::XenditTest
- impl: impl ConnectorActions for XenditTest
- impl: impl utils::Connector for XenditTest
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 6593, "pr_title": "feat(connector): [Xendit] Template PR", "merged_at": "2024-11-21T19:28:56Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/connector_enums.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/xendit.rs", "crates/hyperswitch_connectors/src/connectors/xendit/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/xendit.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", "crates/hyperswitch_interfaces/src/configs.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"structs_added": 10, "functions_added": 78, "enums_added": 2, "fields_added": 158, "imports_added": 19}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): fix Click to Pay cavv None error
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
## Description
<!-- Describe your changes in detail -->
Currently Click to pay is breaking due to CAVV being populated as null in the flow this PR fixes it.
## 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_mastercard
```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": "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": "b6e06cc6-3018-4c4c-bbf5-9fb232615090",
"dpa_name": "TestMerchant",
"locale": "en_AU",
"card_brands": ["mastercard", "visa"],
"acquirer_bin": "545301",
"acquirer_merchant_id": "SRC3DS",
"merchant_category_code": "0001",
"merchant_country_code": "US"
}
}
'
```
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": "cybersource",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_secret": "bypQ0ZszfbHTyNgLEQx+Txvs3qqYc14LVKS+QmwX/88=",
"api_key": "538e4ded-cef5-4438-a153-5a02566a34fd",
"key1": "juspay_us_sandbox"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"AmericanExpress"
],
"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": "556B655EBE2F2F0912F6DBC893C23C8A30F5F5293746B80114844AB30549E2AB"
}
// "business_country": "US",
// "business_label": "default"
}
'
```
update business profile with ctp_mastercard 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" : {
"merchant_transaction_id": "0a4e0d3.34f4a04b.803eb38b0a56f082296538d4a70c064a6b320639",
"correlation_id": "34f4a04b.bcd1ac39-e0f3-479e-b3ee-703ade0c66dc",
"x_src_flow_id" : "34f4a04b.bcd1ac39-e0f3-479e-b3ee-703ade0c66dc.1727438793"
},
"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_uExtVlV6ueNkLeUPiXZg",
"merchant_id": "sahkal",
"status": "succeeded",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 100,
"connector": "cybersource",
"client_secret": "pay_uExtVlV6ueNkLeUPiXZg_secret_mU8Au3Lupz6KXgHzW5z4",
"created": "2025-05-13T15:50:46.759Z",
"currency": "USD",
"customer_id": null,
"customer": {
"id": null,
"name": "John Doe",
"email": "sahkalplanet@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"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": "sahkal",
"last_name": "poddar"
},
"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": "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": "7471514619636683503812",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_uExtVlV6ueNkLeUPiXZg_1",
"payment_link": null,
"profile_id": "pro_Img0GLzvnKEFzGRdsqdF",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_3TGQxhtgz4WtNjlj17fn",
"incremental_authorization_allowed": false,
"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-05-13T16:05:46.759Z",
"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-05-13T15:51:03.564Z",
"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
}
```
## 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. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
- `crates/hyperswitch_domain_models/src/router_request_types/authentication.rs`
**2. Core Business Logic**
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/payments/operations/payment_confirm.rs`
- `crates/router/src/core/unified_authentication_service.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
- ... and 3 more files
**4. Tests**
- `config/deployments/integration_test.toml`
**Code Patterns Applied:**
- Extend existing types with new fields (13 changes)
**Detailed Identifier Changes:**
Commit 344dcd6e:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/archipel/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/datatrans/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/authentication.rs**
Modify existing code
**crates/router/src/core/authentication.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
|
{"pr_number": 8019, "pr_title": "fix(router): fix Click to Pay cavv None error", "merged_at": "2025-05-20T10:46:27Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_request_types/authentication.rs"], "core_business": ["crates/router/src/core/authentication.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/unified_authentication_service.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs", "crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs"], "tests": ["config/deployments/integration_test.toml"]}, "change_types": {"fields_added": 13}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(Cypress): Add testcase for newline in address
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
There is a bug fix for cybersource where the billing address contains new line then the payments are getting failed. To address that in automation have added billling address with newlinw in confirm call and expecting succeeded in the response.
## Motivation and Context
To enhance the testcase
## How did you test it?
<img width="1055" alt="Screenshot 2024-12-02 at 5 07 37 PM" src="https://github.com/user-attachments/assets/5f021fa4-fa98-4c1a-99fd-1d1f2749dc30">
## 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/PaymentUtils/Cybersource.js`
**Code Patterns Applied:**
- Extend existing types with new fields (14 changes)
|
{"pr_number": 6721, "pr_title": "ci(Cypress): Add testcase for newline in address", "merged_at": "2024-12-09T09:39:55Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js"]}, "change_types": {"fields_added": 14}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(connector): [AIRWALLEX, MULTISAFEPAY, RAZORPAY, SHIFT4, WORLDPAY, ZSL] Move connectors from `router` to `hyperswitch_connectors` crate
## 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 connector Airwallex, Multisafepay, Razorpay, Shift4, Worldpay and Zsl 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)?
-->
Multisafepay
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_1065dc44-f94e-4744-b15c-feb9f63b144b","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/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data-raw '{"merchant_id":"postman_merchant_GHAction_1065dc44-f94e-4744-b15c-feb9f63b144b","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"}}'
```
3. Payment connector create
```
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_8ced15a4-5c29-43bb-bbaa-5dc3c96e20a0/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "multisafepay",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "86c0___"
},
"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": "wallet",
"payment_method_types": [
{
"payment_method_type": "paypal",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": false,
"installment_payment_enabled": false
},
{
"payment_method_type": "paypal",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": false,
"installment_payment_enabled": false
}
]
},
{
"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
}
]
}
],
"metadata": {
"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": ""
}
}
}
],
"merchant_info": {
"merchant_name": "Narayan Bhat"
}
}
}
}'
```
4. Payment Create
Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_TufBwOhnJi33KSmiu0UH6yK4YS0Lf1sCxMWQtsL6wA1ter2EOAEG6qyNB03kxXnz' \
--data-raw '{
"amount": 1200,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1200,
"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://hs-payments-test.netlify.app/payments",
"setup_future_usage": "off_session",
"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"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"payment_method": "wallet",
"payment_method_type": "paypal",
"payment_method_data": {
"wallet": {
"paypal_redirect": {}
}
}
}
'
```
Response
```
{
"payment_id": "pay_TzGlHb6BNbeiWs8oCcUo",
"merchant_id": "postman_merchant_GHAction_8ced15a4-5c29-43bb-bbaa-5dc3c96e20a0",
"status": "requires_customer_action",
"amount": 1200,
"net_amount": 1200,
"shipping_cost": null,
"amount_capturable": 1200,
"amount_received": null,
"connector": "multisafepay",
"client_secret": "pay_TzGlHb6BNbeiWs8oCcUo_secret_AyESdhRFL4faKyzRuhT9",
"created": "2024-10-30T10:17:38.682Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "abcdef123@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://hs-payments-test.netlify.app/payments",
"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_TzGlHb6BNbeiWs8oCcUo/postman_merchant_GHAction_8ced15a4-5c29-43bb-bbaa-5dc3c96e20a0/pay_TzGlHb6BNbeiWs8oCcUo_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "paypal",
"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": 1730283458,
"expires": 1730287058,
"secret": "epk_42ec8e85781f47e9905f7ea5a6e1d83d"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pay_TzGlHb6BNbeiWs8oCcUo_1",
"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_TzGlHb6BNbeiWs8oCcUo_1",
"payment_link": null,
"profile_id": "pro_pElUALDEgI6YV9vkF3k1",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_FxkTFmTgQqpjTEEoCRye",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-30T10:32:38.682Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-10-30T10:17:40.362Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
5. Payments Retreive
Request
```
curl --location 'http://localhost:8080/payments/pay_TzGlHb6BNbeiWs8oCcUo' \
--header 'Accept: application/json' \
--header 'api-key: dev_TufBwOhnJi33KSmiu0UH6yK4YS0Lf1sCxMWQtsL6wA1ter2EOAEG6qyNB03kxXnz'
```
Response
```
{
"payment_id": "pay_TzGlHb6BNbeiWs8oCcUo",
"merchant_id": "postman_merchant_GHAction_8ced15a4-5c29-43bb-bbaa-5dc3c96e20a0",
"status": "requires_customer_action",
"amount": 1200,
"net_amount": 1200,
"shipping_cost": null,
"amount_capturable": 1200,
"amount_received": null,
"connector": "multisafepay",
"client_secret": "pay_TzGlHb6BNbeiWs8oCcUo_secret_AyESdhRFL4faKyzRuhT9",
"created": "2024-10-30T10:17:38.682Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "abcdef123@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://hs-payments-test.netlify.app/payments",
"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_TzGlHb6BNbeiWs8oCcUo/postman_merchant_GHAction_8ced15a4-5c29-43bb-bbaa-5dc3c96e20a0/pay_TzGlHb6BNbeiWs8oCcUo_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "paypal",
"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": "pay_TzGlHb6BNbeiWs8oCcUo_1",
"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_TzGlHb6BNbeiWs8oCcUo_1",
"payment_link": null,
"profile_id": "pro_pElUALDEgI6YV9vkF3k1",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_FxkTFmTgQqpjTEEoCRye",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-30T10:32:38.682Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-10-30T10:17:40.362Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
---
Shift4
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_1730283636",
"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
},
"primary_business_details": [
{
"country": "US",
"business": "default"
}
],
"sub_merchants_enabled": false,
"metadata": {
"city": "NY",
"unit": "245"
}
}'
```
2. API Key Create
```
curl --location 'http://localhost:8080/api_keys/merchant_1730283633' \
--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_1730283633/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "shift4",
"business_country": "US",
"business_label": "default",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "Basic c2t__"
},
"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": {
"gpay": {
"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": "exampleGatewayMerchantId"
}
}
}
],
"merchant_info": {
"merchant_name": "Narayan Bhat"
}
}
}
}'
```
4. Payment Create
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_DeHgzgycPF7hN0rYtqMvYwyDDSCLxq6iShtEa30GmwF3sMkEs3L6epMHVWJ4mVww' \
--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":"no_three_ds","return_url":"https://duck.com","payment_method":"card","payment_method_data":{"card":{"card_number":"4242424242424242","card_exp_month":"10","card_exp_year":"25","card_holder_name":"joseph Doe","card_cvc":"123"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"California","zip":"94122","country":"US","first_name":"PiX","last_name":"Fix"}},"shipping":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"California","zip":"94122","country":"US","first_name":"PiX","last_name":"Fix"}},"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"}}'
```
5. Payment Retreive
Request
```
curl --location 'http://localhost:8080/payments/pay_KmHxye9RoexrG6f6bydq' \
--header 'Accept: application/json' \
--header 'api-key: dev_DeHgzgycPF7hN0rYtqMvYwyDDSCLxq6iShtEa30GmwF3sMkEs3L6epMHVWJ4mVww'
```
Response
```
{
"payment_id": "pay_KmHxye9RoexrG6f6bydq",
"merchant_id": "merchant_1730283633",
"status": "succeeded",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6540,
"connector": "shift4",
"client_secret": "pay_KmHxye9RoexrG6f6bydq_secret_VWlULL4D41zPLenyfWhC",
"created": "2024-10-30T10:21:50.017Z",
"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": "4242",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "STRIPE PAYMENTS UK LIMITED",
"card_issuing_country": "UNITEDKINGDOM",
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_1lKy27KbQfeoblowcPEZ",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": "Fix"
},
"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": "Fix"
},
"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": 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": "char_hD8dPxtkAfXYPBEX5zhIFHBp",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "char_hD8dPxtkAfXYPBEX5zhIFHBp",
"payment_link": null,
"profile_id": "pro_HqPBEPdGu6DThZSFnDSB",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_SkAZvF7cbc7XPqGZaCbz",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-30T10:36:50.017Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-10-30T10:21:50.894Z",
"charges": 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. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/types.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/connector_integration_v2_impls.rs`
- `crates/router/src/core/payments/flows.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/Cargo.toml`
- `crates/hyperswitch_connectors/src/connectors.rs`
- `crates/router/src/connector/airwallex.rs`
- ... and 21 more files
**4. Other**
- `Cargo.lock`
**Code Patterns Applied:**
- Implement new functions (38 changes)
- Extend existing types with new fields (458 changes)
- Add conditional logic for feature flags or filtering (4 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit 72ee4340:
Files to modify:
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::airwallex
- mod: pub::multisafepay
- mod: pub::razorpay
- mod: pub::shift4
- mod: pub::worldpay
- mod: pub::zsl
**crates/hyperswitch_connectors/src/constants.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_connectors/src/lib.rs**
Add:
- mod: pub::metrics
**crates/hyperswitch_connectors/src/metrics.rs**
Modify existing code
**crates/hyperswitch_connectors/src/types.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Remove:
- function: private::get_request_id
- trait: pub::AccessTokenRequestInfo
- impl: impl AccessTokenRequestInfo for RefreshTokenRouterData
Add:
- function: pub::handle_json_response_deserialization_failure
- function: private::get_request_id
- function: private::get_optional_full_name
- function: private::get_amount
- function: private::get_currency
- trait: pub::AccessTokenRequestInfo
- trait: pub::AddressData
- impl: impl AccessTokenRequestInfo for RefreshTokenRouterData
- impl: impl AddressData for Address
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/router/src/connector.rs**
Remove:
- mod: pub::airwallex
- mod: pub::multisafepay
- mod: pub::razorpay
- mod: pub::shift4
- mod: pub::worldpay
- mod: pub::zsl
**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": 6369, "pr_title": "refactor(connector): [AIRWALLEX, MULTISAFEPAY, RAZORPAY, SHIFT4, WORLDPAY, ZSL] Move connectors from `router` to `hyperswitch_connectors` crate", "merged_at": "2024-11-04T15:29:10Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/types.rs"], "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/airwallex.rs", "crates/router/src/connector/airwallex/transformers.rs", "crates/router/src/connector/multisafepay.rs", "crates/router/src/connector/multisafepay/transformers.rs", "crates/router/src/connector/razorpay.rs", "crates/router/src/connector/razorpay/transformers.rs", "crates/router/src/connector/shift4.rs", "crates/router/src/connector/shift4/transformers.rs", "crates/router/src/connector/worldpay.rs", "crates/router/src/connector/worldpay/requests.rs", "crates/router/src/connector/worldpay/response.rs", "crates/router/src/connector/worldpay/transformers.rs", "crates/router/src/connector/zsl.rs", "crates/router/src/connector/zsl/transformers.rs", "crates/hyperswitch_connectors/src/constants.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/hyperswitch_connectors/src/lib.rs", "crates/hyperswitch_connectors/src/metrics.rs", "crates/hyperswitch_connectors/src/types.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector.rs"], "other": ["Cargo.lock"]}, "change_types": {"functions_added": 38, "enums_added": 1, "fields_added": 458, "imports_added": 80, "conditionals_added": 4, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(config): enable payout in prod release
## 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 enables payout for release
### 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 build with `cargo build --no-default-features --features "release" --features "v1"`
<img width="892" height="472" alt="image" src="https://github.com/user-attachments/assets/cab6215c-d3d7-478b-b761-316fecfe02c4" />
## 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. Configuration Files**
- `crates/router/Cargo.toml`
|
{"pr_number": 8817, "pr_title": "refactor(config): enable payout in prod release", "merged_at": "2025-08-04T18:59:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"config": ["crates/router/Cargo.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(core): Added additional authentication fields for 3ds external authentication
## 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 introduces the following changes
1. Added additional authentication fields for 3ds external authentication, the fields are as following
- challenge_code
- challenge_code_reason
- challenge_cancel
- message_extension
2. Added additional fields for Cybersource payments request corresponding to the newly added auth fields
3. Added additional request fields for Netcetera, and other 3ds connectors corresponding to the newly added auth fields
Context - Cybersource payments via Netcetera are failing for a France based acquirer in prod, the above fields are added to fix the same.
### 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).
-->
## 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)?
-->
### Card used for testing (mastercard with challenge flow)
5306 8899 4283 3340
### Successful 3DS challenge completion flow
_Tested using local hyperswitch sdk and hyperswitch backend_
[Test video](https://drive.google.com/file/d/1rV5mnly1WdvLk8Ff1_r16vAxBqgGJVUJ/view?usp=sharing)
Connector Request for Cybersource:
<img width="1720" height="321" alt="Screenshot 2025-07-30 at 8 39 57 PM" src="https://github.com/user-attachments/assets/3fa4c555-7d11-4482-b232-baa8713af24c" />
> cavvAlgorithm - "02"
> paresStatus - "Y"
> challengeCode - Null (Please note - This is not supposed to be null, checking with Netcetera team since it's coming as None from Netcetera) Fix merged in [PR](https://github.com/juspay/hyperswitch/pull/8850)
> paresStatusReason - Null (Please note - Null is not expected here,checking this with Netcetera team) Fix raised here [PR](https://github.com/juspay/hyperswitch/pull/8907)
> challengeCancelCode - Null (Please note - Null is expected here, as challenge is not cancelled)
> networkScore - Null (Please note - Null is expected here, as card is not CartesBancaires and also since it is not production environment - messageExtension field is only available on production)
> acsTransactionId - "9187c2cb-54f8-4e70-a63b-537046c2b34d"
### 3DS challenge cancel flow
_Tested using local hyperswitch sdk and hyperswitch backend_
[Test video](https://drive.google.com/file/d/1jIAtfLotxhZsroT-xYUEttUXapuRn0Sv/view?usp=sharing)
Incoming Webhook from Netcetera on cancelling challenge:
<img width="1720" height="198" alt="Screenshot 2025-07-30 at 9 23 53 PM" src="https://github.com/user-attachments/assets/93b0eacd-676c-4d88-993b-77ef78e3da90" />
## 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. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
- `crates/hyperswitch_domain_models/src/router_request_types/authentication.rs`
- `crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs`
- ... and 1 more files
**3. Core Business Logic**
- `crates/router/src/core/authentication/utils.rs`
- `crates/router/src/core/payments/types.rs`
- `crates/router/src/core/unified_authentication_service.rs`
- ... and 2 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/gpayments.rs`
- `crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs`
- ... and 7 more files
**5. Other**
- `crates/hyperswitch_interfaces/src/authentication.rs`
- `crates/router/src/db/authentication.rs`
- `migrations/2025-07-25-115018_add_authn_fields_challenge_code_cancel_reason_message_extension/down.sql`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (155 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 89774f3a:
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/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Add:
- function: private::extract_score_id
**crates/hyperswitch_connectors/src/connectors/gpayments.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/netcetera.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/netcetera/netcetera_types.rs**
Remove:
- struct: pub::MessageExtensionAttribute
**crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Remove:
- struct: pub::MessageExtension
- struct: pub::MessageExtensionData
**crates/hyperswitch_connectors/src/connectors/threedsecureio.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/authentication.rs**
Add:
- struct: pub::MessageExtensionAttribute
**crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/authentication.rs**
Modify existing code
**crates/router/src/core/authentication/utils.rs**
Modify existing code
**crates/router/src/core/payments/types.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/utils.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/db/authentication.rs**
Modify existing code
|
{"pr_number": 8758, "pr_title": "feat(core): Added additional authentication fields for 3ds external authentication", "merged_at": "2025-08-05T18:05:07Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"database": ["crates/diesel_models/src/authentication.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_request_types/authentication.rs", "crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/authentication/utils.rs", "crates/router/src/core/payments/types.rs", "crates/router/src/core/unified_authentication_service.rs", "crates/router/src/core/unified_authentication_service/utils.rs", "crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/gpayments.rs", "crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs", "crates/hyperswitch_connectors/src/connectors/netcetera.rs", "crates/hyperswitch_connectors/src/connectors/netcetera/netcetera_types.rs", "crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/connectors/threedsecureio.rs", "crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs", "crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs"], "other": ["crates/hyperswitch_interfaces/src/authentication.rs", "crates/router/src/db/authentication.rs", "migrations/2025-07-25-115018_add_authn_fields_challenge_code_cancel_reason_message_extension/down.sql", "migrations/2025-07-25-115018_add_authn_fields_challenge_code_cancel_reason_message_extension/up.sql"]}, "change_types": {"structs_added": 1, "functions_added": 1, "fields_added": 155, "imports_added": 2, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(api_locking): add delay between api-locking retries
## 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 delay between api-locking retries for `HoldMultiple` locking mechanism.
This was missed during development before.
This is already available for Single id locking.
### 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 cases in this pr.
https://github.com/juspay/hyperswitch/pull/8887
## 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`
**Detailed Identifier Changes:**
Commit 4052f8a2:
Files to modify:
**crates/router/src/core/api_locking.rs**
Modify existing code
|
{"pr_number": 9308, "pr_title": "fix(api_locking): add delay between api-locking retries", "merged_at": "2025-09-09T13:04:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/api_locking.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payments): implement routing in payments v2
## 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 -->
Implemented rule based routing in payments v2.
Straight through routing in v2 will be achieved by first configuring a straight through algorithm using `routing` endpoint and then passing the `routing_algorithm_id` field in payment create intent request.
* Added validation for `routing_algorithm_id` in payment_inten_create and payment_intent_update.
Three diff types of routing
- Straight through - routing id sent in request
- routing id activated in profile
- Default fallback - in the order the MCA's are created.
### 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)?
-->
Please use this log for checking the final list of connectors decided by routing module - `final_selected_connectors_for_routing`
- Straight through routing -
Create a routing algo entry, with rule and use that routing id in payment intent create
create routing algorithm -
<img width="1030" alt="Screenshot 2025-05-27 at 2 42 36 PM" src="https://github.com/user-attachments/assets/14786801-f860-4f0c-940c-14e3ff9d9c29" />
request -
```
curl --location 'http://localhost:8080/v2/routing-algorithm' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_Ku6SmaxCKhT5paf7bvG0QVtZq9skqpqkn2NznC6Ef5jWLD2aidCDeaby0i4DWThq' \
--header 'X-Profile-Id: pro_kQqIhnCrULOPt4tmuP5v' \
--header 'api-key: dev_Ku6SmaxCKhT5paf7bvG0QVtZq9skqpqkn2NznC6Ef5jWLD2aidCDeaby0i4DWThq' \
--data '{
"name": "newalgo",
"description": "It is my ADVANCED config",
"algorithm": {
"type": "advanced",
"data": {
"defaultSelection": {
"type": "priority",
"data": [
{"connector": "bluesnap",
"merchant_connector_id":"mca_xMJUJRcvk333cIPrJtdZ"}
]
},
"rules": [
{
"name": "bluesnap",
"connectorSelection": {
"type": "priority",
"data": [
{ "connector": "bluesnap",
"merchant_connector_id":"mca_xMJUJRcvk333cIPrJtdZ"},
{"connector": "adyen",
"merchant_connector_id":"mca_IpsaFXCRJa2TNYWuVkNx"},
{
"connector": "stripe",
"merchant_connector_id":"mca_DfyZDqHCZErTASCW170f"
}
]
},
"statements": [
{
"condition": [
{
"lhs": "amount",
"comparison": "greater_than",
"value": {
"type": "number",
"value": 100077
},
"metadata": {}
}
],
"nested": null
}
]
}
],
"metadata": {}
}
},
"profile_id":"pro_kQqIhnCrULOPt4tmuP5v"
}'
```
Response -
```
{
"id": "routing_bFY4UYfNYLR0pQozeoPX",
"profile_id": "pro_kQqIhnCrULOPt4tmuP5v",
"name": "newalgo",
"kind": "advanced",
"description": "It is my ADVANCED config",
"created_at": 1748843132,
"modified_at": 1748843132,
"algorithm_for": "payment",
"decision_engine_routing_id": null
}
```
Payment intent create -
```
curl --location 'http://localhost:8080/v2/payments/create-intent' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_kQqIhnCrULOPt4tmuP5v' \
--header 'Authorization: api-key=dev_Ku6SmaxCKhT5paf7bvG0QVtZq9skqpqkn2NznC6Ef5jWLD2aidCDeaby0i4DWThq' \
--header 'api-key: dev_Ku6SmaxCKhT5paf7bvG0QVtZq9skqpqkn2NznC6Ef5jWLD2aidCDeaby0i4DWThq' \
--data-raw '{
"amount_details": {
"order_amount": 100,
"currency": "USD"
},
"capture_method":"manual",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"first_name": "John",
"last_name": "Dough"
},
"email": "example@example.com"
},
"shipping": {
"address": {
"first_name": "John",
"last_name": "Dough",
"city": "Karwar",
"zip": "581301",
"state": "Karnataka"
},
"email": "example@example.com"
},
"routing_algorithm_id":"routing_bFY4UYfNYLR0pQozeoPX"
}'
```
Confirm intent -
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_01972f2d4b007c119e0373142eac05d3/confirm-intent' \
--header 'x-client-secret: cs_01972f2d4b1a7fa091ec990921d3bea7' \
--header 'x-profile-id: pro_kQqIhnCrULOPt4tmuP5v' \
--header 'Authorization: api-key=dev_Ku6SmaxCKhT5paf7bvG0QVtZq9skqpqkn2NznC6Ef5jWLD2aidCDeaby0i4DWThq' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_47a62e65c5124ddab58d82c3bb4d0072' \
--data-raw '{
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "01",
"card_exp_year": "25",
"card_holder_name": "John Doe",
"card_cvc": "100"
},
"billing": {
"address": {
"first_name": "John",
"last_name": "Dough"
},
"email": "example@example.com"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"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"
}
}'
```
final list of connectors decided by routing module
<img width="1361" alt="Screenshot 2025-06-02 at 11 17 12 AM" src="https://github.com/user-attachments/assets/53b8c78d-ebe6-496f-ba6f-65be7bdccfd0" />
payment happened with Bluesnap
**Rule based routing activation at profile level -**
Creating new routing algo , with adyen as priority.
<img width="986" alt="Screenshot 2025-06-02 at 11 20 29 AM" src="https://github.com/user-attachments/assets/93361a49-b17f-46c1-9bc0-158ed63a0fb8" />
Activate the routing algorithm id
req -
```
curl --location --request PATCH 'http://localhost:8080/v2/profiles/pro_kQqIhnCrULOPt4tmuP5v/activate-routing-algorithm' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_Ku6SmaxCKhT5paf7bvG0QVtZq9skqpqkn2NznC6Ef5jWLD2aidCDeaby0i4DWThq' \
--header 'X-Profile-Id: pro_kQqIhnCrULOPt4tmuP5v' \
--header 'api-key: dev_Ku6SmaxCKhT5paf7bvG0QVtZq9skqpqkn2NznC6Ef5jWLD2aidCDeaby0i4DWThq' \
--data '{
"routing_algorithm_id": "routing_VdGQBkci7Wt5eoFRMJ6L"
}'
```
response -
```
{
"id": "routing_VdGQBkci7Wt5eoFRMJ6L",
"profile_id": "pro_kQqIhnCrULOPt4tmuP5v",
"name": "newalgo",
"kind": "advanced",
"description": "It is my ADVANCED config",
"created_at": 1748843407,
"modified_at": 1748843407,
"algorithm_for": "payment",
"decision_engine_routing_id": null
}
```
verify from profile entry, the routing algo id will be populated
<img width="1540" alt="Screenshot 2025-06-02 at 11 22 11 AM" src="https://github.com/user-attachments/assets/21ec88db-6b48-45c1-b062-93b93be5d2f2" />
Create intent without passing routing id at all in the request
<img width="1103" alt="Screenshot 2025-06-02 at 11 23 47 AM" src="https://github.com/user-attachments/assets/80d7bdf2-623b-4e29-b4c1-c57981f1e6d2" />
Final list of connectors -
<img width="1558" alt="Screenshot 2025-06-02 at 11 24 27 AM" src="https://github.com/user-attachments/assets/f259e9e5-b40d-4c02-b78f-8798329d31fa" />
Confirm intent
<img width="1182" alt="Screenshot 2025-06-02 at 11 24 10 AM" src="https://github.com/user-attachments/assets/577bbf47-ae94-4d7e-88ac-60aad4fb764b" />
**Default Fallback -**
Verify in profile
<img width="1728" alt="Screenshot 2025-06-02 at 11 10 08 AM" src="https://github.com/user-attachments/assets/3d154892-c583-4c55-ae82-c3048c7debcc" />
<img width="1411" alt="Screenshot 2025-06-02 at 11 11 19 AM" src="https://github.com/user-attachments/assets/c4405bfb-f066-45dd-af07-6ab88f786492" />
Payment Intent create -
```
curl --location 'http://localhost:8080/v2/payments/create-intent' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_kQqIhnCrULOPt4tmuP5v' \
--header 'Authorization: api-key=dev_Ku6SmaxCKhT5paf7bvG0QVtZq9skqpqkn2NznC6Ef5jWLD2aidCDeaby0i4DWThq' \
--header 'api-key: dev_Ku6SmaxCKhT5paf7bvG0QVtZq9skqpqkn2NznC6Ef5jWLD2aidCDeaby0i4DWThq' \
--data-raw '{
"amount_details": {
"order_amount": 100,
"currency": "USD"
},
"capture_method":"manual",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"first_name": "John",
"last_name": "Dough"
},
"email": "example@example.com"
},
"shipping": {
"address": {
"first_name": "John",
"last_name": "Dough",
"city": "Karwar",
"zip": "581301",
"state": "Karnataka"
},
"email": "example@example.com"
}
}'
```
use the client secret to confirm the intent
Confirm request -
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_01972f2414617513a2b2387237f61eb9/confirm-intent' \
--header 'x-client-secret: cs_01972f2414cb7720be7f596e088f9bfd' \
--header 'x-profile-id: pro_kQqIhnCrULOPt4tmuP5v' \
--header 'Authorization: api-key=dev_Ku6SmaxCKhT5paf7bvG0QVtZq9skqpqkn2NznC6Ef5jWLD2aidCDeaby0i4DWThq' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_47a62e65c5124ddab58d82c3bb4d0072' \
--data-raw '{
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "01",
"card_exp_year": "25",
"card_holder_name": "John Doe",
"card_cvc": "100"
},
"billing": {
"address": {
"first_name": "John",
"last_name": "Dough"
},
"email": "example@example.com"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"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"
}
}'
```
Confirm Intent Response -
here the payment went through stripe -
```
{
"id": "12345_pay_01972f2414617513a2b2387237f61eb9",
"status": "failed",
"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
},
"customer_id": null,
"connector": "stripe",
"created": "2025-06-02T05:36:23.178Z",
"payment_method_data": {
"billing": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"line3": null,
"zip": null,
"state": null,
"first_name": "John",
"last_name": "Dough"
},
"phone": null,
"email": "example@example.com"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector_transaction_id": null,
"connector_reference_id": null,
"merchant_connector_id": "mca_DfyZDqHCZErTASCW170f",
"browser_info": null,
"error": {
"code": "No error code",
"message": "No error message",
"unified_code": null,
"unified_message": null,
"network_advice_code": null,
"network_decline_code": null,
"network_error_message": 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
}
```
## 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`
- `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/payment_method_data.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`
- ... and 1 more files
**3. Core Business Logic**
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payment_methods/vault.rs`
- `crates/router/src/core/payments.rs`
- ... and 6 more files
**4. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/domain.rs`
**5. Configuration Files**
- `crates/payment_methods/Cargo.toml`
**6. Other**
- `crates/router/src/routes/payments.rs`
- `v2_migrations/2025-01-13-081847_drop_v1_columns/up.sql`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (21 changes)
- Extend existing types with new fields (75 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 8871f310:
Files to modify:
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- function: pub::get_co_badged_card_data
- function: pub::to_card_details_from_locker
- function: pub::get_issuer_country_alpha2
- function: private::from
- struct: pub::CardDetailsPaymentMethod
- impl: impl CardDetailsPaymentMethod
- impl: impl From<payment_methods::CardDetail> for CardDetailsPaymentMethod
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/routing.rs**
Add:
- struct: pub::RoutingData
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/vault.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Add:
- function: pub::route_connector_v2_for_payments
- function: private::get_pre_routing_result
- function: private::set_prerouting_algorithm_in_payment_intent
- function: private::get_pre_routing_result
- function: private::set_prerouting_algorithm_in_payment_intent
- function: private::get_pre_routing_result
- function: private::set_prerouting_algorithm_in_payment_intent
- function: private::get_pre_routing_result
- function: private::set_prerouting_algorithm_in_payment_intent
**crates/router/src/core/payments/helpers.rs**
Add:
- function: pub::get_connector_name
- function: pub::validate_routing_id_with_profile_id
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update_intent.rs**
Modify existing code
**crates/router/src/core/payments/retry.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/domain.rs**
Add:
- mod: private::routing
|
{"pr_number": 7709, "pr_title": "feat(payments): implement routing in payments v2", "merged_at": "2025-06-03T07:37:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs", "crates/hyperswitch_domain_models/src/routing.rs"], "core_business": ["crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_create_intent.rs", "crates/router/src/core/payments/operations/payment_update_intent.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/utils.rs"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/domain.rs"], "config": ["crates/payment_methods/Cargo.toml"], "other": ["crates/router/src/routes/payments.rs", "v2_migrations/2025-01-13-081847_drop_v1_columns/up.sql"]}, "change_types": {"structs_added": 2, "functions_added": 21, "fields_added": 75, "imports_added": 3, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): pass card network for external 3DS from additional_payment_method_data
## 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 -->
- card network fetch from db was not being populated in payment call resulting in sending the default value which failed the payment
- util function have been added to collect the card network from additional_payment_method_data
- ucaf_indicator is being populated for mastercard
- profile generic update is made optional to not update the force_3ds_challenge if it is passed as null
- External authentication is disabled for Datatrans
Note: hotfix raised against https://github.com/juspay/hyperswitch/pull/7473
### 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 MCA(Cybersource):
- Create MCA(Netcetera):
- Create a payment call (enable external 3ds):
```
{
"amount": 499,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "test_rec7",
"email": "guest@example.com",
"request_external_three_ds_authentication": true,
"customer_acceptance": {
"acceptance_type": "online"
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5512459816707531",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "Sakil Mostak",
"card_cvc": "737"
}
},
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here is some \n there is some \n none is some? \n ",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "CA",
"first_name": "Sakil",
"last_name": "Mostak"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"authentication_type": "three_ds"
}
```
Response should have the following data:
```
{
"payment_id": "pay_DJzWCB8vpM2nl6tti5q5",
"merchant_id": "merchant_1741687051",
"status": "requires_customer_action",
"amount": 499,
"net_amount": 499,
"shipping_cost": null,
"amount_capturable": 499,
"amount_received": null,
"connector": "cybersource",
"client_secret": "pay_DJzWCB8vpM2nl6tti5q5_secret_JwlJcjRW9Q5TRrlNKNrf",
"created": "2025-03-11T10:43:06.966Z",
"currency": "USD",
"customer_id": "test_rec7",
"customer": {
"id": "test_rec7",
"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": "7531",
"card_type": null,
"card_network": "Mastercard",
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "551245",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "Sakil Mostak",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_eappafndmAWU8SvNsaoy",
"shipping": null,
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here is some \n there is some \n none is some? \n ",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "CA",
"first_name": "Sakil",
"last_name": "Mostak"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"order_details": null,
"email": "guest@example.com",
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "three_ds_invoke",
"three_ds_data": {
"three_ds_authentication_url": "http://localhost:8080/payments/pay_DJzWCB8vpM2nl6tti5q5/3ds/authentication",
"three_ds_authorize_url": "http://localhost:8080/payments/pay_DJzWCB8vpM2nl6tti5q5/merchant_1741687051/authorize/cybersource",
"three_ds_method_details": {
"three_ds_method_key": "threeDSMethodData",
"three_ds_method_data_submission": true,
"three_ds_method_data": "eyJ0aHJlZURTTWV0aG9kTm90aWZpY2F0aW9uVVJMIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS8zZHMtbWV0aG9kLW5vdGlmaWNhdGlvbi11cmwiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6ImVkNmQ4Y2M1LWU2YTgtNDg4ZC05NDI4LWM2ZDRkZWY2ZDFlNiJ9",
"three_ds_method_url": "https://ndm-prev.3dss-non-prod.cloud.netcetera.com/acs/3ds-method"
},
"poll_config": {
"poll_id": "external_authentication_pay_DJzWCB8vpM2nl6tti5q5",
"delay_in_secs": 2,
"frequency": 5
},
"message_version": "2.3.1",
"directory_server_id": "A000000004"
}
},
"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": "test_rec7",
"created_at": 1741689786,
"expires": 1741693386,
"secret": "epk_71a1ecdc177e48a2af0172ad2bb14fc8"
},
"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_IauTXmHo2gR6Cufm1fXK",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_qJi1npMpCWiTuiL0rGOK",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": {
"authentication_flow": null,
"electronic_commerce_indicator": null,
"status": "pending",
"ds_transaction_id": "ed6d8cc5-e6a8-488d-9428-c6d4def6d1e6",
"version": "2.3.1",
"error_code": null,
"error_message": null
},
"external_3ds_authentication_attempted": true,
"expires_on": "2025-03-11T10:58:06.966Z",
"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-03-11T10:43:07.760Z",
"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"
}
```
- Create Challenge
```
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": "{{client_secret}}",
"device_channel": "BRW",
"threeds_method_comp_ind": "Y"
}'
```
- Response should contain following data:
```
{
"trans_status": "Y",
"acs_url": null,
"challenge_request": null,
"acs_reference_number": null,
"acs_trans_id": null,
"three_dsserver_trans_id": "ed6d8cc5-e6a8-488d-9428-c6d4def6d1e6",
"acs_signed_content": null,
"three_ds_requestor_url": "https://google.com"
}
```
- Authorize from Netcetera:
```
curl --location --request POST '{{baseurl}}/payments/{{payment_id}}/{{merchant_id}}/authorize/checkout' \
--header 'api-key:{{api_Key}}'
```
- Retrieve the transaction, the status should be succeeded in response, below is an example:
```
{
"payment_id": "pay_lTIv7ZbWr5Y237CqHXxq",
"merchant_id": "merchant_1741687051",
"status": "succeeded",
"amount": 499,
"net_amount": 499,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 499,
"connector": "cybersource",
"client_secret": "pay_lTIv7ZbWr5Y237CqHXxq_secret_cYx3O8cQMGUR2O1RVta9",
"created": "2025-03-11T10:28:34.005Z",
"currency": "USD",
"customer_id": "test_rec7",
"customer": {
"id": "test_rec7",
"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": "7531",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "551245",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "Sakil Mostak",
"payment_checks": {
"avs_response": {
"code": "X",
"codeRaw": "I1"
},
"card_verification": null
},
"authentication_data": null
},
"billing": null
},
"payment_token": "token_P8rNgP3WpYuJWLRgRWaz",
"shipping": null,
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here is some \n there is some \n none is some? \n ",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "CA",
"first_name": "Sakil",
"last_name": "Mostak"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"order_details": null,
"email": "guest@example.com",
"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": "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": "7416889232566498604807",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_lTIv7ZbWr5Y237CqHXxq_1",
"payment_link": null,
"profile_id": "pro_IauTXmHo2gR6Cufm1fXK",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_qJi1npMpCWiTuiL0rGOK",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": {
"authentication_flow": "frictionless",
"electronic_commerce_indicator": null,
"status": "success",
"ds_transaction_id": "19329442-7532-4e25-bc88-a5f1d99c1f5e",
"version": "2.3.1",
"error_code": null,
"error_message": null
},
"external_3ds_authentication_attempted": true,
"expires_on": "2025-03-11T10:43:34.005Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_Wfs6CcChddyjlx99kQKU",
"payment_method_status": "active",
"updated": "2025-03-11T10:28:43.771Z",
"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"
}
```
## 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/business_profile.rs`
**2. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payments/transformers.rs`
**3. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (4 changes)
**Detailed Identifier Changes:**
Commit abd3cd52:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_card_network_from_additional_payment_method_data
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
|
{"pr_number": 7545, "pr_title": "fix(router): pass card network for external 3DS from additional_payment_method_data", "merged_at": "2025-03-18T10:03:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs"]}, "change_types": {"functions_added": 2, "fields_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(core): introduce new field in payment_intent to handle longer return_url
## 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 -->
- A new field in introduced in payment_intent table called extended_return_url
- This deprecate the existing return_url field since it can take string only upto length 255
- extended_return_url can now take length upto 2048 size
- write is done into the new field (extended_return_url)
- read is backward compatible (return_url as fallback)
### 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 a Payment with return url length smaller than 2048
```
curl --location '{{baseUrl}}/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{api_key}}' \
--data-raw '{
"amount": 499,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "test_rec7",
"email": "guest@example.com",
"customer_acceptance": {
"acceptance_type": "online"
},
"return_url": "https://www.duckduckgo.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "02",
"card_exp_year": "26",
"card_holder_name": "Joseph Doe",
"card_cvc": "999"
},
"billing": {
"address": {
"line1": "8th block",
"line2": "8th block",
"line3": "8th block",
"city": "Bengaluru",
"state": "Karnataka",
"zip": "560095",
"country": "IN",
"first_name": "Sakil",
"last_name": "Mostak"
}
}
},
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here is some \n there is some \n none is some? \n ",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "CA",
"first_name": "Sakil",
"last_name": "Mostak"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"authentication_type": "three_ds"
}'
```
- Create a Payment with return url length greater than 2048
```
curl --location '{{baseUrl}}/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{api_key}}' \
--data-raw '{
"amount": 499,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "test_rec7",
"email": "guest@example.com",
"customer_acceptance": {
"acceptance_type": "online"
},
"return_url": "https://www.duckduckgo.comaaaqaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "02",
"card_exp_year": "26",
"card_holder_name": "Joseph Doe",
"card_cvc": "999"
},
"billing": {
"address": {
"line1": "8th block",
"line2": "8th block",
"line3": "8th block",
"city": "Bengaluru",
"state": "Karnataka",
"zip": "560095",
"country": "IN",
"first_name": "Sakil",
"last_name": "Mostak"
}
}
},
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here is some \n there is some \n none is some? \n ",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "CA",
"first_name": "Sakil",
"last_name": "Mostak"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"authentication_type": "three_ds"
}'
```
## 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_intent.rs`
- `crates/diesel_models/src/schema.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`
**4. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Commons.js`
- `cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js`
**5. Other**
- `api-reference/openapi_spec.json`
- `migrations/2025-05-25-185220_add-merchant_return_url-column-to-payment_intent/down.sql`
- `migrations/2025-05-25-185220_add-merchant_return_url-column-to-payment_intent/up.sql`
- ... and 1 more files
**Code Patterns Applied:**
- Extend existing types with new fields (30 changes)
**Detailed Identifier Changes:**
Commit a88eebde:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
|
{"pr_number": 8135, "pr_title": "refactor(core): introduce new field in payment_intent to handle longer return_url", "merged_at": "2025-06-07T10:03:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/schema.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_intent.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Commons.js", "cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js"], "other": ["api-reference/openapi_spec.json", "migrations/2025-05-25-185220_add-merchant_return_url-column-to-payment_intent/down.sql", "migrations/2025-05-25-185220_add-merchant_return_url-column-to-payment_intent/up.sql", "v2_migrations/2025-01-13-081847_drop_v1_columns/up.sql"]}, "change_types": {"fields_added": 30}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): add expiry year conversion for adyen mit transactions
## 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 MIT payments failing especially during NTID flow.
We previously used to get below error message during MIT Confirm call:
```log
"The provided Expiry Date is not valid.: Expiry year should be a 4 digit number greater than 2000: 30"
```
closes https://github.com/juspay/hyperswitch/issues/6850
### 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)?
-->
xecuted below commands:
```sh
# cherry picked commits from my cypress branch which is where the existence of this issue came into light
git cherry-pick -n ..cypress-delete-pm
# ran necessary migrations on the latest branch
just migrate
# started the server
cargo r
```
ran the cypress NTID tests for Adyen:
<img width="1425" alt="image" src="https://github.com/user-attachments/assets/6fea7809-854f-428b-be45-c2632a71f5a8" />
full test (based on #6735) -- no regressions found with 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. External Connector Integration**
- `crates/router/src/connector/adyen/transformers.rs`
**Detailed Identifier Changes:**
Commit c154a385:
Files to modify:
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
|
{"pr_number": 6851, "pr_title": "fix(connector): add expiry year conversion for adyen mit transactions", "merged_at": "2024-12-17T11:32:24Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"connectors": ["crates/router/src/connector/adyen/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payouts): [Nuvei] add payout 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 -->
- Add Cards Payout through Nuvei
- Add Webhook support for Payouts in Nuvei
- Propagate error from failure response in payouts
- Create webhook_url in PayoutsData Request to pass to Psp's
Note: hotfix pr raised against https://github.com/juspay/hyperswitch/pull/9618
### 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 (Nuvei):
Creata a Card Payouts:
```
curl --location '{{baseUrl}}/payouts/create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{api_key}}' \
--data-raw '{
"amount": 10,
"currency": "EUR",
"customer_id": "payout_customer",
"email": "payout_customer@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payout request",
"payout_type": "card",
"payout_method_data": {
"card": {
"card_number": "4000027891380961",
"expiry_month": "12",
"expiry_year": "2025",
"card_holder_name": "CL-BRW1"
}
},
"entity_type": "Individual",
"recurring": true,
"metadata": {
"ref": "123"
},
"auto_fulfill": true,
"confirm": true
}'
```
The response should be succeeded and you should receive an webhook
```
{
"payout_id": "payout_NOakA22TBihvGMX3h2Qb",
"merchant_id": "merchant_1759235409",
"merchant_order_reference_id": null,
"amount": 10,
"currency": "EUR",
"connector": "nuvei",
"payout_type": "card",
"payout_method_data": {
"card": {
"card_issuer": null,
"card_network": null,
"card_type": null,
"card_issuing_country": null,
"bank_code": null,
"last4": "0961",
"card_isin": "400002",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "2025",
"card_holder_name": "CL-BRW1"
}
},
"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_NOakA22TBihvGMX3h2Qb_secret_jCqeQBT3uVeU77Oth6Pl",
"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_cDe3Fa7sUarn7ryqAMOk",
"status": "success",
"error_message": null,
"error_code": null,
"profile_id": "pro_9bk44BClwKvHHsVHiRIV",
"created": "2025-09-30T12:40:14.361Z",
"connector_transaction_id": "7110000000017707955",
"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_WkPPJd9Tr9Mnmw73fkG5"
}
```
Payout success event should be received and webhook should be source verified
<img width="1053" height="181" alt="image" src="https://github.com/user-attachments/assets/d1faab18-43ad-4d1b-92cc-1e1a60617d73" />
<img width="1048" height="155" alt="image" src="https://github.com/user-attachments/assets/108502c2-630c-40b7-a1ee-4d794ce53f71" />
## 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`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
**3. Core Business Logic**
- `crates/router/src/core/payouts.rs`
- `crates/router/src/core/utils.rs`
**4. External Connector Integration**
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- ... and 6 more files
**5. Tests**
- `config/deployments/integration_test.toml`
**6. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 1 more files
**7. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (16 changes)
- Extend existing types with new fields (82 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 4e2e2b31:
Files to modify:
**crates/api_models/src/enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nuvei.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::has_payout_prefix
- impl: impl api::Payouts for Nuvei
- impl: impl api::PayoutFulfill for Nuvei
- impl: impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Nuvei
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Add:
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::from
- function: private::from
- function: pub::map_notification_to_event_for_payout
- struct: pub::NuveiPayoutRequest
- struct: pub::NuveiPayoutUrlDetails
- struct: pub::NuveiPayoutCardData
- struct: pub::NuveiPayoutSuccessResponse
- struct: pub::NuveiPayoutErrorResponse
- enum: pub::NuveiPayoutResponse
- impl: impl TryFrom<api_models::payouts::PayoutMethodData> for NuveiPayoutCardData
- impl: impl TryFrom<&types::PayoutsRouterData<F>> for NuveiPayoutRequest
- impl: impl TryFrom<PayoutsResponseRouterData<PoFulfill, NuveiPayoutResponse>> for types::PayoutsRouterData<PoFulfill>
- impl: impl From<NuveiTransactionStatus> for enums::PayoutStatus
- impl: impl From<NuveiPaymentStatus> for enums::PayoutStatus
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_webhook_url
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/router/src/core/payouts.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
|
{"pr_number": 9635, "pr_title": "feat(payouts): [Nuvei] add payout flows", "merged_at": "2025-10-01T12:46:51Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/enums.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payouts.rs", "crates/router/src/core/utils.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/nuvei.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/tests/connectors/utils.rs"], "tests": ["config/deployments/integration_test.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json"]}, "change_types": {"structs_added": 5, "functions_added": 16, "enums_added": 1, "fields_added": 82, "imports_added": 4, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor: [Netcetera] Handle response deserialization error
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
- Handle response deserialization error
- three_ds_requestor_challenge_ind can be vector or string
### 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?
Sanity flow with netcetra and cybersource
Profile update
```
curl --location 'http://localhost:8080/account/merchant_1755510755/business_profile/pro_BwyTBsmG8NfDWCJNSozM' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_QBdrxdNVk1Qi1kfHVAxfkkN4It60LAsZB1Zfb1SWaXePTncdQ8qS6v0ikHyHcXJy' \
--data '{
"authentication_connector_details": {
"authentication_connectors": ["netcetera"],
"three_ds_requestor_url": "https://google.com"
}
}'
```
Response
```
{
"merchant_id": "merchant_1755510755",
"profile_id": "pro_BwyTBsmG8NfDWCJNSozM",
"profile_name": "US_default",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "iCpLwpK7rw6BuAvVHhA4n73QtuDLJ82MUwAqMzWsiAhytB8SnxVVjrqRmOhRuLD4",
"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": null,
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true,
"payment_statuses_enabled": null,
"refund_statuses_enabled": null,
"payout_statuses_enabled": null
},
"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": {
"authentication_connectors": [
"netcetera"
],
"three_ds_requestor_url": "https://google.com",
"three_ds_requestor_app_url": 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,
"is_pre_network_tokenization_enabled": false,
"acquirer_configs": null,
"is_iframe_redirection_enabled": null,
"merchant_category_code": null,
"merchant_country_code": null,
"dispute_polling_interval": null
}
```
Card request
```
{
"amount": 2540,
"currency": "USD",
"profile_id": "pro_BwyTBsmG8NfDWCJNSozM",
"confirm": true,
"amount_to_capture": 2540,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"request_external_three_ds_authentication": true,
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"setup_future_usage": "on_session",
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"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"
}
},
"routing": {
"type": "single",
"data": "nmi"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4035 5014 2814 6300",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
// "card_network": "CartesBancaires"
}
},
"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"
}
}
}
```
response
```
{
"payment_id": "pay_VIDTWLGUcRV3CD9htaVR",
"merchant_id": "merchant_1755510755",
"status": "requires_customer_action",
"amount": 2540,
"net_amount": 2540,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "cybersource",
"client_secret": "pay_VIDTWLGUcRV3CD9htaVR_secret_oQT12tBHvaPkuODXoyex",
"created": "2025-08-19T10:17:28.860Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "abcdef123@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "6300",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "403550",
"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": "token_V0xBNOlCVuSJuByMCfEB",
"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://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": {
"type": "three_ds_invoke",
"three_ds_data": {
"three_ds_authentication_url": "http://localhost:8080/payments/pay_VIDTWLGUcRV3CD9htaVR/3ds/authentication",
"three_ds_authorize_url": "http://localhost:8080/payments/pay_VIDTWLGUcRV3CD9htaVR/merchant_1755510755/authorize/cybersource",
"three_ds_method_details": {
"three_ds_method_key": "threeDSMethodData",
"three_ds_method_data_submission": true,
"three_ds_method_data": "eyJ0aHJlZURTTWV0aG9kTm90aWZpY2F0aW9uVVJMIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS8zZHMtbWV0aG9kLW5vdGlmaWNhdGlvbi11cmwiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjNiMGRhOGE5LWJhY2UtNGNlMS05NWI4LTJhMWNmOTlmOThhOCJ9",
"three_ds_method_url": "https://ndm-prev.3dss-non-prod.cloud.netcetera.com/acs/3ds-method"
},
"poll_config": {
"poll_id": "external_authentication_pay_VIDTWLGUcRV3CD9htaVR",
"delay_in_secs": 2,
"frequency": 5
},
"message_version": "2.3.1",
"directory_server_id": "A000000003"
}
},
"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": 1755598648,
"expires": 1755602248,
"secret": "epk_fd1d2eec8768439685e62ee45dabb4bc"
},
"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_BwyTBsmG8NfDWCJNSozM",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_dRvP71fPP5fDcWrMaE2z",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": {
"authentication_flow": null,
"electronic_commerce_indicator": null,
"status": "pending",
"ds_transaction_id": "3b0da8a9-bace-4ce1-95b8-2a1cf99f98a8",
"version": "2.3.1",
"error_code": null,
"error_message": null
},
"external_3ds_authentication_attempted": true,
"expires_on": "2025-08-19T10:32:28.860Z",
"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-08-19T10:17:29.573Z",
"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
}
Create challenge
```
curl --location 'http://localhost:8080/payments/pay_VIDTWLGUcRV3CD9htaVR/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_5b6e1d248e7f412eaba54679208f9a84' \
--data '{
"client_secret": "pay_VIDTWLGUcRV3CD9htaVR_secret_oQT12tBHvaPkuODXoyex",
"device_channel": "BRW",
"threeds_method_comp_ind": "Y"
}'
Response
```
{
"trans_status": "C",
"acs_url": "https://ndm-prev.3dss-non-prod.cloud.netcetera.com/acs/challenge",
"challenge_request": "eyJtZXNzYWdlVHlwZSI6IkNSZXEiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjNiMGRhOGE5LWJhY2UtNGNlMS05NWI4LTJhMWNmOTlmOThhOCIsImFjc1RyYW5zSUQiOiJlNjcxYWM4ZS0wZWEyLTRhNzQtOGY5NC0zMzAyMDRhMWI3NmUiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMy4xIn0",
"acs_reference_number": "3DS_LOA_ACS_201_13579",
"acs_trans_id": "e671ac8e-0ea2-4a74-8f94-330204a1b76e",
"three_dsserver_trans_id": "3b0da8a9-bace-4ce1-95b8-2a1cf99f98a8",
"acs_signed_content": null,
"three_ds_requestor_url": "https://google.com",
"three_ds_requestor_app_url": 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. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types/authentication.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit 08166991:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs**
Add:
- enum: pub::ThreedsRequestorChallengeInd
|
{"pr_number": 8988, "pr_title": "refactor: [Netcetera] Handle response deserialization error ", "merged_at": "2025-08-19T11:19:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_request_types/authentication.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs"]}, "change_types": {"enums_added": 1, "fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(utils): match string for state with SDK's naming convention
## 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 -->
string value for each state is being refactored to the values provided by the the given file: https://github.com/juspay/hyperswitch-web/edit/main/src/States.json
### 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. External Connector Integration**
- `crates/hyperswitch_connectors/src/utils.rs`
**2. Other**
- `crates/common_enums/src/enums.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (42 changes)
**Detailed Identifier Changes:**
Commit f3ca2009:
Files to modify:
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
|
{"pr_number": 7300, "pr_title": "refactor(utils): match string for state with SDK's naming convention", "merged_at": "2025-02-19T11:00:15Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/utils.rs"], "other": ["crates/common_enums/src/enums.rs"]}, "change_types": {"fields_added": 42}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): Use SignatureKey for VGS auth_type
## 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 VGS auth type from BodyKey to SignatureKey
### 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 #9067
## 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/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_v2_WmQmWko8QabakxqCypsz' \
--header 'x-profile-id: pro_vnTuyThRZPNGRWjIHrIt' \
--header 'Authorization: admin-api-key=test_admin' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "vault_processor",
"connector_name": "vgs",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "[REDACTED]",
"key1": "[REDACTED]",
"api_secret": "[REDACTED]"
},
"frm_configs": null,
"connector_webhook_details": {
"merchant_secret": ""
},
"profile_id": "pro_vnTuyThRZPNGRWjIHrIt"
}'
Response:
```json
{
"connector_type": "vault_processor",
"connector_name": "vgs",
"connector_label": "vgs_businesss",
"id": "mca_VsS4aBqNwMcPptFn4ZPL",
"profile_id": "pro_vnTuyThRZPNGRWjIHrIt",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "US********************q4",
"key1": "ca********************************07",
"api_secret": "st*ff"
},
"payment_methods_enabled": null,
"connector_webhook_details": {
"merchant_secret": "",
"additional_secret": null
},
"metadata": null,
"disabled": false,
"frm_configs": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null,
"feature_metadata": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 1ff2ed94:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs**
Modify existing code
|
{"pr_number": 9068, "pr_title": "fix(connector): Use SignatureKey for VGS auth_type", "merged_at": "2025-08-28T02:44:22Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "connector"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): add validation to check if routable connector supports network tokenization in CIT repeat flow
## 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 -->
Currently we always fetch network token for the connector that does not support network tokenization.
Fix: we ll only fetch network token if the connector supports network tokenization else fetch card details to make CIT repeat.
### 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 cases -
Create two MCA ex - Cybersource(network tokenization supported conn), Adyen
enable network tokenization for business profile
Make saved card flow transaction.
when routable connector list - [Cybersource, Adyen] -> payment should happen with Network token + cryptogram
when routable connector list - [ Adyen, Cybersource] -> payment should happen with card+cvc
CIT -
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api-key' \
--data-raw '{
"amount": 10,
"amount_to_capture": 10,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "customer1733733309",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"setup_future_usage": "off_session",
"return_url": "http://127.0.0.1:4040/",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "card_number",
"card_exp_month": "card_exp_month",
"card_exp_year": "card_exp_year",
"card_holder_name": "joseph Doe",
"card_cvc": "947"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
},
"email": "soppa@gmail.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": "125.0.0.1"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
## 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.rs`
- `crates/router/src/core/payments/helpers.rs`
**Code Patterns Applied:**
- 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 9f0d8efa:
Files to modify:
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
|
{"pr_number": 6749, "pr_title": "fix(core): add validation to check if routable connector supports network tokenization in CIT repeat flow", "merged_at": "2024-12-10T12:40:31Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/payment_methods.rs", "crates/router/src/core/payments/helpers.rs"]}, "change_types": {"fields_added": 2, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [ACI] 3DS, connector mandate id, error handling fixed
## 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. For different creds, ACI sends different redirection_data (for default account setting and the one with proper 3DS configuration). This PR handles both types of responses.
2. `connector_mandate_id` is populated.
3. Error handling added for payments that failed in redirection page.
### 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`
4. `crates/router/src/configs`
5. `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)?
-->
<details>
<summary>1. No 3DS</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_epFDmKUa7NgLAHjaVqzosie9XFxtUWGg7mPpvRCxO1Ca8jpnG61onOfuDuVFvDDs' \
--data-raw '{
"amount": 6540,
"currency": "EUR",
"amount_to_capture": 6540,
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "no_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",
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5386024192625914",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "737",
"card_network": "Mastercard"
}
},
"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"
}
],
"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"
}
},
"payment_link": false,
"payment_link_config": {
"theme": "",
"logo": "",
"seller_name": "",
"sdk_layout": "",
"display_sdk_only": false,
"enabled_saved_payment_method": false
},
"payment_type": "normal"
}
'
```
Response
```
{"payment_id":"pay_QGmgxuHIDXUgHII6NNmx","merchant_id":"merchant_1757933948","status":"succeeded","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":0,"amount_received":6540,"connector":"aci","client_secret":"pay_QGmgxuHIDXUgHII6NNmx_secret_x4I2YeJaxhH9JVNuMBAb","created":"2025-09-15T11:01:08.620Z","currency":"EUR","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":"card","payment_method_data":{"card":{"last4":"5914","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"538602","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":"joseph","last_name":"Doe","origin_zip":null},"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","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"order_details":[{"sku":null,"upc":null,"brand":null,"amount":6540,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"description":null,"product_name":"Apple iphone 15","product_type":null,"sub_category":null,"total_amount":null,"commodity_code":null,"unit_of_measure":null,"product_img_link":null,"product_tax_code":null,"total_tax_amount":null,"requires_shipping":null,"unit_discount_amount":null}],"email":"customer@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":"customer123","created_at":1757934068,"expires":1757937668,"secret":"epk_b8e9152acbd24ee0ac061baa0617feb1"},"manual_retry_allowed":false,"connector_transaction_id":"8ac7a4a0994cf69201994d09282331fe","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":"8ac7a4a0994cf69201994d09282331fe","payment_link":null,"profile_id":"pro_j4CnihpZTrXIjSNPUsNh","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_lVE0EwNLMYRHDpNBmVlA","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-09-15T11:16:08.620Z","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_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-09-15T11:01:09.918Z","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}
```
</details>
<details>
<summary>2. 3DS</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_epFDmKUa7NgLAHjaVqzosie9XFxtUWGg7mPpvRCxO1Ca8jpnG61onOfuDuVFvDDs' \
--data-raw '{
"amount": 6540,
"currency": "EUR",
"amount_to_capture": 6540,
"confirm": true,
"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",
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4200000000000042",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "737",
"card_network": "Mastercard"
}
},
"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"
}
],
"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"
}
},
"payment_link": false,
"payment_link_config": {
"theme": "",
"logo": "",
"seller_name": "",
"sdk_layout": "",
"display_sdk_only": false,
"enabled_saved_payment_method": false
},
"payment_type": "normal"
}
'
```
Response
```
{"payment_id":"pay_jrngVtebxn7T4AaHet1M","merchant_id":"merchant_1757933948","status":"requires_customer_action","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":6540,"amount_received":null,"connector":"aci","client_secret":"pay_jrngVtebxn7T4AaHet1M_secret_zPycDPRI28mHm74opFzt","created":"2025-09-15T11:04:30.938Z","currency":"EUR","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":"card","payment_method_data":{"card":{"last4":"0042","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"420000","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":"joseph","last_name":"Doe","origin_zip":null},"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","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"order_details":[{"sku":null,"upc":null,"brand":null,"amount":6540,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"description":null,"product_name":"Apple iphone 15","product_type":null,"sub_category":null,"total_amount":null,"commodity_code":null,"unit_of_measure":null,"product_img_link":null,"product_tax_code":null,"total_tax_amount":null,"requires_shipping":null,"unit_discount_amount":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":{"type":"redirect_to_url","redirect_to_url":"http://localhost:8080/payments/redirect/pay_jrngVtebxn7T4AaHet1M/merchant_1757933948/pay_jrngVtebxn7T4AaHet1M_1"},"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":"customer123","created_at":1757934270,"expires":1757937870,"secret":"epk_79c3da22f470438e87512a7cf3f02f5c"},"manual_retry_allowed":null,"connector_transaction_id":"8ac7a49f994ceb6701994d0c30a371ef","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":"8ac7a49f994ceb6701994d0c30a371ef","payment_link":null,"profile_id":"pro_j4CnihpZTrXIjSNPUsNh","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_lVE0EwNLMYRHDpNBmVlA","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-09-15T11:19:30.938Z","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_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-09-15T11:04:32.598Z","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}
```
</details>
<details>
<summary>3. Normal CIT (connector_mandate_id is populated)</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_ZDCvcDb99HXoXMPfhYH80zn1SxdQgd5k9hZRuGCgXc8NqpE6xLybm4fAnbt9ajyX' \
--data-raw '{
"amount": 6540,
"currency": "EUR",
"amount_to_capture": 6540,
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "no_three_ds",
"setup_future_usage": "off_session",
"customer": {
"id": "customer123",
"name": "John Doe",
"email": "customer@gmail.com",
"phone": "9999999999",
"phone_country_code": "+1"
},
"force_3ds_challenge":true,
"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": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5454545454545454",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "737",
"card_network": "Mastercard"
}
},
"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"
}
},
"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
}'
```
</details>
<details>
<summary>4. Corresponding MIT</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ZDCvcDb99HXoXMPfhYH80zn1SxdQgd5k9hZRuGCgXc8NqpE6xLybm4fAnbt9ajyX' \
--data '{
"amount": 1000,
"currency": "EUR",
"customer_id": "customer123",
"description": "Subsequent Mandate Test Payment (MIT from New CIT Demo)",
"confirm": true,
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "pm_q7MPhjU2C4ESToibANUP"
}
}
'
```
Response:
```
{"payment_id":"pay_oZojObfAq51KOloVFqaz","merchant_id":"merchant_1758091392","status":"succeeded","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":0,"amount_received":1000,"connector":"aci","client_secret":"pay_oZojObfAq51KOloVFqaz_secret_lyPemnJRzLpowy3oHQr4","created":"2025-09-17T10:27:46.593Z","currency":"EUR","customer_id":"customer123","customer":{"id":"customer123","name":"John Doe","email":"customer@gmail.com","phone":"9999999999","phone_country_code":"+1"},"description":"Subsequent Mandate Test Payment (MIT from New CIT Demo)","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":true,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"5454","card_type":null,"card_network":"Mastercard","card_issuer":null,"card_issuing_country":null,"card_isin":"545454","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":null,"billing":null,"order_details":null,"email":"customer@gmail.com","name":"John Doe","phone":"9999999999","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":"customer123","created_at":1758104866,"expires":1758108466,"secret":"epk_494edf4e77694e87957fd33bc06f442c"},"manual_retry_allowed":false,"connector_transaction_id":"8ac7a4a29954a312019957373b1f5423","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":"8ac7a4a29954a312019957373b1f5423","payment_link":null,"profile_id":"pro_NqB8390WmB1tf7HTqW13","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_gQxjoWkinnB11T360xVf","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-09-17T10:42:46.593Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_q7MPhjU2C4ESToibANUP","network_transaction_id":null,"payment_method_status":"active","updated":"2025-09-17T10:27:47.977Z","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":"8ac7a4a09954a1ce01995735a3585e19","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}
```
</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 **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/aci/transformers.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (58 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit eccc7221:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/aci/transformers.rs**
Add:
- function: private::get_recurring_type
- enum: pub::AciRecurringType
|
{"pr_number": 9367, "pr_title": "fix(connector): [ACI] 3DS, connector mandate id, error handling fixed", "merged_at": "2025-09-17T17:59:19Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/aci/transformers.rs"]}, "change_types": {"functions_added": 1, "enums_added": 1, "fields_added": 58, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Add Support for redirection inside Iframe
## 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 pull request introduces support for **payment redirection inside an iframe**.
- **New flag added**:
- `is_iframe_redirection_enabled` has been introduced in both:
- `PaymentIntent`
- `BusinessProfile`
- **New `NextActionType`**:
- Added `RedirectInsidePopup` to `NextActionType` and `NextActionData` enums to support redirection within a popup (iframe-based).
## Behavior of `is_iframe_redirection_enabled`
- The flag is resolved in the following order of precedence:
1. The value provided in the **`PaymentIntent`** request (if explicitly set)
2. If not set in the request, the value from the **`BusinessProfile`** is used
3. If the flag is **not set in either place**, **iframe redirection is disabled by default**
## Flag Resolution Scenarios
| Case | PaymentIntent Flag | BusinessProfile Flag | Resulting Behavior |
|------|---------------------|----------------------|---------------------------------|
| 1 | `true` | `false` | Iframe redirection **enabled** |
| 2 | `false` | `true` | Iframe redirection **disabled** |
| 3 | *not set* | `true` | Iframe redirection **enabled** |
| 4 | *not set* | `false` or *not set* | Iframe redirection **disabled** |
### 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).
-->
## 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)?
-->
### 🟢 Case 1: `PaymentIntent = true`, `BusinessProfile = false`
| Attribute | Value |
|---------------------|-----------------------------------------|
| **PaymentIntent** | `"is_iframe_redirection_enabled": true` |
| **BusinessProfile** | `"is_iframe_redirection_enabled": false`|
| **Expected Result** | Iframe redirection **enabled** |
| **NextActionType** | `RedirectInsidePopup` |
https://github.com/user-attachments/assets/da07cb01-411f-40e1-a0bf-ce20ca178d0e
### 🟢 Case 1: `PaymentIntent = False`, `BusinessProfile = True`
https://github.com/user-attachments/assets/f40cbc56-f77d-4187-8231-aef06e4abe93
**This change is done only for cards 3ds where we get the authenticationData .**
https://github.com/user-attachments/assets/0b812d06-20f5-4188-a1f7-6e7e332723bb
## 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`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/payment_intent.rs`
- `crates/diesel_models/src/schema.rs`
- ... and 1 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
- `crates/hyperswitch_domain_models/src/payments.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payments.rs`
- ... and 7 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/api/admin.rs`
**6. Utils**
- `crates/router/src/utils/user/sample_data.rs`
**7. Tests**
- `crates/router/tests/payments.rs`
- `crates/router/tests/payments2.rs`
**8. Other**
- `migrations/2025-05-05-104001_is_iframe_redirection_enabled_to_business_profile/down.sql`
- `migrations/2025-05-05-104001_is_iframe_redirection_enabled_to_business_profile/up.sql`
- `migrations/2025-05-06-121325_is_iframe_redirection_enabled_to_payment_intent/down.sql`
- ... and 1 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (128 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit 831149c9:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/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/core/admin.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/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update_intent.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Add:
- function: pub::get_html_redirect_response_popup
**crates/router/src/types/api/admin.rs**
Modify existing code
**crates/router/src/utils/user/sample_data.rs**
Modify existing code
**crates/router/tests/payments.rs**
Modify existing code
**crates/router/tests/payments2.rs**
Modify existing code
|
{"pr_number": 7976, "pr_title": "feat(core): Add Support for redirection inside Iframe ", "merged_at": "2025-05-15T11:46:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "order"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs", "crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs"], "core_business": ["crates/router/src/core/admin.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/operations/payment_update.rs", "crates/router/src/core/payments/operations/payment_update_intent.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/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/api/admin.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "tests": ["crates/router/tests/payments.rs", "crates/router/tests/payments2.rs"], "other": ["migrations/2025-05-05-104001_is_iframe_redirection_enabled_to_business_profile/down.sql", "migrations/2025-05-05-104001_is_iframe_redirection_enabled_to_business_profile/up.sql", "migrations/2025-05-06-121325_is_iframe_redirection_enabled_to_payment_intent/down.sql", "migrations/2025-05-06-121325_is_iframe_redirection_enabled_to_payment_intent/up.sql"]}, "change_types": {"functions_added": 1, "fields_added": 128, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Add three_ds_requestor_app_url in business_profile
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [X] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Add `three_ds_requestor_app_url` in business profile
Context: This is for merchant app declaring their URL within the CReq message so that the Authentication app can call the Merchant app after OOB authentication has occurred.
Scenario:
- A user is making a purchase on a merchant's mobile app.
- The transaction requires OOB authentication (e.g., through a separate authentication app).
- The merchant app needs to tell the authentication app where to send the user back after authentication.
- `three_ds_requestor_app_url` will contain the merchant's mobile app url
### 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)?
-->
### Update business profile with three_ds_requestor_app_url
**curl**
`curl --location --request POST 'http://localhost:8080/account/merchant_1742547204/business_profile/pro_6298oBgpw27s6v1QqYQs' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
"collect_billing_details_from_wallet_connector": false,
"collect_shipping_details_from_wallet_connector": false,
"always_collect_shipping_details_from_wallet_connector": true,
"always_collect_billing_details_from_wallet_connector": true,
"authentication_connector_details": {
"authentication_connectors": [],
"three_ds_requestor_url": "https://app.hyperswitch.io/dashboard/payment-settings/pro_6298oBgpw27s6v1QqYQs",
"three_ds_requestor_app_url": "merchantapp://auth/success?transactionId=1234567890"
}
}'`
<img width="1209" alt="Screenshot 2025-03-21 at 14 39 38" src="https://github.com/user-attachments/assets/51909e98-6b20-4d5f-8213-c5f2592ea4a3" />
### Create 3ds payment with external authentication
`curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_32udksJbcR2pLlvH67LsV6Iaaxfw5CQ0BqIZyRzGUwDqTfIEcXT9LCNCyAZwbQhH' \
--data-raw '{
"amount": 10000,
"currency": "EUR",
"confirm": true,
"payment_link": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 10000,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"request_external_three_ds_authentication": true,
"authentication_type": "three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4000 0000 0000 1091",
"card_exp_month": "12",
"card_exp_year": "2025",
"card_cvc": "000"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "Henry",
"last_name": "Henry"
},
"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": {
"dg": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'`
<img width="1209" alt="Screenshot 2025-03-21 at 16 43 31" src="https://github.com/user-attachments/assets/64ecc1af-3052-44c4-bcd7-a6e67ec9fc86" />
### Create External 3DS Authentication
`curl --location --request POST 'localhost:8080/payments/pay_xhce13K4UclicVA0Q0IZ/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_a9a46d8a885940a3bf543ba1f8df66d7' \
--data-raw '{
"client_secret": "pay_xhce13K4UclicVA0Q0IZ_secret_TOYbtoZx1IFCx8Muuz8t",
"device_channel": "BRW",
"threeds_method_comp_ind": "Y"
}'`
<img width="1230" alt="Screenshot 2025-03-21 at 16 47 22" src="https://github.com/user-attachments/assets/781aae10-302c-4c49-bdb7-5ade31b929ee" />
## 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`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments.rs`
**4. Type Definitions**
- `crates/router/src/types/transformers.rs`
**5. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Extend existing types with new fields (6 changes)
**Detailed Identifier Changes:**
Commit 2ad2e508:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 7589, "pr_title": "feat(core): Add three_ds_requestor_app_url in business_profile", "merged_at": "2025-03-24T11:30:28Z", "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"], "database": ["crates/diesel_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/payments.rs"], "types": ["crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"fields_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat: add support for 3ds exemption rules in euclid crate
## 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 3ds exemption rules in euclid crate
add
DirKeyKind::IssuerName - Name of the card issuing bank
DirKeyKind::IssuerCountry - Country of the card issuing bank
DirKeyKind::CustomerDevicePlatform - Platform of the customer's device (Web, Android, iOS)
DirKeyKind::CustomerDeviceType - Type of the customer's device (Mobile, Tablet, Desktop, Gaming Console)
DirKeyKind::CustomerDeviceDisplaySize - Display size of the customer's device (e.g., 500x600)
DirKeyKind::AcquirerCountry - Country of the acquiring bank
DirKeyKind::AcquirerFraudRate - Fraud rate of the acquiring bank
These keys would be required for setting up 3DS Exemption Rules
Possible outcomes for 3DS decision rules:
/// No 3DS authentication required
NoThreeDs,
/// Mandate 3DS Challenge
ChallengeRequested,
/// Prefer 3DS Challenge
ChallengePreferred,
/// Request 3DS Exemption, Type: Transaction Risk Analysis (TRA)
ThreeDsExemptionRequestedTra,
/// Request 3DS Exemption, Type: Low Value Transaction
ThreeDsExemptionRequestedLowValue,
/// No challenge requested by merchant (e.g., delegated authentication)
IssuerThreeDsExemptionRequested,
### 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)?
-->
Compiler guided
## 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_types/src/lib.rs`
- `crates/common_types/src/three_ds_decision_rule_engine.rs`
- `crates/euclid/src/types.rs`
**2. Other**
- `crates/euclid/src/dssa/graph.rs`
- `crates/euclid/src/frontend/ast/lowering.rs`
- `crates/euclid/src/frontend/dir.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 (1 changes)
**Detailed Identifier Changes:**
Commit 34dd99d8:
Files to modify:
**crates/common_types/src/lib.rs**
Add:
- mod: pub::three_ds_decision_rule_engine
**crates/common_types/src/three_ds_decision_rule_engine.rs**
Add:
- struct: pub::ThreeDSDecisionRule
- enum: pub::ThreeDSDecision
- impl: impl EuclidDirFilter for ThreeDSDecisionRule
**crates/euclid/src/dssa/graph.rs**
Modify existing code
**crates/euclid/src/frontend/ast/lowering.rs**
Modify existing code
**crates/euclid/src/frontend/dir.rs**
Modify existing code
**crates/euclid/src/frontend/dir/enums.rs**
Add:
- enum: pub::CustomerDevicePlatform
- enum: pub::CustomerDeviceType
- enum: pub::CustomerDeviceDisplaySize
**crates/euclid/src/frontend/dir/lowering.rs**
Modify existing code
**crates/euclid/src/types.rs**
Modify existing code
**crates/euclid_wasm/src/lib.rs**
Add:
- function: pub::get_three_ds_decision_rule_engine_keys
|
{"pr_number": 8013, "pr_title": "feat: add support for 3ds exemption rules in euclid crate", "merged_at": "2025-05-16T14:25:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "merchant", "card"]}, "hierarchy": {"types": ["crates/common_types/src/lib.rs", "crates/common_types/src/three_ds_decision_rule_engine.rs", "crates/euclid/src/types.rs"], "other": ["crates/euclid/src/dssa/graph.rs", "crates/euclid/src/frontend/ast/lowering.rs", "crates/euclid/src/frontend/dir.rs", "crates/euclid/src/frontend/dir/enums.rs", "crates/euclid/src/frontend/dir/lowering.rs", "crates/euclid_wasm/src/lib.rs"]}, "change_types": {"structs_added": 1, "functions_added": 1, "enums_added": 4, "fields_added": 1, "imports_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(users): Add force rotate password on first login for non-email flow
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Currently in non-email flow, users who are invited are not forced to change their password. This PR will add that.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR 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 [#6482](https://github.com/juspay/hyperswitch/issues/6482).
## 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. Invite a new user in non-email flow
```
curl --location 'http://localhost:8080/user/user/invite_multiple?token_only=true' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiN2I2NTA1NGQtNjgzNC00NzU2LTgyNDYtN2RkOWM1ZmQzMzRmIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI5MTc4MDgzIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMDk4MzEyOSwib3JnX2lkIjoib3JnXzRiYWFjbHZxUklJTEl2a25NdnZQIiwicHJvZmlsZV9pZCI6InByb18yOUFWY0ltVnFDYTV1UHdMMzlQWCJ9.E5ZfkG5y0tqGa_vzGXe5LTJlyljqP8tKs1T2qokRtr0' \
--data-raw '[
{
"email": "new email",
"name": "name",
"role_id": "merchant_view_only"
}
]'
```
```json
[
{
"email": "email from request",
"is_email_sent": false,
"password": "4724b955-bc1d-4565-bbb6-1a09b2372bfaA"
}
]
```
2. Sign in as the new user
```
curl --location 'http://localhost:8080/user/v2/signin' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "email used in invite",
"password": "password from invite API response"
}'
```
```json
{
"token": "TOTP SPT",
"token_type": "totp"
}
```
3. Terminate 2FA (This API should give reset password SPT)
```
curl --location 'http://localhost:8080/user/2fa/terminate?skip_two_factor_auth=true' \
--header 'Authorization: TOTP SPT' \
```
```json
{
"token": "Force set password SPT",
"token_type": "force_set_password"
}
```
## 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/router/src/types/domain/user.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (13 changes)
**Detailed Identifier Changes:**
Commit b43033c2:
Files to modify:
**crates/router/src/types/domain/user.rs**
Add:
- function: private::deref
- struct: pub::NewUserPassword
- impl: impl Deref for NewUserPassword
|
{"pr_number": 6483, "pr_title": "fix(users): Add force rotate password on first login for non-email flow", "merged_at": "2024-11-07T10:37:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "token"]}, "hierarchy": {"types": ["crates/router/src/types/domain/user.rs"]}, "change_types": {"structs_added": 1, "functions_added": 1, "fields_added": 13, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment_methods_v2): add total-payment-method-count api
## 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 -->
add total-payment-method-count api. this is olap api to fetch total count of payment method of customer of given merchant id
### 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)?
-->
req curl -
```
curl --location 'http://localhost:8080/v2/customers/total-payment-methods' \
--header 'x-profile-id: pro_i9LGtymazprJz3PG4aam' \
--header 'api-key: dev_QetiSV8rA4A92lmwb52ZJxE7BX8mnLLeQyr6CUoTh745dCfu2A33MVyXKdjKE0Ka'
```
resp -
```
{
"total_count": 3
}
```
<img width="1146" alt="Screenshot 2025-03-12 at 11 08 57 AM" src="https://github.com/user-attachments/assets/635f6d97-690e-44dd-971d-5a62b261a4b9" />
verification:-
<img width="1146" alt="Screenshot 2025-03-12 at 11 28 58 AM" src="https://github.com/user-attachments/assets/9702edd1-9a72-4144-adc2-d887afc48a3f" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] 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/payment_methods.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/payment_method.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payment_methods.rs`
**4. Core Business Logic**
- `crates/router/src/core/payment_methods.rs`
**5. Type Definitions**
- `crates/router/src/types/api/payment_methods.rs`
- `crates/router_env/src/logger/types.rs`
**6. Utils**
- `crates/router/src/routes/lock_utils.rs`
**7. Other**
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/routes/app.rs`
- `crates/router/src/routes/payment_methods.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (13 changes)
- Extend existing types with new fields (24 changes)
- Modify database queries (7 changes)
**Detailed Identifier Changes:**
Commit 4f6174d1:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Add:
- struct: pub::TotalPaymentMethodCountResponse
- impl: impl common_utils::events::ApiEventMetric for TotalPaymentMethodCountResponse
**crates/diesel_models/src/query/payment_method.rs**
Add:
- function: pub::get_count_by_merchant_id_status
- function: pub::get_count_by_merchant_id_status
**crates/hyperswitch_domain_models/src/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Add:
- function: pub::get_total_saved_payment_methods_for_merchant
- function: pub::get_total_payment_method_count_core
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::get_payment_method_count_by_merchant_id_status
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Add:
- function: pub::get_total_payment_method_count
**crates/router/src/types/api/payment_methods.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
**crates/storage_impl/src/payment_method.rs**
Add:
- function: private::get_payment_method_count_by_merchant_id_status
- function: private::get_payment_method_count_by_merchant_id_status
- function: private::get_payment_method_count_by_merchant_id_status
|
{"pr_number": 7479, "pr_title": "feat(payment_methods_v2): add total-payment-method-count api", "merged_at": "2025-03-12T19:11:12Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "database": ["crates/diesel_models/src/query/payment_method.rs"], "domain": ["crates/hyperswitch_domain_models/src/payment_methods.rs"], "core_business": ["crates/router/src/core/payment_methods.rs"], "types": ["crates/router/src/types/api/payment_methods.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "other": ["crates/router/src/db/kafka_store.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payment_methods.rs", "crates/storage_impl/src/payment_method.rs"]}, "change_types": {"structs_added": 1, "functions_added": 13, "fields_added": 24, "imports_added": 1, "database_queries": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add db interface for `/relay`
## 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 -->
/relay is a api that will be used to just forward the request sent by merchant without performing any application logic on it. In this pr the changes is particular to support the refunds for the payments that was directly performed with the connector (example stripe) with out hyperswitch involved during the payment flow.
Flow
1. Merchant performs payment directly with processor and stores the payment reference id associated with it.
2. Merchant tiggers the refund through hyperswitch using the processor reference id for the payment.
### 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)?
-->
-> Create a merchant connector account
-> Make a refund request with invalid `connector_resource_id`
```
curl --location 'http://localhost:8080/relay' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_Pwvl4mcL0CmLR1YbIXnq' \
--header 'api-key: dev_y6s7DJZguBHxS66AneCCoJUgO3aTjcdafjJ5x1JiBtOJFofp5AchFIC4oxTxd8oa' \
--data '{
"connector_id": "mca_M3pxBGmzJeOPHBhBxOoH",
"connector_resource_id": "X445D84NZ22WQT65",
"data": {
"amount": 50,
"currency": "USD"
},
"type": "refund"
}'
```
```
{
"id": "relay_XiAMJo3ifbyhYaQ7AyW9",
"status": "failure",
"connector_resource_id": "X445D84NZ22WQT65",
"error": {
"code": "resource_missing",
"message": "resource_missing"
},
"connector_reference_id": null,
"connector_id": "mca_M3pxBGmzJeOPHBhBxOoH",
"profile_id": "pro_Pwvl4mcL0CmLR1YbIXnq",
"type": "refund",
"data": {
"amount": 50,
"currency": "USD",
"reason": null
}
}
```
-> Make a refund request with valid `connector_resource_id`
```
curl --location 'http://localhost:8080/relay' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_vb2ZGypHwTIhL1xpi7cV' \
--header 'api-key: dev_yOa9A8G8VyF3rDcy8KUylUsSZxXwGYIQOVo10YEPFhVvouztwHhVmpOkqsbPVKKJ' \
--data '{
"connector_id": "mca_qjU8mTdWzr7uKhm99WON",
"connector_resource_id": "7348595224296247904953",
"data": {
"refund": {
"amount": 50,
"currency": "USD"
}},
"type": "refund"
}'
```
```
{
"id": "relay_5sEV785aXJs1ZQwpMmO5",
"status": "pending",
"connector_resource_id": "7348595224296247904953",
"error": null,
"connector_reference_id": "7348601752236522904951",
"connector_id": "mca_qjU8mTdWzr7uKhm99WON",
"profile_id": "pro_vb2ZGypHwTIhL1xpi7cV",
"type": "refund",
"data": {
"refund": {
"amount": 50,
"currency": "USD",
"reason": 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/relay.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/enums.rs`
- `crates/diesel_models/src/lib.rs`
- `crates/diesel_models/src/query.rs`
- ... and 4 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/lib.rs`
- `crates/hyperswitch_domain_models/src/merchant_connector_account.rs`
- `crates/hyperswitch_domain_models/src/relay.rs`
**4. Core Business Logic**
- `crates/router/src/core.rs`
- `crates/router/src/core/relay.rs`
- `crates/router/src/core/relay/utils.rs`
**5. Type Definitions**
- `crates/router_env/src/logger/types.rs`
**6. Utils**
- `crates/common_utils/src/id_type/relay.rs`
- `crates/router/src/routes/lock_utils.rs`
**7. Other**
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- `crates/openapi/src/openapi.rs`
- ... and 9 more files
**Code Patterns Applied:**
- Define new data structures (6 changes)
- Implement new functions (31 changes)
- Extend existing types with new fields (272 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 0f8b0b3b:
Files to modify:
**crates/api_models/src/relay.rs**
Remove:
- enum: pub::RelayType
- enum: pub::RelayStatus
Add:
- impl: impl common_utils::events::ApiEventMetric for RelayRequest
- impl: impl common_utils::events::ApiEventMetric for RelayResponse
**crates/common_enums/src/enums.rs**
Add:
- function: private::from
- function: private::from
- enum: pub::RelayStatus
- enum: pub::RelayType
- impl: impl From<RefundStatus> for RelayStatus
- impl: impl From<RelayStatus> for RefundStatus
**crates/common_utils/src/id_type/relay.rs**
Modify existing code
**crates/diesel_models/src/enums.rs**
Modify existing code
**crates/diesel_models/src/lib.rs**
Add:
- mod: pub::relay
**crates/diesel_models/src/query.rs**
Add:
- mod: pub::relay
**crates/diesel_models/src/query/relay.rs**
Add:
- function: pub::insert
- function: pub::update
- impl: impl RelayNew
- impl: impl Relay
**crates/diesel_models/src/relay.rs**
Add:
- struct: pub::Relay
- struct: pub::RelayNew
- struct: pub::RelayUpdateInternal
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- mod: pub::relay
**crates/hyperswitch_domain_models/src/merchant_connector_account.rs**
Add:
- function: pub::get_connector_account_details
- function: pub::get_connector_test_mode
- function: pub::get_connector_test_mode
**crates/hyperswitch_domain_models/src/relay.rs**
Add:
- function: pub::new
- function: private::from
- function: pub::from
- function: private::from
- function: private::from
- function: private::convert
- function: private::convert_back
- function: private::construct_new
- struct: pub::Relay
- struct: pub::RelayRefundData
- enum: pub::RelayData
- enum: pub::RelayUpdate
- impl: impl Relay
- impl: impl From<api_models::relay::RelayData> for RelayData
- impl: impl RelayUpdate
- impl: impl From<Relay> for api_models::relay::RelayResponse
- impl: impl From<RelayUpdate> for RelayUpdateInternal
- impl: impl super::behaviour::Conversion for Relay
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/router/src/core.rs**
Add:
- mod: pub::relay
**crates/router/src/core/relay.rs**
Add:
- function: pub::relay
- function: pub::relay_refund
- function: pub::validate_relay_refund_request
- function: pub::validate_relay_refund_data
- mod: pub::utils
**crates/router/src/core/relay/utils.rs**
Add:
- function: pub::construct_relay_refund_router_data
**crates/router/src/db.rs**
Add:
- mod: pub::relay
**crates/router/src/db/relay.rs**
Add:
- function: private::insert_relay
- function: private::update_relay
- function: private::insert_relay
- function: private::update_relay
- function: private::insert_relay
- function: private::update_relay
- trait: pub::RelayInterface
- impl: impl RelayInterface for Store
- impl: impl RelayInterface for MockDb
- impl: impl RelayInterface for KafkaStore
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes.rs**
Add:
- mod: pub::relay
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- struct: pub::Relay
- impl: impl Relay
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/relay.rs**
Add:
- function: pub::relay
**crates/router/src/services/authentication.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 6879, "pr_title": "feat(router): add db interface for `/relay`", "merged_at": "2024-12-22T17:37:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "refund"]}, "hierarchy": {"api_models": ["crates/api_models/src/relay.rs"], "database": ["crates/diesel_models/src/enums.rs", "crates/diesel_models/src/lib.rs", "crates/diesel_models/src/query.rs", "crates/diesel_models/src/query/relay.rs", "crates/diesel_models/src/relay.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/merchant_connector_account.rs", "crates/hyperswitch_domain_models/src/relay.rs"], "core_business": ["crates/router/src/core.rs", "crates/router/src/core/relay.rs", "crates/router/src/core/relay/utils.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/id_type/relay.rs", "crates/router/src/routes/lock_utils.rs"], "other": ["api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi.rs", "crates/router/src/db.rs", "crates/router/src/db/relay.rs", "crates/router/src/lib.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/relay.rs", "crates/router/src/services/authentication.rs", "migrations/2024-12-17-141811_add_relay_table/down.sql", "migrations/2024-12-17-141811_add_relay_table/up.sql"]}, "change_types": {"structs_added": 6, "functions_added": 31, "enums_added": 4, "fields_added": 272, "imports_added": 44, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): payments - map billing first and last name to card holder name
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for https://github.com/juspay/hyperswitch/pull/6791
### 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/payment_methods/vault.rs`
- `crates/router/src/core/payments/helpers.rs`
**4. External Connector Integration**
- `crates/router/src/utils/verify_connector.rs`
- `crates/router/tests/connectors/aci.rs`
- `crates/router/tests/connectors/adyen.rs`
- ... and 5 more files
**5. Tests**
- `cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js`
- `cypress-tests/cypress/e2e/PaymentUtils/Stripe.js`
**Code Patterns Applied:**
- Extend existing types with new fields (28 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 6d252dc9:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Modify existing code
**crates/router/src/core/payment_methods/vault.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/utils/verify_connector.rs**
Modify existing code
**crates/router/tests/connectors/aci.rs**
Modify existing code
**crates/router/tests/connectors/adyen.rs**
Modify existing code
**crates/router/tests/connectors/airwallex.rs**
Modify existing code
**crates/router/tests/connectors/fiserv.rs**
Modify existing code
**crates/router/tests/connectors/rapyd.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
**crates/router/tests/connectors/worldline.rs**
Modify existing code
|
{"pr_number": 6793, "pr_title": "fix(core): payments - map billing first and last name to card holder name", "merged_at": "2024-12-10T17:40:27Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "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/payment_methods/vault.rs", "crates/router/src/core/payments/helpers.rs"], "connectors": ["crates/router/src/utils/verify_connector.rs", "crates/router/tests/connectors/aci.rs", "crates/router/tests/connectors/adyen.rs", "crates/router/tests/connectors/airwallex.rs", "crates/router/tests/connectors/fiserv.rs", "crates/router/tests/connectors/rapyd.rs", "crates/router/tests/connectors/utils.rs", "crates/router/tests/connectors/worldline.rs"], "tests": ["cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js", "cypress-tests/cypress/e2e/PaymentUtils/Stripe.js"]}, "change_types": {"fields_added": 28, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(authentication): added authentication sync api
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] New feature
## Description
<!-- Describe your changes in detail -->
The main feature is the addition of a new authentication synchronization API that allows syncing authentication data between systems.
### API Contract Changes
- Updated OpenAPI specifications (v1 and v2)
- Added new authentication endpoints and data models
- Modified existing API contracts to support the new sync functionality
## Files Modified
### Core Authentication Logic
- `crates/router/src/core/unified_authentication_service.rs` - Main authentication service logic
- `crates/router/src/core/authentication/utils.rs` - Authentication utilities
- `crates/router/src/services/authentication.rs` - Authentication services
### API Models & Routes
- `crates/api_models/src/authentication.rs` - Authentication API models
- `crates/router/src/routes/authentication.rs` - Authentication route handlers
- `crates/router/src/routes/app.rs` - App routing configuration
- `crates/router/src/routes/lock_utils.rs` - Lock utilities for routes
### Domain Models
- `crates/hyperswitch_domain_models/src/authentication.rs` - Authentication domain models
- `crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs` - Request types for unified auth service
### Connector Integration
- `crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs` - Unified auth service connector
- `crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs` - Data transformers
- `crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs` - Netcetera connector transformers
### Configuration & Documentation
- `config/development.toml` - Development configuration updates
- `api-reference/v1/openapi_spec_v1.json` - Updated OpenAPI v1 specification
- `api-reference/v2/openapi_spec_v2.json` - Updated OpenAPI v2 specification
## Technical Implementation Details
### Integration Points
- Unified Authentication Service integration
- Netcetera connector enhancements
- Business profile integration with merchant country code
- SDK information handling improvements
## 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)?
-->
Try the flow with both Friction and Frictionless card
Setup Netcetera in MCA :
```shell
curl --location 'http://localhost:8080/account/sahkal11/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_xekWBE7fjlTQ4d4fsmYBqgoNyBdfLaZxggJ6nY4tL2Eyl0Ece6lGGH1o7N4ZtrE3' \
--data '
{
"connector_type": "authentication_processor",
"connector_name": "netcetera",
"connector_account_details": {
"auth_type": "CertificateAuth",
"certificate": CERTIFICATE,
"private_key": PRIVATE_KEY
},
"test_mode": true,
"disabled": false,
"metadata": {
"merchant_category_code": "5411",
"merchant_country_code": "840",
"merchant_name": "Dummy Merchant",
"endpoint_prefix": "flowbird",
"three_ds_requestor_name": "juspay-prev",
"three_ds_requestor_id": "juspay-prev",
"pull_mechanism_for_external_3ds_enabled": false
}
}
'
```
Setup Profile acquirer Config
```
curl --location 'localhost:8080/profile_acquirer' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_xekWBE7fjlTQ4d4fsmYBqgoNyBdfLaZxggJ6nY4tL2Eyl0Ece6lGGH1o7N4ZtrE3' \
--data '{
"acquirer_assigned_merchant_id": "00002000000",
"merchant_name": "Demo Merchant",
"network": "AmericanExpress",
"acquirer_bin": "400000",
"acquirer_fraud_rate": 0.2345545234765,
"profile_id": "pro_89fr3mDlSeDfh8fro28W"
}'
```
Update Business Profile
```shell
curl --location 'http://localhost:8080/account/sahkal11/business_profile/pro_89fr3mDlSeDfh8fro28W' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_xekWBE7fjlTQ4d4fsmYBqgoNyBdfLaZxggJ6nY4tL2Eyl0Ece6lGGH1o7N4ZtrE3' \
--data '
{
"authentication_connector_details": {
"authentication_connectors": ["netcetera"],
"three_ds_requestor_url": "https://google.com"
},
"merchant_country_code": "004",
"merchant_category_code": "5411"
}
'
```
Do Authentication Create :
```shell
curl --location 'localhost:8080/authentication' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_xekWBE7fjlTQ4d4fsmYBqgoNyBdfLaZxggJ6nY4tL2Eyl0Ece6lGGH1o7N4ZtrE3' \
--data '{
"amount": 10,
"currency": "USD",
"acquirer_details": {
"merchant_id": "12134",
"bin": "438309",
"country_code": null
},
"authentication_connector":"netcetera",
"profile_acquirer_id": "pro_acq_JO8uZghB4Y6qJFAgkUbI"
}'
```
Do Authentication Eligibility
```shell
curl --location 'localhost:8080/authentication/authn_G2nUqHYBrMLIMgcyO8Az/eligibility' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_xekWBE7fjlTQ4d4fsmYBqgoNyBdfLaZxggJ6nY4tL2Eyl0Ece6lGGH1o7N4ZtrE3' \
--data-raw '{
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": CARD_NUMBER,
"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": "CA",
"zip": "94122",
"country": "US",
"first_name": "PiX"
},
"phone": {
"number": "123456789",
"country_code": "12"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
},
"phone": {
"number": "123456789",
"country_code": "12"
}
},
"email": "sahkalplanet@gmail.com",
"browser_information": {
"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": "115.99.183.2"
},
"profile_acquirer_id": "pro_acq_LhAY1jDOAYJuHeUAQWwh"
}'
```
RESPONSE
```shell
{
"authentication_id": "authn_U4Z7xqe7HHIScfDU50xW",
"next_api_action": {
"url": "http://localhost:8080/authentication/authn_U4Z7xqe7HHIScfDU50xW/authenticate",
"http_method": "POST"
},
"status": "pending",
"eligibility_response_params": {
"ThreeDsData": {
"threeds_server_transaction_id": "ed790486-dda7-4972-83ab-5d0afbaa8885",
"maximum_supported_3ds_version": "2.3.1",
"connector_authentication_id": "ed790486-dda7-4972-83ab-5d0afbaa8885",
"three_ds_method_data": "eyJ0aHJlZURTTWV0aG9kTm90aWZpY2F0aW9uVVJMIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS8zZHMtbWV0aG9kLW5vdGlmaWNhdGlvbi11cmwiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6ImVkNzkwNDg2LWRkYTctNDk3Mi04M2FiLTVkMGFmYmFhODg4NSJ9",
"three_ds_method_url": "https://ndm-prev.3dss-non-prod.cloud.netcetera.com/acs/3ds-method",
"message_version": "2.3.1",
"directory_server_id": "A000000003"
}
},
"connector_metadata": null,
"profile_id": "pro_To47L194jVTevrWXRxR3",
"error_message": null,
"error_code": null,
"authentication_connector": "netcetera",
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "CA",
"first_name": "PiX",
"last_name": null
},
"phone": {
"number": "123456789",
"country_code": "12"
},
"email": 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": {
"number": "123456789",
"country_code": "12"
},
"email": null
},
"browser_information": {
"color_depth": 24,
"java_enabled": true,
"java_script_enabled": true,
"language": "nl-NL",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"ip_address": "115.99.183.2",
"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/70.0.3538.110 Safari/537.36",
"os_type": null,
"os_version": null,
"device_model": null
},
"email": "sahkalplanet@gmail.com"
}
```
Authentication API
```shell
curl --location 'localhost:8080/authentication/authn_mZZSwXGzD20i4x41pjLp/authenticate' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_MB8FHXAmDStuArWrRisGDRe6kadzIIxWgOI8Bk0uEHtIkU5WA2oxcBrvozEjjiP2' \
--data '
{
"device_channel": "APP",
"threeds_method_comp_ind": "N",
"sdk_information": {
"sdk_app_id": "4d017186-318a-42e0-99cd-203367af5aa1",
"sdk_enc_data": "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0.AeiTEwYFYMBl68uRqI2ePfIYJ_xDjZDBjvD-2dS4vCKUCUz-Pab8OVf5DiA8LovnoMI8dVJbFCVfWEgSjb8S99rFkm_g-J3hnBdiWgr7inSoW9NCvHgKU9hrTkhWijOFXNWHtBO4ECYIQg93RCv3svVDGTBkx0CucxlzkZF0Ct4sknMH6p4BGdioet8P8PVZPQcpM_9bd8JSdK1V8sUPPneeyYqlJ3MEQdZSfggRixUvlxdVhxVLlFHLyhjqzN7MpFT3NWsIG7mikkkLjlDlAE29Qm8xLBxqgL8apq57IR8map7KqacT20Uxirstskrlh6nfAk8aqU_Eo78Gd6XZrQ.12WaY03igq7b8At8GXXM7g.qpqNbumX0rpW1WRB_tMOsfVOeYzz6LbJfLFgSH49yMVvfGha7hEYEy0_h5nbPkWA_S95SubmfxQeN9Ale6uPTT_-lfSb4DpHKTMaYx3pVZrYA2qtR-0Iuft-t-zerEfqrd87TaKZNPxGzvrt6tdSig4PmFpg07AqcwQGDVvkxja_wO7PgcvR6lmKAt73IMJYAVXxb6oW1nGREJtzK9rTob48qnMdAJmmB3-0DwCeb7zZaNLI8ngs7qMj740atmzfR-cLdQ3AHDMlv0n4C7INFaaIn3vsJ_UxFuGCTmrTBc-Fgx7F5uOUI3Sc8BehqWTWox1AJ-Qz-t_9I1SobTWWKQ0U-JpeNoloXDEAA3fFgd6acOToAzeTxQckymVGPIhy6-VLYf7d80prT9TzRgMGlUEj-nQjy8svqambWFHvueLZUh_YluyJlWX0R2_1GQKwIExiLoMXBr7dJhLslLBm9VLZKqEa6xGI8uTtO0KpN_FmFXKvBDBSPQ_WK8WpN9OLoElJbuveKwXhkMIDqYexxwOngyAApNjBoKom23r3a1zxWtZZNeD6Z7vPAirHRSN6-YdIJDym2LRopFRItm80oDUAOity5DeZMODTz0SdhNXfpsagsYktRmPXZ1WxKZf6yY9z_EGFYHZ4aYTsulPYuFMhp3Dc6CC-GiM2UdDbztcqoscVJpJLvCr4Yagg5xeEshr3K4F5FDUP1gtkEjQzRdHUTAFJQCKXb0Z6U9F40yiCr-E5SugBZDUk1iGrc72e0s-1xqAx89Q9N_T2j8ejc8M38AaDODnVM5h6E7vhSxilp4f--m_eSCCSyduNM2jE_MT1knfrh16JoE-DLaUr9zYgIN05WjmoT0OWL5ax3x98Y17_fxAxTKW9ZIfTYAG8bFWwlErXzjttZe3_Pe1ORpSKkl5hUWey9RGHk6WqUAZfdACzabJRTUCaC1g2t2KX6sQusFhdh8s-ArfStN7oJ-oO807Phlix2VNxKDiDpUKLaLBwQQV37jRJ2gMohsC-Wl5diOg81c9FPut9v7pTODd0AVEN-Y2CWFVyHdoYgc57MPFTJFkTFCX3j0w5ZZQO10aPyM0_gc9UOiPlPOIsXZdUbBxN_dCcq5xSQgl5rxaLO89444u3Nq3cTVlPu6Vkjardaj2Asz_tdmN6JKbCCHbVg8xUjdY8qbSn144WWc8s_oldaJhV-BlBNt5mFrkLVxy0msyDBRJQ5TK7Prck5Puz36RZ8I7VsTMcyE0q8tO5GXxLYyV-vnJb4IOyfEVBv-SB_g2auAMFB58lRh4lv80gIdRGZcY1sS9cuKeHboQGNSXYtGExPmmb-iV0UA34jNkert9p2-dxQLXfdYSlKXgly_L9qUQEM1kPdwWVin7nwqz4gtt-tnllcve2w2qd1XaY3BdtVkzpqrKQqq0UDz32NKBbSKhzQIfzXadWsjYYJ_bKWF2uKOM6es3Gd-BUP-FvjjHwZyQcQyMBENxAdQyXuicwKcgjFct5GQx2Zt2_K14O8b-y0_-p3n2EmYk7xUWo4JuD_IaOm3EoBo67TVS74F2Ef5mOIx6S8kaHV8N6L9OWJCvgFhkVDYkq6GhCOf5yRP8I-tm4xwwn0Wt60i9nCOvooPI36T-mU8TnKSVGtziKq9JTjLGpFf5jHxBBL97mEstpCONo2B8-U3_wUOkRJEzhAS7sKtvMCcsKzL4ak16GCKrznciiBYdCI6tIjnY0gl0IiFRy_9CNPRym6RTECnksaTjmZIJJgcn2jGP0gFF7BxE2lBVe-3Y5JOHW3ho-i6SEp7cEKVx2pTvc2CBwPoWTUkFlTTelH95tG5ftRpFOQmfrpzvjMW22UU9BFvuU3CBvb5fptq7iqdUm62DuKegEYPQrUq0_K0gwoP1fwdiWYLDI9vlpGTj57E6f8idPb1YunE1Urko9h0m4ye-xlMli6NobPGSX7PpkY4QwkFeAVBUifwy3oodYkiF0QUq2_mMdf2863MfUF8lkp6oVDiFgvy3hmD0EJajnq2KRMIlhOwIrVhSSEc2Oqpn6Fn6xJQcrm556tb6MNh5wpjCQWIc5lHXwANvLSZY70KhKaeM3fsKW5T2c16bQ1BrerrcLiYVYde7o-Zb1xXRyBoopiNvcDxBKcyFgRzaT7TkRjyx-TeZJMjPe-oEk25kJUAgFXpwNB7Ki9Qj2hsLLn_Yc8kUfr4YW_C-64PtDdhqaryHjIYOL5h6YWGizWzmgFKVytTfr2A1WeIdMDsA4IvpOtNZHUr0RR7NPQpwd_7sV3Eb5_utpQ2fnj-D5zdlqK1TODZoZEANFL7T_lwemRZdlhOGS9he19oU8djhaTPNBCvy64lyS3rOaNy_JtgQhS17RKWyqC2YNyfO1G2SGXmO6CDti21TCtgIoh3YLe94RNNzLn2tSPxjI67JQ-5WaVBa1_910Jpy8zRhxo9QMtWzmN4HUoy6GAUPeaRJhtTc9pvMrKxl6WLLNJ4sivGdPR_D6j-wilx6ayQduC8D2NSHhgt2hxT6r_W_ILfQ9GAWc8pNAcn4EVEDf2EMriLveMcFBYOurO8wwndCtHPBlawN93-wNUy6PMh_7KN0Kq-L8pltjj41ymdWQIaph0qgWHTMaO0XAeJGYp9qWlNRX6p-PVJU7vTSV2pKJbl-Bnbw-dBUJXFb6SGrum28Un6bcx5e6cFUN--sZl7OLzLQgexy0CerypsgwTQ68oEDNYQjmRA-Zo5e7eW2srh-kV29TVjwMT49_krBR3ypCEV8gbvHumBLxXR4CiU_PMSSNi-lUt5_kQvMb7GfS_JYwdVRx93nku1RTToStIfoDKhE9VpsSp7GN2Z7Fy1k80d0pQ-d2SwBL3QXGtUVcwqoW4PbPDhwYhjpRAkhTNwO6cw9AgVYNE8--V79Ln6nEXKBBVUK3Coj01jm--G8vkWZZ6U-zt2QZVoJApKombi2TloXw3VohPODsR6UfYJkdpKjl1E_Q4VA1-aLUYDQ6xRlfYi0wSqvQDtKrwlGumIVn0qEjZFeupTtr9ux72i0T2sagb4oOi9FHwLaR7HfcgczCH5OokFv2IpEOV8k91Ucg78KAynqce-l522tCHu3flWelXv2feS7eSqNax9kjBs-rEsxLQtDffccY5L5Zvr90gKaWGAa4z9sqb9QKmOulFGcPLquQZF51VrX-5wFoAQ15xbpYxjX5Ks1i9hwExvyLIW-n4xyxC64n7tHpqDTsnxXu_VHvkyNbF9eXeDT7vhG85zhoi9ULHtRsbJilnlPMZNQcO-cBboVl1sR4_8_t2sCoNjtMGGbnsYintgPfUAGPLfLnddqC8LFIKH0ZN22-cPCthUGFpKNuau9RCaquz7cHjsGkp9yJKVXWlSxfr6WIjGHEe8hi1dnr83rkfcxTzcaxvCaQy6clUQjqyWOV4l-TuAtplv12NQX-mxN2E5cJmFY1wnyJ5GPu9VtYq2xbTw3-xoU8ikgw9XkI7HML2z0HpXi0k5QZJ9QJPXuP3273FjZSOQGyj2qJ3zRGAWJEJdKpMkP4gsxLuPm_mtzSYMj6HxwHjvMB1Yqd9iVUkXQgdRU_kRROK3anyKeetezft1-G4E_ScUNONODn",
"sdk_ephem_pub_key": {
"kty": "EC",
"x": "AIKHXxBSZ9t7wzeiZ9ZpsCjL84btRwXfMM3mtqaQjJw",
"y": "6lY5bSlSsx40gUPGKRXBcL05v_rQncf6k0qmLc4V8Qs",
"crv": "P-256"
},
"sdk_trans_id": "705d277d-e11e-4518-9cf2-88e35fccf8b3",
"sdk_reference_number": "3DS_LOA_SDK_NEAG_020301_00792",
"sdk_max_timeout": 15
}
}
'
```
Response
```
{
"trans_status": "C",
"acs_url": null,
"challenge_request": null,
"acs_reference_number": "3DS_LOA_ACS_201_13579",
"acs_trans_id": "3ed60678-2116-4b3d-ba8b-fea3368694ee",
"three_dsserver_trans_id": "e2f6ac79-b9ef-49a1-999a-2f3d998300db",
"acs_signed_content": null,
"three_ds_requestor_url": "https://google.com",
"three_ds_requestor_app_url": null,
"error_message": null,
"error_code": null,
"authentication_value": null,
"status": "pending",
"authentication_connector": "netcetera"
}
```
Sync
```shell
curl --location --request POST 'localhost:8080/authentication/authn_xfnVvnZIWfGMaHrwEBGJ/sync' \
--header 'api-key: dev_5oijCvZhFkoyZWkDFaLPGeN9kajUAt03yG6Aju1DSh79ghiT8i8moIEsjRxVf6Tq' \
--data ''
```
Response
```shell
{
"authentication_id": "authn_xfnVvnZIWfGMaHrwEBGJ",
"merchant_id": "sahkal11",
"status": "success",
"client_secret": "authn_xfnVvnZIWfGMaHrwEBGJ_secret_b1iIylqBuPVUBw1EYibA",
"amount": 10,
"currency": "USD",
"authentication_connector": "netcetera",
"force_3ds_challenge": false,
"return_url": null,
"created_at": "2025-07-26T11:30:13.974Z",
"profile_id": "pro_BEX6ZBeTBuJq3TxXrjwz",
"psd2_sca_exemption_type": null,
"acquirer_details": {
"bin": "400000",
"merchant_id": "00002000000",
"country_code": "004"
},
"threeds_server_transaction_id": "23be8c88-8dee-4279-94c0-7c7a7148ad74",
"maximum_supported_3ds_version": "2.3.1",
"connector_authentication_id": "23be8c88-8dee-4279-94c0-7c7a7148ad74",
"three_ds_method_data": "eyJ0aHJlZURTTWV0aG9kTm90aWZpY2F0aW9uVVJMIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS8zZHMtbWV0aG9kLW5vdGlmaWNhdGlvbi11cmwiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjIzYmU4Yzg4LThkZWUtNDI3OS05NGMwLTdjN2E3MTQ4YWQ3NCJ9",
"three_ds_method_url": "https://ndm-prev.3dss-non-prod.cloud.netcetera.com/acs/3ds-method",
"message_version": "2.3.1",
"connector_metadata": null,
"directory_server_id": "A000000003",
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "CA",
"first_name": "PiX",
"last_name": null
},
"phone": {
"number": "123456789",
"country_code": "12"
},
"email": 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": {
"number": "123456789",
"country_code": "12"
},
"email": null
},
"browser_information": {
"color_depth": 24,
"java_enabled": true,
"java_script_enabled": true,
"language": "nl-NL",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"ip_address": "115.99.183.2",
"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/70.0.3538.110 Safari/537.36",
"os_type": null,
"os_version": null,
"device_model": null
},
"email": "sahkalplanet@gmail.com",
"trans_status": "Y",
"acs_url": null,
"challenge_request": null,
"acs_reference_number": null,
"acs_trans_id": null,
"three_dsserver_trans_id": "23be8c88-8dee-4279-94c0-7c7a7148ad74",
"acs_signed_content": null,
"three_ds_requestor_url": "https://google.com",
"three_ds_requestor_app_url": null,
"authentication_value": "MTIzNDU2Nzg5MDA5ODc2NTQzMjE=",
"error_message": null,
"error_code": null,
"profile_acquirer_id": "pro_acq_ebY2fZAOqqjMAikwIMqH"
}
```
## 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/authentication.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/authentication.rs`
- `crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments/helpers.rs`
- `crates/router/src/core/unified_authentication_service.rs`
- `crates/router/src/core/utils.rs`
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs`
**5. Type Definitions**
- `crates/common_types/src/payments.rs`
- `crates/router_env/src/logger/types.rs`
**6. Utils**
- `crates/common_utils/src/id_type/authentication.rs`
- `crates/router/src/routes/lock_utils.rs`
**7. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `crates/common_enums/src/enums.rs`
- `crates/openapi/src/openapi.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (18 changes)
- Extend existing types with new fields (167 changes)
- Add conditional logic for feature flags or filtering (6 changes)
**Detailed Identifier Changes:**
Commit 794dce16:
Files to modify:
**crates/api_models/src/authentication.rs**
Add:
- function: private::get_api_event_type
- function: private::get_api_event_type
- function: private::get_api_event_type
- struct: pub::AuthenticationSyncResponse
- struct: pub::AuthenticationSyncRequest
- struct: pub::AuthenticationSyncPostUpdateRequest
- impl: impl ApiEventMetric for AuthenticationSyncResponse
- impl: impl ApiEventMetric for AuthenticationSyncRequest
- impl: impl ApiEventMetric for AuthenticationSyncPostUpdateRequest
**crates/common_enums/src/enums.rs**
Add:
- function: pub::is_pending
- impl: impl TransactionStatus
**crates/common_types/src/payments.rs**
Add:
- function: pub::new
**crates/common_utils/src/id_type/authentication.rs**
Add:
- function: pub::get_external_authentication_request_poll_id
**crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/authentication.rs**
Add:
- struct: pub::PgRedirectResponseForAuthentication
**crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Add:
- function: pub::get_handle_response_url_for_modular_authentication
- function: pub::make_merchant_url_with_response_for_authentication
- function: pub::make_pg_redirect_response_for_authentication
**crates/router/src/core/unified_authentication_service.rs**
Add:
- function: pub::authentication_sync_core
- function: pub::authentication_post_sync_core
**crates/router/src/core/utils.rs**
Add:
- function: pub::get_modular_authentication_request_poll_id
- function: pub::get_html_redirect_response_for_external_modular_authentication
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/authentication.rs**
Add:
- function: pub::authentication_sync
- function: pub::authentication_sync_post_update
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Add:
- function: private::get_client_secret
- impl: impl ClientSecretFetch for api_models::authentication::AuthenticationSyncRequest
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 8596, "pr_title": "feat(authentication): added authentication sync api", "merged_at": "2025-07-31T07:34:43Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/authentication.rs"], "domain": ["crates/hyperswitch_domain_models/src/authentication.rs", "crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs"], "core_business": ["crates/router/src/core/payments/helpers.rs", "crates/router/src/core/unified_authentication_service.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs"], "types": ["crates/common_types/src/payments.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/id_type/authentication.rs", "crates/router/src/routes/lock_utils.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/authentication.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"structs_added": 4, "functions_added": 18, "fields_added": 167, "imports_added": 2, "conditionals_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(refunds_v2): Change refunds v2 list request verb from GET to POST
## 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 to list refunds in v2, we are using GET verb, but we are passing filters through body which is not correct. Since listing requests are generally GET requests, we pass filters through query params.
In the current scenario, passing filters through query params may result in url length violation. Hence we are changing the route verb from GET to POST request.
### 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).
-->
Follow correct and semantic approach to list refunds in v2 apis.
## 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 some payments and refunds before hand.
- List all refunds API call
```
curl --location 'http://localhost:8080/v2/refunds/list' \
--header 'x-profile-id: pro_hB6oV5vfIHyqUVw1aetw' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_iNC2eYPgqnHNYoFG44nlmpp3ofzZqQ4wPOcx9r7IONCidqNmbVRLwXZwgctSQn4m' \
--data '{
}'
```
- Response from the above call
```
{
"count": 3,
"total_count": 3,
"data": [
{
"id": "12345_ref_019754aecbb47921a9947612563466bd",
"payment_id": "12345_pay_019754aeb06771c38815608e367ed6a2",
"merchant_reference_id": "1749472431",
"amount": 70,
"currency": "EUR",
"status": "pending",
"reason": "CUSTOMER REQUEST",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-06-09T12:33:51.053Z",
"updated_at": "2025-06-09T12:33:51.363Z",
"connector": "adyen",
"profile_id": "pro_hB6oV5vfIHyqUVw1aetw",
"merchant_connector_id": "mca_76RN9eoOT1pKjdBC8wU7",
"connector_refund_reference_id": null
},
{
"id": "12345_ref_019754ad614b7122b3f9c2b7c0af3ffa",
"payment_id": "12345_pay_019754acd9797072ad358e2ddc41594f",
"merchant_reference_id": "1749472338",
"amount": 720,
"currency": "USD",
"status": "pending",
"reason": "CUSTOMER REQUEST",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-06-09T12:32:18.275Z",
"updated_at": "2025-06-09T12:33:11.264Z",
"connector": "adyen",
"profile_id": "pro_hB6oV5vfIHyqUVw1aetw",
"merchant_connector_id": "mca_76RN9eoOT1pKjdBC8wU7",
"connector_refund_reference_id": null
},
{
"id": "12345_ref_019754ad1149783385dda1328a50d9c9",
"payment_id": "12345_pay_019754acd9797072ad358e2ddc41594f",
"merchant_reference_id": "1749472318",
"amount": 720,
"currency": "USD",
"status": "failed",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "000",
"message": "Invalid merchant refund reason, the only valid values are : [OTHER, RETURN, DUPLICATE, FRAUD, CUSTOMER REQUEST]"
},
"created_at": "2025-06-09T12:31:57.817Z",
"updated_at": "2025-06-09T12:31:58.211Z",
"connector": "adyen",
"profile_id": "pro_hB6oV5vfIHyqUVw1aetw",
"merchant_connector_id": "mca_76RN9eoOT1pKjdBC8wU7",
"connector_refund_reference_id": null
}
]
}
```
- List refund by payment id API Call
```
curl --location 'http://localhost:8080/v2/refunds/list' \
--header 'x-profile-id: pro_hB6oV5vfIHyqUVw1aetw' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_iNC2eYPgqnHNYoFG44nlmpp3ofzZqQ4wPOcx9r7IONCidqNmbVRLwXZwgctSQn4m' \
--data '{
"payment_id":"12345_pay_019754aeb06771c38815608e367ed6a2"
}'
```
- Response from the above call
```
{
"count": 1,
"total_count": 1,
"data": [
{
"id": "12345_ref_019754aecbb47921a9947612563466bd",
"payment_id": "12345_pay_019754aeb06771c38815608e367ed6a2",
"merchant_reference_id": "1749472431",
"amount": 70,
"currency": "EUR",
"status": "pending",
"reason": "CUSTOMER REQUEST",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-06-09T12:33:51.053Z",
"updated_at": "2025-06-09T12:33:51.363Z",
"connector": "adyen",
"profile_id": "pro_hB6oV5vfIHyqUVw1aetw",
"merchant_connector_id": "mca_76RN9eoOT1pKjdBC8wU7",
"connector_refund_reference_id": null
}
]
}
```
- List refund by currencies API Call
```
curl --location 'http://localhost:8080/v2/refunds/list' \
--header 'x-profile-id: pro_hB6oV5vfIHyqUVw1aetw' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_iNC2eYPgqnHNYoFG44nlmpp3ofzZqQ4wPOcx9r7IONCidqNmbVRLwXZwgctSQn4m' \
--data '{
"currency":["EUR","USD"]
}'
```
- Response from the above call
```
{
"count": 3,
"total_count": 3,
"data": [
{
"id": "12345_ref_019754aecbb47921a9947612563466bd",
"payment_id": "12345_pay_019754aeb06771c38815608e367ed6a2",
"merchant_reference_id": "1749472431",
"amount": 70,
"currency": "EUR",
"status": "pending",
"reason": "CUSTOMER REQUEST",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-06-09T12:33:51.053Z",
"updated_at": "2025-06-09T12:33:51.363Z",
"connector": "adyen",
"profile_id": "pro_hB6oV5vfIHyqUVw1aetw",
"merchant_connector_id": "mca_76RN9eoOT1pKjdBC8wU7",
"connector_refund_reference_id": null
},
{
"id": "12345_ref_019754ad614b7122b3f9c2b7c0af3ffa",
"payment_id": "12345_pay_019754acd9797072ad358e2ddc41594f",
"merchant_reference_id": "1749472338",
"amount": 720,
"currency": "USD",
"status": "pending",
"reason": "CUSTOMER REQUEST",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-06-09T12:32:18.275Z",
"updated_at": "2025-06-09T12:33:11.264Z",
"connector": "adyen",
"profile_id": "pro_hB6oV5vfIHyqUVw1aetw",
"merchant_connector_id": "mca_76RN9eoOT1pKjdBC8wU7",
"connector_refund_reference_id": null
},
{
"id": "12345_ref_019754ad1149783385dda1328a50d9c9",
"payment_id": "12345_pay_019754acd9797072ad358e2ddc41594f",
"merchant_reference_id": "1749472318",
"amount": 720,
"currency": "USD",
"status": "failed",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "000",
"message": "Invalid merchant refund reason, the only valid values are : [OTHER, RETURN, DUPLICATE, FRAUD, CUSTOMER REQUEST]"
},
"created_at": "2025-06-09T12:31:57.817Z",
"updated_at": "2025-06-09T12:31:58.211Z",
"connector": "adyen",
"profile_id": "pro_hB6oV5vfIHyqUVw1aetw",
"merchant_connector_id": "mca_76RN9eoOT1pKjdBC8wU7",
"connector_refund_reference_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. Other**
- `api-reference-v2/openapi_spec.json`
- `crates/openapi/src/routes/refunds.rs`
- `crates/router/src/routes/app.rs`
**Detailed Identifier Changes:**
Commit 6ea2e2a6:
Files to modify:
**crates/openapi/src/routes/refunds.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
|
{"pr_number": 8289, "pr_title": "refactor(refunds_v2): Change refunds v2 list request verb from GET to POST", "merged_at": "2025-06-11T14:06:22Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"other": ["api-reference-v2/openapi_spec.json", "crates/openapi/src/routes/refunds.rs", "crates/router/src/routes/app.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.