prompt
stringlengths 83
247k
| response
stringlengths 121
36.1k
| metadata
stringlengths 314
42.3k
|
|---|---|---|
feat(business_profile): add field in profile for manual retry
## 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 -->
- `is_manual_retry_enabled` is added to business profile
- it is a nullable value
- this provide control over the manual retry of payment for merchant
- [note] respective dashboard changes need to be picked
### 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`
-->
Test through Postman:
Create a business profile with is_manual_retry_enabled field:
```
curl --location '{{baseUrl}}/account/{{merchant_id}}/business_profile' \
--header 'Content-Type: application/json' \
--header 'api-key:{{api_key}}' \
--data '{
"profile_name": "food",
"is_manual_retry_enabled": true
}'
```
it should contain the is_manual_retry_enabled in response
```
{
"merchant_id": "merchant_1750857619",
"profile_id": "pro_skzBddaDpo9jRD7fTR28",
"profile_name": "food",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "iOe4hcQkCoDAz5A1Bb8JiVeCrbzOY14WYhvv2s1DCUgjFqh05Dyn8wXaEPrSaegB",
"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,
"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,
"is_manual_retry_enabled": true
}
```
## 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/admin.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
**5. Type Definitions**
- `crates/router/src/types/api/admin.rs`
**6. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `crates/router/src/db/events.rs`
- `migrations/2025-09-03-115802_add-is_manual_retry_enabled-to-business_profile/down.sql`
- ... and 1 more files
**Code Patterns Applied:**
- Extend existing types with new fields (29 changes)
**Detailed Identifier Changes:**
Commit 9c11a6e6:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/db/events.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code
|
{"pr_number": 9266, "pr_title": "feat(business_profile): add field in profile for manual retry", "merged_at": "2025-09-08T10:44:41Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs"], "database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/admin.rs"], "types": ["crates/router/src/types/api/admin.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "crates/router/src/db/events.rs", "migrations/2025-09-03-115802_add-is_manual_retry_enabled-to-business_profile/down.sql", "migrations/2025-09-03-115802_add-is_manual_retry_enabled-to-business_profile/up.sql"]}, "change_types": {"fields_added": 29}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore: add cardholder name as mandatory field for Worldpay card transactions
## 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/7897
### 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
Card holder name is a mandatory field which is required by WP during card transactions.
Fixing the 3DS SetupMandate flow for Worldpay allows merchants to consume the functionality.
## How did you test it?
Same as in https://github.com/juspay/hyperswitch/pull/7897
## 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/worldpay.rs`
- `crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs`
- `crates/payment_methods/src/configs/payment_connector_required_fields.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (4 changes)
**Detailed Identifier Changes:**
Commit d5a5894c:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/worldpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
**crates/payment_methods/src/configs/payment_connector_required_fields.rs**
Modify existing code
|
{"pr_number": 7900, "pr_title": "chore: add cardholder name as mandatory field for Worldpay card transactions", "merged_at": "2025-04-25T07:55:56Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "card", "transaction"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/worldpay.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs"]}, "change_types": {"fields_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [worldpay] remove threeDS data from Authorize request for NTI flows
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR corrects the Worldpay integration for NTI flows by removing `threeDS` from Authorize 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
Helps in keeping NTI flow consistent with Worldpay.
## How did you test it?
Locally, on top of https://github.com/juspay/hyperswitch/pull/7017
Pre-requisites
- Enable `is_connector_agnostic_mit_enabled` in business_profile
<details>
<summary>1. Perform CIT through Adyen</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_lIho0vjguqEI0zDMwln3I2u0aGHXrmoxQt2iSSDBBhN6vAh7vYN4rUlPy0jjML1d' \
--data-raw '{"amount":100,"currency":"USD","confirm":true,"capture_method":"automatic","capture_on":"2022-09-10T10:11:12Z","customer_id":"cus_IoFeOlGhEeD54AbBdvxI","email":"guest@example.com","name":"John Doe","phone":"999999999","profile_id":"pro_7kIKHNtq6xvKHlBfazbc","phone_country_code":"+65","description":"Its my first payment request","authentication_type":"three_ds","return_url":"https://hyperswitch.io","setup_future_usage":"off_session","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"}},"connector":["adyen"],"payment_method":"card","payment_method_data":{"card":{"card_number":"4917610000000000","card_exp_month":"03","card_exp_year":"2030","card_cvc":"737","nick_name":"JD"},"billing":{"email":"guest@example.com","address":{"first_name":"John","last_name":"US"}}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"California","zip":"94122","country":"US","first_name":"John","last_name":"US"}},"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"ip_address":"129.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","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}}'
Response
{"payment_id":"pay_H7rvl8msRLrDEATj7fJl","merchant_id":"merchant_1737699414","status":"requires_customer_action","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":"adyen","client_secret":"pay_H7rvl8msRLrDEATj7fJl_secret_L7zRGUvytBKuDjEOSh3j","created":"2025-01-24T06:17:19.142Z","currency":"USD","customer_id":"cus_IoFeOlGhEeD54AbBdvxI","customer":{"id":"cus_IoFeOlGhEeD54AbBdvxI","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":"off_session","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":"John US","payment_checks":null,"authentication_data":null},"billing":{"address":{"city":null,"country":null,"line1":null,"line2":null,"line3":null,"zip":null,"state":null,"first_name":"John","last_name":"US"},"phone":null,"email":"guest@example.com"}},"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":"John","last_name":"US"},"phone":null,"email":null},"order_details":null,"email":"guest@example.com","name":"John Doe","phone":"999999999","return_url":"https://hyperswitch.io/","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_H7rvl8msRLrDEATj7fJl/merchant_1737699414/pay_H7rvl8msRLrDEATj7fJl_1"},"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_IoFeOlGhEeD54AbBdvxI","created_at":1737699439,"expires":1737703039,"secret":"epk_a77abad3e68440f386b2bfae90f7b404"},"manual_retry_allowed":null,"connector_transaction_id":"QWXC56XWVQS54FV5","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"QWXC56XWVQS54FV5","payment_link":null,"profile_id":"pro_7kIKHNtq6xvKHlBfazbc","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hQArBUWZB4ivXfFBBr9m","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-01-24T06:32:19.142Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"129.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_19peBlu9TYmWO2bASPQL","payment_method_status":"inactive","updated":"2025-01-24T06:17:19.590Z","split_payments":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}
- Open 3DS link and complete the txn
- Retrieve `payment_method_id`
</details>
<details>
<summary>2. MIT through Worldpay (three_ds)</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_lIho0vjguqEI0zDMwln3I2u0aGHXrmoxQt2iSSDBBhN6vAh7vYN4rUlPy0jjML1d' \
--data-raw '{"amount":6500,"currency":"USD","confirm":true,"capture_method":"automatic","capture_on":"2022-09-10T10:11:12Z","customer_id":"cus_IoFeOlGhEeD54AbBdvxI","email":"guest@example.com","name":"John Doe","phone":"999999999","profile_id":"pro_7kIKHNtq6xvKHlBfazbc","phone_country_code":"+65","description":"Its my first payment request","authentication_type":"three_ds","return_url":"https://hyperswitch.io","off_session":true,"recurring_details":{"type":"payment_method_id","data":"pm_19peBlu9TYmWO2bASPQL"},"connector":["worldpay"],"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"ip_address":"129.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","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}}'
Response
{"payment_id":"pay_5LvOZ6RQsFmyQqDvaqXh","merchant_id":"merchant_1737699414","status":"succeeded","amount":6500,"net_amount":6500,"shipping_cost":null,"amount_capturable":0,"amount_received":6500,"connector":"worldpay","client_secret":"pay_5LvOZ6RQsFmyQqDvaqXh_secret_njW4m0eWv4WWrYHXyUws","created":"2025-01-24T06:49:49.063Z","currency":"USD","customer_id":"cus_IoFeOlGhEeD54AbBdvxI","customer":{"id":"cus_IoFeOlGhEeD54AbBdvxI","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":true,"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":"John US","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"guest@example.com","name":"John Doe","phone":"999999999","return_url":"https://hyperswitch.io/","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":{"customer_id":"cus_IoFeOlGhEeD54AbBdvxI","created_at":1737701389,"expires":1737704989,"secret":"epk_37a0d95869a44072afca52b6a53523b0"},"manual_retry_allowed":false,"connector_transaction_id":"eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT6h+lbqfJa+1BSoKFSY8HLWG3iYvLMl12v8Akq6Pt+SKmRV:l4OVG3XzCOZGpobnymfgF9Uk2Www3mSVoKRxeIXIe9pic4l22Rveu3MW0qp:7+4GYJYOg3e9WdLnxDKf8zDOVuNV9Smp3TrKAPuNF+l9HY8h4r+1y1WBHupQz59qPpv59wMMnZCI15w9voaKGUgn8jvCNhmdUlN6uDEfAu3+Gpx8cadeYO0VLI6Wl9IlaVI4eDFRFhVVWboq417XA0B7A7omqvwyPr9UpXP4WEW0OwEozD:UT7vKzbOBIqfC+WwXVvDoxGmrxlJztOw0Zye5zF6oXedJ3PRFO1S38DZNrYIkRNlWpYaVeOJiIYYJegfV4WMVmEHXUV1JsgVeJ7ye7vUhLQaQWH669jc7KxCb6UloO7ZTj7Q+18PY5jSOT91RpDIiNOKkj:oboIAbw=","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"92b96418-ccfc-4a41-b882-c196f2d17d91","payment_link":null,"profile_id":"pro_7kIKHNtq6xvKHlBfazbc","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_c38WWereiWnpVCtrDTmH","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-01-24T07:04:49.062Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"129.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_19peBlu9TYmWO2bASPQL","payment_method_status":"active","updated":"2025-01-24T06:49:51.258Z","split_payments":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}
</details>
<details>
<summary>3. MIT through Worldpay (no_three_ds)</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_lIho0vjguqEI0zDMwln3I2u0aGHXrmoxQt2iSSDBBhN6vAh7vYN4rUlPy0jjML1d' \
--data-raw '{"amount":6500,"currency":"USD","confirm":true,"capture_method":"automatic","capture_on":"2022-09-10T10:11:12Z","customer_id":"cus_IoFeOlGhEeD54AbBdvxI","email":"guest@example.com","name":"John Doe","phone":"999999999","profile_id":"pro_7kIKHNtq6xvKHlBfazbc","phone_country_code":"+65","description":"Its my first payment request","authentication_type":"no_three_ds","return_url":"https://hyperswitch.io","off_session":true,"recurring_details":{"type":"payment_method_id","data":"pm_19peBlu9TYmWO2bASPQL"},"connector":["worldpay"],"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"ip_address":"129.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","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}}'
Response
{"payment_id":"pay_aKGXEEjMffosxq4yATfF","merchant_id":"merchant_1737699414","status":"succeeded","amount":6500,"net_amount":6500,"shipping_cost":null,"amount_capturable":0,"amount_received":6500,"connector":"worldpay","client_secret":"pay_aKGXEEjMffosxq4yATfF_secret_0t5aKcNGKvMSBZ73rq7Q","created":"2025-01-24T06:54:15.005Z","currency":"USD","customer_id":"cus_IoFeOlGhEeD54AbBdvxI","customer":{"id":"cus_IoFeOlGhEeD54AbBdvxI","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":true,"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":"John US","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"guest@example.com","name":"John Doe","phone":"999999999","return_url":"https://hyperswitch.io/","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":"cus_IoFeOlGhEeD54AbBdvxI","created_at":1737701654,"expires":1737705254,"secret":"epk_f22c70c671db4033ab961e4c22ae527e"},"manual_retry_allowed":false,"connector_transaction_id":"eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT6h+lbqfJa+1BSoKFSY8HLGSTASY95iq12AOTIBUlbsIGcbISmRKqyXIcHxP13A3qmfgF9Uk2Www3mSVoKRxeIXIe9pic4l22Rveu3MW0qp:7+4GYJYOg3e9WdLnxDKf8zDOVuNV9Smp3TrKAPuNF+l9HY8h4r+1y1WBHupQz59qPpv59wMMnZCI15w9voaKGUgn8jvCNhmdUlN6uDEfAu3+Gpx8cadeYO0VLI6Wl9InLGVywmC7PhBaHgcQaHenojnpgUJrlrQeSkmSEIXwt1fH1esPYY8WNPjoRYtjOHTS+WwXVvDoxGmrxlJztOw0Zye5zF6oXedJ3PRFO1S38DZNrYIkRNlWpYaVeOJiIYYJegfV4WMVmEHXUV1JsgVeJ7ye7vUhLQaQWH669jc7Kx9M5pRUpP39THyBJ9inGcU+T91RpDIiNOKkj:oboIAbw=","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"845551ad-c9a7-4722-8f8c-42d05097f692","payment_link":null,"profile_id":"pro_7kIKHNtq6xvKHlBfazbc","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_c38WWereiWnpVCtrDTmH","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-01-24T07:09:15.005Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"129.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_19peBlu9TYmWO2bASPQL","payment_method_status":"active","updated":"2025-01-24T06:54:16.779Z","split_payments":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs`
- `crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs`
**Detailed Identifier Changes:**
Commit 7b1bb39f:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
Commit d443a4cf:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
|
{"pr_number": 7097, "pr_title": "fix(connector): [worldpay] remove threeDS data from Authorize request for NTI flows", "merged_at": "2025-02-05T15:13:19Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
feat(connector): [DUMMY_CONNECTOR] crate restructuring
## 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 -->
Movement of dummy connector form `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).
-->
https://github.com/juspay/hyperswitch/issues/8371
## 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)?
-->
Only dummy connector moved to crate hyoerswitch_connectors hence no testing required.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] 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/payments/flows.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/Cargo.toml`
- `crates/hyperswitch_connectors/src/connectors.rs`
- `crates/hyperswitch_connectors/src/connectors/dummyconnector.rs`
- ... and 5 more files
**3. Configuration Files**
- `crates/router/Cargo.toml`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (52 changes)
- Extend existing types with new fields (113 changes)
**Detailed Identifier Changes:**
Commit 293d93f6:
Files to modify:
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::dummyconnector
**crates/hyperswitch_connectors/src/connectors/dummyconnector.rs**
Add:
- function: private::build_headers
- function: private::id
- function: private::common_get_content_type
- function: private::base_url
- function: private::get_auth_header
- function: private::build_error_response
- function: private::validate_connector_against_payment_request
- 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_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::DummyConnector
- impl: impl Payment for DummyConnector<T>
- impl: impl PaymentSession for DummyConnector<T>
- impl: impl ConnectorAccessToken for DummyConnector<T>
- impl: impl MandateSetup for DummyConnector<T>
- impl: impl PaymentAuthorize for DummyConnector<T>
- impl: impl PaymentSync for DummyConnector<T>
- impl: impl PaymentCapture for DummyConnector<T>
- impl: impl PaymentVoid for DummyConnector<T>
- impl: impl Refund for DummyConnector<T>
- impl: impl RefundExecute for DummyConnector<T>
- impl: impl RefundSync for DummyConnector<T>
- impl: impl PaymentToken for DummyConnector<T>
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorCommonExt<Flow, Request, Response> for DummyConnector<T>
- impl: impl ConnectorCommon for DummyConnector<T>
- impl: impl ConnectorValidation for DummyConnector<T>
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for DummyConnector<T>
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for DummyConnector<T>
- impl: impl IncomingWebhook for DummyConnector<T>
- impl: impl ConnectorSpecifications for DummyConnector<T>
- mod: pub::transformers
**crates/hyperswitch_connectors/src/default_implementations.rs**
Add:
- function: private::get_flow_type
- impl: impl PaymentsCompleteAuthorize for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl ConnectorVerifyWebhookSource for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
VerifyWebhookSource,
VerifyWebhookSourceRequestData,
VerifyWebhookSourceResponseData,
> for connectors::DummyConnector<T>
- impl: impl ConnectorCustomer for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl ConnectorRedirectResponse for connectors::DummyConnector<T>
- impl: impl ConnectorTransactionId for connectors::DummyConnector<T>
- impl: impl Dispute for connectors::DummyConnector<T>
- impl: impl AcceptDispute for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Accept, AcceptDisputeRequestData, AcceptDisputeResponse> for connectors::DummyConnector<T>
- impl: impl FileUpload for connectors::DummyConnector<T>
- impl: impl UploadFile for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Upload, UploadFileRequestData, UploadFileResponse> for connectors::DummyConnector<T>
- impl: impl RetrieveFile for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Retrieve, RetrieveFileRequestData, RetrieveFileResponse> for connectors::DummyConnector<T>
- impl: impl SubmitEvidence for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Evidence, SubmitEvidenceRequestData, SubmitEvidenceResponse> for connectors::DummyConnector<T>
- impl: impl DefendDispute for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Defend, DefendDisputeRequestData, DefendDisputeResponse> for connectors::DummyConnector<T>
- impl: impl PaymentsPreProcessing for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl PaymentsPostProcessing for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PostProcessing, PaymentsPostProcessingData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl api::Payouts for connectors::DummyConnector<T>
- impl: impl PayoutCreate for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PoCreate, PayoutsData, PayoutsResponseData> for connectors::DummyConnector<T>
- impl: impl PayoutSync for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> for connectors::DummyConnector<T>
- impl: impl PayoutEligibility for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PoEligibility, PayoutsData, PayoutsResponseData> for connectors::DummyConnector<T>
- impl: impl PayoutFulfill for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for connectors::DummyConnector<T>
- impl: impl PayoutCancel for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PoCancel, PayoutsData, PayoutsResponseData> for connectors::DummyConnector<T>
- impl: impl PayoutQuote for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PoQuote, PayoutsData, PayoutsResponseData> for connectors::DummyConnector<T>
- impl: impl PayoutRecipient for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PoRecipient, PayoutsData, PayoutsResponseData> for connectors::DummyConnector<T>
- impl: impl PayoutRecipientAccount for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PoRecipientAccount, PayoutsData, PayoutsResponseData> for connectors::DummyConnector<T>
- impl: impl PaymentApprove for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Approve, PaymentsApproveData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl PaymentReject for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Reject, PaymentsRejectData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl FraudCheck for connectors::DummyConnector<T>
- impl: impl FraudCheckSale for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Sale, FraudCheckSaleData, FraudCheckResponseData> for connectors::DummyConnector<T>
- impl: impl FraudCheckCheckout for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Checkout, FraudCheckCheckoutData, FraudCheckResponseData> for connectors::DummyConnector<T>
- impl: impl FraudCheckTransaction for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Transaction, FraudCheckTransactionData, FraudCheckResponseData> for connectors::DummyConnector<T>
- impl: impl FraudCheckFulfillment for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Fulfillment, FraudCheckFulfillmentData, FraudCheckResponseData> for connectors::DummyConnector<T>
- impl: impl FraudCheckRecordReturn for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<RecordReturn, FraudCheckRecordReturnData, FraudCheckResponseData> for connectors::DummyConnector<T>
- impl: impl PaymentIncrementalAuthorization for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
IncrementalAuthorization,
PaymentsIncrementalAuthorizationData,
PaymentsResponseData,
> for connectors::DummyConnector<T>
- impl: impl ConnectorMandateRevoke for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<MandateRevoke, MandateRevokeRequestData, MandateRevokeResponseData> for connectors::DummyConnector<T>
- impl: impl ExternalAuthentication for connectors::DummyConnector<T>
- impl: impl ConnectorPreAuthentication for connectors::DummyConnector<T>
- impl: impl ConnectorPreAuthenticationVersionCall for connectors::DummyConnector<T>
- impl: impl ConnectorAuthentication for connectors::DummyConnector<T>
- impl: impl ConnectorPostAuthentication for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
Authentication,
ConnectorAuthenticationRequestData,
AuthenticationResponseData,
> for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PreAuthentication, PreAuthNRequestData, AuthenticationResponseData> for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
PreAuthenticationVersionCall,
PreAuthNRequestData,
AuthenticationResponseData,
> for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
PostAuthentication,
ConnectorPostAuthenticationRequestData,
AuthenticationResponseData,
> for connectors::DummyConnector<T>
- impl: impl PaymentAuthorizeSessionToken for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<AuthorizeSessionToken, AuthorizeSessionTokenData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl TaxCalculation for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<CalculateTax, PaymentsTaxCalculationData, TaxCalculationResponseData> for connectors::DummyConnector<T>
- impl: impl PaymentSessionUpdate for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<SdkSessionUpdate, SdkPaymentsSessionUpdateData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl PaymentPostSessionTokens for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<PostSessionTokens, PaymentsPostSessionTokensData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl PaymentsCreateOrder for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<CreateOrder, CreateOrderRequestData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl PaymentUpdateMetadata for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<UpdateMetadata, PaymentsUpdateMetadataData, PaymentsResponseData> for connectors::DummyConnector<T>
- impl: impl UasPreAuthentication for connectors::DummyConnector<T>
- impl: impl UnifiedAuthenticationService for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
PreAuthenticate,
UasPreAuthenticationRequestData,
UasAuthenticationResponseData,
> for connectors::DummyConnector<T>
- impl: impl UasPostAuthentication for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
PostAuthenticate,
UasPostAuthenticationRequestData,
UasAuthenticationResponseData,
> for connectors::DummyConnector<T>
- impl: impl UasAuthenticationConfirmation for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
AuthenticationConfirmation,
UasConfirmationRequestData,
UasAuthenticationResponseData,
> for connectors::DummyConnector<T>
- impl: impl UasAuthentication for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<Authenticate, UasAuthenticationRequestData, UasAuthenticationResponseData> for connectors::DummyConnector<T>
- impl: impl RevenueRecovery for connectors::DummyConnector<T>
- impl: impl api::revenue_recovery::BillingConnectorPaymentsSyncIntegration for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
BillingConnectorPaymentsSync,
BillingConnectorPaymentsSyncRequest,
BillingConnectorPaymentsSyncResponse,
> for connectors::DummyConnector<T>
- impl: impl api::revenue_recovery::RevenueRecoveryRecordBack for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
RecoveryRecordBack,
RevenueRecoveryRecordBackRequest,
RevenueRecoveryRecordBackResponse,
> for connectors::DummyConnector<T>
- impl: impl BillingConnectorInvoiceSyncIntegration for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
BillingConnectorInvoiceSync,
BillingConnectorInvoiceSyncRequest,
BillingConnectorInvoiceSyncResponse,
> for connectors::DummyConnector<T>
- impl: impl ExternalVault for connectors::DummyConnector<T>
- impl: impl ExternalVaultInsert for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<ExternalVaultInsertFlow, VaultRequestData, VaultResponseData> for connectors::DummyConnector<T>
- impl: impl ExternalVaultRetrieve for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<ExternalVaultRetrieveFlow, VaultRequestData, VaultResponseData> for connectors::DummyConnector<T>
- impl: impl ExternalVaultDelete for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<ExternalVaultDeleteFlow, VaultRequestData, VaultResponseData> for connectors::DummyConnector<T>
- impl: impl ExternalVaultCreate for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<ExternalVaultCreateFlow, VaultRequestData, VaultResponseData> for connectors::DummyConnector<T>
**crates/router/src/connector.rs**
Remove:
- mod: pub::dummyconnector
**crates/router/src/connector/dummyconnector.rs**
Remove:
- function: private::build_headers
- function: private::id
- function: private::common_get_content_type
- function: private::base_url
- function: private::get_auth_header
- function: private::build_error_response
- function: private::validate_connector_against_payment_request
- 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_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::DummyConnector
- impl: impl api::Payment for DummyConnector<T>
- impl: impl api::PaymentSession for DummyConnector<T>
- impl: impl api::ConnectorAccessToken for DummyConnector<T>
- impl: impl api::MandateSetup for DummyConnector<T>
- impl: impl api::PaymentAuthorize for DummyConnector<T>
- impl: impl api::PaymentSync for DummyConnector<T>
- impl: impl api::PaymentCapture for DummyConnector<T>
- impl: impl api::PaymentVoid for DummyConnector<T>
- impl: impl api::Refund for DummyConnector<T>
- impl: impl api::RefundExecute for DummyConnector<T>
- impl: impl api::RefundSync for DummyConnector<T>
- impl: impl api::PaymentToken for DummyConnector<T>
- impl: impl ConnectorIntegration<
api::PaymentMethodToken,
types::PaymentMethodTokenizationData,
types::PaymentsResponseData,
> for DummyConnector<T>
- impl: impl ConnectorCommonExt<Flow, Request, Response> for DummyConnector<T>
- impl: impl ConnectorCommon for DummyConnector<T>
- impl: impl ConnectorValidation for DummyConnector<T>
- impl: impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> for DummyConnector<T>
- impl: impl ConnectorIntegration<
api::SetupMandate,
types::SetupMandateRequestData,
types::PaymentsResponseData,
> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for DummyConnector<T>
- impl: impl api::IncomingWebhook for DummyConnector<T>
- impl: impl ConnectorSpecifications for DummyConnector<T>
- mod: pub::transformers
**crates/router/src/connector/utils.rs**
Remove:
- function: pub::construct_not_supported_error_report
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Modify existing code
|
{"pr_number": 8372, "pr_title": "feat(connector): [DUMMY_CONNECTOR] crate restructuring", "merged_at": "2025-06-20T13:24:23Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/hyperswitch_connectors/Cargo.toml", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/dummyconnector.rs", "crates/router/src/connector/dummyconnector/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/router/src/connector.rs", "crates/router/src/connector/dummyconnector.rs", "crates/router/src/connector/utils.rs"], "config": ["crates/router/Cargo.toml"]}, "change_types": {"structs_added": 1, "functions_added": 52, "enums_added": 2, "fields_added": 113, "imports_added": 20}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [SANTANDER] Add Template Code
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
API Reference : https://developer.santander.com.br/api/documentacao/pix-visao-geral#/api/documentacao/pix-visao-geral/
https://developer.santander.com.br/api/user-guide/pix-visao-geral
### 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. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/configs.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`
- `crates/hyperswitch_connectors/src/connectors.rs`
- ... and 10 more files
**4. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/transformers.rs`
**5. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**6. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (78 changes)
- Extend existing types with new fields (157 changes)
**Detailed Identifier Changes:**
Commit c8b35dac:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::santander
**crates/hyperswitch_connectors/src/connectors/santander.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::Santander
- impl: impl Santander
- impl: impl api::Payment for Santander
- impl: impl api::PaymentSession for Santander
- impl: impl api::ConnectorAccessToken for Santander
- impl: impl api::MandateSetup for Santander
- impl: impl api::PaymentAuthorize for Santander
- impl: impl api::PaymentSync for Santander
- impl: impl api::PaymentCapture for Santander
- impl: impl api::PaymentVoid for Santander
- impl: impl api::Refund for Santander
- impl: impl api::RefundExecute for Santander
- impl: impl api::RefundSync for Santander
- impl: impl api::PaymentToken for Santander
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Santander
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Santander
- impl: impl ConnectorCommon for Santander
- impl: impl ConnectorValidation for Santander
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Santander
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Santander
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Santander
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Santander
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Santander
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Santander
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Santander
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Santander
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Santander
- impl: impl webhooks::IncomingWebhook for Santander
- impl: impl ConnectorSpecifications for Santander
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/santander/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::SantanderRouterData
- struct: pub::SantanderPaymentsRequest
- struct: pub::SantanderCard
- struct: pub::SantanderAuthType
- struct: pub::SantanderPaymentsResponse
- struct: pub::SantanderRefundRequest
- struct: pub::RefundResponse
- struct: pub::SantanderErrorResponse
- enum: pub::SantanderPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMajorUnit, T)> for SantanderRouterData<T>
- impl: impl TryFrom<&SantanderRouterData<&PaymentsAuthorizeRouterData>> for SantanderPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for SantanderAuthType
- impl: impl From<SantanderPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, SantanderPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&SantanderRouterData<&RefundsRouterData<F>>> for SantanderRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
- impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/configs.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::santander
**crates/router/tests/connectors/santander.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::SantanderTest
- impl: impl ConnectorActions for SantanderTest
- impl: impl utils::Connector for SantanderTest
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 8369, "pr_title": "feat(connector): [SANTANDER] Add Template Code", "merged_at": "2025-06-20T13:28:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/configs.rs"], "core_business": ["crates/router/src/core/admin.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/santander.rs", "crates/hyperswitch_connectors/src/connectors/santander/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/santander.rs", "crates/test_utils/src/connector_auth.rs", "scripts/add_connector.sh"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 10, "functions_added": 78, "enums_added": 2, "fields_added": 157, "imports_added": 19}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(api_models): Fix `wasm` build problems caused by `actix-multipart`
## 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 -->
Wasm build is failing because of adding `actix-multipart` dependency 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).
-->
Closes #6748.
## 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)?
-->
Checked by building `wasm` locally. It worked.

No need to run any other tests as this is an internal change.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/Cargo.toml`
- `crates/api_models/src/events/user.rs`
- `crates/api_models/src/user.rs`
**2. Configuration Files**
- `crates/router/Cargo.toml`
**Code Patterns Applied:**
**Detailed Identifier Changes:**
Commit 437a8de8:
Files to modify:
**crates/api_models/src/events/user.rs**
Modify existing code
**crates/api_models/src/user.rs**
Modify existing code
|
{"pr_number": 6747, "pr_title": "fix(api_models): Fix `wasm` build problems caused by `actix-multipart`", "merged_at": "2024-12-05T11:09:38Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"api_models": ["crates/api_models/Cargo.toml", "crates/api_models/src/events/user.rs", "crates/api_models/src/user.rs"], "config": ["crates/router/Cargo.toml"]}, "change_types": {"imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment-methods): create payment_token in vault confirm / do payment-confirm with temp token from session
## 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 -->
- Save the context of payment_method_id in the session
- Create temporary token for payment_method_id to pass to payment confirm
- Save the cvc as a temporary data against the payment_token to be accessed by payment
- Evict the cvc after first use
- Encrypt/Decrypt the payload for cvc to store in redis
- do confirm with payment_token in payment confirm call
- the relative data are stored temporarily (15 mins) or till the first use
- payment_method_data and cvc are fetch against the payment_token for the payment
### Additional Changes
- [x] This PR modifies the API contract
payment token are present in payment method session response
```
"associated_payment_methods": [
"token_Dafmj9an9QORtSR2ZUlt"
],
```
- [ ] 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 (Hyperswitch v2):
Create a customer:
- curl for customer create
```
curl --location '{{baseUrl}}/v2/customers' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key={{api_key}}' \
--data-raw '{
"name": "John Doe",
"email": "guest@example.com"
}'
```
- example response:
```
{
"id": "12345_cus_0197c9ed96757970805bab9ee33c297c",
"merchant_reference_id": null,
"connector_customer_ids": null,
"name": "John Doe",
"email": "guest@example.com",
"phone": null,
"phone_country_code": null,
"description": null,
"default_billing_address": null,
"default_shipping_address": null,
"created_at": "2025-07-02T06:58:00.438Z",
"metadata": null,
"default_payment_method_id": null
}
```
Create an Payment Intent:
- curl for create payment intent
```
curl --location '{{baseUrl}}/v2/payments/create-intent' \
--header 'Content-Type: application/json' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Authorization: api-key={{api_key}}' \
--data '{
"amount_details": {
"order_amount": 100,
"currency": "EUR"
},
"customer_id": "{{customer_id}}",
"capture_method":"automatic",
"authentication_type": "no_three_ds"
}'
```
- example response
```
{
"id": "12345_pay_0197ca1bd1b77843abb91962582f7e4b",
"status": "requires_payment_method",
"amount_details": {
"order_amount": 100,
"currency": "EUR",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null
},
"client_secret": "cs_0197ca1bd1d07612a7b320f752ac4488",
"profile_id": "pro_SZTOpU280AYkfajAgo5e",
"merchant_reference_id": null,
"routing_algorithm_id": null,
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"billing": null,
"shipping": null,
"customer_id": "12345_cus_0197ca1b7f117c20b6e75853d71550af",
"customer_present": "present",
"description": null,
"return_url": null,
"setup_future_usage": "on_session",
"apply_mit_exemption": "Skip",
"statement_descriptor": null,
"order_details": null,
"allowed_payment_method_types": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"payment_link_enabled": "Skip",
"payment_link_config": null,
"request_incremental_authorization": "default",
"expires_on": "2025-07-02T08:03:30.279Z",
"frm_metadata": null,
"request_external_three_ds_authentication": "Skip"
}
```
Create a Payment Method Session:
- curl for payment_method_session create
```
curl --location 'http://localhost:8080/v2/payment-methods-session' \
--header 'X-Profile-Id: pro_SZTOpU280AYkfajAgo5e' \
--header 'x-feature: hyperswitch-custom-v2' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_asjzrvIGaJOBC19Hx719NnZBxpydXaERsgKO6ltr9X8Z0sg69XouAfZnRoQB14W4' \
--data '{
"customer_id": "{{customer_id}}"
}'
```
- example response
```
{
"id": "12345_pms_0197ca1b96677e10bc58ea9b14097714",
"customer_id": "12345_cus_0197ca1b7f117c20b6e75853d71550af",
"billing": null,
"psp_tokenization": null,
"network_tokenization": null,
"tokenization_data": null,
"expires_at": "2025-07-02T08:03:15.079Z",
"client_secret": "cs_0197ca1b96677e10bc58eaa6c8632a9d",
"return_url": null,
"next_action": null,
"authentication_details": null,
"associated_payment_methods": null,
"associated_token_id": null
}
```
Confirm the session and collect the payment_method_token from associated_payment_methods:
- curl for confirming payment_method_session:
```
curl --location '{{baseUrl}}/v2/payment-methods-session/:session_id' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: publishable-key={{publishable_key}},client-secret={{client_secret}}' \
--data '{
"payment_method_type": "card",
"payment_method_subtype": "debit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "11",
"card_exp_year": "29",
"card_holder_name": "John Doe",
"card_cvc": "123"
}
}
}'
```
- example response
```
{
"id": "12345_pms_0197ca1b96677e10bc58ea9b14097714",
"customer_id": "12345_cus_0197ca1b7f117c20b6e75853d71550af",
"billing": null,
"psp_tokenization": null,
"network_tokenization": null,
"tokenization_data": null,
"expires_at": "2025-07-02T08:03:15.079Z",
"client_secret": "CLIENT_SECRET_REDACTED",
"return_url": null,
"next_action": null,
"authentication_details": null,
"associated_payment_methods": [
"token_Dafmj9an9QORtSR2ZUlt"
],
"associated_token_id": null
}
```
Confirm the payment with the payment_method_token:
- curl for confirming payment
```
curl --location '{{baseUrl}}/v2/payments/{{payment_id}}/confirm-intent' \
--header 'x-client-secret:{{client_secret}}' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: publishable-key={{publishable_key}},client-secret={{client_secret}}' \
--data '{
"payment_method_data": {
"card_token": {
}
},
"payment_method_type": "card",
"payment_method_subtype": "debit",
"payment_token": "token_Dafmj9an9QORtSR2ZUlt"
}'
```
- example response
```
{
"id": "12345_pay_0197ca1bd1b77843abb91962582f7e4b",
"status": "succeeded",
"amount": {
"order_amount": 100,
"currency": "EUR",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 100
},
"customer_id": "12345_cus_0197ca1b7f117c20b6e75853d71550af",
"connector": "stripe",
"created": "2025-07-02T07:48:30.279Z",
"payment_method_data": {
"billing": null
},
"payment_method_type": "card",
"payment_method_subtype": "debit",
"connector_transaction_id": "pi_3RgLPJD5R7gDAGff1vB5q7OL",
"connector_reference_id": null,
"merchant_connector_id": "mca_pWR7OWBqRtRvEAr9zgkE",
"browser_info": null,
"error": null,
"shipping": null,
"billing": null,
"attempts": null,
"connector_token_details": {
"token": "pm_1RgLPJD5R7gDAGff8n5Q2798",
"connector_token_request_reference_id": "Og4oxt3597iaNjG9wS"
},
"payment_method_id": "12345_pm_0197ca1ba6ec7d63a37f47fa75794839",
"next_action": null,
"return_url": "https://google.com/success",
"authentication_type": "no_three_ds",
"authentication_type_applied": "no_three_ds",
"is_iframe_redirection_enabled": null,
"merchant_reference_id": null
}
```
## 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`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_methods_session.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/vault.rs`
- `crates/router/src/core/payments/operations/payment_confirm_intent.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (2 changes)
- Extend existing types with new fields (27 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 4aca4553:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Modify existing code
**crates/diesel_models/src/payment_methods_session.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/vault.rs**
Add:
- function: pub::insert_cvc_using_payment_token
- function: pub::retrieve_and_delete_cvc_from_payment_token
- struct: pub::TemporaryVaultCvc
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Modify existing code
|
{"pr_number": 8525, "pr_title": "feat(payment-methods): create payment_token in vault confirm / do payment-confirm with temp token from session", "merged_at": "2025-07-07T11:56:09Z", "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/payment_methods_session.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/vault.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs"]}, "change_types": {"structs_added": 1, "functions_added": 2, "fields_added": 27, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): Making a mandate payment with large customer user agents
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Added cypress test for this PR(https://github.com/juspay/hyperswitch/pull/8616/files).
Increased the Cypress timeout to ensure all redirection flows complete successfully during CI checks.
## How did you test it?
<img width="551" height="703" alt="image" src="https://github.com/user-attachments/assets/209a3fd8-3868-4e89-901f-e5eb74b8da0a" />
## 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 **validation** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests/cypress.config.js`
- `cypress-tests/cypress/e2e/configs/Payment/Commons.js`
**Code Patterns Applied:**
- Extend existing types with new fields (11 changes)
|
{"pr_number": 8790, "pr_title": "ci(cypress): Making a mandate payment with large customer user agents", "merged_at": "2025-07-30T10:07:15Z", "intent": {"feature_type": "validation", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"tests": ["cypress-tests/cypress.config.js", "cypress-tests/cypress/e2e/configs/Payment/Commons.js"]}, "change_types": {"fields_added": 11}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(permissions): Remove permissions field from permission info API response
## 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 -->
The permissions in the permission info API are not being used and this PR will remove them.
This will help the future PRs which will introduce new kind of Permissions.
### 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 [#6375](https://github.com/juspay/hyperswitch/issues/6375).
## 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 'https://sandbox.hyperswitch.io/user/permission_info' \
--header 'Authorization: Bearer JWT'
```
This API will no longer have permissions field in the response.
```json
[
{
"group": "operations_view",
"description": "View Payments, Refunds, Payouts, Mandates, Disputes and Customers"
},
{
"group": "operations_manage",
"description": "Create, modify and delete Payments, Refunds, Payouts, Mandates, Disputes and Customers"
}
]
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/user_role.rs`
**2. Utils**
- `crates/router/src/utils/user_role.rs`
**3. Other**
- `crates/router/src/services/authorization/info.rs`
- `crates/router/src/services/authorization/permissions.rs`
**Code Patterns Applied:**
**Detailed Identifier Changes:**
Commit e5710fa0:
Files to modify:
**crates/api_models/src/user_role.rs**
Remove:
- struct: pub::PermissionInfo
- enum: pub::Permission
**crates/router/src/services/authorization/info.rs**
Remove:
- function: pub::get_permission_info_from_permissions
**crates/router/src/services/authorization/permissions.rs**
Remove:
- function: pub::get_permission_description
- impl: impl Permission
**crates/router/src/utils/user_role.rs**
Remove:
- function: private::from
- impl: impl From<Permission> for user_role_api::Permission
|
{"pr_number": 6376, "pr_title": "refactor(permissions): Remove permissions field from permission info API response", "merged_at": "2024-10-22T10:15:42Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/user_role.rs"], "utils": ["crates/router/src/utils/user_role.rs"], "other": ["crates/router/src/services/authorization/info.rs", "crates/router/src/services/authorization/permissions.rs"]}, "change_types": {"imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Loonio] Implement 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 interac Bank Redirect Payment Method
- Payments
- Psync
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
1. Create MCA for Loonio
```
curl --location 'http://localhost:8080/account/merchant_1759170450/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: _' \
--data '{
"connector_type": "payment_processor",
"business_country": "US",
"business_label": "food",
"connector_name": "loonio",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "",
"key1": "_"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "interac",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
]
}'
```
2. Create a Interac Payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: _' \
--data-raw '{
"amount": 1500,
"currency": "CAD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "aaaa",
"profile_id": "pro_C15ZRcjRQncWBGB2yuqm",
"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": "SG",
"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_pDnVks1Ok2xqEiTKSc3L",
"merchant_id": "merchant_1759170450",
"status": "failed",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "loonio",
"client_secret": "pay_pDnVks1Ok2xqEiTKSc3L_secret_BOt98GDVh1YUREeBj49y",
"created": "2025-09-30T09:06:47.208Z",
"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": "SG",
"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": null,
"cancellation_reason": null,
"error_code": "BSC02005",
"error_message": "Input field validation error: 'Missed required field 'transaction_id'.'.",
"unified_code": "UE_9000",
"unified_message": "Something went wrong",
"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": 1759223207,
"expires": 1759226807,
"secret": "epk_e7a1dc4e967a490781a35fe9d93dcf9a"
},
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_C15ZRcjRQncWBGB2yuqm",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_1D5PxJd9ci3fD8Nj9hKL",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-30T09:21:47.208Z",
"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-30T09:06:48.505Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": {
"network_advice_code": null
}
}
```
Complete payment using redirect_url
It takes about 1 minute after the redirection for the status to change to succeeded.
3. Do force sync for status get
```
curl --location 'http://localhost:8080/payments/pay_pDnVks1Ok2xqEiTKSc3L?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: _'
```
Response
```
{
"payment_id": "pay_hJ7WTdtJEsXcY53E7n0W",
"merchant_id": "merchant_1759170450",
"status": "succeeded",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1500,
"connector": "loonio",
"client_secret": "pay_hJ7WTdtJEsXcY53E7n0W_secret_OzW8vHtTkedDIW8yt9Sn",
"created": "2025-09-30T08:59:59.957Z",
"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": "SG",
"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": null,
"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": null,
"manual_retry_allowed": null,
"connector_transaction_id": "pay_hJ7WTdtJEsXcY53E7n0W_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_C15ZRcjRQncWBGB2yuqm",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_1D5PxJd9ci3fD8Nj9hKL",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-30T09:14:59.957Z",
"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-30T09:00:55.783Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
## 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/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 8 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/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**6. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (4 changes)
- Extend existing types with new fields (64 changes)
**Detailed Identifier Changes:**
Commit c1f8b961:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/loonio.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs**
Remove:
- function: private::try_from
- struct: pub::LoonioPaymentsRequest
- struct: pub::LoonioCard
- impl: impl TryFrom<&LoonioRouterData<&PaymentsAuthorizeRouterData>> for LoonioPaymentsRequest
**crates/hyperswitch_connectors/src/constants.rs**
Modify existing code
**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
|
{"pr_number": 9620, "pr_title": "feat(connector): [Loonio] Implement interac Bank Redirect Payment Method", "merged_at": "2025-09-30T15:41:22Z", "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/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/loonio.rs", "crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs", "crates/hyperswitch_connectors/src/constants.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"], "types": ["crates/router/src/types/api/feature_matrix.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"]}, "change_types": {"structs_added": 4, "functions_added": 4, "enums_added": 2, "fields_added": 64, "imports_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat: customise default theme
## 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 -->
https://github.com/user-attachments/assets/89bb0a3f-b160-4b60-91fe-6306a806c554
FE PR : https://github.com/juspay/hyperswitch-control-center/pull/3505
This pull request makes significant updates to the dashboard configuration and theming system. The main changes include a major refactor of the `dashboard.toml` file to reorganize endpoints and feature flags, and the introduction of a new `dashboard_theme.json` file to centralize and modernize theme settings. These changes improve maintainability, flexibility, and clarity in how the dashboard's appearance and features are configured.
**Configuration and Feature Management:**
- Refactored `config/dashboard.toml`:
- Removed the `[default.theme]` section and moved theme-related settings to a new JSON file.
- Updated and reorganized `[default.endpoints]` with new URLs and additional keys for certificates, analytics, and third-party integrations.
- Expanded `[default.features]` with new feature flags (e.g., `branding`, `mixpanel`, `feedback`, `global_search`, `transaction_view`, `custom_webhook_headers`, etc.) and restructured existing flags for better clarity and future scalability.
- Added `[default.merchant_config.whitelist]` and `[default.merchant_config.blacklist]` sections to support granular merchant-specific feature access control.
**Theming and UI Customization:**
- Added `config/dashboard_theme.json`:
- Introduced a new JSON-based theme configuration with structured settings for colors, sidebar, typography, buttons, borders, and spacing.
- Centralized all UI theming options to make it easier to update the dashboard's look and feel without modifying TOML files.
- Provided placeholders for `faviconUrl` and `logoUrl` to further support branding customization.
### 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. Configuration Files**
- `config/dashboard.toml`
- `config/dashboard_theme.json`
- `docker-compose.yml`
|
{"pr_number": 9243, "pr_title": "feat: customise default theme", "merged_at": "2025-09-09T09:37:32Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "order"]}, "hierarchy": {"config": ["config/dashboard.toml", "config/dashboard_theme.json", "docker-compose.yml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(authentication): moved cavv storing from table to temp locker
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Refactoring
## Description
<!-- Describe your changes in detail -->
moved cavv storing from table to temp locker
## 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).
-->
Currently we are storing CAVV value in authentication table which might cause a security issue to resolve that we will be storing the CAVV in temp locker and fetch it in the current session while proceeding with the transaction.
## 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 sanity of 3ds flows such as Netcetera, 3dsecure.io
Do Payments Create
```shell
curl --location 'localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ChBq2jsHNemvjysRrur7R62Xlk5acxmaneYdGdYu05Rn4yPtnj8uySMIVd8qnqBa' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": false,
"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": "+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",
"last_name": "ieuhfuqe"
},
"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"
},
"force_3ds_challenge": false
}'
```
Do version call in payments confirm
```shell
curl --location 'localhost:8080/payments/pay_FMW9BlITyGdXbkqFqGCr/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ChBq2jsHNemvjysRrur7R62Xlk5acxmaneYdGdYu05Rn4yPtnj8uySMIVd8qnqBa' \
--data '{
"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": "115.99.183.2"
},
"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": "cvc"
}
}
}'
```
authenticate via browser
```shell
curl --location 'http://localhost:8080/payments/pay_FMW9BlITyGdXbkqFqGCr/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_9dd8d1dc9c24494ab149ee4364874671' \
--data '{
"client_secret": "pay_FMW9BlITyGdXbkqFqGCr_secret_HcardpDpDtFO0wOpi8nA",
"device_channel": "BRW",
"threeds_method_comp_ind": "N"
}'
```
Authorise
```shell
curl --location 'localhost:8080/payments/pay_FMW9BlITyGdXbkqFqGCr/sahkal/authorize/cybersource' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_9dd8d1dc9c24494ab149ee4364874671' \
--data '{
"client_secret": "pay_FMW9BlITyGdXbkqFqGCr_secret_HcardpDpDtFO0wOpi8nA"
}'
```
## 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. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/authentication.rs`
**2. Domain Models (Business Logic Types)**
- `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`
**3. Core Business Logic**
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/authentication/utils.rs`
- `crates/router/src/core/payments.rs`
- ... and 7 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/gpayments/gpayments_types.rs`
- `crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs`
- `crates/router/src/connector/threedsecureio/transformers.rs`
**5. Type Definitions**
- `crates/router/src/types/api/authentication.rs`
- `crates/router/src/types/domain.rs`
- `crates/router/src/types/transformers.rs`
**6. Other**
- `crates/hyperswitch_interfaces/src/authentication.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (32 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit dbaf5679:
Files to modify:
**crates/diesel_models/src/authentication.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/gpayments/gpayments_types.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/authentication.rs**
Add:
- struct: pub::AuthenticationStore
**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/connector/threedsecureio/transformers.rs**
Modify existing code
**crates/router/src/core/authentication.rs**
Modify existing code
**crates/router/src/core/authentication/utils.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_status.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/payments/types.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/types/api/authentication.rs**
Modify existing code
**crates/router/src/types/domain.rs**
Add:
- mod: pub::authentication
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 7978, "pr_title": "refactor(authentication): moved cavv storing from table to temp locker", "merged_at": "2025-05-12T11:24:55Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"database": ["crates/diesel_models/src/authentication.rs"], "domain": ["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.rs", "crates/router/src/core/authentication/utils.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/payment_status.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/payments/types.rs", "crates/router/src/core/unified_authentication_service/utils.rs", "crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/gpayments/gpayments_types.rs", "crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs", "crates/router/src/connector/threedsecureio/transformers.rs"], "types": ["crates/router/src/types/api/authentication.rs", "crates/router/src/types/domain.rs", "crates/router/src/types/transformers.rs"], "other": ["crates/hyperswitch_interfaces/src/authentication.rs"]}, "change_types": {"structs_added": 1, "functions_added": 8, "fields_added": 32, "imports_added": 5, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
Fix(connector): [NUVEI] 3ds unsuccessful redirection error msg
## 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 -->
Show Error Message during 3ds un-sussessful error redirection
### request
```json
{
"amount": 15100,
"currency": "EUR",
"confirm": true,
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
// "order_tax_amount": 100,
"setup_future_usage": "off_session",
// "payment_type":"setup_mandate",
"customer_id": "nithxxinn",
"return_url": "https://www.google.com",
"capture_method": "automatic",
"payment_method": "card",
"payment_method_type": "credit",
"authentication_type": "three_ds",
"description": "hellow world",
"billing": {
"address": {
"zip": "560095",
"country": "US",
"first_name": "Sakil",
"last_name": "Mostak",
"line1": "Fasdf",
"line2": "Fasdf",
"city": "Fasdf"
}
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},
"email": "hello@gmail.com",
"payment_method_data": {
"card": {
"card_number": "2221008123677736",
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"card_cvc": "100"
}
}
}
```
### Response
```json
{
"payment_id": "pay_fwQ1e408So9yev8f0rfZ",
"merchant_id": "merchant_1758526798",
"status": "requires_customer_action",
"amount": 15100,
"net_amount": 15100,
"shipping_cost": null,
"amount_capturable": 15100,
"amount_received": null,
"connector": "nuvei",
"client_secret": "pay_fwQ1e408So9yev8f0rfZ_secret_kgOB1urvHoS4RJMA2uUU",
"created": "2025-09-22T07:40:07.679Z",
"currency": "EUR",
"customer_id": "nithxxinn",
"customer": {
"id": "nithxxinn",
"name": null,
"email": "hello@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": "hellow world",
"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": "7736",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "222100",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"payment_checks": {
"avs_result": "",
"avs_description": null,
"card_validation_result": "",
"card_validation_description": null
},
"authentication_data": {
"cReq": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjhjY2NkYWQwLWIyYzgtNDQyYy05NTkxLTkxM2M4ZWVlZDZmNyIsImFjc1RyYW5zSUQiOiJjMzRlMmJkZS0wODYwLTRmZWItOWQ5ZS1mYmY2Y2YxZDY4ZjIiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0",
"flow": "challenge",
"acsUrl": "https://3dsn.sandbox.safecharge.com/ThreeDSACSEmulatorChallenge/api/ThreeDSACSChallengeController/ChallengePage?eyJub3RpZmljYXRpb25VUkwiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvcGF5bWVudHMvcGF5X2Z3UTFlNDA4U285eWV2OGYwcmZaL21lcmNoYW50XzE3NTg1MjY3OTgvcmVkaXJlY3QvY29tcGxldGUvbnV2ZWkiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjhjY2NkYWQwLWIyYzgtNDQyYy05NTkxLTkxM2M4ZWVlZDZmNyIsImFjc1RyYW5zSUQiOiJjMzRlMmJkZS0wODYwLTRmZWItOWQ5ZS1mYmY2Y2YxZDY4ZjIiLCJkc1RyYW5zSUQiOiIyN2QzYTdmZC01MWQ2LTQyMzUtYjUxYS1iNDM1MWI1YzhkNTUiLCJkYXRhIjpudWxsLCJNZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0=",
"version": "2.2.0",
"threeDFlow": "1",
"decisionReason": "NoPreference",
"threeDReasonId": "",
"acquirerDecision": "ExemptionRequest",
"challengePreferenceReason": "12",
"isExemptionRequestInAuthentication": "0"
}
},
"billing": null
},
"payment_token": "token_bf3xxZIcLphaWc1zN4EK",
"shipping": null,
"billing": {
"address": {
"city": "Fasdf",
"country": "US",
"line1": "Fasdf",
"line2": "Fasdf",
"line3": null,
"zip": "560095",
"state": null,
"first_name": "Sakil",
"last_name": "Mostak",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "hello@gmail.com",
"name": null,
"phone": null,
"return_url": "https://www.google.com/",
"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_fwQ1e408So9yev8f0rfZ/merchant_1758526798/pay_fwQ1e408So9yev8f0rfZ_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": "nithxxinn",
"created_at": 1758526807,
"expires": 1758530407,
"secret": "epk_232dee5832244f6eaf70dc9ce96dac85"
},
"manual_retry_allowed": null,
"connector_transaction_id": "8110000000014692337",
"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": "9043552111",
"payment_link": null,
"profile_id": "pro_CHQ1GcBL3YipP8sGVO3B",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_9jUvWoUndSfvW4nY9kay",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-22T07:55:07.679Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": "pm_ihTRKltv5SDVRSK4mK2v",
"network_transaction_id": "",
"payment_method_status": "inactive",
"updated": "2025-09-22T07:40:12.797Z",
"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": "2090421111",
"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
}
```
<img width="1717" height="1117" alt="Screenshot 2025-09-22 at 1 09 05 PM" src="https://github.com/user-attachments/assets/55f8815e-88d5-4ada-b053-c23a73afc413" />
### Psync
```json
{
"payment_id": "pay_fwQ1e408So9yev8f0rfZ",
"merchant_id": "merchant_1758526798",
"status": "failed",
"amount": 15100,
"net_amount": 15100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "nuvei",
"client_secret": "pay_fwQ1e408So9yev8f0rfZ_secret_kgOB1urvHoS4RJMA2uUU",
"created": "2025-09-22T07:40:07.679Z",
"currency": "EUR",
"customer_id": "nithxxinn",
"customer": {
"id": "nithxxinn",
"name": null,
"email": "hello@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": "hellow world",
"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": "7736",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "222100",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"payment_checks": {
"avs_result": "",
"avs_description": null,
"card_validation_result": "",
"card_validation_description": null
},
"authentication_data": {
"cReq": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjhjY2NkYWQwLWIyYzgtNDQyYy05NTkxLTkxM2M4ZWVlZDZmNyIsImFjc1RyYW5zSUQiOiJjMzRlMmJkZS0wODYwLTRmZWItOWQ5ZS1mYmY2Y2YxZDY4ZjIiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0",
"flow": "challenge",
"acsUrl": "https://3dsn.sandbox.safecharge.com/ThreeDSACSEmulatorChallenge/api/ThreeDSACSChallengeController/ChallengePage?eyJub3RpZmljYXRpb25VUkwiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvcGF5bWVudHMvcGF5X2Z3UTFlNDA4U285eWV2OGYwcmZaL21lcmNoYW50XzE3NTg1MjY3OTgvcmVkaXJlY3QvY29tcGxldGUvbnV2ZWkiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjhjY2NkYWQwLWIyYzgtNDQyYy05NTkxLTkxM2M4ZWVlZDZmNyIsImFjc1RyYW5zSUQiOiJjMzRlMmJkZS0wODYwLTRmZWItOWQ5ZS1mYmY2Y2YxZDY4ZjIiLCJkc1RyYW5zSUQiOiIyN2QzYTdmZC01MWQ2LTQyMzUtYjUxYS1iNDM1MWI1YzhkNTUiLCJkYXRhIjpudWxsLCJNZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0=",
"version": "2.2.0",
"threeDFlow": "1",
"decisionReason": "NoPreference",
"threeDReasonId": "",
"acquirerDecision": "ExemptionRequest",
"challengePreferenceReason": "12",
"isExemptionRequestInAuthentication": "0"
}
},
"billing": null
},
"payment_token": "token_bf3xxZIcLphaWc1zN4EK",
"shipping": null,
"billing": {
"address": {
"city": "Fasdf",
"country": "US",
"line1": "Fasdf",
"line2": "Fasdf",
"line3": null,
"zip": "560095",
"state": null,
"first_name": "Sakil",
"last_name": "Mostak",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "hello@gmail.com",
"name": null,
"phone": null,
"return_url": "https://www.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": "3ds Authentication failed", // error msg
"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": null,
"manual_retry_allowed": null,
"connector_transaction_id": "8110000000014692337",
"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": "9043552111",
"payment_link": null,
"profile_id": "pro_CHQ1GcBL3YipP8sGVO3B",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_9jUvWoUndSfvW4nY9kay",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-22T07:55:07.679Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": "pm_ihTRKltv5SDVRSK4mK2v",
"network_transaction_id": "",
"payment_method_status": "inactive",
"updated": "2025-09-22T07:40:25.329Z",
"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": {
"network_advice_code": null
}
}
```
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/nuvei.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit ceacec90:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/nuvei.rs**
Modify existing code
|
{"pr_number": 9471, "pr_title": "Fix(connector): [NUVEI] 3ds unsuccessful redirection error msg", "merged_at": "2025-09-23T16:31:06Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nuvei.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(config): change UCS connector list from array to comma-separated string
# Refactor: Change UCS connector configuration from array to comma-separated string
## Summary
This PR refactors the unified connector service (UCS) configuration to use a comma-separated string format instead of an array for specifying connectors that should use UCS only. This change improves configuration management and parsing efficiency while maintaining type safety through a custom deserializer.
## Changes
- **Configuration Format Change**: Modified `ucs_only_connectors` from `Vec<String>` to `HashSet<Connector>` with comma-separated string input
- **Custom Deserializer Implementation**: Added a new `utils.rs` module in `external_services` with `deserialize_hashset` function for parsing comma-separated values into typed HashSets
- **Type Safety Enhancement**: Updated connector validation to use `Connector` enum instead of raw strings, preventing invalid connector names
- **Configuration Updates**: Updated all config files (`development.toml`, `config.example.toml`, `deployments/env_specific.toml`) to use the new comma-separated format
- **Dependencies**: Added `common_enums` dependency to `external_services` crate for proper connector enum handling
## Related Issues
Closes #8906 - Improve UCS connector configuration format for better type safety and usability
## Type of Change
- [x] Refactoring
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- **Configuration Parsing**: Tested comma-separated string parsing with various inputs including whitespace handling
- **Type Validation**: Verified that invalid connector names are properly rejected during deserialization
- **Backward Compatibility**: Ensured existing connector validation logic works with the new enum-based approach
- **Unit Tests**: Added comprehensive test suite for the new deserializer functionality covering:
- Valid comma-separated inputs
- Whitespace handling
- Error handling for invalid values
- Empty string and single value scenarios
- Duplicate value handling
## Implementation Details
### Key Files Modified
- `crates/external_services/src/grpc_client/unified_connector_service.rs:119` - Configuration struct update
- `crates/external_services/src/utils.rs` - New deserializer implementation
- `crates/router/src/core/unified_connector_service.rs:57` - Connector validation logic update
- Configuration files in `config/` directory
### New Functionality
The custom deserializer provides:
- Type-safe parsing of comma-separated strings into HashSets
- Comprehensive error handling with detailed error messages
- Generic implementation supporting any type that implements `FromStr + Eq + Hash`
- Proper handling of edge cases (empty strings, whitespace, duplicates)
## Checklist
- [x] Code follows project style guidelines
- [x] Self-review completed
- [x] Configuration changes tested locally
- [x] Unit tests added for new deserializer functionality
- [x] Type safety improvements verified
- [x] All config files updated consistently
|
To implement this **connector_integration** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/unified_connector_service.rs`
**2. External Connector Integration**
- `crates/external_services/src/grpc_client/unified_connector_service.rs`
**3. Utils**
- `crates/external_services/src/utils.rs`
**4. Tests**
- `config/deployments/integration_test.toml`
**5. Configuration Files**
- `config/config.example.toml`
- `config/deployments/env_specific.toml`
- `config/deployments/production.toml`
- ... and 2 more files
**6. Other**
- `crates/external_services/src/lib.rs`
**Code Patterns Applied:**
- Implement new functions (7 changes)
- Extend existing types with new fields (4 changes)
- Add conditional logic for feature flags or filtering (7 changes)
**Detailed Identifier Changes:**
Commit 9f055e10:
Files to modify:
**crates/external_services/src/grpc_client/unified_connector_service.rs**
Modify existing code
**crates/external_services/src/lib.rs**
Add:
- mod: pub::utils
**crates/external_services/src/utils.rs**
Add:
- function: private::deserialize_hashset_inner
- function: pub::deserialize_hashset
- function: private::test_deserialize_hashset_inner_success
- function: private::test_deserialize_hashset_inner_with_whitespace
- function: private::test_deserialize_hashset_inner_empty_string
- function: private::test_deserialize_hashset_inner_single_value
- function: private::test_deserialize_hashset_inner_invalid_int
- function: private::test_deserialize_hashset_inner_duplicates
- mod: private::tests
**crates/router/src/core/unified_connector_service.rs**
Modify existing code
|
{"pr_number": 8905, "pr_title": "refactor(config): change UCS connector list from array to comma-separated string", "merged_at": "2025-08-13T15:11:30Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/unified_connector_service.rs"], "connectors": ["crates/external_services/src/grpc_client/unified_connector_service.rs"], "utils": ["crates/external_services/src/utils.rs"], "tests": ["config/deployments/integration_test.toml"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml"], "other": ["crates/external_services/src/lib.rs"]}, "change_types": {"functions_added": 7, "fields_added": 4, "imports_added": 10, "conditionals_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): added customer phone_number and email to session token response for click to pay
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Enhancement
## Description
<!-- Describe your changes in detail -->
Add customer phone_number and email to session token response for click to pay
## 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 Ctp_mastercard as a connector and send relevant details to ctp in connector metadata
```shell
curl --location 'http://localhost:8080/account/dqwdwljildqwjd/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"
}
}
'
```
update business profile with
```shell
"is_click_to_pay_enabled": true,
"authentication_product_ids": {"click_to_pay": "mca_id"}
```
Do payments create with customer details
```shell
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_myZVgK2frn2tWuTghpqBw4YmFcVOKoQ0etjGKyZCdegwHvKiGQgZOvhGsu7ShkaU' \
--data-raw '{
"amount": 1130,
"currency": "USD",
"confirm": false,
"return_url": "https://hyperswitch.io",
"customer": {
"email": "john@example.com",
"id": "cus_abcdccqjciefgh",
"name": "John Dough",
"phone": "9123456789"
}
}'
```
Look for customer details in click to pay session response
```shell
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'x-feature: integ-custom' \
--header 'api-key: pk_dev_a82510aa11054218bfbae152586fb16d' \
--data '{
"payment_id": "pay_gEidbQrgy29Hu2JfUWto",
"client_secret": "pay_gEidbQrgy29Hu2JfUWto_secret_PfoMiqnCRZL3uCKrNDmv",
"wallets": []
}
'
```
Response
```shell
{
"payment_id": "pay_gEidbQrgy29Hu2JfUWto",
"client_secret": "pay_gEidbQrgy29Hu2JfUWto_secret_PfoMiqnCRZL3uCKrNDmv",
"session_token": [
{
"wallet_name": "click_to_pay",
"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",
"transaction_amount": "11.30",
"transaction_currency_code": "USD",
"phone_number": "9123456789",
"email": "john@example.com"
}
]
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments.rs`
**3. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (9 changes)
**Detailed Identifier Changes:**
Commit 092c79ec:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Add:
- function: private::validate_customer_details_for_click_to_pay
|
{"pr_number": 6863, "pr_title": "feat(core): added customer phone_number and email to session token response for click to pay", "merged_at": "2024-12-19T12:03:50Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "core_business": ["crates/router/src/core/payments.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"functions_added": 1, "fields_added": 9, "imports_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(cypress): move memory cache tests out of payment for misc
## 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 -->
This PR aims at refactoring:
- `cypress-tests` folder structure to reduce confusion and chaos in within `e2e` directory
- previous:
```sh
.
└── cypress
├── e2e
│ ├── PaymentMethodListTest
│ ├── PaymentMethodListUtils
│ ├── PaymentTest
│ ├── PaymentUtils
│ ├── PayoutTest
│ ├── PayoutUtils
│ ├── RoutingTest
│ └── RoutingUtils
├── fixtures
├── support
└── utils
```
- present:
```sh
.
└── cypress
├── e2e
│ ├── configs
│ │ ├── Payment
│ │ ├── PaymentMethodList
│ │ ├── Payout
│ │ └── Routing
│ └── spec
│ ├── Misc <- memory cache tests have been moved here
│ ├── Payment
│ ├── PaymentMethodList
│ ├── Payout
│ └── Routing
├── fixtures
├── support
└── utils
```
- reduce / remove duplicate commands in memory cache (config calls) by unifying them
- #6961 introduces the memory cache test, but does not aim at optimising things. this pr is intended to address that
- additionally, memory cache test have been moved out of `payments` service to `misc` just so that, tests that are independent of business profile, mca, merchant account can be added here in the future
- new command addition to miscellaneous tests: `npm run cypress:misc`
- slight security improvement by forcing the api key to expire within `24` hours
closes #6993
documentation will be updated later
### 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).
-->
Too many boiler plates, too many useless code
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
```sh
# executed below command to cherry-pick cookie changes just so that userlogin work
git cherry-pick -n ..fix-cookie-cypress
# started cypress against stripe
CYPRESS_CONNECTOR=stripe npm run cypress
```
stripe:
<img width="556" alt="image" src="https://github.com/user-attachments/assets/df8c443f-d0ba-4f8b-ac65-a68ad5f7c89e" />
memory cache:
<img width="554" alt="image" src="https://github.com/user-attachments/assets/10545633-7691-4841-831a-38f04ca9a91a" />
health check:
<img width="467" alt="image" src="https://github.com/user-attachments/assets/3e14bd10-4f05-42c9-84f9-c925beae15e3" />
ci:

## 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. Utils**
- `cypress-tests/cypress/utils/RequestBodyUtils.js`
**2. Tests**
- `cypress-tests/README.md`
- `cypress-tests/cypress/e2e/PaymentUtils/Adyen.js`
- `cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js`
- ... and 83 more files
**Code Patterns Applied:**
- Extend existing types with new fields (70 changes)
- Add conditional logic for feature flags or filtering (27 changes)
- Modify database queries (13 changes)
|
{"pr_number": 6992, "pr_title": "refactor(cypress): move memory cache tests out of payment for misc", "merged_at": "2025-01-24T17:23:22Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"utils": ["cypress-tests/cypress/utils/RequestBodyUtils.js"], "tests": ["cypress-tests/README.md", "cypress-tests/cypress/e2e/PaymentUtils/Adyen.js", "cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js", "cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js", "cypress-tests/cypress/e2e/PaymentUtils/Checkout.js", "cypress-tests/cypress/e2e/PaymentUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js", "cypress-tests/cypress/e2e/PaymentUtils/Datatrans.js", "cypress-tests/cypress/e2e/PaymentUtils/Deutschebank.js", "cypress-tests/cypress/e2e/PaymentUtils/Elavon.js", "cypress-tests/cypress/e2e/PaymentUtils/Fiservemea.js", "cypress-tests/cypress/e2e/PaymentUtils/Fiuu.js", "cypress-tests/cypress/e2e/PaymentUtils/Iatapay.js", "cypress-tests/cypress/e2e/PaymentUtils/ItauBank.js", "cypress-tests/cypress/e2e/PaymentUtils/Jpmorgan.js", "cypress-tests/cypress/e2e/configs/Payment/Modifiers.js", "cypress-tests/cypress/e2e/PaymentUtils/Nexixpay.js", "cypress-tests/cypress/e2e/PaymentUtils/Nmi.js", "cypress-tests/cypress/e2e/PaymentUtils/Noon.js", "cypress-tests/cypress/e2e/PaymentUtils/Novalnet.js", "cypress-tests/cypress/e2e/PaymentUtils/Paybox.js", "cypress-tests/cypress/e2e/PaymentUtils/Paypal.js", "cypress-tests/cypress/e2e/PaymentUtils/Stripe.js", "cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js", "cypress-tests/cypress/e2e/PaymentUtils/Utils.js", "cypress-tests/cypress/e2e/PaymentUtils/WellsFargo.js", "cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js", "cypress-tests/cypress/e2e/PaymentUtils/Xendit.js", "cypress-tests/cypress/e2e/PaymentMethodListUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentMethodListUtils/Connector.js", "cypress-tests/cypress/e2e/PaymentMethodListUtils/Utils.js", "cypress-tests/cypress/e2e/PayoutUtils/Adyen.js", "cypress-tests/cypress/e2e/PayoutUtils/AdyenPlatform.js", "cypress-tests/cypress/e2e/PayoutUtils/Commons.js", "cypress-tests/cypress/e2e/configs/Payout/Modifiers.js", "cypress-tests/cypress/e2e/PayoutUtils/Utils.js", "cypress-tests/cypress/e2e/PayoutUtils/Wise.js", "cypress-tests/cypress/e2e/RoutingUtils/Adyen.js", "cypress-tests/cypress/e2e/RoutingUtils/Autoretries.js", "cypress-tests/cypress/e2e/RoutingUtils/Commons.js", "cypress-tests/cypress/e2e/RoutingUtils/Stripe.js", "cypress-tests/cypress/e2e/RoutingUtils/Utils.js", "cypress-tests/cypress/e2e/spec/Misc/00000-HealthCheck.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00028-MemoryCacheConfigs.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00000-CoreFlows.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00001-AccountCreate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00002-CustomerCreate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00003-ConnectorCreate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00004-NoThreeDSAutoCapture.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00005-ThreeDSAutoCapture.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00006-NoThreeDSManualCapture.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00007-VoidPayment.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00008-SyncPayment.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00009-RefundPayment.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00010-SyncRefund.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00011-CreateSingleuseMandate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00012-CreateMultiuseMandate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00013-ListAndRevokeMandate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00014-SaveCardFlow.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00015-ZeroAuthMandate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00016-ThreeDSManualCapture.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00017-BankTransfers.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00018-BankRedirect.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00019-MandatesUsingPMID.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00020-MandatesUsingNTIDProxy.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00021-UPI.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00022-Variations.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00023-PaymentMethods.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00024-ConnectorAgnosticNTID.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00024-SessionCall.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00025-BusinessProfileConfigs.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00026-DynamicFields.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00027-IncrementalAuth.cy.js", "cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js", "cypress-tests/cypress/e2e/PayoutTest/00000-AccountCreate.cy.js", "cypress-tests/cypress/e2e/PayoutTest/00001-CustomerCreate.cy.js", "cypress-tests/cypress/e2e/PayoutTest/00002-ConnectorCreate.cy.js", "cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js", "cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js", "cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js", "cypress-tests/cypress/e2e/RoutingTest/00000-PriorityRouting.cy.js", "cypress-tests/cypress/e2e/RoutingTest/00001-VolumeBasedRouting.cy.js", "cypress-tests/cypress/e2e/RoutingTest/00002-RuleBasedRouting.cy.js", "cypress-tests/cypress/e2e/RoutingTest/00003-Retries.cy.js", "cypress-tests/cypress/support/commands.js", "cypress-tests/package.json"]}, "change_types": {"fields_added": 70, "conditionals_added": 27, "database_queries": 13}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
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**
- `config/deployments/integration_test.toml`
- `cypress-tests/cypress/e2e/configs/Payment/Commons.js`
- `cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js`
- ... and 1 more files
**5. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
- ... and 1 more files
**6. 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 (31 changes)
**Detailed Identifier Changes:**
Commit 39c97c74:
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": 8279, "pr_title": "refactor(core): introduce new field in payment_intent to handle longer return_url", "merged_at": "2025-06-07T08:22:10Z", "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": ["config/deployments/integration_test.toml", "cypress-tests/cypress/e2e/configs/Payment/Commons.js", "cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js", "loadtest/config/development.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"], "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": 31}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payments): [Payment links] add configs for payment link
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [X] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for PR https://github.com/juspay/hyperswitch/pull/7340
`cargo clippy` output
<img width="801" alt="Screenshot 2025-02-27 at 19 25 27" src="https://github.com/user-attachments/assets/b1026453-719c-4efe-85c8-4ec8807443c6" />
### 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/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`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/lib.rs`
**4. Core Business Logic**
- `crates/router/src/core/payment_link.rs`
- `crates/router/src/core/payment_link/payment_link_initiate/payment_link.js`
- `crates/router/src/core/payments/transformers.rs`
**5. Type Definitions**
- `crates/router/src/types/transformers.rs`
**6. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Extend existing types with new fields (47 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 1d44549a:
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/hyperswitch_domain_models/src/lib.rs**
Modify existing code
**crates/router/src/core/payment_link.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 7394, "pr_title": "feat(payments): [Payment links] add configs for payment link", "merged_at": "2025-02-27T14:19:17Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "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"], "domain": ["crates/hyperswitch_domain_models/src/lib.rs"], "core_business": ["crates/router/src/core/payment_link.rs", "crates/router/src/core/payment_link/payment_link_initiate/payment_link.js", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"fields_added": 47, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(routing): Add API key auth for decision engine endpoints
## 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 API key auth to the decision engine endpoints for the decide gateway call and the update gateway score call.
### 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 #8613
## 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>decide-gateway</summary>
curl --location 'http://localhost:8080/routing/evaluate' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_UnrorzUwWmt9GUkRTalEmIjrWu3JwKNh8TkSZmMJ2Fsm***** \
--data '{
"merchantId": "pro_VTQjooFPAyPOBC0aj9Jk",
"eligibleGatewayList": ["GatewayA", "GatewayB", "GatewayC"],
"rankingAlgorithm": "SR_BASED_ROUTING",
"eliminationEnabled": true,
"paymentInfo": {
"paymentId": "PAY12359",
"amount": 100,
"currency": "USD",
"customerId": "CUST12345",
"udfs": null,
"preferredGateway": null,
"paymentType": "ORDER_PAYMENT",
"metadata": null,
"internalMetadata": null,
"isEmi": false,
"emiBank": null,
"emiTenure": null,
"paymentMethodType": "credit",
"paymentMethod": "card",
"paymentSource": null,
"authType": null,
"cardIssuerBankName": null,
"cardIsin": null,
"cardType": null,
"cardSwitchProvider": null
}
}'
</details>
<details>
<summary>response</summary>
{
"decided_gateway": "GatewayA",
"gateway_priority_map": {
"GatewayA": 1.0,
"GatewayB": 1.0,
"GatewayC": 1.0
},
"filter_wise_gateways": null,
"priority_logic_tag": null,
"routing_approach": "SR_SELECTION_V3_ROUTING",
"gateway_before_evaluation": "GatewayC",
"priority_logic_output": {
"isEnforcement": false,
"gws": [
"GatewayA",
"GatewayB",
"GatewayC"
],
"priorityLogicTag": null,
"gatewayReferenceIds": {},
"primaryLogic": null,
"fallbackLogic": null
},
"reset_approach": "NO_RESET",
"routing_dimension": "ORDER_PAYMENT, CREDIT, card",
"routing_dimension_level": "PM_LEVEL",
"is_scheduled_outage": false,
"is_dynamic_mga_enabled": false,
"gateway_mga_id_map": null
}
</details>
---
<details>
<summary>update-gateway-score</summary>
curl --location 'http://localhost:8080/routing/feedback' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_UnrorzUwWmt9GUkRTalEmIjrWu3JwKNh8TkSZmMJ2Fs******' \
--data '{
"merchantId" : "pro_VTQjooFPAyPOBC0aj9Jk",
"gateway": "GatewayC",
"gatewayReferenceId": null,
"status": "FAILURE",
"paymentId": "PAY12359",
"enforceDynamicRoutingFailure" : null
}'
</details>
<details>
<summary>response</summary>
{
"message": "Success"
}
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/events/routing.rs`
- `crates/api_models/src/open_router.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/routing/utils.rs`
- `crates/router/src/core/routing.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 (3 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (36 changes)
**Detailed Identifier Changes:**
Commit f4da057c:
Files to modify:
**crates/api_models/src/events/routing.rs**
Add:
- function: private::get_api_event_type
- function: private::get_api_event_type
- function: private::get_api_event_type
- function: private::get_api_event_type
- impl: impl ApiEventMetric for crate::open_router::DecideGatewayResponse
- impl: impl ApiEventMetric for crate::open_router::OpenRouterDecideGatewayRequest
- impl: impl ApiEventMetric for crate::open_router::UpdateScorePayload
- impl: impl ApiEventMetric for crate::open_router::UpdateScoreResponse
**crates/api_models/src/open_router.rs**
Add:
- struct: pub::DecideGatewayResponse
- struct: pub::PriorityLogicOutput
- struct: pub::PriorityLogicData
**crates/router/src/core/payments/routing/utils.rs**
Modify existing code
**crates/router/src/core/routing.rs**
Add:
- function: pub::decide_gateway_open_router
- function: pub::update_gateway_score_open_router
**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::call_decide_gateway_open_router
- function: pub::call_update_gateway_score_open_router
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 8640, "pr_title": "feat(routing): Add API key auth for decision engine endpoints", "merged_at": "2025-07-21T13:38:52Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/routing.rs", "crates/api_models/src/open_router.rs"], "core_business": ["crates/router/src/core/payments/routing/utils.rs", "crates/router/src/core/routing.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": 3, "functions_added": 8, "fields_added": 36, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Stripe revolut pay wallet integration
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Implement `revolut_pay` for stripe
### 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`
-->
Docs: https://docs.stripe.com/payments/revolut-pay
API: https://docs.stripe.com/api/payment_methods/create?api-version=2025-04-30.basil
## How did you test it?
1. Enable revolut pay wallet in stripe https://dashboard.stripe.com/test/settings/payment_methods/pmc_1ROdpjB97BExDDPTOZMrPWhw
<img width="1728" alt="Screenshot 2025-05-15 at 2 46 27 PM" src="https://github.com/user-attachments/assets/6a629470-4057-4940-aa31-7b15d4e1eee2" />
2. test locally with stripe api if payment works
```sh
curl --location 'https://api.stripe.com/v1/payment_intents' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic *****' \
--data-urlencode 'amount=1000' \
--data-urlencode 'currency=GBP' \
--data-urlencode 'confirm=true' \
--data-urlencode 'payment_method_types%5B%5D=revolut_pay' \
--data-urlencode 'payment_method_data%5Btype%5D=revolut_pay' \
--data-urlencode 'return_url=https://www.google.com'
```
- Response
```json
{
"id": "pi_3ROxvwB97BExDDPT0dHsgo6t",
"object": "payment_intent",
"amount": 1000,
"amount_capturable": 0,
"amount_details": {
"tip": {}
},
"amount_received": 0,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic_async",
"client_secret": "***",
"confirmation_method": "automatic",
"created": 1747300712,
"currency": "gbp",
"customer": null,
"description": null,
"last_payment_error": null,
"latest_charge": null,
"livemode": false,
"metadata": {},
"next_action": {
"redirect_to_url": {
"return_url": "https://www.google.com",
"url": "https://pm-redirects.stripe.com/authorize/acct_1ROdpBB97BExDDPT/pa_nonce_SJb8ufPcGprPwuS2U43cjPBc7Suv5EM"
},
"type": "redirect_to_url"
},
"on_behalf_of": null,
"payment_method": "pm_1ROxvwB97BExDDPTQZMvJtAv",
"payment_method_configuration_details": null,
"payment_method_options": {
"revolut_pay": {}
},
"payment_method_types": [
"revolut_pay"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "requires_action",
"transfer_data": null,
"transfer_group": null
}
```
3. Open url "https://pm-redirects.stripe.com/authorize/acct_1ROdpBB97BExDDPT/pa_nonce_SJb8ufPcGprPwuS2U43cjPBc7Suv5EM" & approve
<img width="1728" alt="Screenshot 2025-05-15 at 2 49 54 PM" src="https://github.com/user-attachments/assets/b2787047-ae96-4cf3-971f-ba5966173973" />
4. check the payment is successful
```sh
curl --location 'https://api.stripe.com/v1/payment_intents/pi_3ROxvwB97BExDDPT0dHsgo6t' \
--header 'Authorization: Basic ********
```
response
```json
{
"id": "pi_3ROxvwB97BExDDPT0dHsgo6t",
"object": "payment_intent",
"amount": 1000,
"amount_capturable": 0,
"amount_details": {
"tip": {}
},
"amount_received": 1000,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic_async",
"client_secret": "pi_3ROxvwB97BExDDPT0dHsgo6t_secret_CkX00D5AVYktG9OOiS2QaSFH9",
"confirmation_method": "automatic",
"created": 1747300712,
"currency": "gbp",
"customer": null,
"description": null,
"last_payment_error": null,
"latest_charge": "py_3ROxvwB97BExDDPT0ZAud2QG",
"livemode": false,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1ROxvwB97BExDDPTQZMvJtAv",
"payment_method_configuration_details": null,
"payment_method_options": {
"revolut_pay": {}
},
"payment_method_types": [
"revolut_pay"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
```
Similarly in hyperswitch
1. create MCA
```sh
curl --location 'http://localhost:8080/account/merchant_1747238601/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-feature: integ-custom' \
--header 'api-key: dev_UAkNrfXtBq40DJA7ZNe0hlA7uNWEsnHCaKHDwq1E14bV5UVo4NFw1D3e0Nxq7w8s' \
--data '{
"connector_type": "payment_processor",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "********"
},
"connector_name": "stripe",
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "revolut_pay",
"recurring_enabled": false,
"installment_payment_enabled": false
}
]
},
],
"metadata": {
"city": "NY",
"unit": "245"
},
"connector_webhook_details": {
"merchant_secret": "MyWebhookSecret"
},
"business_country": "US",
"business_label": "default"
}'
```
2. payment create
```sh
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_cnuJqFYwxtGHff4Q6llYITJKjoG9FRkOW21ggOIS24UQclh3D6DVezsaN7EZQTq2' \
--data '{
"amount": 111,
"currency": "GBP",
"confirm": true,
"capture_method": "manual",
"payment_method": "wallet",
"payment_method_type": "revolut_pay",
"payment_method_data": {
"wallet": {
"revolut_pay": {}
}
}
}'
```
response
```json
{
"payment_id": "pay_bmOvXjRBZfqUvyQP8fus",
"merchant_id": "merchant_1747377561",
"status": "requires_customer_action",
"amount": 111,
"net_amount": 111,
"shipping_cost": null,
"amount_capturable": 111,
"amount_received": 0,
"connector": "stripe",
"client_secret": "pay_bmOvXjRBZfqUvyQP8fus_secret_nKIT1jegspBnMg1eufRO",
"created": "2025-05-16T07:26:35.752Z",
"currency": "GBP",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {},
"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_bmOvXjRBZfqUvyQP8fus/merchant_1747377561/pay_bmOvXjRBZfqUvyQP8fus_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "revolut_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": "pi_3RPIfAB97BExDDPT1XSgQ3ql",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3RPIfAB97BExDDPT1XSgQ3ql",
"payment_link": null,
"profile_id": "pro_Et1v5W5jHI8bM4MZJqZc",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_lKADRn7MC7urVbXp5MM5",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-05-16T07:41:35.752Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-05-16T07:26:37.003Z",
"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
}
```
3. open return url "http://localhost:8080/payments/redirect/pay_RyVOqpl8ARzzfD1RjB69/merchant_1747238601/pay_RyVOqpl8ARzzfD1RjB69_1" & a approve the test payment
<img width="1728" alt="Screenshot 2025-05-15 at 2 49 54 PM" src="https://github.com/user-attachments/assets/a710513d-e7ee-4e37-b2ad-7ec54d9cf0fd" />
4. capture the payment status
```sh
curl --location 'http://localhost:8080/payments/pay_bmOvXjRBZfqUvyQP8fus/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_cnuJqFYwxtGHff4Q6llYITJKjoG9FRkOW21ggOIS24UQclh3D6DVezsaN7EZQTq2' \
--data '{
"metadata":"updated"
}'
```
response
```json
{
"payment_id": "pay_bmOvXjRBZfqUvyQP8fus",
"merchant_id": "merchant_1747377561",
"status": "succeeded",
"amount": 111,
"net_amount": 111,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 111,
"connector": "stripe",
"client_secret": "pay_OkUFkYRuaAj1NOlCLjBp_secret_UHeMixoT9PNRpNVtMrci",
"created": "2025-05-16T07:34:43.017Z",
"currency": "GBP",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {},
"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": "revolut_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3RPIn2B97BExDDPT1XFiD5Sp",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3RPIn2B97BExDDPT1XFiD5Sp",
"payment_link": null,
"profile_id": "pro_Et1v5W5jHI8bM4MZJqZc",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_lKADRn7MC7urVbXp5MM5",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-05-16T07:49:43.017Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-05-16T07:34:58.228Z",
"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
}
```
- Similarly check for refunds
- supported currency `EUR`, `GBP`
## 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`
**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 30 more files
**4. Type Definitions**
- `crates/router/src/types/domain/payments.rs`
- `crates/router/src/types/transformers.rs`
**5. Utils**
- `crates/kgraph_utils/src/mca.rs`
- `crates/kgraph_utils/src/transformers.rs`
- `crates/payment_methods/src/helpers.rs`
**6. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
**7. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit b3d47b65:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::RevolutPayData
**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/aci/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/boku/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/klarna.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/noon/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payme/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/square/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs**
Add:
- struct: pub::RevolutpayPayment
**crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/zen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- struct: pub::RevolutPayData
**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/connector/utils.rs**
Modify existing code
**crates/router/src/types/domain/payments.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 8066, "pr_title": "feat(connector): Stripe revolut pay wallet integration", "merged_at": "2025-05-27T07:32:38Z", "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/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/aci/transformers.rs", "crates/hyperswitch_connectors/src/connectors/adyen.rs", "crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/airwallex/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/boku/transformers.rs", "crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/klarna.rs", "crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs", "crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs", "crates/hyperswitch_connectors/src/connectors/noon/transformers.rs", "crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payme/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs", "crates/hyperswitch_connectors/src/connectors/square/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/zen/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/utils.rs"], "types": ["crates/router/src/types/domain/payments.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"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.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, "fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore(connectors): [fiuu] update pm_filters for apple pay and google pay
## 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/7182
### 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 process APay and GPay txns using MYR currency.
## How did you test it?
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `config/deployments/integration_test.toml`
**2. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
|
{"pr_number": 7238, "pr_title": "chore(connectors): [fiuu] update pm_filters for apple pay and google pay", "merged_at": "2025-02-11T14:24:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["config/deployments/integration_test.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): [CASHTOCODE] Added supported countries and currencies
… (#8060)
## 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 supported countries and currencies for Cashtocode.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `config/deployments/integration_test.toml`
**2. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
- ... and 1 more files
|
{"pr_number": 8101, "pr_title": "fix(connector): [CASHTOCODE] Added supported countries and currencies", "merged_at": "2025-05-21T13:11:19Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["config/deployments/integration_test.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(router): add capability to force challenge for 3DS Payments through Netcetera and send few optional fields
## 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 capability to force challenge for 3DS Payments through Netcetera and send few optional fields
Note: hotfix raised against: https://github.com/juspay/hyperswitch/pull/7429
1. Profile level enablement `force_3ds_challenge` which would request netcetera for challenge flow
2. Send few optional fields like trans_type, which can potentially be required on PROD (Because docs says, it maybe required in some markets)
Note: Clippy run
<img width="1725" alt="image" src="https://github.com/user-attachments/assets/f6833c2d-45f1-4709-8251-ecae2d03040a" />
### 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`
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)?
-->
Tested Manually
Perform a External 3DS payment by enabling force_3ds_challenge at profile level, and observe ThreeDSRequestorChallengeInd being sent "04" to netcetera connector
CURL
```
curl --location '{{BASE_URL}}/payments/{{PAYMENT_ID}}/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{PUBLISHABLE_KEY}}' \
--data '{
"client_secret": "pay_SiyzAZBqOJgLShX0Kjxw_secret_vEfMKRmj8ovnvxVYJdqK",
"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": "eyJtZXNzYWdlVHlwZSI6IkNSZXEiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjRjY2M5ZGRkLWMxZGMtNGMyNy04YzAyLTg5NmE2MzI5MWMzZCIsImFjc1RyYW5zSUQiOiI5MWM0MWZjOS0zZDI1LTQ0OGItODA4MS1mMDkxOTg3NmM1ZTQiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMy4xIn0",
"acs_reference_number": "3DS_LOA_ACS_201_13579",
"acs_trans_id": "91c41fc9-3d25-448b-8081-f0919876c5e4",
"three_dsserver_trans_id": "4ccc9ddd-c1dc-4c27-8c02-896a63291c3d",
"acs_signed_content": null,
"three_ds_requestor_url": "https://google.com/"
}
```

## 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/router_request_types/authentication.rs`
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/authentication/transformers.rs`
- ... and 1 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
- `crates/router/src/connector/netcetera/netcetera_types.rs`
- `crates/router/src/connector/netcetera/transformers.rs`
**6. Type Definitions**
- `crates/common_utils/src/types.rs`
- `crates/router/src/types/api/admin.rs`
**7. Other**
- `api-reference/openapi_spec.json`
- `migrations/2025-03-04-105454_add_force_3ds_challenge_column_to_business_profile/down.sql`
- `migrations/2025-03-04-105454_add_force_3ds_challenge_column_to_business_profile/up.sql`
**Code Patterns Applied:**
- Implement new functions (4 changes)
- Extend existing types with new fields (56 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit a5a51d06:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/common_utils/src/types.rs**
Add:
- function: pub::get_minor
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/authentication.rs**
Modify existing code
**crates/router/src/connector/netcetera/netcetera_types.rs**
Remove:
- function: private::from
- impl: impl From<Option<common_enums::ScaExemptionType>> for ThreeDSRequestor
Add:
- function: private::get_version_checked
- function: pub::new
- function: private::try_from
- enum: pub::SchemeId
- impl: impl SingleOrListElement<T>
- impl: impl ThreeDSRequestor
- impl: impl TryFrom<common_enums::CardNetwork> for SchemeId
**crates/router/src/connector/netcetera/transformers.rs**
Remove:
- function: private::try_from
- enum: pub::SchemeId
- impl: impl TryFrom<common_enums::CardNetwork> for SchemeId
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/authentication.rs**
Modify existing code
**crates/router/src/core/authentication/transformers.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code
|
{"pr_number": 7434, "pr_title": "feat(router): add capability to force challenge for 3DS Payments through Netcetera and send few optional fields", "merged_at": "2025-03-05T14:59:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "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/router_request_types/authentication.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/authentication.rs", "crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/payments.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/router/src/connector/netcetera/netcetera_types.rs", "crates/router/src/connector/netcetera/transformers.rs"], "types": ["crates/common_utils/src/types.rs", "crates/router/src/types/api/admin.rs"], "other": ["api-reference/openapi_spec.json", "migrations/2025-03-04-105454_add_force_3ds_challenge_column_to_business_profile/down.sql", "migrations/2025-03-04-105454_add_force_3ds_challenge_column_to_business_profile/up.sql"]}, "change_types": {"functions_added": 4, "enums_added": 1, "fields_added": 56, "imports_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(cors): expose all headers set by application in `access-control-expose-headers` header value
## 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 exposes all headers set by the application in the `access-control-expose-headers` header value. This should thus allow our headers like `x-request-id` to be accessed by the browser.
## 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 should allow headers set by our application like the `x-request-id` header to be accessed by the browser.
This was fixed once before in #1673, but I suspect the behavior changed again when #3646 was merged.
## 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.
```shell
$ curl -i http://localhost:8080/health
[...]
access-control-expose-headers: x-request-id, via, strict-transport-security
[...]
```
The `access-control-expose-headers` header is included in the response headers, and `x-request-id` is included in the header value.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **connector_integration** feature, you'll need to modify these architectural layers:
**1. Other**
- `crates/router/src/cors.rs`
**Detailed Identifier Changes:**
Commit 9c3547fa:
Files to modify:
**crates/router/src/cors.rs**
Modify existing code
|
{"pr_number": 6877, "pr_title": "fix(cors): expose all headers set by application in `access-control-expose-headers` header value", "merged_at": "2024-12-24T07:04:04Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["crates/router/src/cors.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connnector): Structure connector enums in separate files for improved team ownership
## 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 -->
Refactoring connector enums to separate files to give code ownership to connector team for connector related changes.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Cypress tests should be suffice
## 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`
- `crates/api_models/src/enums.rs`
- `crates/api_models/src/lib.rs`
**2. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/router/src/configs/defaults/payment_connector_required_fields.rs`
- `scripts/add_connector.sh`
**3. Configuration Files**
- `crates/router/src/configs/defaults.rs`
**4. Other**
- `.github/CODEOWNERS`
- `crates/common_enums/src/enums.rs`
- `crates/common_enums/src/lib.rs`
**Code Patterns Applied:**
- Implement new functions (14 changes)
- Extend existing types with new fields (4737 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit bb246e27:
Files to modify:
**crates/api_models/src/connector_enums.rs**
Add:
- function: pub::supports_instant_payout
- function: pub::supports_create_recipient
- function: pub::supports_payout_eligibility
- function: pub::is_payout_quote_call_required
- function: pub::supports_access_token_for_payout
- function: pub::supports_vendor_disburse_account_create_for_payout
- function: pub::supports_access_token
- function: pub::supports_file_storage_module
- function: pub::requires_defend_dispute
- function: pub::is_separate_authentication_supported
- function: pub::is_pre_processing_required_before_authorize
- function: pub::validate_dummy_connector_enabled
- enum: pub::Connector
- impl: impl Connector
**crates/api_models/src/enums.rs**
Remove:
- function: pub::supports_instant_payout
- function: pub::supports_create_recipient
- function: pub::supports_payout_eligibility
- function: pub::is_payout_quote_call_required
- function: pub::supports_access_token_for_payout
- function: pub::supports_vendor_disburse_account_create_for_payout
- function: pub::supports_access_token
- function: pub::supports_file_storage_module
- function: pub::requires_defend_dispute
- function: pub::is_separate_authentication_supported
- function: pub::is_pre_processing_required_before_authorize
- function: pub::validate_dummy_connector_enabled
- enum: pub::Connector
- impl: impl Connector
**crates/api_models/src/lib.rs**
Add:
- mod: pub::connector_enums
**crates/common_enums/src/connector_enums.rs**
Add:
- enum: pub::RoutableConnectors
**crates/common_enums/src/enums.rs**
Remove:
- enum: pub::RoutableConnectors
**crates/common_enums/src/lib.rs**
Add:
- mod: pub::connector_enums
**crates/router/src/configs/defaults.rs**
Remove:
- function: private::default
- function: private::default
- impl: impl Default for Mandates
- impl: impl Default for super::settings::RequiredFields
Add:
- mod: pub::payment_connector_required_fields
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Add:
- function: private::default
- function: private::default
- impl: impl Default for Mandates
- impl: impl Default for settings::RequiredFields
|
{"pr_number": 6459, "pr_title": "refactor(connnector): Structure connector enums in separate files for improved team ownership", "merged_at": "2024-10-30T10:42:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/connector_enums.rs", "crates/api_models/src/enums.rs", "crates/api_models/src/lib.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/router/src/configs/defaults/payment_connector_required_fields.rs", "scripts/add_connector.sh"], "config": ["crates/router/src/configs/defaults.rs"], "other": [".github/CODEOWNERS", "crates/common_enums/src/enums.rs", "crates/common_enums/src/lib.rs"]}, "change_types": {"functions_added": 14, "enums_added": 2, "fields_added": 4737, "imports_added": 6, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(analytics): implement currency conversion to power multi-currency aggregation
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
- implemented currency_conversion for calculating values of amount related metrics from their currency (i.e `INR`) to
`USD` and store it in a separate field variant I created `<fieldname>_in_usd`
- Implemented a total_amount_in_usd variant for all the total fields related to amounts in query Metadata
### Fixes #6416
### 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 total amount calculated for all payment analytics buckets related to amounts is incorrect because currency conversion is not being applied before summing the values. As a result, amounts in different currencies are being added together, leading to an inaccurate total.
### Dependency
This functionality depends on `currency_conversion` crate directly to fetch exchange rates.
## 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)?
-->
### API request for metrics
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'QueryType: SingleStat' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36' \
--header 'api-key: dev_r3kVZ4URj3fMiHhJJuhHOVqteaXwKyEMGCaFo6PiCS6S9vZsb0ErV4kCVqogM60H' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDZlOGRmZWYtMzI0Zi00Yjc0LTg2MTItYzdkZjNhOGZmZTcyIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI3NDM0NTkzIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTcyOTgzNzUwNywib3JnX2lkIjoib3JnXzl3Y0kxQ2hTOGVEdnRRQmRXak9IIiwicHJvZmlsZV9pZCI6InByb19FNW5lek43YjZUbVB1WlUzbEU1VSJ9.KlBRpu8DpGZ43u9hsB4xE2oSXNM21HC0RadRdfMe2VI' \
--header 'sec-ch-ua: "Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-10-13T18:30:00Z",
"endTime": "2024-10-21T12:54:00Z"
},
"mode": "ORDER",
"source": "BATCH",
"metrics": [
"payment_processed_amount"
],
"delta": true
}
]'
```
### API response
```json
{
"queryData": [
{
"payment_success_rate": null,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 150000,
"payment_processed_amount_usd": 1782,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": 0,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": null,
"payments_success_rate_distribution_without_smart_retries": null,
"payments_failure_rate_distribution": null,
"payments_failure_rate_distribution_without_smart_retries": null,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"currency": "INR",
"status": null,
"connector": null,
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": null,
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"time_range": {
"start_time": "2024-10-10T18:30:00.000Z",
"end_time": "2024-10-18T08:24:00.000Z"
},
"time_bucket": "2024-10-10 18:30:00"
},
{
"payment_success_rate": null,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 1794006540,
"payment_processed_amount_usd": 1794006540,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": 0,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": null,
"payments_success_rate_distribution_without_smart_retries": null,
"payments_failure_rate_distribution": null,
"payments_failure_rate_distribution_without_smart_retries": null,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"currency": "USD",
"status": null,
"connector": null,
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": null,
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"time_range": {
"start_time": "2024-10-10T18:30:00.000Z",
"end_time": "2024-10-18T08:24:00.000Z"
},
"time_bucket": "2024-10-10 18:30:00"
},
{
"payment_success_rate": null,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 6540,
"payment_processed_amount_usd": 7118,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": 0,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": null,
"payments_success_rate_distribution_without_smart_retries": null,
"payments_failure_rate_distribution": null,
"payments_failure_rate_distribution_without_smart_retries": null,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"currency": "EUR",
"status": null,
"connector": null,
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": null,
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"time_range": {
"start_time": "2024-10-10T18:30:00.000Z",
"end_time": "2024-10-18T08:24:00.000Z"
},
"time_bucket": "2024-10-10 18:30:00"
}
],
"metaData": [
{
"total_payment_processed_amount": 1794163080,
"total_payment_processed_amount_usd": 1794015440,
"total_payment_processed_amount_without_smart_retries": 0,
"total_payment_processed_amount_without_smart_retries_usd": 0,
"total_payment_processed_count": 0,
"total_payment_processed_count_without_smart_retries": 0,
"total_failure_reasons_count": 0,
"total_failure_reasons_count_without_smart_retries": 0
}
]
}
```
## Testing for various other scenarios
### by tweaking `development.toml` we can create these scenarios
```toml
[forex_api]
call_delay = 30
local_fetch_retry_count = 5
local_fetch_retry_delay = 1000
api_timeout = 20000
api_key = "YOUR PRIMARY API KEY HER" # set this value to anything else to invalidate it
fallback_api_key = "YOUR FALLBACK API KEY HER" # set this value to anything else to invalidate it
redis_lock_timeout = 2600
```
by setting `call_delay` to 30s we can check for the fetch cycle and redis updates.
1. When primary api isn't working (invalidating the primary api key)
<img width="1722" alt="Screenshot 2024-10-29 at 12 08 11 AM" src="https://github.com/user-attachments/assets/9b5fe452-d339-4dca-b65d-f3fd3e510037">
#### API response : 200
2. when both keys are invalidated
<img width="1709" alt="Screenshot 2024-10-29 at 12 10 32 AM" src="https://github.com/user-attachments/assets/6dcaa6be-236c-40af-b3a1-0d40f789b99c">
<img width="1282" alt="Screenshot 2024-10-29 at 12 32 15 AM" src="https://github.com/user-attachments/assets/0c13bdee-e076-47a7-943b-642765d09804">
#### API response : 500
## 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/payment_intents.rs`
- `crates/api_models/src/analytics/payments.rs`
**2. Core Business Logic**
- `crates/analytics/src/payment_intents/core.rs`
- `crates/analytics/src/payments/core.rs`
- `crates/router/src/core/currency.rs`
**3. Utils**
- `crates/router/src/utils/currency.rs`
**4. Configuration Files**
- `crates/analytics/Cargo.toml`
**5. Other**
- `Cargo.lock`
- `crates/analytics/src/errors.rs`
- `crates/analytics/src/payment_intents/accumulator.rs`
- ... and 7 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (22 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 01c5216f:
Files to modify:
**crates/analytics/src/errors.rs**
Modify existing code
**crates/analytics/src/payment_intents/accumulator.rs**
Modify existing code
**crates/analytics/src/payment_intents/core.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs**
Modify existing code
**crates/analytics/src/payments/accumulator.rs**
Modify existing code
**crates/analytics/src/payments/core.rs**
Modify existing code
**crates/analytics/src/payments/metrics/payment_processed_amount.rs**
Modify existing code
**crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs**
Modify existing code
**crates/api_models/src/analytics.rs**
Modify existing code
**crates/api_models/src/analytics/payment_intents.rs**
Modify existing code
**crates/api_models/src/analytics/payments.rs**
Modify existing code
**crates/router/src/analytics.rs**
Modify existing code
**crates/router/src/core/currency.rs**
Add:
- function: pub::get_forex_exchange_rates
**crates/router/src/utils/currency.rs**
Modify existing code
|
{"pr_number": 6418, "pr_title": "feat(analytics): implement currency conversion to power multi-currency aggregation", "merged_at": "2024-11-06T09:51:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics.rs", "crates/api_models/src/analytics/payment_intents.rs", "crates/api_models/src/analytics/payments.rs"], "core_business": ["crates/analytics/src/payment_intents/core.rs", "crates/analytics/src/payments/core.rs", "crates/router/src/core/currency.rs"], "utils": ["crates/router/src/utils/currency.rs"], "config": ["crates/analytics/Cargo.toml"], "other": ["Cargo.lock", "crates/analytics/src/errors.rs", "crates/analytics/src/payment_intents/accumulator.rs", "crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs", "crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs", "crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs", "crates/analytics/src/payments/accumulator.rs", "crates/analytics/src/payments/metrics/payment_processed_amount.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs", "crates/router/src/analytics.rs"]}, "change_types": {"functions_added": 1, "fields_added": 22, "imports_added": 8, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): add SCA exemption field
## 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 -->
- To skip authorization, SCA exemption field is added to the transaction to flag it from authentication for frictionless flow for the user.
- The field is passed during the request and accept 2 values: `low_value` and, `transaction_risk_analysis`
### Additional Changes
- [x] This PR modifies the API contract
Add a new field in payment request
```
{
"psd2_sca_exemption_type": "low_value",
}
```
- [x] This PR modifies the database schema
Add a new field to the payment intent table: `psd2_sca_exemption_type`
- [ ] 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 MCA (Cybersource):
- Create a /payment call
```
{
"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": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "Test",
"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": "Washington",
"first_name": "One",
"last_name": "Last"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"psd2_sca_exemption_type": "low_value",
"authentication_type": "no_three_ds"
}
```
- `psd2_sca_exemption_type` field should be present in the payment_intent table against the generated payment_id
## 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/enums.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/payments.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`
- `crates/hyperswitch_domain_models/src/router_data.rs`
**4. Core Business Logic**
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/authentication/transformers.rs`
- `crates/router/src/core/fraud_check/flows/checkout_flow.rs`
- ... and 13 more files
**5. External Connector Integration**
- `crates/router/src/types/api/verify_connector.rs`
- `crates/router/tests/connectors/aci.rs`
- `crates/router/tests/connectors/utils.rs`
**6. Type Definitions**
- `crates/router/src/types.rs`
**7. Utils**
- `crates/router/src/utils/user/sample_data.rs`
**8. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 5 more files
**Code Patterns Applied:**
- Extend existing types with new fields (45 changes)
**Detailed Identifier Changes:**
Commit 2b8eb09a:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::ScaExemptionType
**crates/diesel_models/src/enums.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/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/authentication.rs**
Modify existing code
**crates/router/src/core/authentication/transformers.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/checkout_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/fulfillment_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/record_return.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/sale_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/transaction_flow.rs**
Modify existing code
**crates/router/src/core/mandate/utils.rs**
Modify existing code
**crates/router/src/core/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/transformers.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Modify existing code
**crates/router/src/core/webhooks/utils.rs**
Modify existing code
**crates/router/src/services/conversion_impls.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/src/utils/user/sample_data.rs**
Modify existing code
**crates/router/tests/connectors/aci.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
|
{"pr_number": 6578, "pr_title": "feat(core): add SCA exemption field", "merged_at": "2024-11-25T11:44:53Z", "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/enums.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/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs", "crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/authentication.rs", "crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/fraud_check/flows/checkout_flow.rs", "crates/router/src/core/fraud_check/flows/fulfillment_flow.rs", "crates/router/src/core/fraud_check/flows/record_return.rs", "crates/router/src/core/fraud_check/flows/sale_flow.rs", "crates/router/src/core/fraud_check/flows/transaction_flow.rs", "crates/router/src/core/mandate/utils.rs", "crates/router/src/core/payments.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/transformers.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/utils.rs"], "connectors": ["crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/aci.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/router/src/types.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/services/conversion_impls.rs", "migrations/2024-11-14-084429_add_sca_exemption_field_to_payment_intent/down.sql", "migrations/2024-11-14-084429_add_sca_exemption_field_to_payment_intent/up.sql"]}, "change_types": {"enums_added": 1, "fields_added": 45}, "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)
Note: hotfix raised against https://github.com/juspay/hyperswitch/pull/8135
### 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 148e3d36:
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": 8321, "pr_title": "refactor(core): introduce new field in payment_intent to handle longer return_url", "merged_at": "2025-06-11T13:20:45Z", "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"}
|
refactor(connector): [Fiuu] enable refund ORF feature [RedSys] fix the request structure
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR contains changes for two connector integrations
1. Fiuu - omit `bank_code` from the refund request for enabling ORF feature from Fiuu's side
2. RedSys - fix the field for sending `browserJavascriptEnabled` field properly
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
## Motivation and Context
This change fixes the issues for Fiuu and RedSys integrations. Fiuu for refunds flow, and RedSys for 3ds card transactions.
## How did you test it?
Can only be tested in production.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit b9009c50:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs**
Modify existing code
|
{"pr_number": 8079, "pr_title": "refactor(connector): [Fiuu] enable refund ORF feature [RedSys] fix the request structure", "merged_at": "2025-05-20T15:13:20Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["refund", "connector", "card"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs"]}, "change_types": {"fields_added": 2, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): fix trustpay refund test cases
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
1. Remove multiple connector support for Trustpay payments as refunds works with single connector
2. Fix Session call test cases
3. Fix EPS payment method
### 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`
4. `loadtest/config`
-->
## Motivation and Context
Test cases were failing
## How did you test it?
<img width="728" alt="image" src="https://github.com/user-attachments/assets/3eed77b8-9195-4f14-8b82-15a3fa9c66d1" />
## 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/cypress/e2e/configs/Payment/Commons.js`
- `cypress-tests/cypress/e2e/configs/Payment/Trustpay.js`
- `cypress-tests/cypress/e2e/spec/Payment/00014-SaveCardFlow.cy.js`
- ... and 1 more files
**Code Patterns Applied:**
- Extend existing types with new fields (13 changes)
|
{"pr_number": 7797, "pr_title": "ci(cypress): fix trustpay refund test cases", "merged_at": "2025-04-25T07:50:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "refund"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Commons.js", "cypress-tests/cypress/e2e/configs/Payment/Trustpay.js", "cypress-tests/cypress/e2e/spec/Payment/00014-SaveCardFlow.cy.js", "cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {"fields_added": 13}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(authentication): Initial commit to modular authentication create
## 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 -->
Initial commit to modular authentication create
This PR introduces a new modular authentication system to Hyperswitch, specifically adding an authentication creation API that allows merchants to initiate authentication flows independently of payment processing.
### Key Features Added
__1. New Authentication Create API__
- __Endpoint__: `POST /authentication`
- __Purpose__: Creates standalone authentication sessions for 3DS and other authentication flows
- __Request includes__: amount, currency, acquirer details (BIN, merchant ID, country code)
- __Response includes__: authentication ID, client secret, status, and other metadata
__2. Core Architecture Changes__
- __Database Schema__: New authentication table with fields for:
- Authentication ID and client secret
- Status tracking
- Acquirer details
- PSD2 SCA exemption types
- Force 3DS challenge flags
- Browser information
__3. Database Migrations__
- Multiple migration files added:
- Making connector item optional in authentication table
- Adding client secret field
- Adding force 3DS challenge support
- Adding PSD2 SCA exemption type support
__4. API Models and Types__
- New authentication request/response structures
- Support for acquirer details (BIN, merchant ID, country code)
- Authentication status management
- Client secret generation for secure authentication flows
__5. Integration Points__
- Updated payment confirmation flows to work with authentication
- Modified payment helpers to support authentication context
- Added Kafka event support for authentication tracking
- Updated OpenAPI specifications
### Technical Implementation
__Core Components__:
- `AuthenticationCreateRequest` and `AuthenticationCreateResponse` API models
- Authentication database models with proper indexing
- Unified authentication service with types and utilities
- Route handlers for authentication endpoints
__Security Features__:
- Client secret generation for secure authentication sessions
- Proper authentication status tracking
- Support for PSD2 compliance requirements
### Additional Changes
- [x] This PR modifies the API contract
- [x] This PR modifies the database schema
## 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 authentication create api for modular authentication
Request
```shell
curl --location 'localhost:8080/authentication/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_OUNohkfDdQJBZQ7bWHdrfhezONhOhEjO5ilOc33GocU1AXH1P8TmYX5tViJYoIc5' \
--data '{
"amount": 10,
"currency": "USD",
"acquirer_details": {
"bin": "13443",
"merchant_id": null,
"country_code": null
}
}'
```
Response
```shell
{
"authentication_id": "authn_2HhKIrFIcYDpfQsS79RA",
"merchant_id": "cloth_seller_Y4LXs2yEBKg1c5udLL3f",
"status": "started",
"client_secret": "authn_2HhKIrFIcYDpfQsS79RA_secret_4o5wW7uVYIWBI94kiC0C",
"amount": 134,
"currency": "USD",
"authentication_connector": null,
"return_url": null,
"created_at": "2025-06-16T11:07:43.526Z",
"error_code": null,
"error_message": null,
"profile_id": "pro_Z8HmqWhqoMquVmSyA2kN",
"psd2_sca_exemption_type": null,
"acquirer_details": {
"bin": null,
"merchant_id": null,
"country_code": null
}
}
```
Test Netcetera Flow nothing should break
## 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`
- `crates/api_models/src/lib.rs`
- `crates/api_models/src/webhooks.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/authentication.rs`
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/query/authentication.rs`
- ... and 3 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/router_data.rs`
- `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs`
**4. Core Business Logic**
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/authentication/utils.rs`
- `crates/router/src/core/payments.rs`
- ... and 7 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs`
**6. Type Definitions**
- `crates/router_env/src/logger/types.rs`
**7. Utils**
- `crates/common_utils/src/events.rs`
- `crates/common_utils/src/id_type.rs`
- `crates/common_utils/src/id_type/authentication.rs`
- ... and 2 more files
**8. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `crates/openapi/src/openapi.rs`
- `crates/openapi/src/routes.rs`
- ... and 13 more files
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (11 changes)
- Extend existing types with new fields (156 changes)
**Detailed Identifier Changes:**
Commit 2ea5d81d:
Files to modify:
**crates/api_models/src/authentication.rs**
Add:
- function: private::get_api_event_type
- function: private::get_api_event_type
- struct: pub::AuthenticationCreateRequest
- struct: pub::AcquirerDetails
- struct: pub::AuthenticationResponse
- impl: impl ApiEventMetric for AuthenticationCreateRequest
- impl: impl ApiEventMetric for AuthenticationResponse
**crates/api_models/src/lib.rs**
Add:
- mod: pub::authentication
**crates/api_models/src/webhooks.rs**
Modify existing code
**crates/common_utils/src/events.rs**
Modify existing code
**crates/common_utils/src/id_type.rs**
Add:
- mod: private::authentication
**crates/common_utils/src/id_type/authentication.rs**
Add:
- function: pub::generate_authentication_id
- function: private::get_api_event_type
- function: private::get_api_event_type
- function: private::get_api_event_type
- impl: impl AuthenticationId
- impl: impl crate::events::ApiEventMetric for AuthenticationId
- impl: impl crate::events::ApiEventMetric for (super::MerchantId, AuthenticationId)
- impl: impl crate::events::ApiEventMetric for (&super::MerchantId, &AuthenticationId)
**crates/diesel_models/src/authentication.rs**
Modify existing code
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/diesel_models/src/query/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/diesel_models/src/user/sample_data.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/routes.rs**
Add:
- mod: pub::authentication
**crates/openapi/src/routes/authentication.rs**
Add:
- function: pub::authentication_create
**crates/router/src/core/authentication.rs**
Modify existing code
**crates/router/src/core/authentication/utils.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_status.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Add:
- function: pub::authentication_create_core
- function: private::foreign_from
- impl: impl ForeignFrom<(
Authentication,
common_utils::types::MinorUnit,
common_enums::Currency,
common_utils::id_type::ProfileId,
Option<AcquirerDetails>,
)> for AuthenticationResponse
**crates/router/src/core/unified_authentication_service/types.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/utils.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/db/authentication.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes.rs**
Add:
- mod: pub::authentication
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- struct: pub::Authentication
- impl: impl Authentication
**crates/router/src/routes/authentication.rs**
Add:
- function: pub::authentication_create
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/services/kafka/authentication.rs**
Modify existing code
**crates/router/src/services/kafka/authentication_event.rs**
Modify existing code
**crates/router/src/services/kafka/payment_attempt.rs**
Modify existing code
**crates/router/src/services/kafka/payment_attempt_event.rs**
Modify existing code
**crates/router/src/utils.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 8085, "pr_title": "feat(authentication): Initial commit to modular authentication create", "merged_at": "2025-06-24T12:14:25Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "merchant", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/authentication.rs", "crates/api_models/src/lib.rs", "crates/api_models/src/webhooks.rs"], "database": ["crates/diesel_models/src/authentication.rs", "crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/query/authentication.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs", "crates/diesel_models/src/user/sample_data.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs"], "core_business": ["crates/router/src/core/authentication.rs", "crates/router/src/core/authentication/utils.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_status.rs", "crates/router/src/core/unified_authentication_service.rs", "crates/router/src/core/unified_authentication_service/types.rs", "crates/router/src/core/unified_authentication_service/utils.rs", "crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.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/authentication.rs", "crates/router/src/routes/lock_utils.rs", "crates/router/src/utils.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/routes.rs", "crates/openapi/src/routes/authentication.rs", "crates/router/src/db/authentication.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/lib.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/authentication.rs", "crates/router/src/services/kafka/authentication.rs", "crates/router/src/services/kafka/authentication_event.rs", "crates/router/src/services/kafka/payment_attempt.rs", "crates/router/src/services/kafka/payment_attempt_event.rs", "migrations/2025-05-19-130655_authentication_table_refactor/down.sql", "migrations/2025-05-19-130655_authentication_table_refactor/up.sql"]}, "change_types": {"structs_added": 4, "functions_added": 11, "fields_added": 156, "imports_added": 13}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(themes): Create APIs for managing themes
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR adds APIs to manage themes.
These are the following APIs
1. Create Theme
2. Delete Theme
3. Update Theme
4. Upload Asset
5. Find Theme by Theme ID
6. Find Theme by Lineage
### Additional Changes
- [x] 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`
7. `crates/router/src/configs`
8. `loadtest/config`
-->
todo!()
## 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 #6553
## 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 Theme
```
curl --location 'http://localhost:8080/user/theme' \
--header 'Content-Type: application/json' \
--header 'api-key: ••••••' \
--data '{
"lineage": {
"entity_type": "profile",
"tenant_id": "t1",
"org_id": "o1",
"merchant_id": "m1",
"profile_id": "p1"
},
"theme_name": "Test",
"theme_data": {
"settings": {
"colors": {
"primary": "#3498db",
"sidebar": "#2ecc71"
},
"buttons": {
"primary": {
"hoverBackgroundColor": "#27ae60"
}
}
}
}
}'
```
2. Delete Theme
```
curl --location --request DELETE 'http://localhost:8080/user/theme/087c79dc-640c-4a2a-8552-6fa4e868cc63?entity_type=profile&tenant_id=t1&org_id=o1&merchant_id=m1&profile_id=p1' \
--header 'api-key: ••••••'
```
3. Update Theme
```
curl --location --request PUT 'http://localhost:8080/user/theme/087c79dc-640c-4a2a-8552-6fa4e868cc63' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"lineage": {
"entity_type": "profile",
"tenant_id": "t1",
"org_id": "o1",
"merchant_id": "m1",
"profile_id": "p1"
},
"theme_data": {
"settings": {
"colors": {
"primary": "#3498xb",
"sidebar": "#2ecc71"
},
"buttons": {
"primary": {
"hoverBackgroundColor": "#27ae60"
}
}
}
}
}'
```
4. Upload Asset
```
curl --location 'http://localhost:8080/user/theme/087c79dc-640c-4a2a-8552-6fa4e868cc63?entity_type=profile&tenant_id=t1&org_id=o1&merchant_id=m1&profile_id=p1' \
--header 'api-key: ••••••' \
--form 'asset_name="logo.png"' \
--form 'asset_data=@"path to file"'
```
5. Get Theme by Theme ID
```
curl --location 'http://localhost:8080/user/theme/087c79dc-640c-4a2a-8552-6fa4e868cc63' \
--header 'api-key: ••••••'
```
6. Get Theme by Lineage
```
curl --location 'http://localhost:8080/user/theme?entity_type=merchant&tenant_id=t1&org_id=o1&merchant_id=m1&profile_id=p1' \
--header 'api-key: ••••••'
```
Responses
- Delete Theme and Upload Asset: 200 OK
- Everything else
```
{
"theme_id": "087c79dc-640c-4a2a-8552-6fa4e868cc63",
"theme_name": "Test",
"entity_type": "profile",
"tenant_id": "t1",
"org_id": "o1",
"merchant_id": "m1",
"profile_id": "p1",
"theme_data": {
"settings": {
"colors": {
"primary": "#3498db",
"sidebar": "#2ecc71"
},
"typography": null,
"buttons": {
"primary": {
"backgroundColor": null,
"textColor": null,
"hoverBackgroundColor": "#27ae60"
},
"secondary": null
},
"borders": null,
"spacing": null
},
"urls": null
}
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/Cargo.toml`
- `crates/api_models/src/events/user.rs`
- `crates/api_models/src/user.rs`
- ... and 1 more files
**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/errors/user.rs`
- `crates/router/src/core/user.rs`
- `crates/router/src/core/user/theme.rs`
**4. Type Definitions**
- `crates/common_utils/src/types/theme.rs`
- `crates/router_env/src/logger/types.rs`
**5. Utils**
- `crates/router/src/routes/lock_utils.rs`
- `crates/router/src/utils/user.rs`
- `crates/router/src/utils/user/theme.rs`
**6. Configuration Files**
- `config/config.example.toml`
- `config/deployments/env_specific.toml`
- `config/development.toml`
- ... and 3 more files
**7. Other**
- `Cargo.lock`
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/db/user/theme.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (15 changes)
- Implement new functions (41 changes)
- Extend existing types with new fields (149 changes)
- Add conditional logic for feature flags or filtering (4 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 3a3e93cb:
Files to modify:
**crates/api_models/src/events/user.rs**
Modify existing code
**crates/api_models/src/user.rs**
Add:
- mod: pub::theme
**crates/api_models/src/user/theme.rs**
Add:
- struct: pub::GetThemeResponse
- struct: pub::UploadFileAssetData
- struct: pub::UploadFileRequest
- struct: pub::CreateThemeRequest
- struct: pub::UpdateThemeRequest
- struct: pub::ThemeData
- struct: private::Settings
- struct: private::Colors
- struct: private::Typography
- struct: private::Buttons
- struct: private::PrimaryButton
- struct: private::SecondaryButton
- struct: private::Borders
- struct: private::Spacing
- struct: private::Urls
**crates/common_utils/src/types/theme.rs**
Add:
- function: pub::entity_type
- function: pub::tenant_id
- function: pub::org_id
- function: pub::merchant_id
- function: pub::profile_id
- impl: impl ThemeLineage
**crates/diesel_models/src/query/user/theme.rs**
Add:
- function: pub::find_by_theme_id
**crates/diesel_models/src/user/theme.rs**
Add:
- function: pub::new
- impl: impl ThemeNew
**crates/router/src/configs/secrets_transformers.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Modify existing code
**crates/router/src/core/errors/user.rs**
Modify existing code
**crates/router/src/core/user.rs**
Add:
- mod: pub::theme
**crates/router/src/core/user/theme.rs**
Add:
- function: pub::get_theme_using_lineage
- function: pub::get_theme_using_theme_id
- function: pub::upload_file_to_theme_storage
- function: pub::create_theme
- function: pub::update_theme
- function: pub::delete_theme
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::find_theme_by_theme_id
**crates/router/src/db/user/theme.rs**
Add:
- function: private::find_theme_by_theme_id
- function: private::find_theme_by_theme_id
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/user.rs**
Add:
- mod: pub::theme
**crates/router/src/routes/user/theme.rs**
Add:
- function: pub::get_theme_using_lineage
- function: pub::get_theme_using_theme_id
- function: pub::upload_file_to_theme_storage
- function: pub::create_theme
- function: pub::update_theme
- function: pub::delete_theme
**crates/router/src/utils/user.rs**
Add:
- mod: pub::theme
**crates/router/src/utils/user/theme.rs**
Add:
- function: private::get_theme_dir_key
- function: pub::get_specific_file_key
- function: pub::get_theme_file_key
- function: private::path_buf_to_str
- function: pub::retrieve_file_from_theme_bucket
- function: pub::upload_file_to_theme_bucket
- function: pub::validate_lineage
- function: private::validate_tenant
- function: private::validate_org
- function: private::validate_merchant_and_get_key_store
- function: private::validate_merchant
- function: private::validate_profile
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 6658, "pr_title": "feat(themes): Create APIs for managing themes", "merged_at": "2024-12-04T11:06:34Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "order"]}, "hierarchy": {"api_models": ["crates/api_models/Cargo.toml", "crates/api_models/src/events/user.rs", "crates/api_models/src/user.rs", "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/errors/user.rs", "crates/router/src/core/user.rs", "crates/router/src/core/user/theme.rs"], "types": ["crates/common_utils/src/types/theme.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs", "crates/router/src/utils/user.rs", "crates/router/src/utils/user/theme.rs"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/secrets_transformers.rs", "crates/router/src/configs/settings.rs"], "other": ["Cargo.lock", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/user/theme.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/user.rs", "crates/router/src/routes/user/theme.rs"]}, "change_types": {"structs_added": 15, "functions_added": 41, "fields_added": 149, "imports_added": 30, "conditionals_added": 4, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix: change precedence order in address that we send to ucs
## Summary
This PR fixes the billing address precedence order in the UCS (Unified Connector Service) transformers to ensure that unified payment method billing addresses take priority over billing addresses from payment requests.
## Changes
- Changed billing address precedence: `unified_payment_method_billing.or(billing)` instead of `billing.or(unified_payment_method_billing)`
- Shipping address logic remains unchanged: `shipping`
## Related Issues
- Closes #9268: Fix UCS address precedence order for payment method billing addresses
## Type of Change
- [x] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
- [ ] Refactoring
## Testing
- [x] Code follows project style guidelines
- [x] Self-review completed
- [ ] Tests pass locally
- [ ] Documentation updated if needed
## Impact
This change ensures that unified payment method billing addresses take priority over payment request billing addresses in UCS transformations, providing more consistent address data handling.
## Files Modified
- `crates/router/src/core/unified_connector_service/transformers.rs` (line 971)
## Technical Details
The fix changes the precedence logic for billing addresses in the `ForeignTryFrom` implementation for `payments_grpc::PaymentAddress`. Previously, billing addresses from the payment request took precedence over unified payment method billing addresses. Now, if a unified payment method billing address exists, it will be used; otherwise, it falls back to the payment request billing address.
### Testing
```sh
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-request-id: adsfadfads' \
--header 'api-key: dev_iTbySOVTqap2S4d7lr80lizI9gP4Ud3cji91v7AV1xk1elLdWNNq6dDVnSoAbpI6' \
--data-raw '{
"amount": 6540,
"currency": "INR",
"amount_to_capture": 6540,
"confirm": true,
"profile_id": "pro_RkdjC1k2ZDLH1wvhSc76",
"email": "customer@gmail.com",
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"customer": {
"id": "customer123",
"name": "John Doe",
"email": "customer@gmail.com",
"phone": "9999999999",
"phone_country_code": "+91"
},
"customer_id": "customer123",
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "upi",
"payment_method_type": "upi_collect",
"payment_method_data": {
"upi": {
"upi_collect": {
"vpa_id": "success@razorpay"
}
},
"billing": {
"email": "pmbi@example.com",
"phone": {
"country_code": "+91",
"number": "6502530000"
}
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IN",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "si@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"
},
"request_incremental_authorization": false,
"merchant_order_reference_id": "testing_the_integ03454",
"all_keys_required": true,
"session_expiry": 900
}'
```
```json
{
"payment_id": "pay_d4tMeFMxF4EmZZ4w18Ym",
"merchant_id": "merchant_1756906013",
"status": "requires_customer_action",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 6540,
"amount_received": null,
"connector": "razorpay",
"client_secret": "pay_d4tMeFMxF4EmZZ4w18Ym_secret_Bj4JWSrDkGDGK3TfKBt1",
"created": "2025-09-03T15:36:23.275Z",
"currency": "INR",
"customer_id": "customer123",
"customer": {
"id": "customer123",
"name": "John Doe",
"email": "customer@gmail.com",
"phone": "9999999999",
"phone_country_code": "+91"
},
"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": "upi",
"payment_method_data": {
"upi": {
"upi_collect": {
"vpa_id": "su*****@razorpay"
}
},
"billing": {
"address": null,
"phone": {
"number": "6502530000",
"country_code": "+91"
},
"email": null
}
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "IN",
"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": "si@example.com"
},
"billing": {
"address": {
"city": "San Fransico",
"country": "IN",
"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": "bi@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": "upi_collect",
"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": 1756913783,
"expires": 1756917383,
"secret": "epk_53d393130e224556b2105520350533ae"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pay_RDBFdT6qU2bwzC",
"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": "unified_connector_service"
},
"reference_id": "order_RDBFcufill32B5",
"payment_link": null,
"profile_id": "pro_RkdjC1k2ZDLH1wvhSc76",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_1cYyVsBadn8UVLK5vI24",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-03T15:51:23.275Z",
"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-03T15:36:26.339Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": "testing_the_integ03454",
"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": "{\"razorpay_payment_id\":\"pay_RDBFdT6qU2bwzC\"}",
"enable_partial_authorization": null
}
```
**Important Note**: before fix the status was failed as it wasn't able to consume email but now it is correct
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/unified_connector_service/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit a2b180e3:
Files to modify:
**crates/router/src/core/unified_connector_service/transformers.rs**
Modify existing code
|
{"pr_number": 9269, "pr_title": "fix: change precedence order in address that we send to ucs", "merged_at": "2025-09-03T17:28:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/unified_connector_service/transformers.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): fix `worldpayxml`, and `deutschebank` cypress test cases
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
Addresses Failed Cypress Test Cases for `deutschebank` and `worldpayxml`.
### 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).
-->
Addresses #8399
## 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)?
-->
### Initial Condition
| Deutschebank | Worldpayxml |
| -------- | ------- |
| <img width="723" alt="image" src="https://github.com/user-attachments/assets/e44e58f0-3eea-4da6-bb98-2a6799a77290" /> | <img width="723" alt="image" src="https://github.com/user-attachments/assets/1ddd0c7f-a584-4f48-b8a2-e545e48fcbf1" /> |
### Current Condition
| Deutschebank | Worldpayxml |
| -------- | ------- |
| <img width="717" alt="image" src="https://github.com/user-attachments/assets/0f66ba7f-122a-4b03-aeee-4df493dc96fa" /> | <img width="725" alt="image" src="https://github.com/user-attachments/assets/bb552bc7-7f1e-4a1d-bac4-fbd47fd57cd8" /> |
## 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/Deutschebank.js`
- `cypress-tests/cypress/e2e/configs/Payment/Utils.js`
- `cypress-tests/cypress/e2e/configs/Payment/Worldpayxml.js`
- ... and 3 more files
**Code Patterns Applied:**
- Extend existing types with new fields (238 changes)
|
{"pr_number": 8193, "pr_title": "ci(cypress): fix `worldpayxml`, and `deutschebank` cypress test cases", "merged_at": "2025-07-04T14:47:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Deutschebank.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/configs/Payment/Worldpayxml.js", "cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.js", "cypress-tests/cypress/support/commands.js", "cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {"fields_added": 238}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): Paypal BankRedirects (Ideal/EPS)
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
PayPal added some extra parameters in the response, which caused the bank redirects to fail.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
## How did you test it?
<img width="604" alt="Screenshot 2024-12-17 at 5 47 45 PM" src="https://github.com/user-attachments/assets/d9294aa2-7cfd-4864-9d6d-766d6f95877e" />
<img width="595" alt="Screenshot 2024-12-17 at 5 49 38 PM" src="https://github.com/user-attachments/assets/093964a0-bee7-4901-b3a9-a9a9eb7fcc23" />
## 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/paypal/transformers.rs`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Extend existing types with new fields (7 changes)
**Detailed Identifier Changes:**
Commit dcd51a7f:
Files to modify:
**crates/router/src/connector/paypal/transformers.rs**
Add:
- struct: pub::EpsRedirectionResponse
- struct: pub::IdealRedirectionResponse
|
{"pr_number": 6864, "pr_title": "fix(connector): Paypal BankRedirects (Ideal/EPS) ", "merged_at": "2024-12-20T07:16:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"connectors": ["crates/router/src/connector/paypal/transformers.rs"]}, "change_types": {"structs_added": 2, "fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): add nexinets connector
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Add Nexinets connector to cypress test suits.
- This connector doesn't support MIT payments hence mapped accordingly
- Added 3ds flows
### 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
Connector Test Case Enhancement
## How did you test it?
<img width="754" alt="image" src="https://github.com/user-attachments/assets/a20f4c3b-0bf3-4d1b-8af0-99f41d84ddce" />
Failure Issues :
1.3DS payments are not working as expected for manual capture flows — clicking the redirection link keeps the payment in the requires_customer_action status.
2. Payment method lists are empty
## 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/cypress/e2e/configs/Payment/Nexinets.js`
- `cypress-tests/cypress/e2e/configs/Payment/Utils.js`
- `cypress-tests/cypress/support/redirectionHandler.js`
**Code Patterns Applied:**
- Extend existing types with new fields (647 changes)
|
{"pr_number": 8510, "pr_title": "ci(cypress): add nexinets connector", "merged_at": "2025-07-02T10:33:27Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Nexinets.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {"fields_added": 647}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): [NMI] Added enum for Void Reason
## 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 -->
Previously, we were accepting void_reason as string, but since Nmi accepts specific values for void_reason, those values have been added to an 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).
-->
Issue Link: https://github.com/juspay/hyperswitch/issues/7222
## 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. Create Payment**
-Request
```
curl --location 'localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_XtFublrRhWIHc7iuKjgQtABwUOjTGaEujjdXNQLUs8cI4xaPZiS4YOAO6gMjQ8fK' \
--data-raw '{
"amount": 3000,
"currency": "USD",
"confirm": true,
"capture_method": "manual",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 3000,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4100000000000100",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "410"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "someone",
"last_name": "happy"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "someone",
"last_name": "happy"
}
},
"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_uPyEZvr3oVAvYsVvZ0jN",
"merchant_id": "postman_merchant_GHAction_dd590ad1-bf12-47a6-bde5-586f878b3ba1",
"status": "processing",
"amount": 3000,
"net_amount": 3000,
"shipping_cost": null,
"amount_capturable": 3000,
"amount_received": null,
"connector": "nmi",
"client_secret": "pay_uPyEZvr3oVAvYsVvZ0jN_secret_9j87TpZlvvlMpSC5eFDq",
"created": "2025-02-10T04:51:56.569Z",
"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": "card",
"payment_method_data": {
"card": {
"last4": "0100",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "410000",
"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_hdl9v3A1JuIvmH2tO02R",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "someone",
"last_name": "happy"
},
"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": "someone",
"last_name": "happy"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1739163116,
"expires": 1739166716,
"secret": "epk_515db508176144d8a80582b802c6da31"
},
"manual_retry_allowed": false,
"connector_transaction_id": "10396960775",
"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_uPyEZvr3oVAvYsVvZ0jN_1",
"payment_link": null,
"profile_id": "pro_qonNkZSegDkXycMtUZsb",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_EtKPhtxukFIa5pSEBtsO",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-10T05:06:56.569Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-10T04:51:59.965Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**2. Psync**
-Request
```
curl --location 'localhost:8080/payments/pay_uPyEZvr3oVAvYsVvZ0jN?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_XtFublrRhWIHc7iuKjgQtABwUOjTGaEujjdXNQLUs8cI4xaPZiS4YOAO6gMjQ8fK'
```
-Response
```
{
"payment_id": "pay_uPyEZvr3oVAvYsVvZ0jN",
"merchant_id": "postman_merchant_GHAction_dd590ad1-bf12-47a6-bde5-586f878b3ba1",
"status": "requires_capture",
"amount": 3000,
"net_amount": 3000,
"shipping_cost": null,
"amount_capturable": 3000,
"amount_received": null,
"connector": "nmi",
"client_secret": "pay_uPyEZvr3oVAvYsVvZ0jN_secret_9j87TpZlvvlMpSC5eFDq",
"created": "2025-02-10T04:51:56.569Z",
"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": "card",
"payment_method_data": {
"card": {
"last4": "0100",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "410000",
"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_hdl9v3A1JuIvmH2tO02R",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "someone",
"last_name": "happy"
},
"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": "someone",
"last_name": "happy"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "10396960775",
"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_uPyEZvr3oVAvYsVvZ0jN_1",
"payment_link": null,
"profile_id": "pro_qonNkZSegDkXycMtUZsb",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_EtKPhtxukFIa5pSEBtsO",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-10T05:06:56.569Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-10T04:54:48.886Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**3. Cancel (Invalid Cancellation Reason)**
-Request
```
curl --location 'localhost:8080/payments/pay_uPyEZvr3oVAvYsVvZ0jN/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_XtFublrRhWIHc7iuKjgQtABwUOjTGaEujjdXNQLUs8cI4xaPZiS4YOAO6gMjQ8fK' \
--data '{
"cancellation_reason": "abcde"
}'
```
-Response
```
{
"error": {
"type": "invalid_request",
"message": "Payment method type not supported",
"code": "IR_19",
"reason": "Json deserialise error: unknown variant `abcde` expected to be one of `fraud`, `user_cancel`, `icc_rejected`, `icc_card_removed`, `icc_no_confirmation`, `pos_timeout`. This cancellation_reason is not supported by nmi"
}
}
```
**4. Cancel (Valid Cancellation Reason)**
-Request
```
curl --location 'localhost:8080/payments/pay_uPyEZvr3oVAvYsVvZ0jN/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_XtFublrRhWIHc7iuKjgQtABwUOjTGaEujjdXNQLUs8cI4xaPZiS4YOAO6gMjQ8fK' \
--data '{
"cancellation_reason": "fraud"
}'
```
-Response
```
{
"payment_id": "pay_uPyEZvr3oVAvYsVvZ0jN",
"merchant_id": "postman_merchant_GHAction_dd590ad1-bf12-47a6-bde5-586f878b3ba1",
"status": "processing",
"amount": 3000,
"net_amount": 3000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "nmi",
"client_secret": "pay_uPyEZvr3oVAvYsVvZ0jN_secret_9j87TpZlvvlMpSC5eFDq",
"created": "2025-02-10T04:51:56.569Z",
"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": "card",
"payment_method_data": {
"card": {
"last4": "0100",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "410000",
"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_hdl9v3A1JuIvmH2tO02R",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "someone",
"last_name": "happy"
},
"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": "someone",
"last_name": "happy"
},
"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": "fraud",
"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": "10396960775",
"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_uPyEZvr3oVAvYsVvZ0jN_1",
"payment_link": null,
"profile_id": "pro_qonNkZSegDkXycMtUZsb",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_EtKPhtxukFIa5pSEBtsO",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-10T05:06:56.569Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-10T04:58:20.070Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**5. Psync**
-Request
```
curl --location 'localhost:8080/payments/pay_uPyEZvr3oVAvYsVvZ0jN?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_XtFublrRhWIHc7iuKjgQtABwUOjTGaEujjdXNQLUs8cI4xaPZiS4YOAO6gMjQ8fK'
```
-Response
```
{
"payment_id": "pay_uPyEZvr3oVAvYsVvZ0jN",
"merchant_id": "postman_merchant_GHAction_dd590ad1-bf12-47a6-bde5-586f878b3ba1",
"status": "cancelled",
"amount": 3000,
"net_amount": 3000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "nmi",
"client_secret": "pay_uPyEZvr3oVAvYsVvZ0jN_secret_9j87TpZlvvlMpSC5eFDq",
"created": "2025-02-10T04:51:56.569Z",
"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": "card",
"payment_method_data": {
"card": {
"last4": "0100",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "410000",
"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_hdl9v3A1JuIvmH2tO02R",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "someone",
"last_name": "happy"
},
"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": "someone",
"last_name": "happy"
},
"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": "fraud",
"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": "10396960775",
"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_uPyEZvr3oVAvYsVvZ0jN_1",
"payment_link": null,
"profile_id": "pro_qonNkZSegDkXycMtUZsb",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_EtKPhtxukFIa5pSEBtsO",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-10T05:06:56.569Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-10T04:59:47.927Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
**Cypress Test Screenshots**
**No3DSAutoCapture**

**No3DSManualCapture**

**3DSAutoCapture**

**3DSManualCapture**

**Refund**

**Void**

**Headless Tests**

Note: Please note that subsequent cypress tests for the same flows might fail because NMI has a validation from their end which prevents duplicate transactions from going through, and throws an error similar to "Duplicate transaction REFID:198369517" for the same.
## 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`
**Code Patterns Applied:**
- Extend existing types with new fields (7 changes)
**Detailed Identifier Changes:**
Commit 90321653:
Files to modify:
**crates/router/src/connector/nmi/transformers.rs**
Add:
- enum: pub::NmiVoidReason
|
{"pr_number": 7221, "pr_title": "fix(connector): [NMI] Added enum for Void Reason", "merged_at": "2025-02-24T20:56:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/connector/nmi/transformers.rs"]}, "change_types": {"enums_added": 1, "fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): add additional revenue recovery call flow
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
For some billing connectors, we get limited data in the webhook that is not sufficient to use. So we need to make an additional api call for this extra data. This pr adds that flow.
### 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
No testing required since its just defining the flow not using it.
## 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. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs`
- ... and 5 more files
**2. Core Business Logic**
- `crates/router/src/core/payments/flows.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/default_implementations.rs`
**4. Type Definitions**
- `crates/hyperswitch_interfaces/src/types.rs`
- `crates/router/src/types.rs`
- `crates/router/src/types/api.rs`
**5. Configuration Files**
- `config/config.example.toml`
- `config/development.toml`
- `config/docker_compose.toml`
- ... and 3 more files
**6. Other**
- `crates/hyperswitch_interfaces/src/api.rs`
- `crates/hyperswitch_interfaces/src/api/revenue_recovery.rs`
- `crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Extend existing types with new fields (15 changes)
**Detailed Identifier Changes:**
Commit 9e4135cd:
Files to modify:
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs**
Add:
- struct: pub::GetAdditionalRevenueRecoveryFlowCommonData
**crates/hyperswitch_domain_models/src/router_flow_types.rs**
Add:
- mod: pub::revenue_recovery
**crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs**
Add:
- struct: pub::GetAdditionalRevenueRecoveryDetails
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Add:
- mod: pub::revenue_recovery
**crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs**
Add:
- struct: pub::GetAdditionalRevenueRecoveryRequestData
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Add:
- mod: pub::revenue_recovery
**crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs**
Add:
- struct: pub::GetAdditionalRevenueRecoveryResponseData
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api.rs**
Add:
- mod: pub::revenue_recovery
- mod: pub::revenue_recovery_v2
**crates/hyperswitch_interfaces/src/api/revenue_recovery.rs**
Add:
- trait: pub::RevenueRecovery
- trait: pub::AdditionalRevenueRecovery
**crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs**
Add:
- trait: pub::RevenueRecoveryV2
- trait: pub::AdditionalRevenueRecoveryV2
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
**crates/router/src/configs/secrets_transformers.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Add:
- struct: pub::GetAdditionalRevenueRecoveryDetailsCall
**crates/router/src/core/payments/flows.rs**
Add:
- impl: impl api::RevenueRecovery for connector::DummyConnector<T>
- impl: impl api::AdditionalRevenueRecovery for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
GetAdditionalRevenueRecoveryDetails,
types::GetAdditionalRevenueRecoveryRequestData,
types::GetAdditionalRevenueRecoveryResponseData,
> for connector::DummyConnector<T>
**crates/router/src/services/api.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
|
{"pr_number": 7402, "pr_title": "feat(core): add additional revenue recovery call flow", "merged_at": "2025-03-06T07:14:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector", "webhook"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs", "crates/hyperswitch_domain_models/src/router_flow_types.rs", "crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs", "crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/types.rs"], "core_business": ["crates/router/src/core/payments/flows.rs"], "connectors": ["crates/hyperswitch_connectors/src/default_implementations.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs", "crates/router/src/types.rs", "crates/router/src/types/api.rs"], "config": ["config/config.example.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/Cargo.toml", "crates/router/src/configs/secrets_transformers.rs", "crates/router/src/configs/settings.rs"], "other": ["crates/hyperswitch_interfaces/src/api.rs", "crates/hyperswitch_interfaces/src/api/revenue_recovery.rs", "crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs", "crates/router/src/services/api.rs"]}, "change_types": {"structs_added": 5, "fields_added": 15, "imports_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Added recurring payments support for split payments in Stripe
## 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 recurring payments support for split payments in Stripe
### 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. Split payment CIT
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_uLWGMForUNGilTN7hh9dGsQS9WTLqQIrbFqImn4SaXdIApmtEM1G8rcr7hTbimpe' \
--data '
{
"amount": 200,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"amount_to_capture": 200,
"customer_id": "cus_6",
"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"
}
},
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "09",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"split_payments": {
"stripe_split_payment": {
"charge_type": "destination",
"application_fees": 100,
"transfer_account_id": "acct_1PDftAIhl7EEkW0O"
}
},
"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"
}
}
'
```
Response:
```
{
"payment_id": "pay_kEEY34U6ECjUo9WOZe0w",
"merchant_id": "merchant_1749032168",
"status": "succeeded",
"amount": 200,
"net_amount": 200,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 200,
"connector": "stripe",
"client_secret": "pay_kEEY34U6ECjUo9WOZe0w_secret_OQfx3TDdISCFBLQQJn0N",
"created": "2025-06-06T07:28:28.956Z",
"currency": "USD",
"customer_id": "cus_6",
"customer": {
"id": "cus_6",
"name": "John Doe",
"email": null,
"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": "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": "09",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": {
"cvc_check": "pass",
"address_line1_check": "pass",
"address_postal_code_check": "pass"
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": null,
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cus_6",
"created_at": 1749194908,
"expires": 1749198508,
"secret": "epk_66759cf801664cca82299592f2b145ac"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3RWuhWIVaesDjvMP2P4xrYGQ",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3RWuhWIVaesDjvMP2P4xrYGQ",
"payment_link": null,
"profile_id": "pro_E663efxYyhv29dozBbOJ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_ktIVKfHV583ufBYSYrZM",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-06T07:43:28.955Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "128.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_SwM8JpMtFj0OiinNxD0z",
"payment_method_status": "active",
"updated": "2025-06-06T07:28:31.378Z",
"split_payments": {
"stripe_split_payment": {
"charge_id": "ch_3RWv4MIVaesDjvMP0Kkz11A8",
"charge_type": "destination",
"application_fees": 100,
"transfer_account_id": "acct_1PDftAIhl7EEkW0O"
}
},
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "pm_1RWuhWIVaesDjvMPj2276sZZ",
"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
}
```
2. MIT with corresponding payment_method_id
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_uLWGMForUNGilTN7hh9dGsQS9WTLqQIrbFqImn4SaXdIApmtEM1G8rcr7hTbimpe' \
--data '{
"amount": 200,
"currency": "USD",
"customer_id": "cus_6",
"description": "Subsequent Mandate Test Payment (MIT from New CIT Demo)",
"confirm": true,
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "pm_SwM8JpMtFj0OiinNxD0z"
}
}'
```
Response
```
{
"payment_id": "pay_v1AVWCpSd9smRvcecCZ6",
"merchant_id": "merchant_1749032168",
"status": "succeeded",
"amount": 200,
"net_amount": 200,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 200,
"connector": "stripe",
"client_secret": "pay_v1AVWCpSd9smRvcecCZ6_secret_KuDu34Dvmjca1WVnzvmX",
"created": "2025-06-06T07:28:52.689Z",
"currency": "USD",
"customer_id": "cus_6",
"customer": {
"id": "cus_6",
"name": "John Doe",
"email": null,
"phone": "999999999",
"phone_country_code": "+65"
},
"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": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "09",
"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": null,
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cus_6",
"created_at": 1749194932,
"expires": 1749198532,
"secret": "epk_bd21a582aa7145e7a546ceaecd99c09e"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3RWuhtIVaesDjvMP1GQPCvAA",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3RWuhtIVaesDjvMP1GQPCvAA",
"payment_link": null,
"profile_id": "pro_E663efxYyhv29dozBbOJ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_ktIVKfHV583ufBYSYrZM",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-06T07:43:52.689Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_SwM8JpMtFj0OiinNxD0z",
"payment_method_status": "active",
"updated": "2025-06-06T07:28:53.931Z",
"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": "pm_1RWuhWIVaesDjvMPj2276sZZ",
"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/transformers.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (6 changes)
**Detailed Identifier Changes:**
Commit 6f75c4b6:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Add:
- function: private::get_off_session
|
{"pr_number": 8271, "pr_title": "feat(connector): Added recurring payments support for split payments in Stripe", "merged_at": "2025-06-08T12:57:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs"]}, "change_types": {"functions_added": 1, "fields_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(events): adding infra level components to api-events
## 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 -->
main PR
https://github.com/juspay/hyperswitch/pull/8214
Adding infra level information to `ApiEvent` based on config from deployment config under `infra_values`
### 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`
-->
```bash
[infra_values]
cluster = "CLUSTER" # value of CLUSTER from deployment
version = "HOSTNAME" # value of HOSTNAME from deployment which tells its version
```
## 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 is required for comparing events generation and their status code for comparing success rate of 2 different versions of router
## 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="985" alt="Screenshot 2025-06-03 at 11 18 29 AM" src="https://github.com/user-attachments/assets/8cc863c5-f948-4232-969f-7a6d44be1dac" />
## 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`
- `crates/router/src/core/webhooks/incoming_v2.rs`
**2. Configuration Files**
- `config/config.example.toml`
- `config/development.toml`
- `config/docker_compose.toml`
- ... and 2 more files
**3. Other**
- `crates/router/src/events/api_logs.rs`
- `crates/router/src/routes/app.rs`
- `crates/router/src/services/api.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (9 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 2ba704a8:
Files to modify:
**crates/router/src/configs/secrets_transformers.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming_v2.rs**
Modify existing code
**crates/router/src/events/api_logs.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Add:
- function: pub::process_env_mappings
**crates/router/src/services/api.rs**
Modify existing code
|
{"pr_number": 8242, "pr_title": "feat(events): adding infra level components to api-events", "merged_at": "2025-06-04T14:48:46Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"core_business": ["crates/router/src/core/webhooks/incoming.rs", "crates/router/src/core/webhooks/incoming_v2.rs"], "config": ["config/config.example.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/secrets_transformers.rs", "crates/router/src/configs/settings.rs"], "other": ["crates/router/src/events/api_logs.rs", "crates/router/src/routes/app.rs", "crates/router/src/services/api.rs"]}, "change_types": {"functions_added": 1, "fields_added": 9, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template
## 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 adds fetches payment method data in payment attempt list v2 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).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Request:
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0198179b2de5751292df2b555eaa3cf2/list_attempts' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_2Kk2ddRcJttgm6ONh0zm' \
--header 'api-key: dev_g5HfT4ijuVQs3QLUPf3xAT6M26ebVgHHTivreiSljKPdRvEsqBNSKxHJrhLboLsT' \
--header 'Authorization: api-key=dev_g5HfT4ijuVQs3QLUPf3xAT6M26ebVgHHTivreiSljKPdRvEsqBNSKxHJrhLboLsT'
```
Response
```
{
"payment_attempt_list": [
{
"id": "12345_att_0198179b2e167703a070a6ec12d40213",
"status": "voided",
"amount": {
"net_amount": 10000,
"amount_to_capture": null,
"surcharge_amount": null,
"tax_on_surcharge": null,
"amount_capturable": 0,
"shipping_cost": null,
"order_tax_amount": null
},
"connector": "stripe",
"error": {
"code": "card_declined",
"message": "Your card was declined.",
"unified_code": null,
"unified_message": null,
"network_advice_code": null,
"network_decline_code": null,
"network_error_message": null
},
"authentication_type": "no_three_ds",
"created_at": "2025-07-16T12:18:21.000Z",
"modified_at": "2025-07-17T08:58:23.034Z",
"cancellation_reason": null,
"payment_token": null,
"connector_metadata": null,
"payment_experience": null,
"payment_method_type": "card",
"connector_reference_id": null,
"payment_method_subtype": "credit",
"connector_payment_id": {
"TxnId": "pi_3RlUHlCZJlEh6syL1TxJJCst"
},
"payment_method_id": null,
"client_source": null,
"client_version": null,
"feature_metadata": {
"revenue_recovery": {
"attempt_triggered_by": "external",
"charge_id": "ch_3RlUHlCZJlEh6syL1gLXCiDC"
}
},
"payment_method_data": {
"card": {
"last4": "0008",
"card_type": null,
"card_network": null,
"card_issuer": "Chase",
"card_issuing_country": null,
"card_isin": null,
"card_extended_bin": null,
"card_exp_month": "06",
"card_exp_year": "50",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": 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. API Request/Response Models**
- `crates/api_models/src/enums.rs`
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/connector_endpoints.rs`
**3. Core Business Logic**
- `crates/router/src/core/connector_validation.rs`
- `crates/router/src/core/payments/transformers.rs`
**4. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/hyperswitch_connectors/src/connectors.rs`
- ... and 9 more files
**5. Tests**
- `loadtest/config/development.toml`
**6. Configuration Files**
- `config/docker_compose.toml`
**7. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (78 changes)
- Extend existing types with new fields (162 changes)
**Detailed Identifier Changes:**
Commit 110beaff:
Files to modify:
**crates/api_models/src/enums.rs**
Modify existing code
**crates/api_models/src/payments.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::custombilling
**crates/hyperswitch_connectors/src/connectors/custombilling.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::Custombilling
- impl: impl Custombilling
- impl: impl api::Payment for Custombilling
- impl: impl api::PaymentSession for Custombilling
- impl: impl api::ConnectorAccessToken for Custombilling
- impl: impl api::MandateSetup for Custombilling
- impl: impl api::PaymentAuthorize for Custombilling
- impl: impl api::PaymentSync for Custombilling
- impl: impl api::PaymentCapture for Custombilling
- impl: impl api::PaymentVoid for Custombilling
- impl: impl api::Refund for Custombilling
- impl: impl api::RefundExecute for Custombilling
- impl: impl api::RefundSync for Custombilling
- impl: impl api::PaymentToken for Custombilling
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Custombilling
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Custombilling
- impl: impl ConnectorCommon for Custombilling
- impl: impl ConnectorValidation for Custombilling
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Custombilling
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Custombilling
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Custombilling
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Custombilling
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Custombilling
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Custombilling
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Custombilling
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Custombilling
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Custombilling
- impl: impl webhooks::IncomingWebhook for Custombilling
- impl: impl ConnectorSpecifications for Custombilling
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/custombilling/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::CustombillingRouterData
- struct: pub::CustombillingPaymentsRequest
- struct: pub::CustombillingCard
- struct: pub::CustombillingAuthType
- struct: pub::CustombillingPaymentsResponse
- struct: pub::CustombillingRefundRequest
- struct: pub::RefundResponse
- struct: pub::CustombillingErrorResponse
- enum: pub::CustombillingPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for CustombillingRouterData<T>
- impl: impl TryFrom<&CustombillingRouterData<&PaymentsAuthorizeRouterData>> for CustombillingPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for CustombillingAuthType
- impl: impl From<CustombillingPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, CustombillingPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&CustombillingRouterData<&RefundsRouterData<F>>> for CustombillingRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
- impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/connector_endpoints.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/core/connector_validation.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/types/api/connector_mapping.rs**
Modify existing code
**crates/router/src/types/connector_transformers.rs**
Modify existing code
**crates/router/tests/connectors/custombilling.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::CustombillingTest
- impl: impl ConnectorActions for CustombillingTest
- impl: impl utils::Connector for CustombillingTest
|
{"pr_number": 8681, "pr_title": "refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template", "merged_at": "2025-07-21T19:08:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "order", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/enums.rs", "crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/connector_endpoints.rs"], "core_business": ["crates/router/src/core/connector_validation.rs", "crates/router/src/core/payments/transformers.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/custombilling.rs", "crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/src/types/connector_transformers.rs", "crates/router/tests/connectors/custombilling.rs", "scripts/add_connector.sh"], "tests": ["loadtest/config/development.toml"], "config": ["config/docker_compose.toml"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json"]}, "change_types": {"structs_added": 10, "functions_added": 78, "enums_added": 2, "fields_added": 162, "imports_added": 19}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Add Connector changes for 3ds (v2)
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
- Add `PreAuthenticate`, `Authenticate` and `PostAuthenticate` connector integration and implement them for cybersource
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] 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 #9116
## 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 only adds the code changes without actually wiring them to APIs, so it can't be tested as is. A separate PR will add new endpoints that use these flows, they will be tested there.
## 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`
- `crates/hyperswitch_domain_models/src/types.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/cybersource.rs`
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
- `crates/hyperswitch_connectors/src/default_implementations.rs`
**3. Type Definitions**
- `crates/hyperswitch_interfaces/src/types.rs`
**4. Other**
- `crates/hyperswitch_interfaces/src/api/payments.rs`
- `crates/hyperswitch_interfaces/src/api/payments_v2.rs`
**Code Patterns Applied:**
- Define new data structures (7 changes)
- Implement new functions (40 changes)
- Extend existing types with new fields (275 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 6b880e45:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/cybersource.rs**
Add:
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_5xx_error_response
- impl: impl api::PaymentsPreAuthenticate for Cybersource
- impl: impl api::PaymentsPostAuthenticate for Cybersource
- impl: impl api::PaymentsAuthenticate for Cybersource
- impl: impl ConnectorIntegration<PreAuthenticate, PaymentsPreAuthenticateData, PaymentsResponseData> for Cybersource
- impl: impl ConnectorIntegration<Authenticate, PaymentsAuthenticateData, PaymentsResponseData> for Cybersource
- impl: impl ConnectorIntegration<PostAuthenticate, PaymentsPostAuthenticateData, PaymentsResponseData> for Cybersource
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Cybersource
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Remove:
- struct: pub::CybersourceConsumerAuthValidateResponse
- struct: pub::CybersourceThreeDSMetadata
- struct: pub::CybersourceConsumerAuthInformationEnrollmentResponse
- struct: pub::ClientAuthCheckInfoResponse
- enum: pub::CybersourceAuthEnrollmentStatus
- enum: pub::CybersourcePreProcessingResponse
- impl: impl TryFrom<&CybersourceRouterData<&PaymentsCompleteAuthorizeRouterData>> for [serde(rename_all = "SCREAMING_SNAKE_CASE")]
Add:
- function: private::from
- function: private::try_from
- impl: impl From<&CybersourceRouterData<&PaymentsPreAuthenticateRouterData>> for ClientReferenceInformation
- impl: impl TryFrom<&CybersourceRouterData<&PaymentsPreAuthenticateRouterData>> for CybersourceAuthSetupRequest
- impl: impl TryFrom<&CybersourceRouterData<&PaymentsAuthenticateRouterData>> for (item.router_data.connector_request_reference_id.clone())
- impl: impl TryFrom<&CybersourceRouterData<&PaymentsPostAuthenticateRouterData>> for (item.router_data.connector_request_reference_id.clone())
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Add:
- function: private::try_from
- function: private::try_from
- function: private::try_from
- struct: pub::PaymentsPreAuthenticateData
- struct: pub::PaymentsAuthenticateData
- struct: pub::PaymentsPostAuthenticateData
- impl: impl TryFrom<PaymentsAuthorizeData> for PaymentsPreAuthenticateData
- impl: impl TryFrom<PaymentsAuthorizeData> for PaymentsAuthenticateData
- impl: impl TryFrom<PaymentsAuthorizeData> for PaymentsPostAuthenticateData
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/payments.rs**
Add:
- trait: pub::PaymentsPreAuthenticate
- trait: pub::PaymentsAuthenticate
- trait: pub::PaymentsPostAuthenticate
**crates/hyperswitch_interfaces/src/api/payments_v2.rs**
Add:
- trait: pub::PaymentsPreAuthenticateV2
- trait: pub::PaymentsAuthenticateV2
- trait: pub::PaymentsPostAuthenticateV2
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
|
{"pr_number": 9117, "pr_title": "feat(router): Add Connector changes for 3ds (v2)", "merged_at": "2025-09-11T14:33:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/types.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs"], "other": ["crates/hyperswitch_interfaces/src/api/payments.rs", "crates/hyperswitch_interfaces/src/api/payments_v2.rs"]}, "change_types": {"structs_added": 7, "functions_added": 40, "enums_added": 3, "fields_added": 275, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore: fix `toml` format to address wasm build failure
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [x] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
An incorrect TOML format has been added to the ctp_mastercard due to which the wasm build is getting failed.
Add development as feature in wasm 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)?
-->
## 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/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
**2. Other**
- `docker/wasm-build.Dockerfile`
|
{"pr_number": 6967, "pr_title": "chore: fix `toml` format to address wasm build failure", "merged_at": "2025-01-28T09:17:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["card"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"], "other": ["docker/wasm-build.Dockerfile"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
chore(deps): update cypress packages to address CVE
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [x] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR update Cypress packages to address [CVE-2024-21538](https://vulert.com/vuln-db/CVE-2024-21538).
Closes https://github.com/juspay/hyperswitch/issues/6623
### 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).
-->
CVE.
## 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 tests needed as it is just a dependency update. CI passing should be enough.
## 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-v2/package-lock.json`
- `cypress-tests-v2/package.json`
- `cypress-tests/package-lock.json`
- ... and 1 more files
|
{"pr_number": 6624, "pr_title": "chore(deps): update cypress packages to address CVE", "merged_at": "2024-11-25T13:31:10Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["cypress-tests-v2/package-lock.json", "cypress-tests-v2/package.json", "cypress-tests/package-lock.json", "cypress-tests/package.json"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(stripe): partial capture issue when fully captured on redirection flow like card3ds , eps bank redirect
Partial capture issue related to stripe
## 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 -->
Hotfix for :
- https://github.com/juspay/hyperswitch/pull/8956
Issue : https://github.com/juspay/hyperswitch/issues/8953
On successful redirection on CARDS3ds Friction , eps bank redirect, even when fully captured the status is `partially_captured`
### Affected core flow: PSYNC
### Connector : STRIPE
### Flows affected in stripe: Redirection flows like 3ds cards, EPS bank redirect.
### 🔴 potentially other connectors might also be affected
## CAUSE
- `https://github.com/juspay/hyperswitch/pull/8833` this pr changes PSYNC flow and returns amount captured from payment_intent first
```rust
impl Capturable for PaymentsSyncData {
#[cfg(feature = "v1")]
fn get_captured_amount<F>(
&self,
_amount_captured: Option<i64>,
payment_data: &PaymentData<F>,
) -> Option<i64>
where
F: Clone,
{
payment_data
.payment_attempt
.amount_to_capture
.or(payment_data.payment_intent.amount_captured) // added for partial capture
.or_else(|| Some(payment_data.payment_attempt.get_total_amount()))
.map(|amt| amt.get_amount_as_i64())
}
```
- Stripe return `amount_captured=0` for redirection flow instead of `null`
## test case payment request
```json
{
"amount": 689,
"customer_id":"hello_world",
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"authentication_type": "three_ds",
"description": "hellow world",
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},
// "setup_future_usage":"on_session",
// "connector":["paypal_test","stripe_test"],
"billing": {
"address": {
"zip": "560095",
"country": "US",
"first_name": "Sakil",
"last_name": "Mostak",
"line1": "Fasdf",
"line2": "Fasdf",
"city": "Fasdf"
}
},
"payment_method_data": {
"card": {
"card_number": "4000582600000045",
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "John Smith",
"card_cvc": "100"
}
},
"payment_method": "card",
"payment_method_type": "debit"
}
```
### Response
```json
{
"payment_id": "pay_FBU4tzIB9s5ikRJo9JYl",
"merchant_id": "merchant_1755160362",
"status": "requires_customer_action",
"amount": 689,
"net_amount": 689,
"shipping_cost": null,
"amount_capturable": 689,
"amount_received": null,
"connector": "stripe",
"client_secret": "pay_FBU4tzIB9s5ikRJo9JYl_secret_wIPSjXgMkrV3RYtvGRNc",
"created": "2025-08-14T09:05:24.493Z",
"currency": "EUR",
"customer_id": "hello_world",
"customer": {
"id": "hello_world",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": "hellow world",
"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": "0045",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "400058",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "John Smith",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Fasdf",
"country": "US",
"line1": "Fasdf",
"line2": "Fasdf",
"line3": null,
"zip": "560095",
"state": null,
"first_name": "Sakil",
"last_name": "Mostak",
"origin_zip": null
},
"phone": null,
"email": 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": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_FBU4tzIB9s5ikRJo9JYl/merchant_1755160362/pay_FBU4tzIB9s5ikRJo9JYl_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "hello_world",
"created_at": 1755162324,
"expires": 1755165924,
"secret": "epk_2cfbbf8e6d5d4a41a2f6869301843cfc"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pi_3Rvx69D5R7gDAGff0Ov9te3b",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3Rvx69D5R7gDAGff0Ov9te3b",
"payment_link": null,
"profile_id": "pro_27idcUZ9odpGCuWxokRv",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_fxrK7vmhBNuG2kPhJHm8",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-14T09:20:24.493Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-08-14T09:05:25.601Z",
"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 redirection
### Response
```json
{
"payment_id": "pay_FBU4tzIB9s5ikRJo9JYl",
"merchant_id": "merchant_1755160362",
"status": "succeeded",
"amount": 689,
"net_amount": 689,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 689,
"connector": "stripe",
"client_secret": "pay_FBU4tzIB9s5ikRJo9JYl_secret_wIPSjXgMkrV3RYtvGRNc",
"created": "2025-08-14T09:05:24.493Z",
"currency": "EUR",
"customer_id": "hello_world",
"customer": {
"id": "hello_world",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": "hellow world",
"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": "0045",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "400058",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "John Smith",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Fasdf",
"country": "US",
"line1": "Fasdf",
"line2": "Fasdf",
"line3": null,
"zip": "560095",
"state": null,
"first_name": "Sakil",
"last_name": "Mostak",
"origin_zip": null
},
"phone": null,
"email": 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": false,
"connector_transaction_id": "pi_3Rvx69D5R7gDAGff0Ov9te3b",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3Rvx69D5R7gDAGff0Ov9te3b",
"payment_link": null,
"profile_id": "pro_27idcUZ9odpGCuWxokRv",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_fxrK7vmhBNuG2kPhJHm8",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-14T09:20:24.493Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-08-14T09:05:57.723Z",
"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
}
```
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (5 changes)
**Detailed Identifier Changes:**
Commit 318401a2:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: pub::deserialize_zero_minor_amount_as_none
|
{"pr_number": 8976, "pr_title": "fix(stripe): partial capture issue when fully captured on redirection flow like card3ds , eps bank redirect", "merged_at": "2025-08-20T08:38:43Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs"]}, "change_types": {"functions_added": 1, "fields_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
Feat(connector): [ELAVON] 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
<!-- Describe your changes in detail -->
Template code added for new connector Elavon
https://developer.elavon.com/products/xml-api/v1/api-reference#tag/Process-Transaction-Online
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/connector_integration_v2_impls.rs`
- `crates/router/src/core/payments/flows.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors.rs`
- `crates/hyperswitch_connectors/src/connectors/elavon.rs`
- `crates/hyperswitch_connectors/src/connectors/elavon/transformers.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
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (78 changes)
- Extend existing types with new fields (153 changes)
**Detailed Identifier Changes:**
Commit b481e5cb:
Files to modify:
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::elavon
**crates/hyperswitch_connectors/src/connectors/elavon.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::Elavon
- impl: impl Elavon
- impl: impl api::Payment for Elavon
- impl: impl api::PaymentSession for Elavon
- impl: impl api::ConnectorAccessToken for Elavon
- impl: impl api::MandateSetup for Elavon
- impl: impl api::PaymentAuthorize for Elavon
- impl: impl api::PaymentSync for Elavon
- impl: impl api::PaymentCapture for Elavon
- impl: impl api::PaymentVoid for Elavon
- impl: impl api::Refund for Elavon
- impl: impl api::RefundExecute for Elavon
- impl: impl api::RefundSync for Elavon
- impl: impl api::PaymentToken for Elavon
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Elavon
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Elavon
- impl: impl ConnectorCommon for Elavon
- impl: impl ConnectorValidation for Elavon
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Elavon
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Elavon
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Elavon
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Elavon
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Elavon
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Elavon
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Elavon
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Elavon
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Elavon
- impl: impl webhooks::IncomingWebhook for Elavon
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/elavon/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::ElavonRouterData
- struct: pub::ElavonPaymentsRequest
- struct: pub::ElavonCard
- struct: pub::ElavonAuthType
- struct: pub::ElavonPaymentsResponse
- struct: pub::ElavonRefundRequest
- struct: pub::RefundResponse
- struct: pub::ElavonErrorResponse
- enum: pub::ElavonPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for ElavonRouterData<T>
- impl: impl TryFrom<&ElavonRouterData<&PaymentsAuthorizeRouterData>> for ElavonPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for ElavonAuthType
- impl: impl From<ElavonPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, ElavonPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&ElavonRouterData<&RefundsRouterData<F>>> for ElavonRefundRequest
- 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/elavon.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::ElavonTest
- impl: impl ConnectorActions for ElavonTest
- impl: impl utils::Connector for ElavonTest
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::elavon
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 6309, "pr_title": "Feat(connector): [ELAVON] Template PR", "merged_at": "2024-11-05T10:02:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector", "transaction"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/connector_integration_v2_impls.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/elavon.rs", "crates/hyperswitch_connectors/src/connectors/elavon/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/elavon.rs", "crates/router/tests/connectors/main.rs", "crates/router/tests/connectors/sample_auth.toml", "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": 153, "imports_added": 20}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(masking): implement `prost::Message` trait for `Secret` and `StrongSecret` types
## 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 order to use `Secret<String>` and `StrongSecret<String>` as field types of proto requests in other gRPC services (like Unified Connector Service), the `prost::Message` trait has been implemented for the types `Secret<String>` and `StrongSecret<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).
-->
Unified Connector Service (UCS) is an open source, stateless merchant payments abstraction service (built using gRPC) that enables developers to integrate with a wide variety of payment processors using a unified contract. It offers the following capabilities.
Unified contract across multiple payment processors
Establishing and accepting connections to numerous remote endpoints of payment processors like Stripe/Adyen/Razorpay
Supports all payment payment life-cycle management operations like including authorization, capture, refunds, status and chargebacks across processors
Client-SDKs in multiple programming languages (Java, Python, Go, Rust, PHP) for rapid integration.
The goal of this PR is to make hyperswitch masking crate usable by other gRPC services (like Unified Connector Service), to efficiently mask sensitive 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)?
-->
I have tried building the proto files in Unified Connector Service with Secret<String> and StrongSecret<String> types, and it was a success. Attaching screenshots below:
**Secret<String>**

**StrongSecret<String>**

**Testing gRPC cURL**

## 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/masking/Cargo.toml`
**2. Other**
- `Cargo.lock`
- `crates/masking/src/secret.rs`
- `crates/masking/src/strong_secret.rs`
**Code Patterns Applied:**
- Implement new functions (8 changes)
- Extend existing types with new fields (10 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit ad29631c:
Files to modify:
**crates/masking/src/secret.rs**
Add:
- function: private::encode_raw
- function: private::merge_field
- function: private::encoded_len
- function: private::clear
- impl: impl prost::Message for Secret<T, crate::WithType>
**crates/masking/src/strong_secret.rs**
Add:
- function: private::encode_raw
- function: private::merge_field
- function: private::encoded_len
- function: private::clear
- impl: impl prost::Message for StrongSecret<T, crate::WithType>
|
{"pr_number": 8458, "pr_title": "feat(masking): implement `prost::Message` trait for `Secret` and `StrongSecret` types", "merged_at": "2025-07-02T07:16:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"config": ["crates/masking/Cargo.toml"], "other": ["Cargo.lock", "crates/masking/src/secret.rs", "crates/masking/src/strong_secret.rs"]}, "change_types": {"functions_added": 8, "fields_added": 10, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(webhooks): add support for updating mandate details in webhooks flow
## 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 -->
For Fiuu, the mandate ID is updated via webhooks in the case of 3DS payments. The payment webhook body was not consumed when the payment was successful, causing intermittent issues in the sandbox environment. This PR adds support to address this issue.
**more detailed issue description :**
- Fiuu mandate id is consumed from webhooks
- Incase of 3ds payment, on returning to hs return url we do a psync call
- If psync happends before we get notification from connector, we don't consume the webhook. Hence we will never have connector mandate id in our system.
- To consume the webhook, we can add logic in webhooks core that after psync check for the source verification & webhook event based on that get mandate details from webhook and update it in the payment method & payment attempt.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Cannot be tested directly this is an intermediate issue in sandbox. So please test this flow multiple time and mandate id should be stored in CIT transaction against both payment attempt & payment method for the transaction.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs`
**3. Core Business Logic**
- `crates/router/src/core/webhooks/incoming.rs`
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/fiuu.rs`
- `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs`
- `crates/router/src/configs/defaults/payment_connector_required_fields.rs`
- ... and 1 more files
**5. Other**
- `crates/hyperswitch_interfaces/src/webhooks.rs`
**Code Patterns Applied:**
- Define new data structures (1 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 6eb72e92:
Files to modify:
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu.rs**
Add:
- function: private::get_mandate_details
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs**
Add:
- struct: pub::ConnectorMandateDetails
**crates/hyperswitch_interfaces/src/webhooks.rs**
Add:
- function: private::get_mandate_details
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Add:
- function: private::should_update_connector_mandate_details
- function: private::update_connector_mandate_details
- function: private::insert_mandate_details
**crates/router/src/services/connector_integration_interface.rs**
Add:
- function: private::get_mandate_details
Commit 53abcc4d:
Files to modify:
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu.rs**
Add:
- function: private::get_mandate_details
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs**
Add:
- struct: pub::ConnectorMandateDetails
**crates/hyperswitch_interfaces/src/webhooks.rs**
Add:
- function: private::get_mandate_details
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Add:
- function: private::should_update_connector_mandate_details
- function: private::update_connector_mandate_details
- function: private::insert_mandate_details
**crates/router/src/services/connector_integration_interface.rs**
Add:
- function: private::get_mandate_details
|
{"pr_number": 6523, "pr_title": "fix(webhooks): add support for updating mandate details in webhooks flow ", "merged_at": "2024-11-13T10:20:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "connector", "webhook"]}, "hierarchy": {"database": ["crates/diesel_models/src/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs"], "core_business": ["crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/fiuu.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/router/src/configs/defaults/payment_connector_required_fields.rs", "crates/router/src/services/connector_integration_interface.rs"], "other": ["crates/hyperswitch_interfaces/src/webhooks.rs"]}, "change_types": {"structs_added": 1, "functions_added": 6, "fields_added": 80, "imports_added": 5, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
feat(connector): [Gigadat] Add Payments Webhook
## 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 Payments Webhooks
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_DqavEsACXgWdM1lTbHtNE5guERBnw52xBl1HzEV4Va33do2R0aUib98lcvpjsi0z' \
--data-raw '{
"amount": 4100,
"currency": "CAD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "aaaa",
"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": "etransfer@orderdeposi1t.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"
}
}'
```
Response
```
{
"payment_id": "pay_nfubLTxDSYu4Hxm97Y2x",
"merchant_id": "merchant_1759994433",
"status": "requires_customer_action",
"amount": 4100,
"net_amount": 4100,
"shipping_cost": null,
"amount_capturable": 4100,
"amount_received": null,
"connector": "gigadat",
"client_secret": "pay_nfubLTxDSYu4Hxm97Y2x_secret_kZ5dCPr0m92QADu3X3S2",
"created": "2025-10-09T08:28:02.655Z",
"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": "etransfer@orderdeposi1t.com"
},
"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_nfubLTxDSYu4Hxm97Y2x/merchant_1759994433/pay_nfubLTxDSYu4Hxm97Y2x_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": 1759998482,
"expires": 1760002082,
"secret": "epk_58df0c799a764169a48cdc98da6f62bd"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pay_nfubLTxDSYu4Hxm97Y2x_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_UZwf4r8dtBdFhqOrivbE",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_ummWUvMJ8FtO1KCkkZAf",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-09T08:43:02.655Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-09T08:28:04.564Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
<img width="1000" height="614" alt="Screenshot 2025-10-09 at 1 59 30 PM" src="https://github.com/user-attachments/assets/d75df3d0-badf-4f3f-9baf-f13af0815329" />
<img width="994" height="359" alt="Screenshot 2025-10-09 at 1 59 40 PM" src="https://github.com/user-attachments/assets/fd7ebf9d-9ed8-4549-93df-5822c5b05997" />
<img width="1040" height="647" alt="Screenshot 2025-10-09 at 2 00 02 PM" src="https://github.com/user-attachments/assets/9cdfd707-8007-4d2b-ad0f-f1ff96140fde" />
<img width="1079" height="508" alt="Screenshot 2025-10-10 at 1 18 43 PM" src="https://github.com/user-attachments/assets/10fa9655-f20f-47f4-9f20-d14e5a8f824b" />
## 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/gigadat.rs`
- `crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (4 changes)
- Extend existing types with new fields (19 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 0bc0c004:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/gigadat.rs**
Add:
- function: private::get_webhook_query_params
**crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs**
Add:
- function: private::from
- function: private::try_from
- struct: pub::GigadatWebhookQueryParameters
- struct: pub::GigadatWebhookKeyValue
- impl: impl From<GigadatPaymentStatus> for api_models::webhooks::IncomingWebhookEvent
- impl: impl TryFrom<String> for GigadatPaymentStatus
|
{"pr_number": 9775, "pr_title": "feat(connector): [Gigadat] Add Payments Webhook", "merged_at": "2025-10-10T10:19:38Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/gigadat.rs", "crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs"]}, "change_types": {"structs_added": 2, "functions_added": 4, "fields_added": 19, "imports_added": 3, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [BRAINTREE] Googlepay, Applepay wallets added
## 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 -->
`Googlepay`, `Applepay` wallets added in `BRAINTREE`.
In the current implementation of the session-token response flow, only the core layer logic is triggered for apple_pay and google_pay. However, for Braintree, we require a client_token generated from the connector layer.
To support this, I’ve added three new methods in ConnectorSpecifications:
1. is_sdk_session_token_generation_enabled()
2. supported_payment_methods_for_sdk_session_token()
3. validate_sdk_session_token_for_payment_method()
These methods determine whether a connector supports session-token response for a specific payment_method_type. Based on this, mapping is being done whether the session-token should be formed in the core layer or the connector layer.
### 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)?
-->
Currently, testing can be done S2S only, because SDK and dashboard are yet to be done.
<details>
<summary>1. MCA</summary>
```
curl --location 'http://localhost:8080/account/merchant_1754943264/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x_merchant_domain: https://popular-grasshopper-95.telebit.io' \
--header 'api-key: dev_LyW7U8k5lBfnRiPjF75igyRatN0xh1g7cYbUW4pJiuZnmlaVOzeY0mw4bREoiQxh' \
--data '{
"connector_type": "payment_processor",
"connector_name": "braintree",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "API_KEY",
"api_secret": "API_SECRET",
"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"
]
}
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "paypal",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "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": {
"merchant_account_id": "PAYPAL_MERCHANT_ACCOUNT_ID",
"merchant_config_currency": "USD",
"paypal_sdk": {
"client_id": "PAYPAL_CLIENT_ID"
},
"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": "braintree"
}
}
}
],
"merchant_info": {
"merchant_name": "Sweta Sharma"
}
},
"apple_pay_combined": {
"manual": {
"payment_request_data": {
"label": "applepay",
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_capabilities": [
"supports3DS"
]
},
"session_token_data":null
}
}
},
"connector_webhook_details": {
"merchant_secret": "MyWebhookSecret"
},
"business_country": "US",
"business_label": "default"
}'
```
Response:
```
{"connector_type":"payment_processor","connector_name":"braintree","connector_label":"braintree_US_default","merchant_connector_id":"mca_HrBB5GxZaPbMIZm9sAkO","profile_id":"pro_UF7x1VUr8LV9gu1lQwn1","connector_account_details":{"auth_type":"SignatureKey","api_key":"5j************93","key1":"gs************sk","api_secret":"26****************************55"},"payment_methods_enabled":[{"payment_method":"card","payment_method_types":[{"payment_method_type":"credit","payment_experience":null,"card_networks":["Visa","Mastercard"],"accepted_currencies":{"type":"enable_only","list":["USD","GBP","INR"]},"accepted_countries":{"type":"disable_only","list":["HK"]},"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"debit","payment_experience":null,"card_networks":["Visa","Mastercard"],"accepted_currencies":{"type":"enable_only","list":["USD","GBP","INR"]},"accepted_countries":{"type":"disable_only","list":["HK"]},"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"klarna","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"affirm","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"afterpay_clearpay","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"wallet","payment_method_types":[{"payment_method_type":"paypal","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"google_pay","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"apple_pay","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"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":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]}],"connector_webhook_details":{"merchant_secret":"MyWebhookSecret","additional_secret":null},"metadata":{"paypal_sdk":{"client_id":"PAYPAL_CLIENT_ID"},{"google_pay":{"merchant_info":{"merchant_name":"Sweta Sharma"},"allowed_payment_methods":[{"type":"CARD","parameters":{"allowed_auth_methods":["PAN_ONLY","CRYPTOGRAM_3DS"]},"tokenization_specification":{"type":"PAYMENT_GATEWAY","parameters":{"gateway":"stripe"}}}]},"apple_pay_combined":{"manual":{"payment_request_data":{"label":"applepay","supported_networks":["visa","masterCard","amex","discover"],"merchant_capabilities":["supports3DS"]}}},"merchant_account_id":"MERCHANT_ACCOUNT_ID","merchant_config_currency":"USD"},"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":{"apple_pay_combined":{"simplified":{"payment_request_data":{"supported_networks":["visa","masterCard","amex","discover"],"merchant_capabilities":["supports3DS"],"label":"applepay"},"session_token_data":{"initiative_context":null,"merchant_business_country":"US"}}}}}
```
</details>
PMD shouldn't be passed in payment-intent to fetch session-token for braintree. [Ref](https://github.com/juspay/hyperswitch/pull/8728#issuecomment-3389887380)
<details>
<summary>2. Session Token</summary>
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'x-merchant-domain: https://popular-grasshopper-95.telebit.io' \
--header 'api-key: pk_dev_d9bc174655254b479705763816e61259' \
--data '{
"payment_id": "pay_z7h5aBGzTHwYhw4Aw5WC",
"wallets": [],
"client_secret": "pay_z7h5aBGzTHwYhw4Aw5WC_secret_hIDNsxR1lOzC5AQydKKy"
}
'
```
Response:
```
{
"payment_id": "pay_z7h5aBGzTHwYhw4Aw5WC",
"client_secret": "pay_z7h5aBGzTHwYhw4Aw5WC_secret_hIDNsxR1lOzC5AQydKKy",
"session_token": [
{
"wallet_name": "google_pay",
"merchant_info": {
"merchant_name": "Braintree Merchant"
},
"shipping_address_required": false,
"email_required": false,
"shipping_address_parameters": {
"phone_number_required": false
},
"allowed_payment_methods": [],
"transaction_info": {
"country_code": "US",
"currency_code": "USD",
"total_price_status": "FINAL",
"total_price": "65.40"
},
"delayed_session_token": false,
"connector": "braintree",
"sdk_next_action": {
"next_action": "confirm"
},
"secrets": {
"display": "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiJleUowZVhBaU9pSktWMVFpTENKaGJHY2lPaUpGVXpJMU5pSXNJbXRwWkNJNklqSXdNVGd3TkRJMk1UWXRjMkZ1WkdKdmVDSXNJbWx6Y3lJNkltaDBkSEJ6T2k4dllYQnBMbk5oYm1SaWIzZ3VZbkpoYVc1MGNtVmxaMkYwWlhkaGVTNWpiMjBpZlEuZXlKbGVIQWlPakUzTlRVd016VTNNeklzSW1wMGFTSTZJbVZoWTJReE5tUTBMVFF6TURNdE5ERm1OaTFpWWpabExUY3dNbUpsWXpJNVptRTVNeUlzSW5OMVlpSTZJbWR6Wm5BMmJubG5lVE5rZW1JNGMyc2lMQ0pwYzNNaU9pSm9kSFJ3Y3pvdkwyRndhUzV6WVc1a1ltOTRMbUp5WVdsdWRISmxaV2RoZEdWM1lYa3VZMjl0SWl3aWJXVnlZMmhoYm5RaU9uc2ljSFZpYkdsalgybGtJam9pWjNObWNEWnVlV2Q1TTJSNllqaHpheUlzSW5abGNtbG1lVjlqWVhKa1gySjVYMlJsWm1GMWJIUWlPbVpoYkhObExDSjJaWEpwWm5sZmQyRnNiR1YwWDJKNVgyUmxabUYxYkhRaU9tWmhiSE5sZlN3aWNtbG5hSFJ6SWpwYkltMWhibUZuWlY5MllYVnNkQ0pkTENKelkyOXdaU0k2V3lKQ2NtRnBiblJ5WldVNlZtRjFiSFFpTENKQ2NtRnBiblJ5WldVNlFWaFBJbDBzSW05d2RHbHZibk1pT25zaWJXVnlZMmhoYm5SZllXTmpiM1Z1ZEY5cFpDSTZJa0Z1WVc1a0lpd2ljR0Y1Y0dGc1gyTnNhV1Z1ZEY5cFpDSTZJa0ZUUzBGSGFESlhXR2R4WmxFMVZIcHFjRnA2VEhObWFGWkhiRVppYW5FMVZuSldOVWxQV0RoTFdFUkVNazVmV0hGclIyVlpUa1JyVjNseVgxVllibVpvV0hCRmEwRkNaRzFRTWpnMFlsOHlJbjE5Lk84cktrUTRfTHctYi1wbkZJRVdqWkVZNDQ5aE5tSXBzc2RzZDMzQzRjenRoQ2FadF9kM3pMM2xaNDB6LWZIVC16N3ZyN1hSS0NXZnZicmprY0ZnZnhRIiwiY29uZmlnVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2dzZnA2bnlneTNkemI4c2svY2xpZW50X2FwaS92MS9jb25maWd1cmF0aW9uIiwibWVyY2hhbnRBY2NvdW50SWQiOiJBbmFuZCIsImdyYXBoUUwiOnsidXJsIjoiaHR0cHM6Ly9wYXltZW50cy5zYW5kYm94LmJyYWludHJlZS1hcGkuY29tL2dyYXBocWwiLCJkYXRlIjoiMjAxOC0wNS0wOCIsImZlYXR1cmVzIjpbInRva2VuaXplX2NyZWRpdF9jYXJkcyJdfSwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2dzZnA2bnlneTNkemI4c2svY2xpZW50X2FwaSIsImVudmlyb25tZW50Ijoic2FuZGJveCIsIm1lcmNoYW50SWQiOiJnc2ZwNm55Z3kzZHpiOHNrIiwiYXNzZXRzVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhdXRoVXJsIjoiaHR0cHM6Ly9hdXRoLnZlbm1vLnNhbmRib3guYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJ2ZW5tbyI6Im9mZiIsImNoYWxsZW5nZXMiOltdLCJ0aHJlZURTZWN1cmVFbmFibGVkIjp0cnVlLCJhbmFseXRpY3MiOnsidXJsIjoiaHR0cHM6Ly9vcmlnaW4tYW5hbHl0aWNzLXNhbmQuc2FuZGJveC5icmFpbnRyZWUtYXBpLmNvbS9nc2ZwNm55Z3kzZHpiOHNrIn0sImFwcGxlUGF5Ijp7ImNvdW50cnlDb2RlIjoiVVMiLCJjdXJyZW5jeUNvZGUiOiJVU0QiLCJtZXJjaGFudElkZW50aWZpZXIiOiJtZXJjaGFudC5jb20uYWR5ZW4uc2FuIiwic3RhdHVzIjoibW9jayIsInN1cHBvcnRlZE5ldHdvcmtzIjpbInZpc2EiLCJtYXN0ZXJjYXJkIiwiYW1leCIsImRpc2NvdmVyIl19LCJwYXlwYWxFbmFibGVkIjp0cnVlLCJwYXlwYWwiOnsiYmlsbGluZ0FncmVlbWVudHNFbmFibGVkIjp0cnVlLCJlbnZpcm9ubWVudE5vTmV0d29yayI6ZmFsc2UsInVudmV0dGVkTWVyY2hhbnQiOmZhbHNlLCJhbGxvd0h0dHAiOnRydWUsImRpc3BsYXlOYW1lIjoiSnVzcGF5IiwiY2xpZW50SWQiOiJBU0tBR2gyV1hncWZRNVR6anBaekxzZmhWR2xGYmpxNVZyVjVJT1g4S1hERDJOX1hxa0dlWU5Ea1d5cl9VWG5maFhwRWtBQmRtUDI4NGJfMiIsImFjY291bnROdW1iZXIiOm51bGwsImJhc2VVcmwiOiJodHRwczovL2Fzc2V0cy5icmFpbnRyZWVnYXRld2F5LmNvbSIsImFzc2V0c1VybCI6Imh0dHBzOi8vY2hlY2tvdXQucGF5cGFsLmNvbSIsImRpcmVjdEJhc2VVcmwiOm51bGwsImVudmlyb25tZW50Ijoib2ZmbGluZSIsImJyYWludHJlZUNsaWVudElkIjoibWFzdGVyY2xpZW50MyIsIm1lcmNoYW50QWNjb3VudElkIjoiQW5hbmQiLCJjdXJyZW5jeUlzb0NvZGUiOiJVU0QifX0=",
"payment": null
}
},
{
"wallet_name": "apple_pay",
"session_token_data": {
"secrets": {
"display": "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiJleUowZVhBaU9pSktWMVFpTENKaGJHY2lPaUpGVXpJMU5pSXNJbXRwWkNJNklqSXdNVGd3TkRJMk1UWXRjMkZ1WkdKdmVDSXNJbWx6Y3lJNkltaDBkSEJ6T2k4dllYQnBMbk5oYm1SaWIzZ3VZbkpoYVc1MGNtVmxaMkYwWlhkaGVTNWpiMjBpZlEuZXlKbGVIQWlPakUzTlRVd016VTNNek1zSW1wMGFTSTZJbVkzTXpnNU9EVTBMVFE0TnpndE5HTTVNQzFpTW1NMUxUWXpZVEkwWkdVeU56Vm1OeUlzSW5OMVlpSTZJbWR6Wm5BMmJubG5lVE5rZW1JNGMyc2lMQ0pwYzNNaU9pSm9kSFJ3Y3pvdkwyRndhUzV6WVc1a1ltOTRMbUp5WVdsdWRISmxaV2RoZEdWM1lYa3VZMjl0SWl3aWJXVnlZMmhoYm5RaU9uc2ljSFZpYkdsalgybGtJam9pWjNObWNEWnVlV2Q1TTJSNllqaHpheUlzSW5abGNtbG1lVjlqWVhKa1gySjVYMlJsWm1GMWJIUWlPbVpoYkhObExDSjJaWEpwWm5sZmQyRnNiR1YwWDJKNVgyUmxabUYxYkhRaU9tWmhiSE5sZlN3aWNtbG5hSFJ6SWpwYkltMWhibUZuWlY5MllYVnNkQ0pkTENKelkyOXdaU0k2V3lKQ2NtRnBiblJ5WldVNlZtRjFiSFFpTENKQ2NtRnBiblJ5WldVNlFWaFBJbDBzSW05d2RHbHZibk1pT25zaWJXVnlZMmhoYm5SZllXTmpiM1Z1ZEY5cFpDSTZJa0Z1WVc1a0lpd2ljR0Y1Y0dGc1gyTnNhV1Z1ZEY5cFpDSTZJa0ZUUzBGSGFESlhXR2R4WmxFMVZIcHFjRnA2VEhObWFGWkhiRVppYW5FMVZuSldOVWxQV0RoTFdFUkVNazVmV0hGclIyVlpUa1JyVjNseVgxVllibVpvV0hCRmEwRkNaRzFRTWpnMFlsOHlJbjE5Lm5nUHU2dkxlQ3g1bDZDclltMlJfWC1hWHdfZ3Q5ZkVMQ3BnQTc2US11bXJTMjRYdDNKLWNsOWdkM3JiZWZ5UDJOQ0VmRVpkUTMteW1pODVXTzR1NDBBIiwiY29uZmlnVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2dzZnA2bnlneTNkemI4c2svY2xpZW50X2FwaS92MS9jb25maWd1cmF0aW9uIiwibWVyY2hhbnRBY2NvdW50SWQiOiJBbmFuZCIsImdyYXBoUUwiOnsidXJsIjoiaHR0cHM6Ly9wYXltZW50cy5zYW5kYm94LmJyYWludHJlZS1hcGkuY29tL2dyYXBocWwiLCJkYXRlIjoiMjAxOC0wNS0wOCIsImZlYXR1cmVzIjpbInRva2VuaXplX2NyZWRpdF9jYXJkcyJdfSwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2dzZnA2bnlneTNkemI4c2svY2xpZW50X2FwaSIsImVudmlyb25tZW50Ijoic2FuZGJveCIsIm1lcmNoYW50SWQiOiJnc2ZwNm55Z3kzZHpiOHNrIiwiYXNzZXRzVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhdXRoVXJsIjoiaHR0cHM6Ly9hdXRoLnZlbm1vLnNhbmRib3guYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJ2ZW5tbyI6Im9mZiIsImNoYWxsZW5nZXMiOltdLCJ0aHJlZURTZWN1cmVFbmFibGVkIjp0cnVlLCJhbmFseXRpY3MiOnsidXJsIjoiaHR0cHM6Ly9vcmlnaW4tYW5hbHl0aWNzLXNhbmQuc2FuZGJveC5icmFpbnRyZWUtYXBpLmNvbS9nc2ZwNm55Z3kzZHpiOHNrIn0sImFwcGxlUGF5Ijp7ImNvdW50cnlDb2RlIjoiVVMiLCJjdXJyZW5jeUNvZGUiOiJVU0QiLCJtZXJjaGFudElkZW50aWZpZXIiOiJtZXJjaGFudC5jb20uYWR5ZW4uc2FuIiwic3RhdHVzIjoibW9jayIsInN1cHBvcnRlZE5ldHdvcmtzIjpbInZpc2EiLCJtYXN0ZXJjYXJkIiwiYW1leCIsImRpc2NvdmVyIl19LCJwYXlwYWxFbmFibGVkIjp0cnVlLCJwYXlwYWwiOnsiYmlsbGluZ0FncmVlbWVudHNFbmFibGVkIjp0cnVlLCJlbnZpcm9ubWVudE5vTmV0d29yayI6ZmFsc2UsInVudmV0dGVkTWVyY2hhbnQiOmZhbHNlLCJhbGxvd0h0dHAiOnRydWUsImRpc3BsYXlOYW1lIjoiSnVzcGF5IiwiY2xpZW50SWQiOiJBU0tBR2gyV1hncWZRNVR6anBaekxzZmhWR2xGYmpxNVZyVjVJT1g4S1hERDJOX1hxa0dlWU5Ea1d5cl9VWG5maFhwRWtBQmRtUDI4NGJfMiIsImFjY291bnROdW1iZXIiOm51bGwsImJhc2VVcmwiOiJodHRwczovL2Fzc2V0cy5icmFpbnRyZWVnYXRld2F5LmNvbSIsImFzc2V0c1VybCI6Imh0dHBzOi8vY2hlY2tvdXQucGF5cGFsLmNvbSIsImRpcmVjdEJhc2VVcmwiOm51bGwsImVudmlyb25tZW50Ijoib2ZmbGluZSIsImJyYWludHJlZUNsaWVudElkIjoibWFzdGVyY2xpZW50MyIsIm1lcmNoYW50QWNjb3VudElkIjoiQW5hbmQiLCJjdXJyZW5jeUlzb0NvZGUiOiJVU0QifX0=",
"payment": null
}
},
"payment_request_data": {
"country_code": "US",
"currency_code": "USD",
"total": {
"label": "applepay",
"type": null,
"amount": "65.40"
},
"merchant_capabilities": [
"supports3DS"
],
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_identifier": null
},
"connector": "braintree",
"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>3. Google pay</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_LyW7U8k5lBfnRiPjF75igyRatN0xh1g7cYbUW4pJiuZnmlaVOzeY0mw4bREoiQxh' \
--data-raw '{
"amount": 100,
"currency": "USD",
"confirm": true,
"payment_link": false,
"capture_method": "sequential_automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 100,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay_third_party_sdk": {
"token":"43d96d4d-934f-1e50-4ac0-74ea696a2696"
}
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "12345",
"country": "DE",
"first_name": "Max",
"last_name": "Mustermann"
},
"email": "test@novalnet.de",
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "Musterstr",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "94122",
"country": "DE",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"ip_address": "103.77.139.95",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
Response:
```
{"payment_id":"pay_bZ0aXWR7c4XyoZPgBp1o","merchant_id":"merchant_1754943264","status":"succeeded","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":100,"connector":"braintree","client_secret":"pay_bZ0aXWR7c4XyoZPgBp1o_secret_70pJCGdL6IsG554zfj7V","created":"2025-08-12T07:35:15.497Z","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":"wallet","payment_method_data":{"wallet":{"google_pay":{"last4":"1111","card_network":"VISA","type":"CARD"}},"billing":null},"payment_token":null,"shipping":{"address":{"city":"Musterhausen","country":"DE","line1":"Musterstr","line2":"CA","line3":"CA","zip":"94122","state":"California","first_name":"joseph","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"billing":{"address":{"city":"Musterhausen","country":"DE","line1":"1467","line2":"CA","line3":"CA","zip":"12345","state":"California","first_name":"Max","last_name":"Mustermann","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"test@novalnet.de"},"order_details":null,"email":"guest@example.com","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"google_pay","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"StripeCustomer","created_at":1754984115,"expires":1754987715,"secret":"epk_4fd82246514e4294b8e656686e8dd50c"},"manual_retry_allowed":false,"connector_transaction_id":"dHJhbnNhY3Rpb25fZnpzaGdncGY","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_UF7x1VUr8LV9gu1lQwn1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_HrBB5GxZaPbMIZm9sAkO","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-12T07:50:15.497Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"103.77.139.95","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-12T07:35:17.108Z","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>4. Apple pay</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_LyW7U8k5lBfnRiPjF75igyRatN0xh1g7cYbUW4pJiuZnmlaVOzeY0mw4bREoiQxh' \
--data '
{
"amount": 100,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "StripeCustomer",
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay_third_party_sdk": {
"token": "a84ed55a-fc0a-13d4-7fbf-5ab3dac058b5"
}
}
"billing": {
"address": {
"first_name": "John",
"last_name": "Doe",
"line1": "Harrison Street",
"city": "San Francisco",
"state": "California",
"zip": "94016",
"country": "US"
}
}
}'
```
Response:
```
{"payment_id":"pay_OQVfaSax3HlpcptsZU9P","merchant_id":"merchant_1752600273","status":"succeeded","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":100,"connector":"braintree","client_secret":"pay_OQVfaSax3HlpcptsZU9P_secret_ZlepECcFLxoUnkI75eYU","created":"2025-07-15T17:24:42.658Z","currency":"USD","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"wallet","payment_method_data":{"wallet":{"apple_pay":{"last4":"0121","card_network":"Visa","type":"debit"}},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Francisco","country":"US","line1":"Harrison Street","line2":null,"line3":null,"zip":"94016","state":"California","first_name":"John","last_name":"Doe"},"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":"apple_pay","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":1752600282,"expires":1752603882,"secret":"epk_6a07cf81f20d420ea7ac55e4a080c3e4"},"manual_retry_allowed":false,"connector_transaction_id":"dHJhbnNhY3Rpb25fMTI5NW16ZGU","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_8u6aGw4HuUDKamhgmjfZ","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_FVuIgKveXUPQx1YwVrzb","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-15T17:39:42.657Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-15T17:24:45.020Z","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>
Test apple_pay, google_pay for other prod connectors (trustpay, stripe, cybersource).
## 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`
- `crates/hyperswitch_domain_models/src/router_data.rs`
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
**3. Core Business Logic**
- `crates/router/src/core/authentication/transformers.rs`
- `crates/router/src/core/fraud_check.rs`
- `crates/router/src/core/fraud_check/flows/checkout_flow.rs`
- ... and 31 more files
**4. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
- ... and 7 more files
**5. Type Definitions**
- `crates/router/src/types.rs`
**6. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/hyperswitch_interfaces/src/api.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (14 changes)
- Implement new functions (19 changes)
- Extend existing types with new fields (249 changes)
- Add conditional logic for feature flags or filtering (4 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit c172f03c:
Files to modify:
**crates/api_models/src/payments.rs**
Remove:
- struct: pub::GooglePayThirdPartySdkData
- struct: pub::ApplePayThirdPartySdkData
Add:
- struct: pub::GooglePayThirdPartySdkData
- struct: pub::ApplePayThirdPartySdkData
**crates/hyperswitch_connectors/src/connectors/braintree.rs**
Remove:
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Braintree
Add:
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::is_sdk_client_token_generation_enabled
- function: private::supported_payment_method_types_for_sdk_client_token_generation
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Braintree
**crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs**
Add:
- struct: pub::WalletTransactionBody
- struct: pub::WalletPaymentInput
- struct: pub::Amount
- struct: pub::WalletAuthResponse
- struct: pub::WalletAuthDataResponse
**crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Remove:
- struct: pub::GooglePayThirdPartySdkData
- struct: pub::ApplePayThirdPartySdkData
Add:
- struct: pub::GooglePayThirdPartySdkData
- struct: pub::ApplePayThirdPartySdkData
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api.rs**
Add:
- function: private::is_sdk_client_token_generation_enabled
- function: private::supported_payment_method_types_for_sdk_client_token_generation
- function: private::validate_sdk_session_token_for_payment_method
**crates/hyperswitch_interfaces/src/connector_integration_interface.rs**
Add:
- function: private::is_sdk_client_token_generation_enabled
- function: private::supported_payment_method_types_for_sdk_client_token_generation
- function: private::validate_sdk_session_token_for_payment_method
**crates/hyperswitch_interfaces/src/conversion_impls.rs**
Modify existing code
**crates/router/src/core/authentication/transformers.rs**
Modify existing code
**crates/router/src/core/fraud_check.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/checkout_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/fulfillment_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/record_return.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/sale_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/transaction_flow.rs**
Modify existing code
**crates/router/src/core/mandate/utils.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Modify existing code
**crates/router/src/core/payments/flows/approve_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/authorize_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/cancel_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/cancel_post_capture_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/capture_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/complete_authorize_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/incremental_authorization_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/post_session_tokens_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/psync_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/reject_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/session_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/session_update_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/setup_mandate_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/update_metadata_flow.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Add:
- function: pub::get_connector_data_with_token
- function: pub::decide_session_token_flow
**crates/router/src/core/payments/operations/payment_session.rs**
Remove:
- function: private::from
- impl: impl From<api_models::enums::PaymentMethodType> for api::GetToken
**crates/router/src/core/payments/operations/payment_session_intent.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/relay/utils.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/utils.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Modify existing code
**crates/router/src/core/webhooks/utils.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
|
{"pr_number": 8728, "pr_title": "feat(connector): [BRAINTREE] Googlepay, Applepay wallets added", "merged_at": "2025-10-07T09:30:42Z", "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/payment_method_data.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/fraud_check.rs", "crates/router/src/core/fraud_check/flows/checkout_flow.rs", "crates/router/src/core/fraud_check/flows/fulfillment_flow.rs", "crates/router/src/core/fraud_check/flows/record_return.rs", "crates/router/src/core/fraud_check/flows/sale_flow.rs", "crates/router/src/core/fraud_check/flows/transaction_flow.rs", "crates/router/src/core/mandate/utils.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/flows.rs", "crates/router/src/core/payments/flows/approve_flow.rs", "crates/router/src/core/payments/flows/authorize_flow.rs", "crates/router/src/core/payments/flows/cancel_flow.rs", "crates/router/src/core/payments/flows/cancel_post_capture_flow.rs", "crates/router/src/core/payments/flows/capture_flow.rs", "crates/router/src/core/payments/flows/complete_authorize_flow.rs", "crates/router/src/core/payments/flows/incremental_authorization_flow.rs", "crates/router/src/core/payments/flows/post_session_tokens_flow.rs", "crates/router/src/core/payments/flows/psync_flow.rs", "crates/router/src/core/payments/flows/reject_flow.rs", "crates/router/src/core/payments/flows/session_flow.rs", "crates/router/src/core/payments/flows/session_update_flow.rs", "crates/router/src/core/payments/flows/setup_mandate_flow.rs", "crates/router/src/core/payments/flows/update_metadata_flow.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_session.rs", "crates/router/src/core/payments/operations/payment_session_intent.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/relay/utils.rs", "crates/router/src/core/unified_authentication_service/utils.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/utils.rs"], "connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/braintree.rs", "crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs", "crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/hyperswitch_interfaces/src/connector_integration_interface.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/router/src/types.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/hyperswitch_interfaces/src/api.rs", "crates/hyperswitch_interfaces/src/conversion_impls.rs"]}, "change_types": {"structs_added": 14, "functions_added": 19, "enums_added": 2, "fields_added": 249, "imports_added": 3, "conditionals_added": 4, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): handle default case for card_network for co-badged cards
## 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 -->
- Handle default case where card network is null because in case of co-badged cards, we will always get the card network from frontend
### 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 (Checkout)
- Create a payment with co-badged card
```
{
"amount": 1043,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4010061700000021",
"card_exp_month": "01",
"card_exp_year": "99",
"card_holder_name": "joseph Doe",
"card_cvc": "123",
"card_network": "CartesBancaires"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}
```
- In the response, the card_network should be present i.e. `CartesBancaires` and should match
- The response should look like following
```
{
"payment_id": "pay_wvcJQRPQKOvHjvzqFJix",
"merchant_id": "merchant_1733907987",
"status": "processing",
"amount": 1043,
"net_amount": 1043,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "checkout",
"client_secret": "pay_wvcJQRPQKOvHjvzqFJix_secret_SukmA54t9oep9K1KxSrc",
"created": "2024-12-11T09:52:28.477Z",
"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": "0021",
"card_type": null,
"card_network": "CartesBancaires",
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "401006",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "99",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://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": 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": 1733910748,
"expires": 1733914348,
"secret": "epk_49d031a3596d4fadb79e7cdb7c58559d"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pay_ymjd6m5acujebkctxn4hteaswa",
"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_wvcJQRPQKOvHjvzqFJix_1",
"payment_link": null,
"profile_id": "pro_jkvQLXzyFlM6p3KyuUEY",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_wz0gCKtDv37owvc8fp6L",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-11T10:07:28.477Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-11T09:52:29.142Z",
"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. Core Business Logic**
- `crates/router/src/core/payments/helpers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit f95ee51b:
Files to modify:
**crates/router/src/core/payments/helpers.rs**
Modify existing code
|
{"pr_number": 6825, "pr_title": "fix(router): handle default case for card_network for co-badged cards", "merged_at": "2024-12-16T12:49:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/helpers.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(themes): Add email configuration support for themes
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Added changes for the emails as per the email theme config.
Changes are done for:
- verify.html
- reset.html
- invite.html
- magic_link.html
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
To add theme customisation to email templates.
## How did you test it?
Email sanity test
## 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/user.rs`
**2. Type Definitions**
- `crates/router/src/services/email/types.rs`
**3. Configuration Files**
- `config/config.example.toml`
- `config/development.toml`
- `config/docker_compose.toml`
**4. Other**
- `crates/router/src/consts/user.rs`
- `crates/router/src/services/email/assets/invite.html`
- `crates/router/src/services/email/assets/magic_link.html`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (74 changes)
**Detailed Identifier Changes:**
Commit 57e1bbdc:
Files to modify:
**crates/router/src/consts/user.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/services/email/types.rs**
Modify existing code
Commit 7805a20d:
Files to modify:
**crates/router/src/consts/user.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/services/email/types.rs**
Modify existing code
|
{"pr_number": 7580, "pr_title": "feat(themes): Add email configuration support for themes", "merged_at": "2025-03-26T14:19:46Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/user.rs"], "types": ["crates/router/src/services/email/types.rs"], "config": ["config/config.example.toml", "config/development.toml", "config/docker_compose.toml"], "other": ["crates/router/src/consts/user.rs", "crates/router/src/services/email/assets/invite.html", "crates/router/src/services/email/assets/magic_link.html", "crates/router/src/services/email/assets/reset.html", "crates/router/src/services/email/assets/verify.html"]}, "change_types": {"fields_added": 74}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
feat(connectors): [Worldpayvantiv] add NTI flow and refactor sync flows
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
In this PR
1. We have implemented the CIT and MIT payments, only for - network transaction id flow
2. Completely refactored the status handling
3. Refactored Psync and Rsync flow.
Any payment operation triggered to Vantiv (if didn't cause an API failure) will be marked as pending initially and later payment status gets updated via sync calls.
> Note: Psync after void will fail the payment - this is a known issue.
## 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>MCA Create</summary>
```curl
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_0e454918-80a7-4094-bcff-daa8e346b243/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_2HAFolGlYSsegZm3**********' \
--data '{
"connector_type": "payment_processor",
"connector_name": "worldpayvantiv",
"business_country": "US",
"business_label": "default",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "**************",
"key1": "**********",
"api_secret": "************"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "debit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"report_group" : "Hello",
"merchant_config_currency":"USD",
}
}'
```
Response
```
{"connector_type":"payment_processor","connector_name":"worldpayvantiv","connector_label":"worldpayvantiv_US_default","merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","connector_account_details":{"auth_type":"SignatureKey","api_key":"u8**************01","key1":"01*****81","api_secret":"qR***********Fr"},"payment_methods_enabled":[{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"affirm","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"afterpay_clearpay","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"klarna","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"klarna","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"bank_redirect","payment_method_types":[{"payment_method_type":"ideal","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"bancontact_card","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"przelewy24","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"giropay","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"sofort","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"eps","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"bank_debit","payment_method_types":[{"payment_method_type":"ach","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"becs","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"sepa","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"bacs","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"bank_transfer","payment_method_types":[{"payment_method_type":"ach","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"bacs","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"sepa","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"card","payment_method_types":[{"payment_method_type":"credit","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"card","payment_method_types":[{"payment_method_type":"debit","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"wallet","payment_method_types":[{"payment_method_type":"apple_pay","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"wallet","payment_method_types":[{"payment_method_type":"google_pay","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]}],"connector_webhook_details":null,"metadata":{"google_pay":{"merchant_info":{"merchant_name":"Narayan Bhat"},"allowed_payment_methods":[{"type":"CARD","parameters":{"allowed_auth_methods":["PAN_ONLY","CRYPTOGRAM_3DS"],"allowed_card_networks":["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]},"tokenization_specification":{"type":"PAYMENT_GATEWAY","parameters":{"gateway":"example","gateway_merchant_id":"{{gateway_merchant_id}}"}}}]},"report_group":"Hello","merchant_config_currency":"USD"},"test_mode":false,"disabled":false,"frm_configs":null,"business_country":"US","business_label":"default","business_sub_label":null,"applepay_verified_domains":null,"pm_auth_config":null,"status":"active","additional_merchant_data":null,"connector_wallets_details":null}
```
</details>
<details>
<summary> Mandates via NTI </summary>
0. Enable `is_connector_agnostic_mit_enabled` for your profile
1. Create a CIT with Vantiv
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{
"amount": 10,
"currency": "USD",
"confirm": true,
"description": "payments",
"connector": ["worldpayvantiv"],
"capture_method": "automatic",
"customer_id": "9ad5a4e4-80f1-494d-b081-8dc5497f0145",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceutâ",
"zip": "94122",
"country": "AR",
"first_name": "joseph",
"last_name": "Doe"
}
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "Joseph",
"card_cvc": "737"
}
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "2025-03-27T13:56:49.848Z",
"online": {
"ip_address": null,
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15"
}
},
"setup_future_usage": "off_session",
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "13.232.74.226"
},
"metadata": {"report_group": "test"}
}'
```
Response
```
{"payment_id":"pay_2lKP1TDqbxFSb4LeKczw","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_2lKP1TDqbxFSb4LeKczw_secret_kteL8nR3S6vFvyQ56mmG","created":"2025-06-30T09:47:06.353Z","currency":"USD","customer_id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","customer":{"id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","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":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"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":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","created_at":1751276826,"expires":1751280426,"secret":"epk_32a625084c354731b59c7d3accac3b70"},"manual_retry_allowed":false,"connector_transaction_id":"83997095739360411","frm_message":null,"metadata":{"report_group":"test"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_2lKP1TDqbxFSb4LeKczw","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:02:06.353Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":"pm_QH26P6o4MrXFv09GaAd7","payment_method_status":"inactive","updated":"2025-06-30T09:47:07.025Z","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}
```
2. Do a Psync
```
curl --location 'http://localhost:8080/payments/pay_2lKP1TDqbxFSb4LeKczw?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY'
```
Response
```
{"payment_id":"pay_2lKP1TDqbxFSb4LeKczw","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"succeeded","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":10,"connector":"worldpayvantiv","client_secret":"pay_2lKP1TDqbxFSb4LeKczw_secret_kteL8nR3S6vFvyQ56mmG","created":"2025-06-30T09:47:06.353Z","currency":"USD","customer_id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","customer":{"id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","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":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"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":"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":"83997095739360411","frm_message":null,"metadata":{"report_group":"test"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_2lKP1TDqbxFSb4LeKczw","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:02:06.353Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":"pm_QH26P6o4MrXFv09GaAd7","payment_method_status":"inactive","updated":"2025-06-30T09:49:15.019Z","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}
```
3. Do a MIT payment with the same connector
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data-raw '{
"amount": 6500,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "ce5eae6b-563b-4f58-bd58-903d633a5a66",
"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://hyperswitch.io",
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "pm_QH26P6o4MrXFv09GaAd7"
},
"connector": [
"worldpayvantiv"
],
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"browser_info": {
"ip_address": "129.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",
"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
}
}'
```
Response
```
{"payment_id":"pay_hzqIaJUelieO3OkgacKN","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":6500,"net_amount":6500,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_hzqIaJUelieO3OkgacKN_secret_6fYRsNwF8UdKNSvquyY7","created":"2025-06-30T09:52:21.261Z","currency":"USD","customer_id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","customer":{"id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","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":true,"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":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"guest@example.com","name":"John Doe","phone":"999999999","return_url":"https://hyperswitch.io/","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":"ce5eae6b-563b-4f58-bd58-903d633a5a66","created_at":1751277141,"expires":1751280741,"secret":"epk_676600b403cd43be8c4b57c7d96faafd"},"manual_retry_allowed":false,"connector_transaction_id":"84085052987747238","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_hzqIaJUelieO3OkgacKN","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:07:21.261Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"129.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_QH26P6o4MrXFv09GaAd7","payment_method_status":"active","updated":"2025-06-30T09:52:23.739Z","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":"saved_card","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
6. Do a Psync
```
curl --location 'http://localhost:8080/payments/pay_hzqIaJUelieO3OkgacKN?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY'
```
response
```
{"payment_id":"pay_hzqIaJUelieO3OkgacKN","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"succeeded","amount":6500,"net_amount":6500,"shipping_cost":null,"amount_capturable":0,"amount_received":6500,"connector":"worldpayvantiv","client_secret":"pay_hzqIaJUelieO3OkgacKN_secret_6fYRsNwF8UdKNSvquyY7","created":"2025-06-30T09:52:21.261Z","currency":"USD","customer_id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","customer":{"id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","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":true,"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":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"Joseph","last_name":null},"phone":null,"email":null}},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"guest@example.com","name":"John Doe","phone":"999999999","return_url":"https://hyperswitch.io/","authentication_type":"no_three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"84085052987747238","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_hzqIaJUelieO3OkgacKN","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:07:21.261Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"129.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_QH26P6o4MrXFv09GaAd7","payment_method_status":"active","updated":"2025-06-30T09:53:49.963Z","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":"saved_card","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
</details>
<details>
<summary> Manual + Refund </summary>
1. Create a manual payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{
"amount": 10,
"currency": "USD",
"confirm": true,
"description": "payments",
"connector": ["worldpayvantiv"],
"capture_method": "manual",
"customer_id": "082c2d86-e9e2-481a-bd7e-1bd2e86575ba",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceutâ",
"zip": "94122",
"country": "AR",
"first_name": "joseph",
"last_name": "Doe"
}
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "Joseph",
"card_cvc": "737"
}
}
}'
```
Response
```
{"payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_uKMQNl7N9wfLvmtq7oJZ_secret_YqGIoiSGvX5aCT0GAM3F","created":"2025-06-30T09:57:16.636Z","currency":"USD","customer_id":"43dbe83d-b75c-496d-a546-59ce2c963322","customer":{"id":"43dbe83d-b75c-496d-a546-59ce2c963322","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"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":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"43dbe83d-b75c-496d-a546-59ce2c963322","created_at":1751277436,"expires":1751281036,"secret":"epk_456b8bb12f6b4a0a8019c6745dc3e615"},"manual_retry_allowed":false,"connector_transaction_id":"83997095739384098","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_uKMQNl7N9wfLvmtq7oJZ","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:12:16.636Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T09:57:18.185Z","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}
```
2. Call Psync
```
curl --location 'http://localhost:8080/payments/pay_uKMQNl7N9wfLvmtq7oJZ?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY'
```
Response
```
{"payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"requires_capture","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_uKMQNl7N9wfLvmtq7oJZ_secret_YqGIoiSGvX5aCT0GAM3F","created":"2025-06-30T09:57:16.636Z","currency":"USD","customer_id":"43dbe83d-b75c-496d-a546-59ce2c963322","customer":{"id":"43dbe83d-b75c-496d-a546-59ce2c963322","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"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":"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":"83997095739384098","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_uKMQNl7N9wfLvmtq7oJZ","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:12:16.636Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T09:58:32.411Z","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}
```
3. Capture
```
curl --location 'http://localhost:8080/payments/pay_uKMQNl7N9wfLvmtq7oJZ/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{
"amount_to_capture": 10,
"statement_descriptor_name": "Joseph",
"statement_descriptor_suffix": "JS"
}'
```
Response
```
{"payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_uKMQNl7N9wfLvmtq7oJZ_secret_YqGIoiSGvX5aCT0GAM3F","created":"2025-06-30T09:57:16.636Z","currency":"USD","customer_id":"43dbe83d-b75c-496d-a546-59ce2c963322","customer":{"id":"43dbe83d-b75c-496d-a546-59ce2c963322","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"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":"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":"83997095739385384","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_uKMQNl7N9wfLvmtq7oJZ","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:12:16.636Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T09:59:22.847Z","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}
```
4. Call Psync
```
curl --location 'http://localhost:8080/payments/pay_uKMQNl7N9wfLvmtq7oJZ?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY'
```
Response
```
{"payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"succeeded","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":10,"connector":"worldpayvantiv","client_secret":"pay_uKMQNl7N9wfLvmtq7oJZ_secret_YqGIoiSGvX5aCT0GAM3F","created":"2025-06-30T09:57:16.636Z","currency":"USD","customer_id":"43dbe83d-b75c-496d-a546-59ce2c963322","customer":{"id":"43dbe83d-b75c-496d-a546-59ce2c963322","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"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":"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":"83997095739385384","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_uKMQNl7N9wfLvmtq7oJZ","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:12:16.636Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T10:00:09.795Z","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}
```
5. Create a refund
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{
"payment_id": "pay_uKMQNl7N9wfLvmtq7oJZ",
"amount": 10,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"split_refunds": {
"stripe_split_refund": {
"revert_platform_fee": true,
"revert_transfer": true
}
}
}'
```
Response
```
{"refund_id":"ref_ONP0iAUqRWqq6v7gSGWS","payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","amount":10,"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-06-30T10:01:00.032Z","updated_at":"2025-06-30T10:01:01.059Z","connector":"worldpayvantiv","profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","split_refunds":{"stripe_split_refund":{"revert_platform_fee":true,"revert_transfer":true}},"issuer_error_code":null,"issuer_error_message":null}
```
6. Call Rsync
```
{"refund_id":"ref_ONP0iAUqRWqq6v7gSGWS","payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","amount":10,"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-06-30T10:01:00.032Z","updated_at":"2025-06-30T10:01:01.059Z","connector":"worldpayvantiv","profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","split_refunds":{"stripe_split_refund":{"revert_platform_fee":true,"revert_transfer":true}},"issuer_error_code":null,"issuer_error_message":null}
```
Response
```
{"refund_id":"ref_ONP0iAUqRWqq6v7gSGWS","payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","amount":10,"currency":"USD","status":"succeeded","reason":"Customer returned product","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"error_message":null,"error_code":null,"unified_code":null,"unified_message":null,"created_at":"2025-06-30T10:01:00.032Z","updated_at":"2025-06-30T10:02:07.545Z","connector":"worldpayvantiv","profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","split_refunds":{"stripe_split_refund":{"revert_platform_fee":true,"revert_transfer":true}},"issuer_error_code":null,"issuer_error_message":null}
```
</details>
<details>
<summary>Void</summary>
1. Create a manual payment with vantiv
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{
"amount": 10,
"currency": "USD",
"confirm": true,
"description": "payments",
"connector": ["worldpayvantiv"],
"capture_method": "manual",
"customer_id": "fb640a0d-6001-4d8d-9f8d-c7365092fbb2",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceutâ",
"zip": "94122",
"country": "AR",
"first_name": "joseph",
"last_name": "Doe"
}
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "Joseph",
"card_cvc": "737"
}
}
}'
```
Response
```
{"payment_id":"pay_VYvdUN8QOKzzMYsJjsbL","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_VYvdUN8QOKzzMYsJjsbL_secret_PithWrAcFr0e4Kb3YBxW","created":"2025-06-30T10:05:18.411Z","currency":"USD","customer_id":"cd60638a-b1ee-420c-87e2-84a0cb417315","customer":{"id":"cd60638a-b1ee-420c-87e2-84a0cb417315","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"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":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cd60638a-b1ee-420c-87e2-84a0cb417315","created_at":1751277918,"expires":1751281518,"secret":"epk_b1782ed082fc40a7b7c1a3580dc68f8e"},"manual_retry_allowed":false,"connector_transaction_id":"83997095871395696","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_VYvdUN8QOKzzMYsJjsbL","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:20:18.411Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T10:05:20.952Z","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}
```
2. Call Psync
```
curl --location 'http://localhost:8080/payments/pay_VYvdUN8QOKzzMYsJjsbL?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY'
```
Response
```
{"payment_id":"pay_VYvdUN8QOKzzMYsJjsbL","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"requires_capture","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_VYvdUN8QOKzzMYsJjsbL_secret_PithWrAcFr0e4Kb3YBxW","created":"2025-06-30T10:05:18.411Z","currency":"USD","customer_id":"cd60638a-b1ee-420c-87e2-84a0cb417315","customer":{"id":"cd60638a-b1ee-420c-87e2-84a0cb417315","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"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":"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":"83997095871395696","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_VYvdUN8QOKzzMYsJjsbL","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:20:18.411Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T10:06:19.219Z","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}
```
3. Void the payment
```
curl --location 'http://localhost:8080/payments/pay_VYvdUN8QOKzzMYsJjsbL/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{"cancellation_reason":"requested_by_customer"}'
```
Response
```
{"payment_id":"pay_VYvdUN8QOKzzMYsJjsbL","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_VYvdUN8QOKzzMYsJjsbL_secret_PithWrAcFr0e4Kb3YBxW","created":"2025-06-30T10:05:18.411Z","currency":"USD","customer_id":"cd60638a-b1ee-420c-87e2-84a0cb417315","customer":{"id":"cd60638a-b1ee-420c-87e2-84a0cb417315","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"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":"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":"84085053114454037","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_VYvdUN8QOKzzMYsJjsbL","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:20:18.411Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T10:07:15.673Z","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 **payment** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/configs.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs`
- `crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs`
**3. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**4. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (7 changes)
- Extend existing types with new fields (122 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit f8dc3ecf:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs**
Remove:
- function: private::get_request_body
Add:
- function: private::get_auth_header
- function: private::validate_mandate_payment
- function: private::handle_vantiv_json_error_response
**crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs**
Remove:
- struct: pub::TransactionQuery
Add:
- function: private::get_processing_info
- struct: pub::VantivSyncErrorResponse
- struct: pub::VantivSyncResponse
- struct: pub::PaymentDetail
- enum: pub::VantivProcessingType
- enum: pub::PaymentStatus
**crates/hyperswitch_domain_models/src/configs.rs**
Modify existing code
|
{"pr_number": 8495, "pr_title": "feat(connectors): [Worldpayvantiv] add NTI flow and refactor sync flows", "merged_at": "2025-07-01T11:22:23Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/configs.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 3, "functions_added": 7, "enums_added": 2, "fields_added": 122, "imports_added": 5, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(cypress-test): include worldpay's request / response structure for test suite
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Described in #6316 point # 4 (read comments)
### 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 sanity testing of Worldpay connector.
## How did you test it?
Locally using `npm run cypress:payments`
<img width="842" alt="Screenshot 2024-10-24 at 11 17 11 AM" src="https://github.com/user-attachments/assets/a9a96e67-e251-428a-9a80-087a06dad32a">
## 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**
- `cypress-tests/cypress/fixtures/create-connector-body.json`
**2. Tests**
- `cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js`
- `cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js`
- `cypress-tests/cypress/e2e/PaymentTest/00020-Variations.cy.js`
- ... and 5 more files
**Code Patterns Applied:**
- Extend existing types with new fields (301 changes)
- Add conditional logic for feature flags or filtering (1 changes)
|
{"pr_number": 6420, "pr_title": "feat(cypress-test): include worldpay's request / response structure for test suite", "merged_at": "2024-10-30T10:11:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"connectors": ["cypress-tests/cypress/fixtures/create-connector-body.json"], "tests": ["cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00020-Variations.cy.js", "cypress-tests/cypress/e2e/PaymentUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentUtils/Paybox.js", "cypress-tests/cypress/e2e/PaymentUtils/Utils.js", "cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js", "cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {"fields_added": 301, "conditionals_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(core): Add record attempt operation for revenue recovery webhooks
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
**Revenue record operation**
In revenue recovery webhook flow, we mainly consume 3 types of events
1) PaymentFailure
2) PaymentSuccess
3) InvoiceCancel
For PaymentFailure or PaymentSuccess scenario we need to record the attempt and update the payment intent fields. This PR adds support for this operations.
**Why do we need to record the payment attempts ?**
To predict the next schedule time of mit transaction we need previous attempts information like error message, code and billing info, mandate details etc. So we store this info in payment_attempt against intent(invoice).
**Why do we need to update payment intent ?**
Intent Status should be altered based on attempt status. Apart from this info like no of retries, payment method token details needs to be update in update trackers of record attempt operation.
### 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)?
-->
Testcase 1:
create payment connector mca :
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_FFzEuYGiJhp3SfL7AXoZ' \
--header 'x-profile-id: pro_gj36mgkfbJuFw2ZVvzX8' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "stripe",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "stripe apikey"
},
"connector_webhook_details": {
"merchant_secret": ""
},
"profile_id": "pro_gj36mgkfbJuFw2ZVvzX8"
}'
```
response :
```
{
"connector_type": "payment_processor",
"connector_name": "stripe",
"connector_label": "stripe_business",
"id": "mca_oAXqVf3BZs7bOS0iNhV7",
"profile_id": "pro_gj36mgkfbJuFw2ZVvzX8",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "sk*******************************************************************************************************5b"
},
"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
}
```
get the payment connector mca and create billing connector mca
Create billing connector mca
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_FFzEuYGiJhp3SfL7AXoZ' \
--header 'x-profile-id: pro_gj36mgkfbJuFw2ZVvzX8' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "billing_processor",
"connector_name": "chargebee",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "chargebee apikey"
},
"connector_webhook_details": {
"merchant_secret": "chargebee",
"additional_secret" : "password"
},
"feature_metadata" : {
"revenue_recovery" : {
"max_retry_count" : 27,
"billing_connector_retry_threshold" : 16,
"billing_account_reference" :{
"mca_oAXqVf3BZs7bOS0iNhV7" : "gw_16BlyOUaPA0eq12MZ"
}
}
},
"profile_id": "pro_gj36mgkfbJuFw2ZVvzX8"
}'
```
response :
```
{
"connector_type": "payment_processor",
"connector_name": "chargebee",
"connector_label": "chargebee_business",
"id": "mca_1WvloGjsk5KcxOZ6fBPd",
"profile_id": "pro_gj36mgkfbJuFw2ZVvzX8",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "sk*******************************************************************************************************5b"
},
"payment_methods_enabled": null,
"connector_webhook_details": {
"merchant_secret": "chargebee",
"additional_secret": "password"
},
"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": {
"revenue_recovery": {
"max_retry_count": 27,
"billing_connector_retry_threshold": 16,
"billing_account_reference": {
"mca_oAXqVf3BZs7bOS0iNhV7": "gw_16BlyOUaPA0eq12MZ"
}
}
}
}
```
Send chargebee simulated webhook either from dashboard or postman
request :
```
curl --location 'http://localhost:8080/v2/webhooks/cloth_seller_FFzEuYGiJhp3SfL7AXoZ/pro_gj36mgkfbJuFw2ZVvzX8/mca_1WvloGjsk5KcxOZ6fBPd' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data-raw '{
"id": "ev_169vy3UaPFn4L4mf",
"occurred_at": 1737361021,
"source": "admin_console",
"user": "ns22eem1r18@student.nitw.ac.in",
"object": "event",
"api_version": "v2",
"content": {
"transaction": {
"id": "txn_169vy3UaPFmC44me",
"customer_id": "Azq8o5UaLqWWvyGd",
"subscription_id": "Azq8o5UaLr2WnyHG",
"gateway_account_id": "gw_16BlyOUaPA0eq12MZ",
"payment_source_id": "pm_169vy3UaPDo0t4hL",
"payment_method": "card",
"gateway": "stripe",
"type": "payment",
"date": 1737361019,
"exchange_rate": 1,
"amount": 5,
"id_at_gateway": "ch_3QjGAJSHworDX2hs0B120C0A",
"status": "failure",
"updated_at": 1737361021,
"fraud_reason": "Payment complete.",
"resource_version": 1737361021397,
"deleted": false,
"object": "transaction",
"masked_card_number": "************4242",
"currency_code": "INR",
"base_currency_code": "INR",
"amount_unused": 0,
"linked_invoices": [
{
"invoice_id": "9",
"applied_amount": 500000,
"applied_at": 1737361021,
"invoice_date": 1737361018,
"invoice_total": 500000,
"invoice_status": "paid"
}
],
"linked_refunds": [],
"initiator_type": "merchant",
"three_d_secure": false,
"payment_method_details": "{\"card\":{\"first_name\":\"test2\",\"last_name\":\"name2\",\"iin\":\"424242\",\"last4\":\"4242\",\"funding_type\":\"credit\",\"expiry_month\":12,\"expiry_year\":2026,\"billing_addr1\":\"asdf\",\"billing_addr2\":\"asd\",\"billing_city\":\"asdf\",\"billing_state\":\"asdfaf\",\"billing_country\":\"AF\",\"billing_zip\":\"12345\",\"masked_number\":\"************4242\",\"object\":\"card\",\"brand\":\"visa\"}}"
},
"invoice": {
"id": "invoice_1234",
"customer_id": "Azq8o5UaLqWWvyGd",
"subscription_id": "Azq8o5UaLr2WnyHG",
"recurring": false,
"status": "paid",
"price_type": "tax_exclusive",
"date": 1737361018,
"due_date": 1737361018,
"net_term_days": 0,
"exchange_rate": 1,
"total": 5,
"amount_paid": 0,
"amount_adjusted": 0,
"write_off_amount": 0,
"credits_applied": 0,
"amount_due": 0,
"paid_at": 1737361019,
"updated_at": 1737361021,
"resource_version": 1737361021401,
"deleted": false,
"object": "invoice",
"first_invoice": false,
"amount_to_collect": 0,
"round_off_amount": 0,
"has_advance_charges": false,
"currency_code": "INR",
"base_currency_code": "INR",
"generated_at": 1737361018,
"is_gifted": false,
"term_finalized": true,
"channel": "web",
"tax": 0,
"line_items": [
{
"id": "li_169vy3UaPFmBR4md",
"date_from": 1737361004,
"date_to": 1737361004,
"unit_amount": 500000,
"quantity": 1,
"amount": 500000,
"pricing_model": "flat_fee",
"is_taxed": false,
"tax_amount": 0,
"object": "line_item",
"subscription_id": "Azq8o5UaLr2WnyHG",
"customer_id": "Azq8o5UaLqWWvyGd",
"description": "Implementation Charge",
"entity_type": "charge_item_price",
"entity_id": "cbdemo_implementation-charge-INR",
"tax_exempt_reason": "tax_not_configured",
"discount_amount": 0,
"item_level_discount_amount": 0
}
],
"sub_total": 500000,
"linked_payments": [
{
"txn_id": "txn_169vy3UaPFmC44me",
"applied_amount": 500000,
"applied_at": 1737361021,
"txn_status": "success",
"txn_date": 1737361019,
"txn_amount": 500000
}
],
"applied_credits": [],
"adjustment_credit_notes": [],
"issued_credit_notes": [],
"linked_orders": [],
"dunning_attempts": [],
"billing_address": {
"first_name": "test1",
"last_name": "name",
"email": "johndoe@gmail.com",
"company": "johndoe",
"phone": "+91 83 17 575848",
"line1": "asdf",
"line2": "asd",
"line3": "ahjkd",
"city": "asdf",
"state_code": "TG",
"state": "Telangana",
"country": "IN",
"zip": "561432",
"validation_status": "not_validated",
"object": "billing_address"
},
"site_details_at_creation": {
"timezone": "Asia/Calcutta"
}
},
"customer": {
"id": "Azq8o5UaLqWWvyGd",
"first_name": "john",
"last_name": "doe",
"email": "john@gmail.com",
"phone": "831 757 5848",
"company": "johndoe",
"auto_collection": "on",
"net_term_days": 0,
"allow_direct_debit": false,
"created_at": 1737310670,
"created_from_ip": "205.254.163.189",
"taxability": "taxable",
"updated_at": 1737360899,
"pii_cleared": "active",
"channel": "web",
"resource_version": 1737360899990,
"deleted": false,
"object": "customer",
"billing_address": {
"first_name": "test1",
"last_name": "name",
"email": "johndoe@gmail.com",
"company": "johndoe",
"phone": "+91 83 17 575848",
"line1": "asdf",
"line2": "asd",
"line3": "ahjkd",
"city": "asdf",
"state_code": "TG",
"state": "Telangana",
"country": "IN",
"zip": "561432",
"validation_status": "not_validated",
"object": "billing_address"
},
"card_status": "valid",
"promotional_credits": 0,
"refundable_credits": 0,
"excess_payments": 0,
"unbilled_charges": 0,
"preferred_currency_code": "INR",
"mrr": 0,
"primary_payment_source_id": "pm_169vy3UaPDo0t4hL",
"payment_method": {
"object": "payment_method",
"type": "card",
"reference_id": "cus_RcUo8xTwe0sHP7/card_1QjG2dSHworDX2hs6YIjKdML",
"gateway": "stripe",
"gateway_account_id": "gw_16BlyOUaPA0eq12MZ",
"status": "valid"
}
},
"subscription": {
"id": "Azq8o5UaLr2WnyHG",
"billing_period": 1,
"billing_period_unit": "month",
"customer_id": "Azq8o5UaLqWWvyGd",
"status": "active",
"current_term_start": 1737310793,
"current_term_end": 1739989193,
"next_billing_at": 1739989193,
"created_at": 1737310793,
"started_at": 1737310793,
"activated_at": 1737310793,
"created_from_ip": "205.254.163.189",
"updated_at": 1737310799,
"has_scheduled_changes": false,
"channel": "web",
"resource_version": 1737310799688,
"deleted": false,
"object": "subscription",
"currency_code": "INR",
"subscription_items": [
{
"item_price_id": "cbdemo_premium-INR-monthly",
"item_type": "plan",
"quantity": 1,
"unit_price": 100000,
"amount": 0,
"free_quantity": 3,
"object": "subscription_item"
}
],
"shipping_address": {
"first_name": "test1",
"last_name": "name",
"email": "johndoe@gmail.com",
"company": "johndoe",
"phone": "+91 83 17 575848",
"line1": "asdf",
"line2": "asd",
"line3": "ahjkd",
"city": "asdf",
"state_code": "TG",
"state": "Telangana",
"country": "IN",
"zip": "561432",
"validation_status": "not_validated",
"object": "shipping_address"
},
"due_invoices_count": 0,
"mrr": 0,
"exchange_rate": 1,
"base_currency_code": "INR",
"has_scheduled_advance_invoices": false
}
},
"event_type": "payment_failed",
"webhook_status": "scheduled",
"webhooks": [
{
"id": "whv2_6oZfZUaLmtchA5Bl",
"webhook_status": "scheduled",
"object": "webhook"
}
]
}'
```
This should create Payment intent, payment attempt in our system with right values in DB
Payment intent details in DB

Payment attempt details in DB

Test case 2 :
change the transaction id in above simulated webhooks and hit the request again, it should create new payment attempt but update the payment intent feature metadata.

Test case 3 :
After passing succeded transaction, we should not allow to record further transactions

Note: This above webhook will still not recieve api response it will only create objects in our system .
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
**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/payments.rs`
- ... and 4 more files
**4. Core Business Logic**
- `crates/router/src/core/errors.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/operations.rs`
- ... and 4 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs`
**6. Type Definitions**
- `crates/router/src/types/api/payments.rs`
**Code Patterns Applied:**
- Define new data structures (7 changes)
- Implement new functions (26 changes)
- Extend existing types with new fields (276 changes)
**Detailed Identifier Changes:**
Commit 24aa0034:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::PaymentsAttemptRecordRequest
- struct: pub::RecordAttemptErrorDetails
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Add:
- struct: pub::ChargebeeMandateDetails
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- function: private::from
- function: private::from
- impl: impl From<&api_models::payments::PaymentAttemptAmountDetails> for payments::payment_attempt::AttemptAmountDetailsSetter
- impl: impl From<&api_models::payments::RecordAttemptErrorDetails> for payments::payment_attempt::ErrorDetails
**crates/hyperswitch_domain_models/src/merchant_connector_account.rs**
Add:
- function: pub::get_payment_merchant_connector_account_id_using_account_reference_id
**crates/hyperswitch_domain_models/src/payments.rs**
Add:
- function: pub::get_revenue_recovery_metadata
- function: pub::get_feature_metadata
- function: pub::get_updated_feature_metadata
- struct: pub::PaymentAttemptRecordData
- struct: pub::RevenueRecoveryData
- impl: impl PaymentAttemptRecordData<F>
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Add:
- function: pub::create_domain_model_using_record_request
- function: pub::get_attempt_merchant_connector_account_id
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/revenue_recovery.rs**
Remove:
- impl: impl From<&RevenueRecoveryInvoiceData> for api_models::payments::AmountDetails
Add:
- function: private::from
**crates/hyperswitch_domain_models/src/router_flow_types/payments.rs**
Add:
- struct: pub::RecordAttempt
**crates/router/src/core/errors.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Add:
- function: pub::record_attempt_core
**crates/router/src/core/payments/operations.rs**
Add:
- mod: pub::payment_attempt_record
**crates/router/src/core/payments/operations/payment_attempt_record.rs**
Add:
- function: private::to_validate_request
- function: private::to_get_tracker
- function: private::to_domain
- function: private::to_update_tracker
- function: private::validate_status_for_operation
- function: private::get_trackers
- function: private::update_trackers
- function: private::validate_request
- function: private::get_customer_details
- function: private::make_pm_data
- function: private::perform_routing
- struct: pub::PaymentAttemptRecord
- impl: impl Operation<F, PaymentsAttemptRecordRequest> for &PaymentAttemptRecord
- impl: impl ValidateStatusForOperation for PaymentAttemptRecord
- impl: impl GetTracker<F, PaymentAttemptRecordData<F>, PaymentsAttemptRecordRequest> for PaymentAttemptRecord
- impl: impl UpdateTracker<F, PaymentAttemptRecordData<F>, PaymentsAttemptRecordRequest> for PaymentAttemptRecord
- impl: impl ValidateRequest<F, PaymentsAttemptRecordRequest, PaymentAttemptRecordData<F>> for PaymentAttemptRecord
- impl: impl Domain<F, PaymentsAttemptRecordRequest, PaymentAttemptRecordData<F>> for PaymentAttemptRecord
**crates/router/src/core/payments/transformers.rs**
Add:
- function: private::generate_response
- impl: impl GenerateResponse<api_models::payments::PaymentAttemptResponse> for hyperswitch_domain_models::payments::PaymentAttemptRecordData<F>
**crates/router/src/core/webhooks/incoming_v2.rs**
Modify existing code
**crates/router/src/core/webhooks/recovery_incoming.rs**
Add:
- function: pub::create_payment_record_request
**crates/router/src/types/api/payments.rs**
Modify existing code
|
{"pr_number": 7236, "pr_title": "feat(core): Add record attempt operation for revenue recovery webhooks", "merged_at": "2025-03-07T14:39:19Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/merchant_connector_account.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/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/router_flow_types/payments.rs"], "core_business": ["crates/router/src/core/errors.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/payment_attempt_record.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/webhooks/incoming_v2.rs", "crates/router/src/core/webhooks/recovery_incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs"], "types": ["crates/router/src/types/api/payments.rs"]}, "change_types": {"structs_added": 7, "functions_added": 26, "fields_added": 276, "imports_added": 15}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connectors): [worldpayvantiv] add setup mandate flow, map network txn id and fix mandate flow
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [x] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This Pr implements setup mandate flow, fixes card mandate flow and maps network_txn_id
Hotfix for https://github.com/juspay/hyperswitch/pull/8929
## 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 zero auth CIT
```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_XAp69f7Dfj6lQBbz5pPoxtnwadx2HAU7F7DTcFbWGB7EnGVHZakPNhkw3cGpmhoB' \
--data '{
"amount":0,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"payment_type": "setup_mandate",
"customer_id": "aaaa",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4100200300011001",
"card_exp_month": "01",
"card_exp_year": "50",
"card_cvc": "987"
}
},
"return_url": "https://www.google.com/",
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "2025-03-27T13:56:49.848Z",
"online": {
"ip_address": null,
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15"
}
},
"setup_future_usage": "off_session"
}'
```
Response
```json
{"payment_id":"pay_VpEtBYRi1niZhQ05lhhn","merchant_id":"postman_merchant_GHAction_012c870c-4e06-418f-a0b3-acdf3a03f4ae","status":"processing","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_VpEtBYRi1niZhQ05lhhn_secret_iZGk5rq2EHnMbomn7TjA","created":"2025-08-12T14:00:54.936Z","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":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"1001","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"410020","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"50","card_holder_name":null,"payment_checks":{"avs_result":"32","advanced_a_v_s_result":null,"authentication_result":null,"card_validation_result":"M"},"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":null,"name":null,"phone":null,"return_url":"https://www.google.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":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":1755007254,"expires":1755010854,"secret":"epk_f12c783739e54105b8a3029503fee836"},"manual_retry_allowed":false,"connector_transaction_id":"84085359781684826","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_VpEtBYRi1niZhQ05lhhn_1","payment_link":null,"profile_id":"pro_2JdUlQe3tdwrnPEDV2OJ","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_z35pR34MapAVxIgwldLa","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-12T14:15:54.935Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_q6EKptpWOxiu5tlv05FQ","network_transaction_id":"759986459639263","payment_method_status":"inactive","updated":"2025-08-12T14:00:56.412Z","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":"2731687290861001","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}
```
2.Psync
```
{"payment_id":"pay_VpEtBYRi1niZhQ05lhhn","merchant_id":"postman_merchant_GHAction_012c870c-4e06-418f-a0b3-acdf3a03f4ae","status":"succeeded","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":0,"connector":"worldpayvantiv","client_secret":"pay_VpEtBYRi1niZhQ05lhhn_secret_iZGk5rq2EHnMbomn7TjA","created":"2025-08-12T14:00:54.936Z","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":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"1001","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"410020","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"50","card_holder_name":null,"payment_checks":{"avs_result":"32","advanced_a_v_s_result":null,"authentication_result":null,"card_validation_result":"M"},"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":null,"name":null,"phone":null,"return_url":"https://www.google.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":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":"84085359781684826","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_VpEtBYRi1niZhQ05lhhn_1","payment_link":null,"profile_id":"pro_2JdUlQe3tdwrnPEDV2OJ","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_z35pR34MapAVxIgwldLa","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-12T14:15:54.935Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_q6EKptpWOxiu5tlv05FQ","network_transaction_id":"759986459639263","payment_method_status":"inactive","updated":"2025-08-12T14:02:12.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":"2731687290861001","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}
```
3. Do a MIT
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_XAp69f7Dfj6lQBbz5pPoxtnwadx2HAU7F7DTcFbWGB7EnGVHZakPNhkw3cGpmhoB' \
--data '{
"amount": 15000,
"currency": "USD",
"off_session": true,
"confirm": true,
"capture_method": "manual",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_q6EKptpWOxiu5tlv05FQ"
},
"customer_id": "aaaa",
"connector": [
"worldpayvantiv"
]
}'
```
Response
```
{"payment_id":"pay_Mkc6QoQYIyLYzwZ1cdTv","merchant_id":"postman_merchant_GHAction_012c870c-4e06-418f-a0b3-acdf3a03f4ae","status":"processing","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":15000,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_Mkc6QoQYIyLYzwZ1cdTv_secret_y2lZVjlOe70KeQfwWqFm","created":"2025-08-12T14:02:44.770Z","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":true,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1001","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"410020","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"50","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":{"customer_id":"aaaa","created_at":1755007364,"expires":1755010964,"secret":"epk_3e3606e996744b3db47d9d0ea7da1f63"},"manual_retry_allowed":false,"connector_transaction_id":"83997400517768209","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_Mkc6QoQYIyLYzwZ1cdTv_1","payment_link":null,"profile_id":"pro_2JdUlQe3tdwrnPEDV2OJ","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_z35pR34MapAVxIgwldLa","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-12T14:17:44.770Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_q6EKptpWOxiu5tlv05FQ","network_transaction_id":"759986459639263","payment_method_status":"active","updated":"2025-08-12T14:02:45.927Z","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":"2731687290861001","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}
```
Psync
```
{"payment_id":"pay_Mkc6QoQYIyLYzwZ1cdTv","merchant_id":"postman_merchant_GHAction_012c870c-4e06-418f-a0b3-acdf3a03f4ae","status":"requires_capture","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":15000,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_Mkc6QoQYIyLYzwZ1cdTv_secret_y2lZVjlOe70KeQfwWqFm","created":"2025-08-12T14:02:44.770Z","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":true,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1001","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"410020","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"50","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":"83997400517768209","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_Mkc6QoQYIyLYzwZ1cdTv_1","payment_link":null,"profile_id":"pro_2JdUlQe3tdwrnPEDV2OJ","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_z35pR34MapAVxIgwldLa","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-12T14:17:44.770Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_q6EKptpWOxiu5tlv05FQ","network_transaction_id":"759986459639263","payment_method_status":"active","updated":"2025-08-12T14:03:28.399Z","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}
```
## 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/transformers.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs`
- `crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
**4. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Worldpayvantiv.js`
**Code Patterns Applied:**
- Implement new functions (18 changes)
- Extend existing types with new fields (99 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit fb194346:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs**
Add:
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
**crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs**
Remove:
- function: private::try_from
- impl: impl TryFrom<&PaymentMethodData> for WorldpayvantivCardData
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_optional_l2_l3_data
- function: private::is_customer_initiated_mandate_payment
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
|
{"pr_number": 8950, "pr_title": "fix(connectors): [worldpayvantiv] add setup mandate flow, map network txn id and fix mandate flow", "merged_at": "2025-08-14T10:04:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Worldpayvantiv.js"]}, "change_types": {"functions_added": 18, "fields_added": 99, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): Add payment_link_data in PaymentData for Psync
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for [7137](https://github.com/juspay/hyperswitch/pull/7137)
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/operations/payment_status.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (5 changes)
**Detailed Identifier Changes:**
Commit 60f5a3e0:
Files to modify:
**crates/router/src/core/payments.rs**
Add:
- function: pub::get_payment_link_response_from_id
**crates/router/src/core/payments/operations/payment_status.rs**
Modify existing code
|
{"pr_number": 7205, "pr_title": "fix(core): Add payment_link_data in PaymentData for Psync", "merged_at": "2025-02-07T06:58:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_status.rs"]}, "change_types": {"functions_added": 1, "fields_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [Peach Payments] fix connector metadata deserialization
## 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 -->
fix connector metadata deserialization
Currently we deserialize to camelCase.
but dashboard always sends in snake_case.
### 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="836" height="924" alt="Screenshot 2025-10-14 at 2 13 20 PM" src="https://github.com/user-attachments/assets/15635e0c-128d-4bb6-80bb-6bfa38bcc424" />
<img width="938" height="935" alt="Screenshot 2025-10-14 at 2 13 38 PM" src="https://github.com/user-attachments/assets/20d7197f-f5e6-4adf-911b-67e80663ca7f" />
## 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/peachpayments/transformers.rs`
**Detailed Identifier Changes:**
Commit 859b3b18:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs**
Modify existing code
|
{"pr_number": 9826, "pr_title": "fix(connector): [Peach Payments] fix connector metadata deserialization", "merged_at": "2025-10-14T10:15:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment-link): update traditional chinese paymentlink exp msg
## 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 -->
We need to update payment link expired msg for traditional chinese locale.
### 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).
-->
Raised by the merchant to update the locale to the correct one as shared by 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)?
-->
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: **' \
--header 'Accept-Language: zh_hant' \
--data '{
"amount": 10,
"setup_future_usage": "off_session",
"profile_id":"pro_vAgaZjm1nZmCss6jud6A",
"currency": "EUR",
"payment_link": true,
"session_expiry": 60,
"return_url": "https://google.com",
"payment_link_config": {
"display_sdk_only":false,
"theme": "#14356F",
"logo": "https://logo.com/wp-content/uploads/2020/08/zurich.svg",
"seller_name": "Zurich Inc."
}
}'
```
<img width="2560" height="1440" alt="image" src="https://github.com/user-attachments/assets/7f7bbd7c-0462-4346-90ae-6ef701ef026a" />
Expected traditional chinese:
<img width="699" height="259" alt="image" src="https://github.com/user-attachments/assets/d809a5a3-d056-4a9c-b9a9-9d0a3e8e4e28" />
## 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/payment_link/locale.js`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
|
{"pr_number": 9007, "pr_title": "feat(payment-link): update traditional chinese paymentlink exp msg", "merged_at": "2025-08-21T11:16:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/payment_link/locale.js"]}, "change_types": {"fields_added": 2}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(dynamic_routing): perform db operations for dynamic_routing_stats table only when payments are in terminal state
## 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 -->
Previously due to the DB insertion code being in `post_update_tracker` was being called several times as our payment's status keeps on changing, due to this our DB broke as we had a unique constraint on `attempt_id` in the `dynamic_routing_stats` table.
To fix this we have added a check that only the payments that are in terminal state will be pushed, which ensures that the insert in db will be called only once for one attempt_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`
-->
## 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. Toggle Success Based routing for the merchant.
```
curl --location --request POST 'http://localhost:8080/account/xxxxxx/business_profile/xxxxxxx/dynamic_routing/success_based/toggle?enable=metrics' \
--header 'api-key: xxxxxxx'
```
2. Create a payment that goes in processing state or any non terminal state. (VOLTE)
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: xxxxxxxx' \
--data-raw '{
"amount": 8000,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 8000,
"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://www.google.com/",
"payment_method": "bank_redirect",
"payment_method_type": "open_banking_uk",
"payment_method_data": {
"bank_redirect": {
"open_banking_uk": {
}
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "DE",
"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": "DE",
"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"
},
"profile_id": "xxxxx"
}
'
```
3. Hit the 3ds link and cancel the payment
5. Check `dynamic_routing_stats` table for the entry of attempt, it should be there.
<img width="569" alt="Screenshot 2025-01-15 at 3 33 58 PM" src="https://github.com/user-attachments/assets/f942db2a-93f2-48f7-9918-eef69996a55c" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/operations/payment_response.rs`
**2. Other**
- `crates/common_enums/src/enums.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 1ec91e54:
Files to modify:
**crates/common_enums/src/enums.rs**
Add:
- function: pub::is_in_terminal_state
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
|
{"pr_number": 6900, "pr_title": "refactor(dynamic_routing): perform db operations for dynamic_routing_stats table only when payments are in terminal state", "merged_at": "2025-01-15T10:59:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/payment_response.rs"], "other": ["crates/common_enums/src/enums.rs"]}, "change_types": {"functions_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(opensearch): fix empty filter array query addition in globalsearch query
## 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 -->
The opensearch query should be built manually in the code, based on the request body.
There is a component called `filter_array` which comprises of the free-text search query, addition of case sensitive filters and also the time_range (if provided).
When all the three sub parts are empty (empty query string, no case-sensitive filters and missing time_range) in the request, the filter_array will not be created, and the logic for integrating the rest of the filters is affected.
Making minor fixes to the query builder to update the opensearch query even if all the above mentioned components are empty.
### 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).
-->
Give out correct results by building the opensearch query through the request body.
## 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)?
-->
Should test the case when free-text query is empty, case-sensitive filters are not provided, and time-range filter is also not applied.
Hit the curl:
```bash
curl --location 'http://localhost:8080/analytics/v1/search' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMzI5ODcwMywib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.y9FI-AvvzNKd4DbJiGT7LmwfzxNjZDdOZfQ40TGTh3w' \
--header 'Referer: http://localhost:9000/' \
--header 'sec-ch-ua: "Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'api-key: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36' \
--header 'Content-Type: application/json' \
--data '{
"query": "",
"filters": {
"currency": [
"USD"
]
}
}'
```
The response should now give out all the results based on the filter applied.
Sample opensearch query structure:
```json
{
"query": {
"bool": {
"must": [
{
"bool": {
"must": [
{
"bool": {
"should": [
{
"term": {
"currency.keyword": {
"value": "USD",
"case_insensitive": true
}
}
}
],
"minimum_should_match": 1
}
}
]
}
},
{
"bool": {
"must": [
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"organization_id.keyword": {
"value": "org_VpSHOjsYfDvabVYJgCAJ"
}
}
}
]
}
}
],
"minimum_should_match": 1
}
}
]
}
}
]
}
},
"sort": [
{
"@timestamp": {
"order": "desc"
}
}
]
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Other**
- `crates/analytics/src/opensearch.rs`
**Detailed Identifier Changes:**
Commit 063a1c63:
Files to modify:
**crates/analytics/src/opensearch.rs**
Modify existing code
|
{"pr_number": 6716, "pr_title": "fix(opensearch): fix empty filter array query addition in globalsearch query", "merged_at": "2024-12-02T15:02:27Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "order"]}, "hierarchy": {"other": ["crates/analytics/src/opensearch.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [NEXIXPAY] Updated the Api Response Schema
## 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 for this [PR](https://github.com/juspay/hyperswitch/pull/9476)
### 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="1337" height="83" alt="Screenshot 2025-09-24 at 11 19 13 AM" src="https://github.com/user-attachments/assets/56b9c6f9-e208-4e19-8804-ae2bf22fc1d5" />
<img width="625" height="120" alt="Screenshot 2025-09-24 at 11 22 57 AM" src="https://github.com/user-attachments/assets/734a04ae-f459-4b07-836a-e906bb2d9751" />
## 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:**
- Define new data structures (1 changes)
- Extend existing types with new fields (10 changes)
**Detailed Identifier Changes:**
Commit c5f76f73:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs**
Add:
- struct: pub::DetailedWarnings
- enum: pub::Channel
|
{"pr_number": 9516, "pr_title": "fix(connector): [NEXIXPAY] Updated the Api Response Schema", "merged_at": "2025-09-24T05:53:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs"]}, "change_types": {"structs_added": 1, "enums_added": 1, "fields_added": 10, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [trustpay] fix webhook deserialization error
## 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 -->
On TrustPay's SEPA redirection page, the customer is shown the necessary details to complete the bank transfer, including an E2E reference number. This reference is used by TrustPay to match the incoming payment with the original payment request. If the customer omits this number while paying, the payment cannot be linked to its corresponding request, resulting in the absence of both the Payment Request ID and the Merchant Reference in the notification.
Deserialization is triggered, and the notification cannot be identified by Hyperswitch.
<img width="490" alt="Screenshot 2025-05-23 at 9 46 37 AM" src="https://github.com/user-attachments/assets/69350117-a6f5-42ef-af1e-04f596318e06" />
</br>
This PR converts the 5xx error into a 4xx error, but Hyperswitch won't be able to identify the webhook with any payment request due to insufficient information received from the TrustPay webhook.
## 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 it manually
Trigger trustpay like webhook to hyperswitch - Throws a 4xx now
<img width="1229" alt="Screenshot 2025-05-23 at 10 34 12 AM" src="https://github.com/user-attachments/assets/3578de15-c44d-44d0-b80e-626e6bf7bab3" />
Terminal Log
<img width="1051" alt="Screenshot 2025-05-23 at 10 34 03 AM" src="https://github.com/user-attachments/assets/949042f0-6ffa-4eb2-9a64-875ff71c4a6c" />
If reference is present
<img width="1237" alt="Screenshot 2025-05-23 at 10 35 46 AM" src="https://github.com/user-attachments/assets/fe9ff7c2-d3fa-4fc5-a576-441ed6687212" />
## 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/trustpay.rs`
- `crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 0fb7eb0b:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/trustpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs**
Modify existing code
|
{"pr_number": 8116, "pr_title": "fix(connector): [trustpay] fix webhook deserialization error", "merged_at": "2025-06-11T13:57:53Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/trustpay.rs", "crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
docs(error_codes): add unified error codes
## 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 -->
Helps closing - #6318
### 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. Other**
- `api-reference/essentials/error_codes.mdx`
|
{"pr_number": 6319, "pr_title": "docs(error_codes): add unified error codes", "merged_at": "2024-10-15T14:02:06Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["api-reference/essentials/error_codes.mdx"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(payout): use get_string_repr for formatting payout IDs
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR fixes the bug report - https://github.com/juspay/hyperswitch/issues/8392#issuecomment-3032692625
Introduces below changes
- Use `get_string_repr` for formatting payoutIDs which were using default formatter
- Update connector configs for `adyenplatform` (WASM)
- Update payout method filters for `adyenplatform`
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Allows `adyenplatform` to be configured with card cards from HyperSwitch dashboard.
## How did you test it?
<details>
<summary>1. Create a payout</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_vhEr5STeoxVwp0UNEyGSBnZn2iP9DMGezNxPeDFxHg3NMldiVgVRtDCvD2b7HNn3' \
--data '{"amount":100,"currency":"EUR","profile_id":"pro_JCDE9eeu7mtOyG33iC9V","customer_id":"cus_gBWmUTIZ5DmABhSNAEjP","description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111111111111111","expiry_month":"03","expiry_year":"2030"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"FR","first_name":"John","last_name":"Doe"}},"entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}'
Response
{"payout_id":"payout_EOI2dK9GHl8YBMvAjqIq","merchant_id":"merchant_1751625933","merchant_order_reference_id":null,"amount":100,"currency":"EUR","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":null,"card_network":null,"card_type":null,"card_issuing_country":null,"bank_code":null,"last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":null}},"billing":{"address":{"city":"San Fransico","country":"FR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"auto_fulfill":true,"customer_id":"cus_gBWmUTIZ5DmABhSNAEjP","customer":{"id":"cus_gBWmUTIZ5DmABhSNAEjP","name":"John Nether","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_EOI2dK9GHl8YBMvAjqIq_secret_FUe8Cp6OvCCpCvIt39ON","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_Zg16yInVWTOGrCcxDQSc","status":"initiated","error_message":null,"error_code":null,"profile_id":"pro_JCDE9eeu7mtOyG33iC9V","created":"2025-07-04T10:54:36.849Z","connector_transaction_id":"38EBIL67IUZSEZC2","priority":null,"payout_link":null,"email":null,"name":"John Nether","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_LoUGCOb3satGrS4yQrcH"}
Things to check
- `client_secret` has the `payout_id` formatted correctly
</details>
<details>
<summary>2. Create a payout link</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--data '{"merchant_order_reference_id":"ref123","amount":1,"currency":"EUR","customer_id":"cus_gBWmUTIZ5DmABhSNAEjP","description":"Its my first payout request","entity_type":"Individual","confirm":false,"auto_fulfill":true,"session_expiry":1000000,"profile_id":"pro_JCDE9eeu7mtOyG33iC9V","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":"payout_Ay4OnMjdz4elGsBDakjH","merchant_id":"merchant_1751625933","merchant_order_reference_id":"ref123","amount":1,"currency":"EUR","connector":null,"payout_type":null,"payout_method_data":null,"billing":null,"auto_fulfill":true,"customer_id":"cus_gBWmUTIZ5DmABhSNAEjP","customer":{"id":"cus_gBWmUTIZ5DmABhSNAEjP","name":"John Nether","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_Ay4OnMjdz4elGsBDakjH_secret_59zWUwIl0p9BmA8dK5S1","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_JCDE9eeu7mtOyG33iC9V","created":"2025-07-04T10:55:45.131Z","connector_transaction_id":null,"priority":null,"payout_link":{"payout_link_id":"payout_link_vYp9cTpn6zr92EVOI3Cd","link":"http://localhost:8080/payout_link/merchant_1751625933/payout_Ay4OnMjdz4elGsBDakjH?locale=en"},"email":null,"name":"John Nether","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":null}
Things to check
- `payout_link` has the `payout_id` formatted correctly
- Payout link renders properly when opened
- Able to submit and process payouts via payment links
<img width="1201" alt="Screenshot 2025-07-04 at 4 26 30 PM" src="https://github.com/user-attachments/assets/43055e26-0938-45c5-8a3f-3227d1359400" />
<img width="731" alt="Screenshot 2025-07-04 at 4 26 52 PM" src="https://github.com/user-attachments/assets/61614b64-a6d4-4652-90e6-467b52e21bd5" />
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payouts.rs`
**2. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
**3. Tests**
- `config/deployments/integration_test.toml`
**4. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit eb94cfe7:
Files to modify:
**crates/router/src/core/payouts.rs**
Modify existing code
|
{"pr_number": 8547, "pr_title": "fix(payout): use get_string_repr for formatting payout IDs", "merged_at": "2025-07-05T15:11:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payouts.rs"], "connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"], "tests": ["config/deployments/integration_test.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [BRAINTREE] Changed Attempt Status Mapping for Braintree
## 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 -->
Changed the Attempt Status Mapping of `SubmittedForSettlement` and `SettlementPending` to `Charged`
### 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/7472
## 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. Create Payment (AutoCapture)**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ekPGg1GI2tBzBI98TAEWKy1FHsIxlwJVA7L9mNtIZPs3UpODWkCzDpUDE2dFM46T' \
--data-raw '{
"amount": 2500,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 2500,
"customer_id": "abcdef",
"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",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5200000000001096",
"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": "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",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
-Response
```
{
"payment_id": "pay_hYJdApy6q8OT0GtFPABl",
"merchant_id": "postman_merchant_GHAction_e5df8f0f-fb19-466e-9a99-d823823a6903",
"status": "requires_customer_action",
"amount": 2500,
"net_amount": 2500,
"shipping_cost": null,
"amount_capturable": 2500,
"amount_received": null,
"connector": "braintree",
"client_secret": "pay_hYJdApy6q8OT0GtFPABl_secret_A7ufMzE2HZOSeygaSOmD",
"created": "2025-03-10T11:51:31.336Z",
"currency": "USD",
"customer_id": "abcdef",
"customer": {
"id": "abcdef",
"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": "1096",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"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"
},
"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": "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_hYJdApy6q8OT0GtFPABl/postman_merchant_GHAction_e5df8f0f-fb19-466e-9a99-d823823a6903/pay_hYJdApy6q8OT0GtFPABl_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": "abcdef",
"created_at": 1741607491,
"expires": 1741611091,
"secret": "epk_fb5c83ed19434ae4bae82b3467ce3dab"
},
"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_7Gok9MiuK8INR4GaonVo",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_BmvFPXpGhBGtxOKNQ9CY",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-10T12:06:31.336Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-10T11:51:33.825Z",
"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"
}
```
**2. PSync**
-Request
```
curl --location 'http://localhost:8080/payments/pay_hYJdApy6q8OT0GtFPABl' \
--header 'Accept: application/json' \
--header 'api-key: dev_ekPGg1GI2tBzBI98TAEWKy1FHsIxlwJVA7L9mNtIZPs3UpODWkCzDpUDE2dFM46T'
```
-Response
```
{
"payment_id": "pay_hYJdApy6q8OT0GtFPABl",
"merchant_id": "postman_merchant_GHAction_e5df8f0f-fb19-466e-9a99-d823823a6903",
"status": "succeeded",
"amount": 2500,
"net_amount": 2500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 2500,
"connector": "braintree",
"client_secret": "pay_hYJdApy6q8OT0GtFPABl_secret_A7ufMzE2HZOSeygaSOmD",
"created": "2025-03-10T11:51:31.336Z",
"currency": "USD",
"customer_id": "abcdef",
"customer": {
"id": "abcdef",
"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": "1096",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"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"
},
"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": "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": "dHJhbnNhY3Rpb25fcHBzZHQ5dmQ",
"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_7Gok9MiuK8INR4GaonVo",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_BmvFPXpGhBGtxOKNQ9CY",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-10T12:06:31.336Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-10T11:51:59.696Z",
"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"
}
```
**3. CIT**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ekPGg1GI2tBzBI98TAEWKy1FHsIxlwJVA7L9mNtIZPs3UpODWkCzDpUDE2dFM46T' \
--data-raw '{
"amount": 1650,
"currency": "USD",
"confirm": true,
"customer_id": "customer123",
"setup_future_usage": "off_session",
"authentication_type": "three_ds",
"payment_method_type": "debit",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "5200000000001096",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"billing": {
"address": {
"first_name": "joseph",
"last_name": "Doe"
}
},
"email": "something@example.com",
"customer_acceptance": {
"acceptance_type": "offline"
}
}'
```
-Response
```
{
"payment_id": "pay_KBOPJsZlEw535w5l73M0",
"merchant_id": "postman_merchant_GHAction_e5df8f0f-fb19-466e-9a99-d823823a6903",
"status": "requires_customer_action",
"amount": 1650,
"net_amount": 1650,
"shipping_cost": null,
"amount_capturable": 1650,
"amount_received": null,
"connector": "braintree",
"client_secret": "pay_KBOPJsZlEw535w5l73M0_secret_DqOaltGsxi41h0T3sYKA",
"created": "2025-03-10T11:52:33.914Z",
"currency": "USD",
"customer_id": "customer123",
"customer": {
"id": "customer123",
"name": null,
"email": "something@example.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1096",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"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": null,
"billing": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"line3": null,
"zip": null,
"state": null,
"first_name": "joseph",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "something@example.com",
"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_KBOPJsZlEw535w5l73M0/postman_merchant_GHAction_e5df8f0f-fb19-466e-9a99-d823823a6903/pay_KBOPJsZlEw535w5l73M0_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "customer123",
"created_at": 1741607553,
"expires": 1741611153,
"secret": "epk_c9d3479f0d864de1bffdd770239b4990"
},
"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_7Gok9MiuK8INR4GaonVo",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_BmvFPXpGhBGtxOKNQ9CY",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-10T12:07:33.913Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_cvaZra9OH2u9zLswzrYb",
"payment_method_status": "inactive",
"updated": "2025-03-10T11:52:35.087Z",
"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"
}
```
**4. MIT**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ekPGg1GI2tBzBI98TAEWKy1FHsIxlwJVA7L9mNtIZPs3UpODWkCzDpUDE2dFM46T' \
--data '{
"amount": 179,
"currency": "USD",
"confirm": true,
"customer_id": "customer123",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_cvaZra9OH2u9zLswzrYb"
},
"off_session": true
}'
```
-Response
```
{
"payment_id": "pay_Guzu7VLXJ56WRrco8Mgd",
"merchant_id": "postman_merchant_GHAction_e5df8f0f-fb19-466e-9a99-d823823a6903",
"status": "succeeded",
"amount": 179,
"net_amount": 179,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 179,
"connector": "braintree",
"client_secret": "pay_Guzu7VLXJ56WRrco8Mgd_secret_YpCWnGkbFS3K7xXsAK6Z",
"created": "2025-03-10T11:53:18.080Z",
"currency": "USD",
"customer_id": "customer123",
"customer": {
"id": "customer123",
"name": null,
"email": "something@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": true,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1096",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"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": null,
"billing": null,
"order_details": null,
"email": "something@example.com",
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "customer123",
"created_at": 1741607598,
"expires": 1741611198,
"secret": "epk_9f5c5a0dd8bd473b873df611b6c0e184"
},
"manual_retry_allowed": false,
"connector_transaction_id": "dHJhbnNhY3Rpb25fMnNncWhjbmE",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_7Gok9MiuK8INR4GaonVo",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_BmvFPXpGhBGtxOKNQ9CY",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-10T12:08:18.080Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_cvaZra9OH2u9zLswzrYb",
"payment_method_status": "active",
"updated": "2025-03-10T11:53:18.925Z",
"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": "cGF5bWVudG1ldGhvZF9jY19idGY1dGFzcg",
"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. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs`
**Detailed Identifier Changes:**
Commit 69d8f351:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs**
Modify existing code
|
{"pr_number": 7471, "pr_title": "fix(connector): [BRAINTREE] Changed Attempt Status Mapping for Braintree", "merged_at": "2025-03-11T11:23:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): Add Globalpay connector test in cypress
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Enhanced Globalpay Connector in cypress for Comprehensive Testing.
## How did you test it?
**Globalpay**
<img width="545" alt="globalpay" src="https://github.com/user-attachments/assets/ccbae99d-bf75-4498-a08a-0deae5976fdb" />
Note: 1. 3ds payments silently falling back to no-3ds(Should throw validation)
2. All MIT payments are failing with error("Payment methods is not implemented") but in feature matrix globalpay supports mandates
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `cypress-tests/cypress/fixtures/create-connector-body.json`
**2. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Globalpay.js`
- `cypress-tests/cypress/e2e/configs/Payment/Utils.js`
**Code Patterns Applied:**
- Extend existing types with new fields (568 changes)
|
{"pr_number": 8403, "pr_title": "ci(cypress): Add Globalpay connector test in cypress", "merged_at": "2025-06-24T14:54:39Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"connectors": ["cypress-tests/cypress/fixtures/create-connector-body.json"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Globalpay.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js"]}, "change_types": {"fields_added": 568}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
revert(routing): update configs on updation of mca
Reverts juspay/hyperswitch#9689
|
To implement this **unknown** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/routing.rs`
- `crates/router/src/core/routing/helpers.rs`
**Code Patterns Applied:**
**Detailed Identifier Changes:**
Commit 1b204b1d:
Files to modify:
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/routing.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Remove:
- function: pub::redact_cgraph_cache
- function: pub::redact_routing_cache
- function: pub::update_default_fallback_on_mca_update
|
{"pr_number": 9740, "pr_title": "revert(routing): update configs on updation of mca", "merged_at": "2025-10-08T08:46:29Z", "intent": {"feature_type": "unknown", "action": "unknown", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/routing.rs", "crates/router/src/core/routing/helpers.rs"]}, "change_types": {"imports_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Implement Razorpay UPI Collect
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
- Integrate Razorpay's API directly
- Payment Method - UPI Collect
- Added a new flow create order
- Added connector_request_reference_id in payment_attempt
### 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?
Using v2 API
1. Create Organisation
2. Create Merchant Account
3. Create Business Profile
4. Create API KEY
5. Create Razorpay Connector
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_LfNJ6bMzJarkrh2kCGbu' \
--header 'x-profile-id: pro_Y7riw0Lyz8GF7ZV778Pj' \
--header 'Authorization: admin-api-key=test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "razorpay",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "_",
"key1": "_"
},
"disabled": false,
"payment_methods_enabled": [
{
"payment_method_type": "upi",
"payment_method_subtypes": [
{
"payment_method_subtype": "upi_collect",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": {
"type" : "enable_only",
"list": ["INR"]
},
"accepted_countries": {
"type" : "enable_only",
"list": ["IN"]
},
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"city": "NY",
"unit": "245"
},
"profile_id": "pro_Y7riw0Lyz8GF7ZV778Pj"
}'
```
6. Create UPI collect Payment
```
curl --location 'http://localhost:8080/v2/payments' \
--header 'api-key: _' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_Y7riw0Lyz8GF7ZV778Pj' \
--header 'Authorization: api-key=_' \
--data-raw '{
"amount_details": {
"order_amount": 100,
"currency": "INR"
},
"capture_method":"automatic",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method_data": {
"upi": {
"upi_collect": {
"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"
}
},
"payment_method_subtype": "upi_collect",
"payment_method_type": "upi"
}'
```
Response
```{
"id": "12345_pay_0197345f8a97773399963e3616993a6d",
"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": 0,
"amount_captured": null
},
"customer_id": null,
"connector": "razorpay",
"created": "2025-06-03T05:59:26.106Z",
"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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "swangi.kumari@juspay.in"
}
},
"payment_method_type": "upi",
"payment_method_subtype": "upi_collect",
"connector_transaction_id": "pay_QccH6k6FydAlRu",
"connector_reference_id": null,
"merchant_connector_id": "mca_KPn3O1yDpcEjAQuGkKyY",
"browser_info": null,
"error": null,
"shipping": null,
"billing": null,
"attempts": null,
"connector_token_details": null,
"payment_method_id": null,
"next_action": {
"type": "wait_screen_information",
"display_from_timestamp": 1748930369789539000,
"display_to_timestamp": 1748930669789539000,
"poll_config": {
"delay_in_secs": 5,
"frequency": 5
}
},
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"authentication_type_applied": "no_three_ds",
"is_iframe_redirection_enabled": null
}
```
7. Psync
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0197345f8a97773399963e3616993a6d?force_sync=true' \
--header 'x-profile-id: pro_Y7riw0Lyz8GF7ZV778Pj' \
--header 'Authorization: api-key=_' \
--data ''
```
Response
```
{
"id": "12345_pay_019734579f437140a230d7387ea89411",
"status": "succeeded",
"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": 0,
"amount_captured": 100
},
"customer_id": "12345_cus_0197345793f67342a629d92ff75da55f",
"connector": "razorpay",
"created": "2025-06-03T05:50:47.108Z",
"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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "swangi.kumari@juspay.in"
}
},
"payment_method_type": "upi",
"payment_method_subtype": "upi_collect",
"connector_transaction_id": "pay_Qcc7y4GnfJNdkS",
"connector_reference_id": null,
"merchant_connector_id": "mca_KPn3O1yDpcEjAQuGkKyY",
"browser_info": null,
"error": null,
"shipping": null,
"billing": null,
"attempts": null,
"connector_token_details": null,
"payment_method_id": null,
"next_action": null,
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"authentication_type_applied": null,
"is_iframe_redirection_enabled": null
}
```
8. Create a Refund
```
curl --location 'http://localhost:8080/v2/refunds' \
--header 'x-profile-id: pro_Y7riw0Lyz8GF7ZV778Pj' \
--header 'Authorization: api-key=_' \
--header 'Content-Type: application/json' \
--header 'api-key: _' \
--data '{
"payment_id": "12345_pay_0197346a13577d61a3a4e95699d565c1",
"merchant_reference_id": "customer_1748931028",
"amount": 100,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
Response
```
{
"id": "12345_ref_0197346a6f2f7093a446ec2609b2d58e",
"payment_id": "12345_pay_0197346a13577d61a3a4e95699d565c1",
"merchant_reference_id": "customer_1748931028",
"amount": 100,
"currency": "INR",
"status": "pending",
"reason": "Customer returned product",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-06-03T06:11:20.007Z",
"updated_at": "2025-06-03T06:11:22.283Z",
"connector": "razorpay",
"profile_id": "pro_Y7riw0Lyz8GF7ZV778Pj",
"merchant_connector_id": "mca_KPn3O1yDpcEjAQuGkKyY",
"connector_refund_reference_id": null
}
```
9. Refund Sync
```
curl --location 'http://localhost:8080/v2/refunds/12345_ref_0197346a6f2f7093a446ec2609b2d58e' \
--header 'Authorization: api-key=_' \
--header 'X-Profile-Id: pro_Y7riw0Lyz8GF7ZV778Pj' \
--header 'api-key: _'
```
Response
```
{
"id": "12345_ref_0197346a6f2f7093a446ec2609b2d58e",
"payment_id": "12345_pay_0197346a13577d61a3a4e95699d565c1",
"merchant_reference_id": "customer_1748931028",
"amount": 100,
"currency": "INR",
"status": "succeeded",
"reason": "Customer returned product",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-06-03T06:11:20.007Z",
"updated_at": "2025-06-03T06:13:40.875Z",
"connector": "razorpay",
"profile_id": "pro_Y7riw0Lyz8GF7ZV778Pj",
"merchant_connector_id": "mca_KPn3O1yDpcEjAQuGkKyY",
"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. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/router_data.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types/payments.rs`
- ... and 3 more files
**4. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/flows.rs`
- `crates/router/src/core/payments/flows/authorize_flow.rs`
- ... and 4 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/razorpay.rs`
- ... and 11 more files
**6. Type Definitions**
- `crates/hyperswitch_interfaces/src/types.rs`
- `crates/router/src/compatibility/stripe/payment_intents/types.rs`
- `crates/router/src/compatibility/stripe/setup_intents/types.rs`
- ... and 2 more files
**7. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**8. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 3 more files
**9. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/hyperswitch_interfaces/src/api.rs`
- ... and 4 more files
**Code Patterns Applied:**
- Define new data structures (18 changes)
- Implement new functions (36 changes)
- Extend existing types with new fields (200 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit ee7bce0f:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::PollConfig
**crates/common_enums/src/connector_enums.rs**
Add:
- function: pub::requires_order_creation_before_payment
**crates/diesel_models/src/payment_attempt.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/razorpay.rs**
Remove:
- function: private::get_request_body
- function: private::get_webhook_object_from_body
Add:
- function: private::get_auth_header
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- impl: impl api::PaymentsCreateOrder for Razorpay
- impl: impl ConnectorIntegration<CreateOrder, CreateOrderRequestData, PaymentsResponseData> for Razorpay
**crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs**
Remove:
- struct: pub::RazorpayPaymentsRequest
- struct: pub::SecondFactor
- struct: pub::MerchantAccount
- struct: pub::OrderReference
- struct: pub::TxnDetail
- struct: pub::TxnCardInfo
- struct: pub::MerchantGatewayAccount
- struct: pub::TransactionCreateReq
- enum: pub::SecondFactorType
- enum: pub::SecondFactorStatus
- enum: pub::OrderType
- enum: pub::MandateFeature
- enum: pub::OrderStatus
- enum: pub::TxnType
- enum: pub::TxnMode
Add:
- struct: pub::RazorpayOrderRequest
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Add:
- impl: impl PaymentCreateOrderV2 for $connector
- impl: impl ConnectorIntegrationV2<CreateOrder, PaymentFlowData, CreateOrderRequestData, PaymentsResponseData> for $connector
**crates/hyperswitch_connectors/src/types.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_optional_user_agent
- function: private::get_order_id
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_flow_types/payments.rs**
Add:
- struct: pub::CreateOrder
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Add:
- function: private::try_from
- struct: pub::CreateOrderRequestData
- impl: impl TryFrom<PaymentsAuthorizeData> for CreateOrderRequestData
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api.rs**
Add:
- function: private::generate_connector_request_reference_id
**crates/hyperswitch_interfaces/src/api/payments.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/payments_v2.rs**
Add:
- trait: pub::PaymentCreateOrderV2
**crates/hyperswitch_interfaces/src/connector_integration_interface.rs**
Add:
- function: private::generate_connector_request_reference_id
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/payment_methods/src/configs/payment_connector_required_fields.rs**
Modify existing code
**crates/router/src/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**
Add:
- function: private::set_connector_request_reference_id
- function: private::set_connector_request_reference_id
- function: private::set_connector_request_reference_id
- function: private::set_connector_request_reference_id
**crates/router/src/core/payments/flows.rs**
Add:
- function: private::create_order_at_connector
- impl: impl api::PaymentsCreateOrder for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
api::CreateOrder,
types::CreateOrderRequestData,
types::PaymentsResponseData,
> for connector::DummyConnector<T>
**crates/router/src/core/payments/flows/authorize_flow.rs**
Add:
- function: private::create_order_at_connector
- function: private::create_order_at_connector
- function: private::update_router_data_with_create_order_result
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Add:
- function: private::populate_payment_data
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/proxy_payments_intent.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/types.rs**
Add:
- struct: pub::CreateOrderResult
**crates/router/src/types/api/payments.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
|
{"pr_number": 8009, "pr_title": "feat(connector): Implement Razorpay UPI Collect", "merged_at": "2025-06-11T14:05:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_flow_types/payments.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs", "crates/hyperswitch_domain_models/src/types.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/flows.rs", "crates/router/src/core/payments/flows/authorize_flow.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/proxy_payments_intent.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/razorpay.rs", "crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/hyperswitch_connectors/src/types.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/hyperswitch_interfaces/src/connector_integration_interface.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/utils.rs", "v2_migrations/2025-05-30-103514_add_connector_request_reference_id_in_payment_attempt/down.sql", "v2_migrations/2025-05-30-103514_add_connector_request_reference_id_in_payment_attempt/up.sql"], "types": ["crates/hyperswitch_interfaces/src/types.rs", "crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs", "crates/router/src/types.rs", "crates/router/src/types/api/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", "config/payment_required_fields_v2.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/hyperswitch_interfaces/src/api.rs", "crates/hyperswitch_interfaces/src/api/payments.rs", "crates/hyperswitch_interfaces/src/api/payments_v2.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 18, "functions_added": 36, "enums_added": 5, "fields_added": 200, "imports_added": 9, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(authentication): create authentications to fallback to ApiKeyAuth if AdminApiAuth fails
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR introduces two new authentication mechanisms that enhance the existing `AdminApiAuth` and `AdminApiAuthWithMerchantIdFromRoute` by allowing fallback to regular API key-based authentication when the admin key check fails.
### 1. `AdminApiAuthWithApiKeyFallback`
- Used in routes where **no merchant context** is required.
- Authenticates using:
1. `admin_api_key`
2. If that fails, falls back to:
- Validating the provided `api-key`
- Ensuring its associated `merchant_id` matches the configured `fallback_merchant_id` from the merchant_ids set.
### 2. `AdminApiAuthWithApiKeyFallbackWithMerchant`
- Used in routes that require **full merchant context** (`AuthenticationData`)
- Authenticates using:
1. `admin_api_key` — on success, loads `AuthenticationData`
2. If that fails:
- Validates the provided `api-key`
- Ensures:
- The `merchant_id` from `api-key` also matches the configured `fallback_merchant_id` from the merchant_ids set.
- If all conditions pass, loads and returns `AuthenticationData`
### 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).
-->
Some internal routes currently rely on `AdminApiAuth` using a shared `admin_api_key`. However, there are scenarios where we want to allow scoped access using an `api-key` associated with a specific merchant — **only if it matches a configured fallback merchant** from the merchant_ids set.
## 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)?
-->
The following APIs need to be validated with
- AdminAPIKey
- the API Key associated with the configured merchant_id in the ENVs.
Tested by setting the ENV through
```bash
ROUTER__FALLBACK_MERCHANT_IDS_API_KEY_AUTH__MERCHANT_IDS="merchant_1744036688, merchant_1744037289" cargo run
```
And also tested by specifying the values in the TOML file.
#### Merchant Account - Create
```bash
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_PY3zf8m1f0HjtqxO7QS36ZRSGMP5u9IWsmDki4fwq5iY0W8e6RoF4WMwCLvlojJM' \
--data-raw '{
"merchant_id": "merchant_1744040286",
"locker_id": "m0010",
"merchant_name": "Nike",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name":"john",
"last_name":"Doe"
}
},
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url":"https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"parent_merchant_id":"merchant_123",
"metadata": {
"city": "NY",
"unit": "245"
},
"primary_business_details": [
{
"country": "US",
"business": "default"
}
],
"organization_id": "org_aDQVlxlUjkkgfFO9rlwr"
}'
```
#### Merchant Account - Retrieve
```bash
curl --location 'http://localhost:8080/accounts/merchant_1744037289' \
--header 'Accept: application/json' \
--header 'api-key: dev_PY3zf8m1f0HjtqxO7QS36ZRSGMP5u9IWsmDki4fwq5iY0W8e6RoF4WMwCLvlojJM'
```
#### Merchant Account - Update
```bash
curl --location 'http://localhost:8080/accounts/merchant_1744037289' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_PY3zf8m1f0HjtqxO7QS36ZRSGMP5u9IWsmDki4fwq5iY0W8e6RoF4WMwCLvlojJM' \
--data-raw '{
"merchant_id": "merchant_1744037289",
"locker_id": "m0010",
"merchant_name": "Nike New",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name":"john",
"last_name":"Doe"
}
},
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url":"https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"parent_merchant_id":"merchant_123",
"metadata": {
"city": "NY",
"unit": "245"
},
"primary_business_details": [
{
"country": "US",
"business": "default"
}
]
}'
```
#### API Key - Create
```bash
curl --location 'http://localhost:8080/api_keys/merchant_1744037289' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"name": "API Key 1",
"description": null,
"expiration": "2038-01-19T03:14:08.000Z"
}'
```
#### API Key - Retrieve
```bash
curl --location 'http://localhost:8080/api_keys/merchant_1744037289/dev_Uyyi5bbsKgcsvwgtC4EJ' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin'
```
#### API Key - Update
```bash
curl --location 'http://localhost:8080/api_keys/merchant_1744037289/dev_Uyyi5bbsKgcsvwgtC4EJ' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"name": "Test API Key",
"description": "My very awesome API key",
"expiration": null
}'
```
#### API Key - List
```bash
curl --location 'http://localhost:8080/api_keys/merchant_1744036688/list' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin'
```
#### Merchant Account - List
## 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/src/configs/secrets_transformers.rs`
- `crates/router/src/configs/settings.rs`
**2. Other**
- `crates/router/src/routes/admin.rs`
- `crates/router/src/routes/api_keys.rs`
- `crates/router/src/services/authentication.rs`
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (5 changes)
- Extend existing types with new fields (25 changes)
- Add conditional logic for feature flags or filtering (9 changes)
**Detailed Identifier Changes:**
Commit d6c26c5d:
Files to modify:
**crates/router/src/configs/secrets_transformers.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Add:
- function: private::deserialize_merchant_ids_inner
- function: private::deserialize_merchant_ids
- struct: pub::FallbackMerchantIds
**crates/router/src/routes/admin.rs**
Modify existing code
**crates/router/src/routes/api_keys.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Add:
- function: private::authenticate_and_fetch
- function: private::fetch_merchant_key_store_and_account
- function: private::authenticate_and_fetch
- struct: pub::AdminApiAuthWithApiKeyFallback
- struct: pub::AdminApiAuthWithApiKeyFallbackAndMerchantIdFromRoute
- impl: impl AuthenticateAndFetch<(), A> for AdminApiAuthWithApiKeyFallback
- impl: impl AdminApiAuthWithApiKeyFallbackAndMerchantIdFromRoute
- impl: impl AuthenticateAndFetch<AuthenticationData, A> for AdminApiAuthWithApiKeyFallbackAndMerchantIdFromRoute
|
{"pr_number": 7744, "pr_title": "feat(authentication): create authentications to fallback to ApiKeyAuth if AdminApiAuth fails", "merged_at": "2025-04-08T07:49:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"config": ["crates/router/src/configs/secrets_transformers.rs", "crates/router/src/configs/settings.rs"], "other": ["crates/router/src/routes/admin.rs", "crates/router/src/routes/api_keys.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"structs_added": 3, "functions_added": 5, "fields_added": 25, "conditionals_added": 9}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connector): [AdyenPlatform] update incoming webhooks for payouts
## 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 updates the webhooks for Adyen's BalancePlatform for payouts.
Main changes -
For status `booked` from Adyen, map it to
`success` for cards
`processing` for banks - reason being status `credited` is received from Adyen for successful credits.
Check the relevant issue for more details.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Enhances payout webhooks for Adyen's BalancePlatform.
## How did you test it?
<details>
<summary>1. Create a successful card payout</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_3ItwbKI2nwx45BPimAEaYP7QwnwKuC5a5GsG0aaow5wWefb62tXAcldZUrntn0jd' \
--data '{"amount":100,"currency":"EUR","profile_id":"pro_S5yvh1TfnZi2Gjv7uSUQ","customer_id":"cus_2bXx7dm7bRTOLOMlBAQi","connector":["adyenplatform"],"description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111111111111111","expiry_month":"03","expiry_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","city":"San Fransico","country":"FR","first_name":"John","last_name":"Doe"}},"recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}'
Response
{"payout_id":"payout_5nv2qm3avmPmQTbvFBZg","merchant_id":"merchant_1755690193","merchant_order_reference_id":null,"amount":100,"currency":"EUR","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":null,"card_network":null,"card_type":null,"card_issuing_country":null,"bank_code":null,"last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"city":"San Fransico","country":"FR","line1":"1467","line2":"Harrison Street","line3":null,"zip":null,"state":null,"first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":null},"auto_fulfill":true,"customer_id":"cus_2bXx7dm7bRTOLOMlBAQi","customer":{"id":"cus_2bXx7dm7bRTOLOMlBAQi","name":"John Nether","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_5nv2qm3avmPmQTbvFBZg_secret_j2B52JTji1yRrEOtd6FI","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_NsHlFe2GsWvK9CdftrLt","status":"initiated","error_message":null,"error_code":null,"profile_id":"pro_S5yvh1TfnZi2Gjv7uSUQ","created":"2025-08-20T11:49:11.757Z","connector_transaction_id":"38EBIY681J48U2JS","priority":null,"payout_link":null,"email":null,"name":"John Nether","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_ywYBGKd0jKSUhIFyNho9"}
Wait for incoming webhook
Check for outgoing webhooks
Initiated
<img width="1726" height="906" alt="Screenshot 2025-08-20 at 5 21 04 PM" src="https://github.com/user-attachments/assets/74cc3db1-2338-4a31-8045-b5c54e156cfe" />
Successful
<img width="1726" height="891" alt="Screenshot 2025-08-20 at 5 21 12 PM" src="https://github.com/user-attachments/assets/ae8fd898-a3f8-4f78-adcf-12d6ddb4c8f8" />
</details>
<details>
<summary>2. Create a successful SEPA payout</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Accept-Language: fr' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_3ItwbKI2nwx45BPimAEaYP7QwnwKuC5a5GsG0aaow5wWefb62tXAcldZUrntn0jd' \
--data '{"amount":1,"currency":"EUR","customer_id":"cus_2bXx7dm7bRTOLOMlBAQi","description":"Its my first payout request","payout_type":"bank","priority":"regular","payout_method_data":{"bank":{"iban":"NL57INGB4654188101"}},"connector":["adyenplatform"],"billing":{"address":{"line1":"Raadhuisplein","line2":"92","city":"Hoogeveen","country":"NL","first_name":"John"}},"entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true,"profile_id":"pro_S5yvh1TfnZi2Gjv7uSUQ"}'
Response
{"payout_id":"payout_FywtoqrSxKtwDDsbCvGa","merchant_id":"merchant_1755690193","merchant_order_reference_id":null,"amount":1,"currency":"EUR","connector":"adyenplatform","payout_type":"bank","payout_method_data":{"bank":{"iban":"NL57I********88101","bank_name":null,"bank_country_code":null,"bank_city":null,"bic":null}},"billing":{"address":{"city":"Hoogeveen","country":"NL","line1":"Raadhuisplein","line2":"92","line3":null,"zip":null,"state":null,"first_name":"John","last_name":null,"origin_zip":null},"phone":null,"email":null},"auto_fulfill":true,"customer_id":"cus_2bXx7dm7bRTOLOMlBAQi","customer":{"id":"cus_2bXx7dm7bRTOLOMlBAQi","name":"John Nether","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_FywtoqrSxKtwDDsbCvGa_secret_fC2TqhM2tucPGuzvQcDr","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_NsHlFe2GsWvK9CdftrLt","status":"initiated","error_message":null,"error_code":null,"profile_id":"pro_S5yvh1TfnZi2Gjv7uSUQ","created":"2025-08-20T11:51:48.487Z","connector_transaction_id":"38EBH1681J56C4WZ","priority":"regular","payout_link":null,"email":null,"name":"John Nether","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_Vc6t4FK6HmbM2TUXsaBs"}
Wait for incoming webhook
Check for outgoing webhooks
Initiated
<img width="1728" height="898" alt="Screenshot 2025-08-20 at 5 22 39 PM" src="https://github.com/user-attachments/assets/a435370c-7954-4d02-8dc3-09b7bd242349" />
Successful
<img width="1728" height="892" alt="Screenshot 2025-08-20 at 5 22 46 PM" src="https://github.com/user-attachments/assets/5b17c1e3-2990-4b9b-9b42-4685a7271a97" />
</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.rs`
- `crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit 0269edf4:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/adyenplatform.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs**
Modify existing code
|
{"pr_number": 9002, "pr_title": "refactor(connector): [AdyenPlatform] update incoming webhooks for payouts", "merged_at": "2025-08-21T14:18:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "merchant", "user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/adyenplatform.rs", "crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat: implement scylla traits for StrongSecret
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] New feature
## Description
<!-- Describe your changes in detail -->
This adds `SerializeValue` and `FromCQL` traits for masking StrongSecret
## 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 is needed for Cassandra ORM to work
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
** THIS CANNOT BE TESTED ON ENVIRONEMTS **
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
|
To implement this **connector_integration** feature, you'll need to modify these architectural layers:
**1. Configuration Files**
- `crates/masking/Cargo.toml`
**2. Other**
- `Cargo.lock`
- `crates/masking/src/cassandra.rs`
- `crates/masking/src/lib.rs`
**Code Patterns Applied:**
- Implement new functions (4 changes)
- Extend existing types with new fields (7 changes)
**Detailed Identifier Changes:**
Commit 7d73e909:
Files to modify:
**crates/masking/src/cassandra.rs**
Add:
- function: private::serialize
- function: private::type_check
- function: private::deserialize
- function: private::from_cql
- impl: impl SerializeValue for StrongSecret<T>
- impl: impl DeserializeValue<'frame> for StrongSecret<T>
- impl: impl FromCqlVal<CqlValue> for StrongSecret<T>
**crates/masking/src/lib.rs**
Add:
- mod: private::cassandra
|
{"pr_number": 6500, "pr_title": "feat: implement scylla traits for StrongSecret", "merged_at": "2024-11-14T09:25:29Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": []}, "hierarchy": {"config": ["crates/masking/Cargo.toml"], "other": ["Cargo.lock", "crates/masking/src/cassandra.rs", "crates/masking/src/lib.rs"]}, "change_types": {"functions_added": 4, "fields_added": 7, "imports_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add confirm flag in kafka payment intent events
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
add confirm flag in kafka payment intent events
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested Manually
confirm flag sent as true in payment intent event in kafka

consolidated event

## 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/payments/payment_intent.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/operations/payment_confirm.rs`
- `crates/router/src/core/payments/operations/payment_update.rs`
**3. Type Definitions**
- `crates/common_utils/src/types/keymanager.rs`
**4. Other**
- `crates/router/src/db/kafka_store.rs`
**Code Patterns Applied:**
- Implement new functions (3 changes)
- Extend existing types with new fields (4 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit bc767b91:
Files to modify:
**crates/common_utils/src/types/keymanager.rs**
Add:
- function: pub::add_confirm_value_in_infra_values
- impl: impl KeyManagerState
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Add:
- function: pub::is_confirm_operation
- function: pub::is_confirm_operation
- impl: impl PaymentIntentUpdate
- impl: impl PaymentIntentUpdate
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
|
{"pr_number": 8432, "pr_title": "feat(router): add confirm flag in kafka payment intent events", "merged_at": "2025-06-24T09:09:14Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/payments/payment_intent.rs"], "core_business": ["crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_update.rs"], "types": ["crates/common_utils/src/types/keymanager.rs"], "other": ["crates/router/src/db/kafka_store.rs"]}, "change_types": {"functions_added": 3, "fields_added": 4, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(analytics): Add refund sessionized metrics for Analytics V2 dashboard
## 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 -->
Adding metrics, and support for Refund Page in Analytics V2 Dashboard through sessionizer.
The metrics added are as follows:
- **Static Metrics in overview section:**
- Refund Success Rate
- Total Refunds Processed (Amount)
- Successful Refunds
- Failed Refunds
- Pending Refunds
- **Series Graphs:**
- Refunds Processed (Amount and Count) (With granularity)
- Refunds Success Rate (With granularity)
- **Distributions:**
- Successful Refunds by connector
- Failed Refunds by connector
- **Tables**
- Refund Reasons
- Failed Refund Error Message
- Failed Refund Error Reasons
This PR also adds support for refunds distribution, similar to payments distribution, which may be needed in the future for more advanced analytics.
The following distributions are added:
- Refund Reasons
- Refund Error Message
### 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).
-->
Provide more insights into Refunds data for the merchants to make important business decisions
## 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)?
-->
Refunds Success Rate:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjc5Mjk0OCwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.Q5ruAj8DwAp5XDj1ktFhma4aZXAHSZBmRSw_EnPk4HE' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"source": "BATCH",
"metrics": [
"sessionized_refund_success_rate"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": 6,
"total_refunds": 10,
"refund_success_rate": 60.0,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": null,
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": 60.0,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested:
- queryData:
```json
"successful_refunds": 6,
"total_refunds": 10,
"refund_success_rate": 60.0,
```
- metaData:
```json
"total_refund_success_rate": 60.0,
```
Total Refunds Processed (Amount)
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjc5Mjk0OCwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.Q5ruAj8DwAp5XDj1ktFhma4aZXAHSZBmRSw_EnPk4HE' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"source": "BATCH",
"metrics": [
"sessionized_refund_processed_amount"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 1800,
"refund_processed_amount_in_usd": 21,
"refund_processed_count": 3,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": "INR",
"refund_status": null,
"connector": null,
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 1800,
"refund_processed_amount_in_usd": 1800,
"refund_processed_count": 3,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": "USD",
"refund_status": null,
"connector": null,
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 3600,
"total_refund_processed_amount_in_usd": 1821,
"total_refund_processed_count": 6,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested:
- queryData:
```json
"refund_processed_amount": 1800,
"refund_processed_amount_in_usd": 21,
"refund_processed_count": 3,
```
- metaData:
```json
"total_refund_processed_amount": 3600,
"total_refund_processed_amount_in_usd": 1821,
"total_refund_processed_count": 6,
```
Successful Refunds:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjc5Mjk0OCwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.Q5ruAj8DwAp5XDj1ktFhma4aZXAHSZBmRSw_EnPk4HE' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"filters": {
"refund_status": [
"success"
]
},
"source": "BATCH",
"metrics": [
"sessionized_refund_count"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": 6,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": null,
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested:
- queryData:
```json
"refund_count": 6,
```
Failed Refunds
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjc5Mjk0OCwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.Q5ruAj8DwAp5XDj1ktFhma4aZXAHSZBmRSw_EnPk4HE' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"filters": {
"refund_status": [
"failure"
]
},
"source": "BATCH",
"metrics": [
"sessionized_refund_count"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": 4,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": null,
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested:
- queryData:
```json
"refund_count": 4,
```
Pending Refunds
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjc5Mjk0OCwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.Q5ruAj8DwAp5XDj1ktFhma4aZXAHSZBmRSw_EnPk4HE' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"filters": {
"refund_status": [
"pending"
]
},
"source": "BATCH",
"metrics": [
"sessionized_refund_count"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": 0,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": null,
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested:
- queryData:
```json
"refund_count": 0,
```
Refund Success Rate series graph is similar to Refund Success Rate above, granularity will be added.
Refund Processed Amount and Count series graph is similar to the one above, granularity will be added.
Successful Refunds Distribution by connector:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjk3MjQxOSwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.eWEvxPl_3-C8tv5_uDfyqV8B8DDUeTK4yn-IHnIQvwY' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"groupByNames": [
"connector"
],
"source": "BATCH",
"metrics": [
"sessionized_refund_count",
"sessionized_refund_success_count"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": 7,
"refund_success_count": 6,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "stripe_test",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": 3,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested and taken into account:
- queryData:
```json
"refund_count": 7,
"refund_success_count": 6,
"connector": "stripe_test",
```
Failed Refunds Distribution by connector:
- This will have multiple API calls from FE, and data would be calculated at FE only.
- First Request:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjk3MjQxOSwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.eWEvxPl_3-C8tv5_uDfyqV8B8DDUeTK4yn-IHnIQvwY' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"groupByNames": [
"connector"
],
"source": "BATCH",
"metrics": [
"sessionized_refund_count"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": 7,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "stripe_test",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": 3,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested and taken into account:
- queryData:
```json
"refund_count": 7,
"connector": "stripe_test",
```
- Second Request:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjk3MjQxOSwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.eWEvxPl_3-C8tv5_uDfyqV8B8DDUeTK4yn-IHnIQvwY' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"filters": {
"refund_status": [
"failure"
]
},
"groupByNames": [
"connector"
],
"source": "BATCH",
"metrics": [
"sessionized_refund_count"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": 3,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": 1,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "stripe_test",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested and taken into account:
- queryData:
```json
"refund_count": 1,
"connector": "stripe_test",
```
From the two API calls, failed refunds and total refunds can be calculated for every connector, and the failed refunds distribution can be plotted and displayed.
Refund Reasons:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjk3MjQxOSwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.eWEvxPl_3-C8tv5_uDfyqV8B8DDUeTK4yn-IHnIQvwY' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"groupByNames": [
"connector", "refund_reason"
],
"source": "BATCH",
"metrics": [
"sessionized_refund_reason"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 1,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "stripe_test",
"refund_type": null,
"profile_id": null,
"refund_reason": "Test REFUND - 1",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 6,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "stripe_test",
"refund_type": null,
"profile_id": null,
"refund_reason": "Customer returned product",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 1,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": "Test Refund - 3",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 2,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": "Test Refund - 2",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 10,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested:
- queryData:
```json
"refund_reason_count": 1,
"refund_reason": "Test Refund - 3",
"connector": "stripe_test",
```
- metaData:
```json
"total_refund_reason_count": 10,
```
Failed Refund Reasons:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjk3MjQxOSwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.eWEvxPl_3-C8tv5_uDfyqV8B8DDUeTK4yn-IHnIQvwY' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"groupByNames": [
"connector", "refund_reason"
],
"filters": {
"refund_status": ["failure"]
},
"source": "BATCH",
"metrics": [
"sessionized_refund_reason"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 2,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": "Test Refund - 2",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 1,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "stripe_test",
"refund_type": null,
"profile_id": null,
"refund_reason": "Customer returned product",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 1,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": "Test Refund - 3",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 4,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested:
- queryData:
```json
"refund_reason_count": 1,
"refund_reason": "Test Refund - 3",
"connector": "adyen",
```
- metaData:
```json
"total_refund_reason_count": 4,
```
Failed Refund Error Message:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjk3MjQxOSwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.eWEvxPl_3-C8tv5_uDfyqV8B8DDUeTK4yn-IHnIQvwY' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"groupByNames": [
"connector", "refund_error_message"
],
"source": "BATCH",
"metrics": [
"sessionized_refund_error_message"
],
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 1,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": "The refund failed due to test-failure 3.",
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 1,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": "The refund failed due to test-failure.",
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 2
}
]
}
```
Fields to be tested:
- queryData:
```json
"refund_error_message_count": 1,
"refund_error_message": "The refund failed due to test-failure.",
"connector": "adyen",
```
- metaData:
```json
"total_refund_error_message_count": 2
```
Refund Reasons Distribution:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjk3MjQxOSwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.eWEvxPl_3-C8tv5_uDfyqV8B8DDUeTK4yn-IHnIQvwY' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"groupByNames": [
"connector"
],
"distribution": {
"distributionFor": "sessionized_refund_reason",
"distributionCardinality": "TOP_5"
},
"metrics": [
],
"source": "BATCH",
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": [
{
"reason": "Test REFUND - 1",
"count": 1,
"percentage": 14.29
}
],
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "stripe_test",
"refund_type": null,
"profile_id": null,
"refund_reason": "Test REFUND - 1",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": [
{
"reason": "Test Refund - 2",
"count": 2,
"percentage": 66.67
}
],
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": "Test Refund - 2",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": [
{
"reason": "Test Refund - 3",
"count": 1,
"percentage": 33.33
}
],
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": "Test Refund - 3",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": [
{
"reason": "Customer returned product",
"count": 6,
"percentage": 85.71
}
],
"refund_error_message_distribution": null,
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "stripe_test",
"refund_type": null,
"profile_id": null,
"refund_reason": "Customer returned product",
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested:
- queryData:
```json
"refund_reason_distribution": [
{
"reason": "Test REFUND - 1",
"count": 1,
"percentage": 14.29
}
],
"connector": "stripe_test",
```
Refund Error Message Distribution:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header '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: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjk3MjQxOSwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.eWEvxPl_3-C8tv5_uDfyqV8B8DDUeTK4yn-IHnIQvwY' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-01T09:00:00Z",
"endTime": "2024-11-29T09:30:39Z"
},
"groupByNames": [
"connector"
],
"distribution": {
"distributionFor": "sessionized_refund_error_message",
"distributionCardinality": "TOP_5"
},
"metrics": [
],
"source": "BATCH",
"delta": true
}
]'
```
Response:
```json
{
"queryData": [
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": [
{
"error_message": "The refund failed due to test-failure 3.",
"count": 1,
"percentage": 33.33
}
],
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": "The refund failed due to test-failure 3.",
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": [
{
"error_message": "",
"count": 1,
"percentage": 33.33
}
],
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": [
{
"error_message": "The refund failed due to test-failure.",
"count": 1,
"percentage": 33.33
}
],
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "adyen",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": "The refund failed due to test-failure.",
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
},
{
"successful_refunds": null,
"total_refunds": null,
"refund_success_rate": null,
"refund_count": null,
"refund_success_count": null,
"refund_processed_amount": 0,
"refund_processed_amount_in_usd": null,
"refund_processed_count": null,
"refund_reason_distribution": null,
"refund_error_message_distribution": [
{
"error_message": "",
"count": 1,
"percentage": 100.0
}
],
"refund_reason_count": 0,
"refund_error_message_count": 0,
"currency": null,
"refund_status": null,
"connector": "stripe_test",
"refund_type": null,
"profile_id": null,
"refund_reason": null,
"refund_error_message": null,
"time_range": {
"start_time": "2024-11-01T09:00:00.000Z",
"end_time": "2024-11-29T09:30:39.000Z"
},
"time_bucket": "2024-11-01 09:00:00"
}
],
"metaData": [
{
"total_refund_success_rate": null,
"total_refund_processed_amount": 0,
"total_refund_processed_amount_in_usd": 0,
"total_refund_processed_count": 0,
"total_refund_reason_count": 0,
"total_refund_error_message_count": 0
}
]
}
```
Fields to be tested:
- queryData:
```json
"refund_error_message_distribution": [
{
"error_message": "The refund failed due to test-failure 3.",
"count": 1,
"percentage": 33.33
}
],
"connector": "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. API Request/Response Models**
- `crates/api_models/src/analytics.rs`
- `crates/api_models/src/analytics/refunds.rs`
**2. Database Layer (Queries & Schema)**
- `crates/analytics/src/query.rs`
**3. Core Business Logic**
- `crates/analytics/src/refunds/core.rs`
**4. Type Definitions**
- `crates/analytics/src/refunds/types.rs`
**5. Other**
- `crates/analytics/src/clickhouse.rs`
- `crates/analytics/src/lib.rs`
- `crates/analytics/src/payments/distribution.rs`
- ... and 21 more files
**Code Patterns Applied:**
- Define new data structures (12 changes)
- Implement new functions (19 changes)
- Extend existing types with new fields (186 changes)
- Add conditional logic for feature flags or filtering (21 changes)
- Modify database queries (3 changes)
**Detailed Identifier Changes:**
Commit 774a53ee:
Files to modify:
**crates/analytics/src/clickhouse.rs**
Add:
- function: private::try_into
- impl: impl super::refunds::distribution::RefundDistributionAnalytics for ClickhouseClient
- impl: impl TryInto<RefundDistributionRow> for serde_json::Value
**crates/analytics/src/lib.rs**
Add:
- function: pub::get_refund_distribution
**crates/analytics/src/payments/distribution.rs**
Modify existing code
**crates/analytics/src/payments/distribution/payment_error_message.rs**
Modify existing code
**crates/analytics/src/query.rs**
Modify existing code
**crates/analytics/src/refunds.rs**
Add:
- mod: pub::distribution
**crates/analytics/src/refunds/accumulator.rs**
Remove:
- struct: pub::SuccessRateAccumulator
Add:
- function: private::add_distribution_bucket
- function: private::collect
- function: private::add_distribution_bucket
- function: private::collect
- function: private::collect
- struct: pub::RefundReasonDistributionRow
- struct: pub::RefundReasonDistributionAccumulator
- struct: pub::RefundErrorMessageDistributionRow
- struct: pub::RefundErrorMessageDistributionAccumulator
- struct: pub::RefundReasonAccumulator
- struct: pub::SuccessRateAccumulator
- impl: impl RefundDistributionAccumulator for RefundReasonDistributionAccumulator
- impl: impl RefundDistributionAccumulator for RefundErrorMessageDistributionAccumulator
- impl: impl RefundMetricAccumulator for RefundProcessedAmountAccumulator
**crates/analytics/src/refunds/core.rs**
Add:
- enum: pub::TaskType
**crates/analytics/src/refunds/distribution.rs**
Add:
- function: private::load_distribution
- struct: pub::RefundDistributionRow
- trait: pub::RefundDistributionAnalytics
- trait: pub::RefundDistribution
- impl: impl RefundDistribution<T> for RefundDistributions
- mod: private::sessionized_distribution
**crates/analytics/src/refunds/distribution/sessionized_distribution.rs**
Add:
- mod: private::refund_error_message
- mod: private::refund_reason
**crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs**
Add:
- function: private::load_distribution
- struct: pub::RefundErrorMessage
- impl: impl RefundDistribution<T> for RefundErrorMessage
**crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs**
Add:
- function: private::load_distribution
- struct: pub::RefundReason
- impl: impl RefundDistribution<T> for RefundReason
**crates/analytics/src/refunds/filters.rs**
Modify existing code
**crates/analytics/src/refunds/metrics.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/refund_count.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/refund_processed_amount.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/refund_success_count.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/refund_success_rate.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/sessionized_metrics.rs**
Add:
- mod: private::refund_error_message
- mod: private::refund_reason
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs**
Add:
- function: private::load_metrics
- struct: pub::RefundErrorMessage
- impl: impl super::RefundMetric<T> for RefundErrorMessage
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs**
Add:
- function: private::load_metrics
- struct: pub::RefundReason
- impl: impl super::RefundMetric<T> for RefundReason
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs**
Modify existing code
**crates/analytics/src/refunds/types.rs**
Modify existing code
**crates/analytics/src/sqlx.rs**
Add:
- impl: impl super::refunds::distribution::RefundDistributionAnalytics for SqlxClient
**crates/api_models/src/analytics.rs**
Add:
- struct: pub::PaymentDistributionBody
**crates/api_models/src/analytics/refunds.rs**
Add:
- struct: pub::ReasonsResult
- struct: pub::ErrorMessagesResult
- enum: pub::RefundDistributions
|
{"pr_number": 6616, "pr_title": "feat(analytics): Add refund sessionized metrics for Analytics V2 dashboard", "merged_at": "2024-12-05T12:09:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics.rs", "crates/api_models/src/analytics/refunds.rs"], "database": ["crates/analytics/src/query.rs"], "core_business": ["crates/analytics/src/refunds/core.rs"], "types": ["crates/analytics/src/refunds/types.rs"], "other": ["crates/analytics/src/clickhouse.rs", "crates/analytics/src/lib.rs", "crates/analytics/src/payments/distribution.rs", "crates/analytics/src/payments/distribution/payment_error_message.rs", "crates/analytics/src/refunds.rs", "crates/analytics/src/refunds/accumulator.rs", "crates/analytics/src/refunds/distribution.rs", "crates/analytics/src/refunds/distribution/sessionized_distribution.rs", "crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs", "crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs", "crates/analytics/src/refunds/filters.rs", "crates/analytics/src/refunds/metrics.rs", "crates/analytics/src/refunds/metrics/refund_count.rs", "crates/analytics/src/refunds/metrics/refund_processed_amount.rs", "crates/analytics/src/refunds/metrics/refund_success_count.rs", "crates/analytics/src/refunds/metrics/refund_success_rate.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs", "crates/analytics/src/sqlx.rs"]}, "change_types": {"structs_added": 12, "functions_added": 19, "enums_added": 2, "fields_added": 186, "imports_added": 38, "conditionals_added": 21, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix: Resolved issue of webhooks response from ucs
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
while handling the response of UCS for webhooks Hyperswitch used to use the existing connector code (Psync's Handle Respnse) which gave error for UCS response so fixed this issue.
Closes #9027
### 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)?
-->
testing of the webhook can be done by the step in this merged PR:https://github.com/juspay/hyperswitch/pull/8814
## 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/webhooks.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/unified_connector_service/transformers.rs`
- `crates/router/src/core/webhooks/incoming.rs`
**3. Other**
- `crates/common_enums/src/enums.rs`
- `crates/router/src/services/api.rs`
**Code Patterns Applied:**
- Implement new functions (3 changes)
- Extend existing types with new fields (6 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 4a60b079:
Files to modify:
**crates/api_models/src/webhooks.rs**
Add:
- function: pub::from_ucs_event_type
- impl: impl IncomingWebhookEvent
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/unified_connector_service/transformers.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/services/api.rs**
Add:
- function: private::handle_ucs_response
|
{"pr_number": 9021, "pr_title": "fix: Resolved issue of webhooks response from ucs", "merged_at": "2025-08-29T15:11:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector", "webhook"]}, "hierarchy": {"api_models": ["crates/api_models/src/webhooks.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/unified_connector_service/transformers.rs", "crates/router/src/core/webhooks/incoming.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/services/api.rs"]}, "change_types": {"functions_added": 3, "enums_added": 1, "fields_added": 6, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(wasm): google pay decryption flow changes
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Added fields in the google pay connector wallet details for the google pay `direct` and `payment gateway` flow
Development.toml
- adyen
- airwallex
- authorizedotnet
- bankofamerica
- bluesnap
- checkout
- cybersource
- globalpay
- multisafepay
- nmi
- noon
- novalnet
- nuvei
- payu
- stripe
- trustpay
- worldpay
- zen
- fiuu
Sandbox.toml
- adyen
- airwallex
- authorizedotnet
- bankofamerica
- bluesnap
- checkout
- cybersource
- globalpay
- multisafepay
- nmi
- noon
- novalnet
- nuvei
- payu
- stripe
- trustpay
- worldpay
- zen
- fiuu
Production.toml
- adyen
- authorizedotnet
- bluesnap
- bankofamerica
- checkout
- cybersource
- globalpay
- novalnet
- payu
- stripe
- trustpay
- worldpay
- zen
- fiuu
### 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?
Locally
In this PR, only wasm changes are there so no test cases required
<!--
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/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- ... and 1 more files
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit ac4af691:
Files to modify:
**crates/connector_configs/src/connector.rs**
Modify existing code
|
{"pr_number": 7616, "pr_title": "feat(wasm): google pay decryption flow changes", "merged_at": "2025-03-28T11:03:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "connector"]}, "hierarchy": {"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"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(hotfix-pr-check): conditionally enforce requirement of main branch PR being merged
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR updates the hotfix PR check workflow to conditionally enforce the requirement of the `main` branch PR being merged, based on the value of a repository variable.
## 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 would allow us to enforce the requirement by changing the repository variable, without having to make workflow file changes across multiple branches.
## 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)?
-->
Temporarily removed the branch filter from the workflow to run on all pull requests, and then checked the errors reported with different values for the repository variable.
| Repository Variable | Workflow Output | Remarks |
|--------|--------|--------|
|  true |  https://github.com/juspay/hyperswitch/actions/runs/13482283192/job/37669000183 | Note that there are two errors reported, one about the title being different, the other about the PR not being merged. |
|  false |  https://github.com/juspay/hyperswitch/actions/runs/13482283192/job/37669038298 | Note that there is only one error reported, about the title being different, there is no error about the PR not being merged. |
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Configuration Files**
- `.github/workflows/hotfix-pr-check.yml`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
- Add conditional logic for feature flags or filtering (4 changes)
|
{"pr_number": 7351, "pr_title": "ci(hotfix-pr-check): conditionally enforce requirement of main branch PR being merged", "merged_at": "2025-02-25T06:52:22Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"config": [".github/workflows/hotfix-pr-check.yml"]}, "change_types": {"fields_added": 1, "conditionals_added": 4}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(router): add dynamic fields support for `samsung_pay`
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
add dynamic fields support for samsung_pay
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
add dynamic fields support for samsung_pay so that it samsung pay button will be displayed in the merchant pml call
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
-> Create a merchant connector account with samsung pay enabled
-> Create a payment with confirm false
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ,api-key.' \
--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": "off_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": "1737615520",
"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"
}
}
}'
```
```
{
"payment_id": "pay_6VymzRBxbxuYxHIxg6Je",
"merchant_id": "merchant_1737542123",
"status": "requires_payment_method",
"amount": 6100,
"net_amount": 6100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_6VymzRBxbxuYxHIxg6Je_secret_zASufbgnXLVB5t4nNz6M",
"created": "2025-01-23T06:58:30.268Z",
"currency": "USD",
"customer_id": "1737615510",
"customer": {
"id": "1737615510",
"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": "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": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "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": 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": "1737615510",
"created_at": 1737615510,
"expires": 1737619110,
"secret": "epk_2026cd6080c54699a02f5e24aabe42c0"
},
"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_ufywYBbtUhSFzOf1cGEM",
"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-01-23T07:13:30.268Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-01-23T06:58:30.324Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
-> Merchant payment methods list with the above client secret. It should contain samsung pay
```
curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_6VymzRBxbxuYxHIxg6Je_secret_zASufbgnXLVB5t4nNz6M' \
--header 'Accept: application/json' \
--header 'api-key: <api-key>'
```
```
{
"redirect_url": "https://google.com/success",
"currency": "USD",
"payment_methods": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "samsung_pay",
"payment_experience": [
{
"payment_experience_type": "invoke_sdk_client",
"eligible_connectors": [
"cybersource"
]
}
],
"card_networks": null,
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": {},
"surcharge_details": null,
"pm_auth_connector": null
},
{
"payment_method_type": "apple_pay",
"payment_experience": [
{
"payment_experience_type": "invoke_sdk_client",
"eligible_connectors": [
"cybersource"
]
}
],
"card_networks": null,
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": {
"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.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"
},
"billing.address.state": {
"required_field": "payment_method_data.billing.address.state",
"display_name": "state",
"field_type": "user_address_state",
"value": "California"
},
"billing.address.zip": {
"required_field": "payment_method_data.billing.address.zip",
"display_name": "zip",
"field_type": "user_address_pincode",
"value": "94122"
},
"billing.email": {
"required_field": "payment_method_data.billing.email",
"display_name": "email",
"field_type": "user_email_address",
"value": "something@gmail.com"
},
"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.city": {
"required_field": "payment_method_data.billing.address.city",
"display_name": "city",
"field_type": "user_address_city",
"value": "San Fransico"
}
},
"surcharge_details": null,
"pm_auth_connector": null
},
{
"payment_method_type": "google_pay",
"payment_experience": [
{
"payment_experience_type": "invoke_sdk_client",
"eligible_connectors": [
"cybersource"
]
}
],
"card_networks": null,
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": {
"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": "billing_last_name",
"field_type": "user_billing_name",
"value": "Doe"
},
"billing.email": {
"required_field": "payment_method_data.billing.email",
"display_name": "email",
"field_type": "user_email_address",
"value": "something@gmail.com"
},
"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.city": {
"required_field": "payment_method_data.billing.address.city",
"display_name": "city",
"field_type": "user_address_city",
"value": "San Fransico"
},
"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": "Discover",
"surcharge_details": null,
"eligible_connectors": [
"cybersource"
]
},
{
"card_network": "DinersClub",
"surcharge_details": null,
"eligible_connectors": [
"cybersource"
]
},
{
"card_network": "Visa",
"surcharge_details": null,
"eligible_connectors": [
"cybersource"
]
},
{
"card_network": "Mastercard",
"surcharge_details": null,
"eligible_connectors": [
"cybersource"
]
}
],
"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
},
"billing.address.state": {
"required_field": "payment_method_data.billing.address.state",
"display_name": "state",
"field_type": "user_address_state",
"value": "California"
},
"billing.address.zip": {
"required_field": "payment_method_data.billing.address.zip",
"display_name": "zip",
"field_type": "user_address_pincode",
"value": "94122"
},
"billing.email": {
"required_field": "payment_method_data.billing.email",
"display_name": "email",
"field_type": "user_email_address",
"value": "something@gmail.com"
},
"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.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.line1": {
"required_field": "payment_method_data.billing.address.line1",
"display_name": "line1",
"field_type": "user_address_line1",
"value": "1467"
},
"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.city": {
"required_field": "payment_method_data.billing.address.city",
"display_name": "city",
"field_type": "user_address_city",
"value": "San Fransico"
},
"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.country": {
"required_field": "payment_method_data.billing.address.country",
"display_name": "country",
"field_type": {
"user_address_country": {
"options": [
"ALL"
]
}
},
"value": "US"
},
"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": [
"cybersource"
]
},
{
"card_network": "Visa",
"surcharge_details": null,
"eligible_connectors": [
"cybersource"
]
}
],
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": {
"billing.address.zip": {
"required_field": "payment_method_data.billing.address.zip",
"display_name": "zip",
"field_type": "user_address_pincode",
"value": "94122"
},
"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.city": {
"required_field": "payment_method_data.billing.address.city",
"display_name": "city",
"field_type": "user_address_city",
"value": "San Fransico"
},
"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.email": {
"required_field": "payment_method_data.billing.email",
"display_name": "email",
"field_type": "user_email_address",
"value": "something@gmail.com"
},
"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"
},
"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.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.state": {
"required_field": "payment_method_data.billing.address.state",
"display_name": "state",
"field_type": "user_address_state",
"value": "California"
},
"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.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
}
]
}
],
"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
}
```
-> Session token call. This should contain samsung pay token
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_62e8ef44460c457fb253bff92ab3a5ae' \
--data '{
"payment_id": "pay_6VymzRBxbxuYxHIxg6Je",
"wallets": [],
"client_secret": "pay_6VymzRBxbxuYxHIxg6Je_secret_zASufbgnXLVB5t4nNz6M"
}'
```
```
{
"payment_id": "pay_6VymzRBxbxuYxHIxg6Je",
"client_secret": "pay_6VymzRBxbxuYxHIxg6Je_secret_zASufbgnXLVB5t4nNz6M",
"session_token": [
{
"wallet_name": "google_pay",
"merchant_info": {
"merchant_name": "Stripe"
},
"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": [
"AMEX",
"DISCOVER",
"INTERAC",
"JCB",
"MASTERCARD",
"VISA"
],
"billing_address_required": false
},
"tokenization_specification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "stripe",
"stripe:version": "2018-10-31",
"stripe:publishableKey": "pk_test_51Msk2GAGHc77EJXX78h549SX2uaOnEkUYqBfjcoD05PIpAnDkYxMn8nQ4d19im85NQuX4Z6WDyHaUw2fFTPBWsIY00Wa7oNerO"
}
}
}
],
"transaction_info": {
"country_code": "US",
"currency_code": "USD",
"total_price_status": "Final",
"total_price": "61.00"
},
"delayed_session_token": false,
"connector": "cybersource",
"sdk_next_action": {
"next_action": "confirm"
},
"secrets": null
},
{
"wallet_name": "samsung_pay",
"version": "2",
"service_id": "49400558c67f4a97b3925f",
"order_number": "pay-6VymzRBxbxuYxHIxg6Je",
"merchant": {
"name": "Hyperswitch",
"url": null,
"country_code": "IN"
},
"amount": {
"option": "FORMAT_TOTAL_PRICE_ONLY",
"currency_code": "USD",
"total": "61.00"
},
"protocol": "PROTOCOL3DS",
"allowed_brands": [
"visa",
"masterCard",
"amex",
"discover"
]
}
]
}
```
## 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/configs/defaults/payment_connector_required_fields.rs`
**2. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**3. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (5 changes)
**Detailed Identifier Changes:**
Commit 144003f7:
Files to modify:
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Modify existing code
Commit e2ddcc26:
Files to modify:
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Modify existing code
|
{"pr_number": 7090, "pr_title": "fix(router): add dynamic fields support for `samsung_pay`", "merged_at": "2025-02-04T12:06:23Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/configs/defaults/payment_connector_required_fields.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": {"fields_added": 5}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
revert: feat(core): add support for api locking with multiple keys for a single api
This reverts commit 2f7cd4f752d98e23910c37502d8748e9842682ef.
## 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 -->
reverted this commit: 2f7cd4f752d98e23910c37502d8748e9842682ef
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/api_locking.rs`
**2. Type Definitions**
- `crates/redis_interface/src/types.rs`
**3. Other**
- `crates/redis_interface/src/commands.rs`
- `crates/redis_interface/src/lib.rs`
- `crates/router/src/routes/payments.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (4 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 9a5a734b:
Files to modify:
**crates/redis_interface/src/commands.rs**
Remove:
- function: pub::get_multiple_keys
- function: pub::get_and_deserialize_multiple_keys
- function: pub::set_multiple_keys_if_not_exists_and_get_values
- function: pub::set_key_if_not_exists_and_get_value
- function: private::test_set_key_if_not_exists_and_get_value_new_key
- function: private::test_set_key_if_not_exists_and_get_value_existing_key
- function: private::test_set_key_if_not_exists_and_get_value_with_default_ttl
- function: private::test_set_key_if_not_exists_and_get_value_concurrent_access
- function: private::test_get_multiple_keys_success
- function: private::test_get_multiple_keys_with_missing_keys
- function: private::test_get_multiple_keys_empty_input
- function: private::test_get_and_deserialize_multiple_keys
- struct: private::TestData
**crates/redis_interface/src/lib.rs**
Remove:
- function: pub::get_transaction
**crates/redis_interface/src/types.rs**
Remove:
- function: pub::is_key_deleted
- function: pub::is_key_not_deleted
- function: pub::get_value
- enum: pub::SetGetReply
- impl: impl DelReply
- impl: impl SetGetReply<T>
**crates/router/src/core/api_locking.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Modify existing code
|
{"pr_number": 9029, "pr_title": "revert: feat(core): add support for api locking with multiple keys for a single api", "merged_at": "2025-08-22T09:32:07Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/api_locking.rs"], "types": ["crates/redis_interface/src/types.rs"], "other": ["crates/redis_interface/src/commands.rs", "crates/redis_interface/src/lib.rs", "crates/router/src/routes/payments.rs"]}, "change_types": {"functions_added": 1, "fields_added": 4, "imports_added": 2, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Added Reward PaymentMethod & CurrencyAuthKey for Hyperswitch <> UCS Integration
## 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 implements the following
- Added support for Reward payment methods for HS <> UCS integration
- Added support for CurrencyAuthKey auth type for HS <> UCS integration
- Send encoded_data as transaction_id when connector_transaction_id is None for PSync via UCS
- Handle mandate_reference in PSync response from UCS
- Updated unified-connector-service-client dependency
### 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?
<details>
<summary>Create Payment Evoucher</summary>
```json
{
"amount": 1000,
"currency": "USD",
"confirm": true,
"payment_method_data": "reward",
"payment_method_type": "evoucher",
"payment_method":"reward",
"capture_method": "automatic",
"browser_info": {
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Safari/605.1.15",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "en-US",
"color_depth": 24,
"screen_height": 1117,
"screen_width": 1728,
"time_zone": -330,
"java_enabled": true,
"java_script_enabled": true
},
"customer_id": "cus_5ZiQdWmdv9efuLCPWeoN",
"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://www.google.com",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "sundari"
},
"phone": {
"number": "1233456789",
"country_code": "+1"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "sundari"
},
"phone": {
"number": "1233456789",
"country_code": "+1"
}
}
}
```
Response
```json
{
"payment_id": "pay_Rg4QpaAPecdVQsRNBTmR",
"merchant_id": "merchant_1753630639",
"status": "requires_customer_action",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 1000,
"amount_received": null,
"connector": "cashtocode",
"client_secret": "pay_Rg4QpaAPecdVQsRNBTmR_secret_OLIhHcWDaspkeHhC1LX8",
"created": "2025-07-27T18:36:26.771Z",
"currency": "USD",
"customer_id": "cus_5ZiQdWmdv9efuLCPWeoN",
"customer": {
"id": "cus_5ZiQdWmdv9efuLCPWeoN",
"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": "reward",
"payment_method_data": "reward",
"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": null
},
"phone": {
"number": "1233456789",
"country_code": "+1"
},
"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": null
},
"phone": {
"number": "1233456789",
"country_code": "+1"
},
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://www.google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_Rg4QpaAPecdVQsRNBTmR/merchant_1753630639/pay_Rg4QpaAPecdVQsRNBTmR_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "evoucher",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cus_5ZiQdWmdv9efuLCPWeoN",
"created_at": 1753641386,
"expires": 1753644986,
"secret": "epk_e8ef8c9944cb44d0a04b9f480d56f8b1"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pay_Rg4QpaAPecdVQsRNBTmR_1",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_TTKe5DLbKRzmvW23NZ8W",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_Cyziv5reSS6yqqJxi3NW",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-27T18:51:26.771Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": -330,
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Safari/605.1.15",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1728,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1117,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-07-27T18:36:28.202Z",
"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>
<details>
<summary>Create Payment Classicreward</summary>
```json
{
"amount": 1000,
"currency": "EUR",
"confirm": true,
"payment_method_data": "reward",
"payment_method_type": "classic",
"payment_method":"reward",
"capture_method": "automatic",
"browser_info": {
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Safari/605.1.15",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "en-US",
"color_depth": 24,
"screen_height": 1117,
"screen_width": 1728,
"time_zone": -330,
"java_enabled": true,
"java_script_enabled": true
},
"customer_id": "cus_5ZiQdWmdv9efuLCPWeoN",
"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://www.google.com",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "sundari"
},
"phone": {
"number": "1233456789",
"country_code": "+1"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "sundari"
},
"phone": {
"number": "1233456789",
"country_code": "+1"
}
}
}
```
Response
```json
{
"payment_id": "pay_u2oFZ7JZu9DKDMxmr4V8",
"merchant_id": "merchant_1753630639",
"status": "requires_customer_action",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 1000,
"amount_received": null,
"connector": "cashtocode",
"client_secret": "pay_u2oFZ7JZu9DKDMxmr4V8_secret_zfm7dQ9weLttW8467iKF",
"created": "2025-07-27T18:41:01.619Z",
"currency": "EUR",
"customer_id": "cus_5ZiQdWmdv9efuLCPWeoN",
"customer": {
"id": "cus_5ZiQdWmdv9efuLCPWeoN",
"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": "reward",
"payment_method_data": "reward",
"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": null
},
"phone": {
"number": "1233456789",
"country_code": "+1"
},
"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": null
},
"phone": {
"number": "1233456789",
"country_code": "+1"
},
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://www.google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_u2oFZ7JZu9DKDMxmr4V8/merchant_1753630639/pay_u2oFZ7JZu9DKDMxmr4V8_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "classic",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cus_5ZiQdWmdv9efuLCPWeoN",
"created_at": 1753641661,
"expires": 1753645261,
"secret": "epk_03beb90b91b249028e5f524c4366b16f"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pay_u2oFZ7JZu9DKDMxmr4V8_1",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_TTKe5DLbKRzmvW23NZ8W",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_Cyziv5reSS6yqqJxi3NW",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-27T18:56:01.619Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": -330,
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Safari/605.1.15",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1728,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1117,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-07-27T18:41:02.554Z",
"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>
Enable payments in HS via UCS
<img width="576" height="148" alt="Screenshot 2025-07-28 at 7 15 10 PM" src="https://github.com/user-attachments/assets/fe0d8b17-a3f6-427c-931f-1cbe2eef252e" />
Tests via HS
<details>
<summary>Create Payment</summary>
```json
{
"amount": 1000,
"currency": "EUR",
"confirm": true,
"payment_link": false,
"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://www.google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4000000000001091",
"card_exp_month": "12",
"card_exp_year": "2029",
"card_holder_name": "Max Mustermann",
"card_cvc": "123",
"card_network": "VISA"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "12345",
"country": "DE",
"first_name": "Max",
"last_name": "Mustermann"
},
"email": "test@novalnet.de",
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "Musterstr",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "94122",
"country": "DE",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"ip_address": "103.77.139.95",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}
```
Response
```json
{
"payment_id": "pay_SRFVMZTPcqcztdvz5Gqo",
"merchant_id": "merchant_1753713393",
"status": "requires_customer_action",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 1000,
"amount_received": null,
"connector": "novalnet",
"client_secret": "pay_SRFVMZTPcqcztdvz5Gqo_secret_8ozHMAIx9DBii0jJSOOH",
"created": "2025-07-28T16:36:32.363Z",
"currency": "EUR",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1091",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "400000",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "2029",
"card_holder_name": "Max Mustermann",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "Musterhausen",
"country": "DE",
"line1": "Musterstr",
"line2": "CA",
"line3": "CA",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "Musterhausen",
"country": "DE",
"line1": "1467",
"line2": "CA",
"line3": "CA",
"zip": "12345",
"state": "California",
"first_name": "Max",
"last_name": "Mustermann"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "test@novalnet.de"
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://www.google.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_SRFVMZTPcqcztdvz5Gqo/merchant_1753713393/pay_SRFVMZTPcqcztdvz5Gqo_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": 1753720592,
"expires": 1753724192,
"secret": "epk_aa8c7a02cd0449c58648567385e71406"
},
"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_khSwRJ3kHOBW2pETWhl3",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_44BTpt1weQvLwraRCJBa",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-28T16:51:32.363Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "103.77.139.95",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-07-28T16:36:33.299Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
</details>
<details>
<summary>Sync Payment</summary>
Response
```json
{
"payment_id": "pay_SRFVMZTPcqcztdvz5Gqo",
"merchant_id": "merchant_1753713393",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "novalnet",
"client_secret": "pay_SRFVMZTPcqcztdvz5Gqo_secret_8ozHMAIx9DBii0jJSOOH",
"created": "2025-07-28T16:36:32.363Z",
"currency": "EUR",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"attempts": [
{
"attempt_id": "pay_SRFVMZTPcqcztdvz5Gqo_1",
"status": "charged",
"amount": 1000,
"order_tax_amount": null,
"currency": "EUR",
"connector": "novalnet",
"error_message": null,
"payment_method": "card",
"connector_transaction_id": null,
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"created_at": "2025-07-28T16:36:32.363Z",
"modified_at": "2025-07-28T16:36:54.815Z",
"cancellation_reason": null,
"mandate_id": null,
"error_code": null,
"payment_token": null,
"connector_metadata": null,
"payment_experience": null,
"payment_method_type": "credit",
"reference_id": null,
"unified_code": null,
"unified_message": null,
"client_source": null,
"client_version": 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": "1091",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "400000",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "2029",
"card_holder_name": "Max Mustermann",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "Musterhausen",
"country": "DE",
"line1": "Musterstr",
"line2": "CA",
"line3": "CA",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "Musterhausen",
"country": "DE",
"line1": "1467",
"line2": "CA",
"line3": "CA",
"zip": "12345",
"state": "California",
"first_name": "Max",
"last_name": "Mustermann"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "test@novalnet.de"
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://www.google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": 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_khSwRJ3kHOBW2pETWhl3",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_44BTpt1weQvLwraRCJBa",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-28T16:51:32.363Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "103.77.139.95",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-07-28T16:36:54.815Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
</details>
<details>
<summary>Setup Mandate with 0 amount</summary>
```json
{
"confirm": true,
"customer_id": "Customer123",
"payment_type": "setup_mandate",
"setup_future_usage": "off_session",
"amount": 0,
"currency": "EUR",
"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"
}
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4000000000001091",
"card_exp_month": "12",
"card_exp_year": "2029",
"card_holder_name": "Max Mustermann",
"card_cvc": "123",
"card_network": "VISA"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "12345",
"country": "DE",
"first_name": "Max",
"last_name": "Mustermann"
},
"email": "test@novalnet.de",
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "Musterstr",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "94122",
"country": "DE",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"ip_address": "103.77.139.95",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}
```
Response
```json
{
"payment_id": "pay_SRFVMZTPcqcztdvz5Gqo",
"merchant_id": "merchant_1753713393",
"status": "requires_customer_action",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 1000,
"amount_received": null,
"connector": "novalnet",
"client_secret": "pay_SRFVMZTPcqcztdvz5Gqo_secret_8ozHMAIx9DBii0jJSOOH",
"created": "2025-07-28T16:36:32.363Z",
"currency": "EUR",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1091",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "400000",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "2029",
"card_holder_name": "Max Mustermann",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "Musterhausen",
"country": "DE",
"line1": "Musterstr",
"line2": "CA",
"line3": "CA",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "Musterhausen",
"country": "DE",
"line1": "1467",
"line2": "CA",
"line3": "CA",
"zip": "12345",
"state": "California",
"first_name": "Max",
"last_name": "Mustermann"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "test@novalnet.de"
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://www.google.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_SRFVMZTPcqcztdvz5Gqo/merchant_1753713393/pay_SRFVMZTPcqcztdvz5Gqo_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": 1753720592,
"expires": 1753724192,
"secret": "epk_aa8c7a02cd0449c58648567385e71406"
},
"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_khSwRJ3kHOBW2pETWhl3",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_44BTpt1weQvLwraRCJBa",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-28T16:51:32.363Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "103.77.139.95",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-07-28T16:36:33.299Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
</details>
<details>
<summary>Make a mandate payment manual capture</summary>
```json
{
"amount": 100,
"currency": "EUR",
"confirm": true,
"capture_method": "manual",
"customer_id": "Customer123",
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "pm_dPmHDOL7xWQi0IGMPlCF"
}
}
```
Response
```json
{
"payment_id": "pay_TyY8IWSWaxTEzpOLgsu1",
"merchant_id": "merchant_1753878378",
"status": "requires_capture",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 100,
"amount_received": null,
"connector": "novalnet",
"client_secret": "pay_TyY8IWSWaxTEzpOLgsu1_secret_CjCYuDfP1JGo6caJ4g2C",
"created": "2025-07-31T13:50:56.144Z",
"currency": "EUR",
"customer_id": "Customer123",
"customer": {
"id": "Customer123",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": "manual",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1091",
"card_type": null,
"card_network": "Visa",
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "400000",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "2029",
"card_holder_name": "Max Mustermann",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"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": 1753969856,
"expires": 1753973456,
"secret": "epk_382858505e58422b980776ffe49e26ed"
},
"manual_retry_allowed": false,
"connector_transaction_id": "15212700054805789",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "15212700054805789",
"payment_link": null,
"profile_id": "pro_McJmiAJzH046VnPS0CAN",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_O7lUCBZh6h106Xmsxady",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-31T14:05:56.144Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_dPmHDOL7xWQi0IGMPlCF",
"payment_method_status": "active",
"updated": "2025-07-31T13:50:58.462Z",
"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": "R2cB22w22w00a02c-R22w22w22wNJV-V14o10kNZ22wB18sB18s16q00aNP22wXV",
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
</details>
<details>
<summary>Make a mandate payment auto capture</summary>
```json
{
"amount": 100,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"customer_id": "Customer123",
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "pm_dPmHDOL7xWQi0IGMPlCF"
}
}
```
Response
```json
{
"payment_id": "pay_Ep1buzxTanjWDHQIv3Sx",
"merchant_id": "merchant_1753878378",
"status": "succeeded",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 100,
"connector": "novalnet",
"client_secret": "pay_Ep1buzxTanjWDHQIv3Sx_secret_9faeER31esgb88tLjiqK",
"created": "2025-07-31T13:52:14.410Z",
"currency": "EUR",
"customer_id": "Customer123",
"customer": {
"id": "Customer123",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1091",
"card_type": null,
"card_network": "Visa",
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "400000",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "2029",
"card_holder_name": "Max Mustermann",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"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": 1753969934,
"expires": 1753973534,
"secret": "epk_253da8acb7454f67a2fb6bcdc170f1aa"
},
"manual_retry_allowed": false,
"connector_transaction_id": "15212700054912058",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "15212700054912058",
"payment_link": null,
"profile_id": "pro_McJmiAJzH046VnPS0CAN",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_O7lUCBZh6h106Xmsxady",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-31T14:07:14.410Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_dPmHDOL7xWQi0IGMPlCF",
"payment_method_status": "active",
"updated": "2025-07-31T13:52:17.146Z",
"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": "R2cB22w22w00a02c-R22w22w22wNJV-V14o10kNZ22wB18sB18s16q00aNP22wXV",
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
</details>
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/unified_connector_service.rs`
- `crates/router/src/core/unified_connector_service/transformers.rs`
**2. External Connector Integration**
- `crates/external_services/src/grpc_client/unified_connector_service.rs`
**3. Configuration Files**
- `crates/external_services/Cargo.toml`
- `crates/router/Cargo.toml`
**4. Other**
- `Cargo.lock`
- `crates/external_services/src/lib.rs`
- `crates/router/src/consts.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (25 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 0821d1b0:
Files to modify:
**crates/external_services/src/grpc_client/unified_connector_service.rs**
Modify existing code
**crates/external_services/src/lib.rs**
Modify existing code
**crates/router/src/consts.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
|
{"pr_number": 8767, "pr_title": "feat(core): Added Reward PaymentMethod & CurrencyAuthKey for Hyperswitch <> UCS Integration", "merged_at": "2025-08-13T11:41:49Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/unified_connector_service.rs", "crates/router/src/core/unified_connector_service/transformers.rs"], "connectors": ["crates/external_services/src/grpc_client/unified_connector_service.rs"], "config": ["crates/external_services/Cargo.toml", "crates/router/Cargo.toml"], "other": ["Cargo.lock", "crates/external_services/src/lib.rs", "crates/router/src/consts.rs"]}, "change_types": {"fields_added": 25, "imports_added": 2, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [Wise] change amount conversion unit
## 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 amount conversion 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
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Create an MCA through Wise:
Create a payout using below body:
```
{
"amount": 500,
"currency": "USD",
"customer_id": "{{customer_id}}",
"email": "payout_customer@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payout request",
"payout_type": "bank",
"payout_method_data": {
"bank": {
"bank_account_number": "40000000000",
"bank_routing_number": "064000020"
}
},
"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": "8056594427",
"country_code": "+91"
}
},
"recurring": false,
"metadata": {
"ref": "123"
},
"confirm": true,
"auto_fulfill": true
}
```
Following should be the response:
```
{
"payout_id": "payout_4w5t7SPgQZX2qf8Lojdk",
"merchant_id": "merchant_1755607920",
"merchant_order_reference_id": null,
"amount": 500,
"currency": "USD",
"connector": "wise",
"payout_type": "bank",
"payout_method_data": {
"bank": {
"bank_account_number": "*******0000",
"bank_routing_number": "064***020",
"bank_name": null,
"bank_country_code": null,
"bank_city": null
}
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "NY",
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"auto_fulfill": true,
"customer_id": "cus_r4hlpxACcjdVr64ypkwQ",
"customer": {
"id": "cus_r4hlpxACcjdVr64ypkwQ",
"name": "John Doe",
"email": "payout_customer@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"client_secret": "payout_payout_4w5t7SPgQZX2qf8Lojdk_secret_bPjBpTiePuIx4Lwedq7t",
"return_url": null,
"business_country": null,
"business_label": null,
"description": "Its my first payout request",
"entity_type": "Individual",
"recurring": false,
"metadata": {
"ref": "123"
},
"merchant_connector_id": "mca_vqTEvjUSP4aJ2SLVik7n",
"status": "initiated",
"error_message": null,
"error_code": null,
"profile_id": "pro_4NfB43WH4HspmYGnsXL1",
"created": "2025-08-19T12:52:08.109Z",
"connector_transaction_id": "55350011",
"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": null
}
```
Check in the dashboard whether the amount matches the payment amount
## 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/wise.rs`
- `crates/hyperswitch_connectors/src/connectors/wise/transformers.rs`
**Code Patterns Applied:**
- Implement new functions (3 changes)
- Extend existing types with new fields (6 changes)
**Detailed Identifier Changes:**
Commit c5174fd6:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/wise.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/wise/transformers.rs**
Add:
- function: private::default
- function: pub::get_status
- enum: pub::WiseHttpStatus
- impl: impl Default for WiseHttpStatus
- impl: impl WiseHttpStatus
|
{"pr_number": 8991, "pr_title": "fix(connector): [Wise] change amount conversion unit", "merged_at": "2025-08-19T14:54:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/wise.rs", "crates/hyperswitch_connectors/src/connectors/wise/transformers.rs"]}, "change_types": {"functions_added": 3, "enums_added": 1, "fields_added": 6, "imports_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(wasm): [dwolla] fix WASM changes
## 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 -->
Fix WASM changes for Dwolla
### 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/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- ... and 1 more files
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit a71acbf8:
Files to modify:
**crates/connector_configs/src/connector.rs**
Modify existing code
|
{"pr_number": 9051, "pr_title": "fix(wasm): [dwolla] fix WASM changes", "merged_at": "2025-08-28T11:58:47Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"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"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore(mintlify): fix mintlify api methods for endpoint
## 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 -->
Fix wrong api methods for the endpoint resulting error is parsing.
### 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.
## 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/api-reference/customer-set-default-payment-method/customers--set-default-payment-method.mdx`
- `api-reference/api-reference/event/events--list.mdx`
- `api-reference/api-reference/payment-methods/payment-method--set-default-payment-method-for-customer.mdx`
- ... and 1 more files
|
{"pr_number": 8112, "pr_title": "chore(mintlify): fix mintlify api methods for endpoint", "merged_at": "2025-05-22T14:25:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["api-reference/api-reference/customer-set-default-payment-method/customers--set-default-payment-method.mdx", "api-reference/api-reference/event/events--list.mdx", "api-reference/api-reference/payment-methods/payment-method--set-default-payment-method-for-customer.mdx", "api-reference/openapi_spec.json"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat: Implement subscription create for Chargebee
## 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 Chargebee subscription creation request/response structures.
- Implemented conversion traits for Chargebee subscription data.
- Enhanced Recurly connector to support subscription creation flows.
- Introduced new router flow types and request/response types for subscriptions.
- Updated default implementations to include subscription-related traits and integrations.
- Added new traits for subscription management in the hyperswitch interfaces.
- Implemented conversion logic for subscription data between old and new router data formats.
- Updated API service to handle subscription connector integration.
Common Status for Chargebee, Recurly and Stripe Billing
```
Common Status Chargebee Recurly Stripe Billing
Pending Future - incomplete,
Trial InTrial - trialing
Active Active ACTIVE active
Paused Paused PAUSED paused
unpaid - - unpaid
Onetime NonRenewing - -
Cancelled Cancelled, CANCELLED, canceled,
Transferred EXPIRED
Failed - FAILED incomplete_expired
```
### 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 [9056](https://github.com/juspay/hyperswitch/issues/9056)
## 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 API handler is being implemented in a separate PR, this connector integration code cannot be called directly and was tested only by successful compilation of code
<img width="996" height="805" alt="image" src="https://github.com/user-attachments/assets/2849b14f-c922-4f63-8ba0-68f5b3e21d29" />
<img width="981" height="623" alt="image" src="https://github.com/user-attachments/assets/b5f2524b-8e46-4c9a-be91-3730d9335865" />
## 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_data_v2/flow_common_types.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types/subscriptions.rs`
- ... and 3 more files
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/chargebee.rs`
- `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/recurly.rs`
- ... and 1 more files
**3. Type Definitions**
- `crates/hyperswitch_interfaces/src/types.rs`
**4. Other**
- `crates/hyperswitch_interfaces/src/api/subscriptions.rs`
- `crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs`
- `crates/hyperswitch_interfaces/src/conversion_impls.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (8 changes)
- Implement new functions (11 changes)
- Extend existing types with new fields (68 changes)
**Detailed Identifier Changes:**
Commit d978afdc:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/chargebee.rs**
Remove:
- impl: impl api::subscriptions::Subscriptions for Chargebee
Add:
- function: private::get_headers
- function: private::get_url
- function: private::get_content_type
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- impl: impl api::subscriptions::Subscriptions for Chargebee
- impl: impl api::subscriptions::SubscriptionCreate for Chargebee
- impl: impl ConnectorIntegration<SubscriptionCreate, SubscriptionCreateRequest, SubscriptionCreateResponse> for Chargebee
- impl: impl ConnectorIntegrationV2<
SubscriptionCreate,
SubscriptionCreateData,
SubscriptionCreateRequest,
SubscriptionCreateResponse,
> for Chargebee
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Add:
- function: private::from
- function: private::try_from
- function: private::from
- function: private::try_from
- struct: pub::ChargebeeSubscriptionCreateRequest
- struct: pub::ChargebeeSubscriptionCreateResponse
- struct: pub::ChargebeeSubscriptionDetails
- enum: pub::ChargebeeAutoCollection
- enum: pub::ChargebeeSubscriptionStatus
- impl: impl From<SubscriptionAutoCollection> for ChargebeeAutoCollection
- impl: impl TryFrom<&ChargebeeRouterData<&hyperswitch_domain_models::types::SubscriptionCreateRouterData>> for ChargebeeSubscriptionCreateRequest
- impl: impl From<ChargebeeSubscriptionStatus> for SubscriptionStatus
- impl: impl TryFrom<
ResponseRouterData<
SubscriptionCreate,
ChargebeeSubscriptionCreateResponse,
SubscriptionCreateRequest,
SubscriptionCreateResponse,
>,
> for hyperswitch_domain_models::types::SubscriptionCreateRouterData
**crates/hyperswitch_connectors/src/connectors/recurly.rs**
Add:
- impl: impl api::subscriptions_v2::SubscriptionsCreateV2 for Recurly
- impl: impl ConnectorIntegrationV2<
SubscriptionCreate,
SubscriptionCreateData,
SubscriptionCreateRequest,
SubscriptionCreateResponse,
> for Recurly
**crates/hyperswitch_connectors/src/default_implementations.rs**
Add:
- impl: impl SubscriptionCreate for $connector
- impl: impl ConnectorIntegration<
SubscriptionCreateFlow,
SubscriptionCreateRequest,
SubscriptionCreateResponse,
> for $connector
- impl: impl SubscriptionCreate for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
SubscriptionCreateFlow,
SubscriptionCreateRequest,
SubscriptionCreateResponse,
> for connectors::DummyConnector<T>
**crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs**
Add:
- struct: pub::SubscriptionCreateData
**crates/hyperswitch_domain_models/src/router_flow_types.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_flow_types/subscriptions.rs**
Add:
- struct: pub::SubscriptionCreate
**crates/hyperswitch_domain_models/src/router_request_types/subscriptions.rs**
Add:
- struct: pub::SubscriptionItem
- struct: pub::SubscriptionCreateRequest
- enum: pub::SubscriptionAutoCollection
**crates/hyperswitch_domain_models/src/router_response_types/subscriptions.rs**
Add:
- struct: pub::SubscriptionCreateResponse
- enum: pub::SubscriptionStatus
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/subscriptions.rs**
Add:
- trait: pub::SubscriptionCreate
- trait: pub::SubscriptionCreate
**crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs**
Add:
- trait: private::SubscriptionsCreateV2
**crates/hyperswitch_interfaces/src/conversion_impls.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
**crates/router/src/services/api.rs**
Modify existing code
|
{"pr_number": 9303, "pr_title": "feat: Implement subscription create for Chargebee", "merged_at": "2025-09-19T14:08:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs", "crates/hyperswitch_domain_models/src/router_flow_types.rs", "crates/hyperswitch_domain_models/src/router_flow_types/subscriptions.rs", "crates/hyperswitch_domain_models/src/router_request_types/subscriptions.rs", "crates/hyperswitch_domain_models/src/router_response_types/subscriptions.rs", "crates/hyperswitch_domain_models/src/types.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/chargebee.rs", "crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs", "crates/hyperswitch_connectors/src/connectors/recurly.rs", "crates/hyperswitch_connectors/src/default_implementations.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs"], "other": ["crates/hyperswitch_interfaces/src/api/subscriptions.rs", "crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs", "crates/hyperswitch_interfaces/src/conversion_impls.rs", "crates/router/src/services/api.rs"]}, "change_types": {"structs_added": 8, "functions_added": 11, "enums_added": 4, "fields_added": 68, "imports_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore: add cardholder name as mandatory field for Worldpay card transactions
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR adds below changes
- Add required field for Worldpay card transactions - card holder name.
- Fix 3DS SetupMandate flows for Worldpay card transactions
### 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
Card holder name is a mandatory field which is required by WP during card transactions.
Fixing the 3DS SetupMandate flow for Worldpay allows merchants to consume the functionality.
## How did you test it?
<details>
<summary>1. [No3DS] Create zero amount off_session payment</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_W87tjiH2egf7KXq7k4Z3Kr4b0DjNZKUqv7MgUxzaAaLa3RC2jREfBOzomE4DsAD7' \
--data-raw '{"amount":0,"currency":"SGD","confirm":true,"profile_id":"pro_5CNWfwHVvSY4jegnpzco","capture_method":"automatic","capture_on":"2022-09-10T10:11:12Z","setup_future_usage":"off_session","customer_id":"cus_GPjGfsYpA50dZpSocrbd","email":"abc@example.com","return_url":"https://google.com","payment_method":"card","payment_method_type":"debit","payment_method_data":{"card":{"card_number":"4000000000002503","card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe","card_cvc":"737"}},"metadata":{"Force-PSP":"Adyen","udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","language":"en-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"connector_metadata":{"adyen":{"testing":{}}},"session_expiry":60}'
Response
{"payment_id":"pay_wfFMLqmemSnqwZVHT3kM","merchant_id":"merchant_1745484169","status":"succeeded","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":0,"connector":"worldpay","client_secret":"pay_wfFMLqmemSnqwZVHT3kM_secret_eeoF2tNW0wRyvp2pU3WP","created":"2025-04-24T13:31:24.448Z","currency":"SGD","customer_id":"cus_GPjGfsYpA50dZpSocrbd","customer":{"id":"cus_GPjGfsYpA50dZpSocrbd","name":"John Doe","email":"abc@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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"abc@example.com","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"debit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_GPjGfsYpA50dZpSocrbd","created_at":1745501484,"expires":1745505084,"secret":"epk_a62a7064a7e34ccd8305d605ae359881"},"manual_retry_allowed":false,"connector_transaction_id":"23fbb1ff-43c0-4fc4-b27d-072e23683f97","frm_message":null,"metadata":{"udf1":"value1","Force-PSP":"Adyen","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":{"apple_pay":null,"airwallex":null,"noon":null,"braintree":null},"feature_metadata":null,"reference_id":"23fbb1ff-43c0-4fc4-b27d-072e23683f97","payment_link":null,"profile_id":"pro_5CNWfwHVvSY4jegnpzco","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3YM2a6Tn1oMvHSLqrGSD","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-04-24T13:32:24.448Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_yg0qfrNde4WjKQH8Gi3h","payment_method_status":"active","updated":"2025-04-24T13:31:26.513Z","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":"https://try.access.worldpay.com/tokens/eyJrIjoxLCJkIjoidFlEWFFxbDNSUDNZZDg4T0VoWVVxbkdlaFB0RUlvVjFQcEs5TU9KRk9TQT0ifQ","card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null}
</details>
<details>
<summary>2. [No3DS] Create non zero amount off_session payment</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_W87tjiH2egf7KXq7k4Z3Kr4b0DjNZKUqv7MgUxzaAaLa3RC2jREfBOzomE4DsAD7' \
--data-raw '{"amount":1000,"currency":"SGD","confirm":true,"profile_id":"pro_5CNWfwHVvSY4jegnpzco","capture_method":"automatic","capture_on":"2022-09-10T10:11:12Z","setup_future_usage":"off_session","customer_id":"cus_GPjGfsYpA50dZpSocrbd","email":"abc@example.com","return_url":"https://google.com","payment_method":"card","payment_method_type":"debit","payment_method_data":{"card":{"card_number":"4000000000002503","card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe","card_cvc":"737"}},"metadata":{"Force-PSP":"Adyen","udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","language":"en-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"connector_metadata":{"adyen":{"testing":{}}},"session_expiry":60}'
Response
{"payment_id":"pay_OmaRK9FIhoOR0opBCA5q","merchant_id":"merchant_1745484169","status":"succeeded","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":0,"amount_received":1000,"connector":"worldpay","client_secret":"pay_OmaRK9FIhoOR0opBCA5q_secret_BZ0tzOif151DIaYSqUWl","created":"2025-04-24T13:32:05.834Z","currency":"SGD","customer_id":"cus_GPjGfsYpA50dZpSocrbd","customer":{"id":"cus_GPjGfsYpA50dZpSocrbd","name":"John Doe","email":"abc@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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"abc@example.com","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"debit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_GPjGfsYpA50dZpSocrbd","created_at":1745501525,"expires":1745505125,"secret":"epk_f3c123ca19364af294602e915a89a659"},"manual_retry_allowed":false,"connector_transaction_id":"eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99HBj426bdlJXCgTskLhNY5Ml0rXtEPNSyl2cbsnj4b2DZrMdENEzIjocoy3lSG96aYlW4Z+fnZKMutoUGX3m1:mDK4Giru8JHLS90mSN+Z+gkVKRI3EE1MXDv7dp+h3RhHFHGaPn9ksCvhYk:a:cH+e81VQ0:KjdVX14V+Q12mM8f8UUuVrb1pWfdmRX0ol0w4rW66yFNGsWi87tzkRENLR8ix3NBfHPU2KlzlyTrmR0mwasA4zRNlfY:bG7Aaa:GaUgn8jvCNhmdUlN6uDEfAu3+Gpx8cadeYO0VLI6Wl9In2xgejGQ0ri:BU5HlAn:UMGwtz7wDtU06VN+Rkfa60cHqFXxXOGsvxbfcVlSe:hmS+WwXVvDoxGmrxlJztOw0ZEV8g:Qgoe7iLzyfbMA1TfZNrYIkRNlWpYaVeOJiIYYCBgREKSZGhVAzktTueU3oo=","frm_message":null,"metadata":{"udf1":"value1","Force-PSP":"Adyen","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":{"apple_pay":null,"airwallex":null,"noon":null,"braintree":null},"feature_metadata":null,"reference_id":"929b66d4-df1d-4660-a4a1-ec4c14136cea","payment_link":null,"profile_id":"pro_5CNWfwHVvSY4jegnpzco","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3YM2a6Tn1oMvHSLqrGSD","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-04-24T13:33:05.834Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_BMicZubaUj8L5mP3dk5M","payment_method_status":"active","updated":"2025-04-24T13:32:07.354Z","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":"https://try.access.worldpay.com/tokens/eyJrIjoxLCJkIjoidFlEWFFxbDNSUDNZZDg4T0VoWVVxbkdlaFB0RUlvVjFQcEs5TU9KRk9TQT0ifQ","card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null}
</details>
<details>
<summary>3. [3DS] Create non zero amount off_session payment</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_W87tjiH2egf7KXq7k4Z3Kr4b0DjNZKUqv7MgUxzaAaLa3RC2jREfBOzomE4DsAD7' \
--data-raw '{"amount":1000,"currency":"SGD","confirm":true,"profile_id":"pro_5CNWfwHVvSY4jegnpzco","capture_method":"automatic","capture_on":"2022-09-10T10:11:12Z","authentication_type":"three_ds","setup_future_usage":"off_session","customer_id":"cus_GPjGfsYpA50dZpSocrbd","email":"abc@example.com","return_url":"https://google.com","payment_method":"card","payment_method_type":"debit","payment_method_data":{"card":{"card_number":"4000000000002503","card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe","card_cvc":"737"}},"metadata":{"Force-PSP":"Adyen","udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","language":"en-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"connector_metadata":{"adyen":{"testing":{}}},"session_expiry":60}'
Response
{"payment_id":"pay_V52ZUSmwZcawWT6SmhK9","merchant_id":"merchant_1745484169","status":"requires_customer_action","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":1000,"amount_received":null,"connector":"worldpay","client_secret":"pay_V52ZUSmwZcawWT6SmhK9_secret_xkcz8525E884zswbTF90","created":"2025-04-24T13:32:54.875Z","currency":"SGD","customer_id":"cus_GPjGfsYpA50dZpSocrbd","customer":{"id":"cus_GPjGfsYpA50dZpSocrbd","name":"John Doe","email":"abc@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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"abc@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":{"type":"redirect_to_url","redirect_to_url":"http://localhost:8080/payments/redirect/pay_V52ZUSmwZcawWT6SmhK9/merchant_1745484169/pay_V52ZUSmwZcawWT6SmhK9_1"},"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"debit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_GPjGfsYpA50dZpSocrbd","created_at":1745501574,"expires":1745505174,"secret":"epk_79da3389a5d349a2a060f8ef6377ad7a"},"manual_retry_allowed":null,"connector_transaction_id":"eyJrIjoxLCJkIjoiZnFyaU40UENQRnQzVHRndEtDdDg0bHZkVGsyMlNGZkpHRmV3Q3UxRHVwSUxvQVZFYmcwR3Q5NHkrN0xNNitQMiJ9_2","frm_message":null,"metadata":{"udf1":"value1","Force-PSP":"Adyen","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":{"apple_pay":null,"airwallex":null,"noon":null,"braintree":null},"feature_metadata":null,"reference_id":"0b390991-6688-40b9-8b95-950a65af5678","payment_link":null,"profile_id":"pro_5CNWfwHVvSY4jegnpzco","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3YM2a6Tn1oMvHSLqrGSD","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-04-24T13:33:54.875Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_1NL54rrmq8DE3vQ9VgZX","payment_method_status":"inactive","updated":"2025-04-24T13:32:55.282Z","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}
Complete the payment by clicking the link
cURL (retrieve)
curl --location --request GET 'http://localhost:8080/payments/pay_V52ZUSmwZcawWT6SmhK9' \
--header 'Accept: application/json' \
--header 'api-key: dev_W87tjiH2egf7KXq7k4Z3Kr4b0DjNZKUqv7MgUxzaAaLa3RC2jREfBOzomE4DsAD7'
Response
{"payment_id":"pay_V52ZUSmwZcawWT6SmhK9","merchant_id":"merchant_1745484169","status":"succeeded","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":0,"amount_received":1000,"connector":"worldpay","client_secret":"pay_V52ZUSmwZcawWT6SmhK9_secret_xkcz8525E884zswbTF90","created":"2025-04-24T13:32:54.875Z","currency":"SGD","customer_id":"cus_GPjGfsYpA50dZpSocrbd","customer":{"id":"cus_GPjGfsYpA50dZpSocrbd","name":"John Doe","email":"abc@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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"abc@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":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99HBj426bdlJXCgTskLhNY5Ml0rXtEPNSyl2cbsnj4b2DZrMdENEzIjocoy3lSG96aYlW4Z+fnZKMutoUGX3m1:mmJTlkRKFQu2PsVe3y+vegKDX5ZP4XxijGSq2aIDDwI7FHGaPn9ksCvhYk:a:cH+e81VQ0:KjdVX14V+Q12mM8f8UUuVrb1pWfdmRX0ol0w4rW66yFNGsWi87tzkRENLR8ix3NBfHPU2KlzlyTrmR0mwasA4zRNlfY:bG7Aaa:GaUgn8jvCNhmdUlN6uDEfAu3+Gpx8cadeYO0VLI6Wl9IlLyMVREoNqKOzGKAWbV6MGEiI1GbjFu2YIwRaZQDXnodMGaowTzH8y6H4OLwV6Mey+WwXVvDoxGmrxlJztOw0ZEV8g:Qgoe7iLzyfbMA1TfZNrYIkRNlWpYaVeOJiIYYCBgREKSZGhVAzktTueU3oo=","frm_message":null,"metadata":{"udf1":"value1","Force-PSP":"Adyen","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":{"apple_pay":null,"airwallex":null,"noon":null,"braintree":null},"feature_metadata":null,"reference_id":"69586da7-7ba1-4154-844c-35a4dddc9b86","payment_link":null,"profile_id":"pro_5CNWfwHVvSY4jegnpzco","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3YM2a6Tn1oMvHSLqrGSD","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-04-24T13:33:54.875Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_1NL54rrmq8DE3vQ9VgZX","payment_method_status":"active","updated":"2025-04-24T13:33:09.920Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null}
</details>
<details>
<summary>4. [3DS] Create zero amount off_session payment</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_W87tjiH2egf7KXq7k4Z3Kr4b0DjNZKUqv7MgUxzaAaLa3RC2jREfBOzomE4DsAD7' \
--data-raw '{"amount":0,"currency":"SGD","confirm":true,"profile_id":"pro_5CNWfwHVvSY4jegnpzco","capture_method":"automatic","capture_on":"2022-09-10T10:11:12Z","authentication_type":"three_ds","setup_future_usage":"off_session","customer_id":"cus_GPjGfsYpA50dZpSocrbd","email":"abc@example.com","return_url":"https://google.com","payment_method":"card","payment_method_type":"debit","payment_method_data":{"card":{"card_number":"4000000000002503","card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe","card_cvc":"737"}},"metadata":{"Force-PSP":"Adyen","udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","language":"en-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"connector_metadata":{"adyen":{"testing":{}}},"session_expiry":60}'
Response
{"payment_id":"pay_i87Xb0hGyY0UmG1yhrpH","merchant_id":"merchant_1745484169","status":"requires_customer_action","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpay","client_secret":"pay_i87Xb0hGyY0UmG1yhrpH_secret_sjCsGpNDs2T8YVZEjaid","created":"2025-04-24T13:35:09.354Z","currency":"SGD","customer_id":"cus_GPjGfsYpA50dZpSocrbd","customer":{"id":"cus_GPjGfsYpA50dZpSocrbd","name":"John Doe","email":"abc@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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"abc@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":{"type":"redirect_to_url","redirect_to_url":"http://localhost:8080/payments/redirect/pay_i87Xb0hGyY0UmG1yhrpH/merchant_1745484169/pay_i87Xb0hGyY0UmG1yhrpH_1"},"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"debit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_GPjGfsYpA50dZpSocrbd","created_at":1745501709,"expires":1745505309,"secret":"epk_f1b950bdde6d4989a336c8322ef732a6"},"manual_retry_allowed":null,"connector_transaction_id":"eyJrIjoxLCJkIjoiY1d2OGxEdTVBbEF4M1VSNVIwK0FnTGpKakl1cVhVWWpZQ3laVHpxdm5WTUxvQVZFYmcwR3Q5NHkrN0xNNitQMiJ9_2","frm_message":null,"metadata":{"udf1":"value1","Force-PSP":"Adyen","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":{"apple_pay":null,"airwallex":null,"noon":null,"braintree":null},"feature_metadata":null,"reference_id":"43da3943-2049-4e20-95fc-172a1b763dde","payment_link":null,"profile_id":"pro_5CNWfwHVvSY4jegnpzco","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3YM2a6Tn1oMvHSLqrGSD","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-04-24T13:36:09.354Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_Lih5KP2o2m4mcGBnlgWF","payment_method_status":"inactive","updated":"2025-04-24T13:35:10.457Z","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}
cURL (retrieve)
curl --location --request GET 'http://localhost:8080/payments/pay_i87Xb0hGyY0UmG1yhrpH' \
--header 'Accept: application/json' \
--header 'api-key: dev_W87tjiH2egf7KXq7k4Z3Kr4b0DjNZKUqv7MgUxzaAaLa3RC2jREfBOzomE4DsAD7'
Response
{"payment_id":"pay_i87Xb0hGyY0UmG1yhrpH","merchant_id":"merchant_1745484169","status":"succeeded","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":0,"connector":"worldpay","client_secret":"pay_i87Xb0hGyY0UmG1yhrpH_secret_sjCsGpNDs2T8YVZEjaid","created":"2025-04-24T13:35:09.354Z","currency":"SGD","customer_id":"cus_GPjGfsYpA50dZpSocrbd","customer":{"id":"cus_GPjGfsYpA50dZpSocrbd","name":"John Doe","email":"abc@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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"abc@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":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"1142f6b3-364b-4988-a508-14b17c18b523","frm_message":null,"metadata":{"udf1":"value1","Force-PSP":"Adyen","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":{"apple_pay":null,"airwallex":null,"noon":null,"braintree":null},"feature_metadata":null,"reference_id":"1142f6b3-364b-4988-a508-14b17c18b523","payment_link":null,"profile_id":"pro_5CNWfwHVvSY4jegnpzco","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3YM2a6Tn1oMvHSLqrGSD","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-04-24T13:36:09.354Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_Lih5KP2o2m4mcGBnlgWF","payment_method_status":"active","updated":"2025-04-24T13:36:35.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":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null}
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [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/worldpay.rs`
- `crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs`
- `crates/payment_methods/src/configs/payment_connector_required_fields.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (4 changes)
**Detailed Identifier Changes:**
Commit 2fe40a2f:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/worldpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
**crates/payment_methods/src/configs/payment_connector_required_fields.rs**
Modify existing code
|
{"pr_number": 7897, "pr_title": "chore: add cardholder name as mandatory field for Worldpay card transactions", "merged_at": "2025-04-24T16:45:27Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/worldpay.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs"]}, "change_types": {"fields_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): Revert [AUTHORIZEDOTNET] customer id population fixed in authorize flow
Reverts juspay/hyperswitch#9079
If a customer profile is not created during the Authorize call, the customer_profile_id and customer_payment_profile_id are not returned in the transaction response. As a result, the connector_mandate_id is populated as null, causing subsequent MIT transactions with "payment_type": "normal" to fail.
To avoid this issue, we are reverting this PR.
Impact of revert:
Reverting will ensure MIT transactions work as expected, but it will lead to two customer records being created in the Authorize.NET dashboard — one with the customer_id we pass, and another with a randomly generated ID.
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (12 changes)
**Detailed Identifier Changes:**
Commit f10a7132:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs**
Modify existing code
|
{"pr_number": 9253, "pr_title": "fix(connector): Revert [AUTHORIZEDOTNET] customer id population fixed in authorize flow", "merged_at": "2025-09-04T07:19:18Z", "intent": {"feature_type": "payment", "action": "fix_bug", "entities": ["customer", "payment", "connector"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs"]}, "change_types": {"fields_added": 12}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connector): rename RevenueRecoveryRecordBack as InvoiceRecordBack
## 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 -->
Make the RevenueRecoveryRecordBack functionality generic to make it usable by subscription after making a successful payment.
This pull request refactors the "record back" functionality in the revenue recovery flow by renaming types and data structures from RevenueRecoveryRecordBack* and RecoveryRecordBack to InvoiceRecordBack* and InvoiceRecordBack. This change is applied consistently across domain models, connector implementations, interfaces, and transformers, improving clarity and aligning naming with their purpose (handling invoice record backs).
### 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)?
-->
Only removing the feature flag and renamed it. compilation and PR checks should be sufficient
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs`
- `crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs`
- ... and 2 more files
**2. Core Business Logic**
- `crates/router/src/core/payments/flows.rs`
- `crates/router/src/core/revenue_recovery/types.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/chargebee.rs`
- `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/recurly.rs`
- ... and 5 more files
**4. Type Definitions**
- `crates/hyperswitch_interfaces/src/types.rs`
- `crates/router/src/types.rs`
**5. Other**
- `crates/hyperswitch_interfaces/src/api/revenue_recovery.rs`
- `crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs`
- `crates/hyperswitch_interfaces/src/conversion_impls.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (24 changes)
**Detailed Identifier Changes:**
Commit ea2fd1d4:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/chargebee.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/recurly.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripebilling.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs**
Remove:
- struct: pub::RevenueRecoveryRecordBackData
Add:
- struct: pub::InvoiceRecordBackData
**crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs**
Remove:
- struct: pub::RecoveryRecordBack
Add:
- struct: pub::InvoiceRecordBack
**crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs**
Remove:
- struct: pub::RevenueRecoveryRecordBackRequest
Add:
- struct: pub::InvoiceRecordBackRequest
**crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs**
Remove:
- struct: pub::RevenueRecoveryRecordBackResponse
Add:
- struct: pub::InvoiceRecordBackResponse
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/revenue_recovery.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/conversion_impls.rs**
Remove:
- impl: impl RouterDataConversion<T, Req, Resp> for RevenueRecoveryRecordBackData
Add:
- impl: impl RouterDataConversion<T, Req, Resp> for InvoiceRecordBackData
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Modify existing code
**crates/router/src/core/revenue_recovery/types.rs**
Modify existing code
**crates/router/src/services/api.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
|
{"pr_number": 9321, "pr_title": "refactor(connector): rename RevenueRecoveryRecordBack as InvoiceRecordBack", "merged_at": "2025-09-10T14:50:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "connector"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs", "crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/types.rs"], "core_business": ["crates/router/src/core/payments/flows.rs", "crates/router/src/core/revenue_recovery/types.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/chargebee.rs", "crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs", "crates/hyperswitch_connectors/src/connectors/recurly.rs", "crates/hyperswitch_connectors/src/connectors/recurly/transformers.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"], "types": ["crates/hyperswitch_interfaces/src/types.rs", "crates/router/src/types.rs"], "other": ["crates/hyperswitch_interfaces/src/api/revenue_recovery.rs", "crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs", "crates/hyperswitch_interfaces/src/conversion_impls.rs", "crates/router/src/services/api.rs"]}, "change_types": {"structs_added": 4, "functions_added": 1, "fields_added": 24, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(debit_routing): add `debit_routing_savings` in analytics payment attempt
<!-- 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 a new feature to track and analyze debit routing savings and integrates it across multiple components of the analytics system. It also refactors the handling of co-badged card networks to provide additional details, such as saving percentages. Below is a breakdown of the most important changes grouped by theme:
### Debit Routing Analytics Integration:
* Added a new column `debit_routing_savings` to the `payment_attempt_queue`, `payment_attempts`, and `payment_attempt_mv` tables in ClickHouse for tracking debit routing savings.
* Updated the `PaymentMetricsAccumulator` struct to include a new `DebitRoutingAccumulator`, which tracks transaction counts and savings amounts. Implemented the necessary methods for metric collection and aggregation.
* Introduced a new `PaymentMetrics::DebitRouting` enum variant and its corresponding implementation to load metrics, process data, and convert savings to USD.
### 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)?
-->
-> Enable debit routing for a profile
-> Configure adyen connector with local debit networks enabled
-> Make some debit routing payments
```
{
"amount": 1,
"amount_to_capture": 1,
"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_{{$timestamp}}",
"return_url": "http://127.0.0.1:4040",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4000 0330 0330 0335",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"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_xrXjk0rlKJG83LNngQ2B",
"merchant_id": "merchant_1751293949",
"status": "succeeded",
"amount": 150000,
"net_amount": 150000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 150000,
"connector": "adyen",
"client_secret": "pay_xrXjk0rlKJG83LNngQ2B_secret_doz5GI9CEnlmcQoBpiNT",
"created": "2025-06-30T15:09:44.649Z",
"currency": "USD",
"customer_id": "cu_1751296185",
"customer": {
"id": "cu_1751296185",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"attempts": [
{
"attempt_id": "pay_xrXjk0rlKJG83LNngQ2B_1",
"status": "charged",
"amount": 150000,
"order_tax_amount": null,
"currency": "USD",
"connector": "adyen",
"error_message": null,
"payment_method": "card",
"connector_transaction_id": "KGRXNH7KQZ9TPM75",
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"created_at": "2025-06-30T15:09:44.649Z",
"modified_at": "2025-06-30T15:09:45.587Z",
"cancellation_reason": null,
"mandate_id": null,
"error_code": null,
"payment_token": null,
"connector_metadata": null,
"payment_experience": null,
"payment_method_type": "debit",
"reference_id": "pay_xrXjk0rlKJG83LNngQ2B_1",
"unified_code": null,
"unified_message": null,
"client_source": null,
"client_version": 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": "0335",
"card_type": null,
"card_network": "Nyce",
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "400003",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San",
"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": null,
"manual_retry_allowed": false,
"connector_transaction_id": "KGRXNH7KQZ9TPM75",
"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_xrXjk0rlKJG83LNngQ2B_1",
"payment_link": null,
"profile_id": "pro_0YmTwtjkst9iUDkg4R5D",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_d1x2St1F4pbgEFYNmxOV",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-30T15:24:44.649Z",
"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": "pm_pRJ3v7spaJ1pfIsMlAqD",
"payment_method_status": "active",
"updated": "2025-06-30T15:09:45.566Z",
"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
}
```
-> Payment FIlters
```
curl --location 'http://localhost:8080/analytics/v1/org/filters/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiZTAxZDlhMzgtMDdlMi00ZmFiLTg3ZmYtZWU0NmE2YTU2MDlhIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzUxMjkzOTQ5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc1MTQ2Njc1MSwib3JnX2lkIjoib3JnX2tOa2k3aXBKS1h4NFc3bGVJU3FQIiwicHJvZmlsZV9pZCI6InByb18wWW1Ud3Rqa3N0OWlVRGtnNFI1RCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.jty5ccBH_Em-odSAlde-FQLMC34aoGdV_UYsJFoUN-w' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '{
"timeRange": {
"startTime": "2024-09-03T18:30:00.000Z",
"endTime": "2025-09-12T09:22:30.000Z"
},
"groupByNames": [
"connector",
"payment_method",
"payment_method_type",
"currency",
"authentication_type",
"status",
"client_source",
"client_version",
"profile_id",
"routing_approach"
],
"source": "BATCH",
"delta": true
}'
```
```
{
"queryData": [
{
"dimension": "connector",
"values": [
"adyen"
]
},
{
"dimension": "payment_method",
"values": [
"card"
]
},
{
"dimension": "payment_method_type",
"values": [
"debit"
]
},
{
"dimension": "currency",
"values": [
"USD"
]
},
{
"dimension": "authentication_type",
"values": [
"no_three_ds"
]
},
{
"dimension": "status",
"values": [
"charged"
]
},
{
"dimension": "client_source",
"values": []
},
{
"dimension": "client_version",
"values": []
},
{
"dimension": "profile_id",
"values": [
"pro_0YmTwtjkst9iUDkg4R5D"
]
},
{
"dimension": "routing_approach",
"values": [
"default_fallback",
"debit_routing"
]
}
]
}
```
-> Payment metric that gives total debit routed txn and savings
```
curl --location 'http://localhost:8080/analytics/v1/org/metrics/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'api-key: dev_cW7LmHwdGurYUqCHLMkUX8AfU9uYzKJc6sT0bsAB1wQJFe6lOP01lRO30Dj0WpcH' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiZTAxZDlhMzgtMDdlMi00ZmFiLTg3ZmYtZWU0NmE2YTU2MDlhIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzUxMjkzOTQ5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc1MTQ2Njc1MSwib3JnX2lkIjoib3JnX2tOa2k3aXBKS1h4NFc3bGVJU3FQIiwicHJvZmlsZV9pZCI6InByb18wWW1Ud3Rqa3N0OWlVRGtnNFI1RCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.jty5ccBH_Em-odSAlde-FQLMC34aoGdV_UYsJFoUN-w' \
--data '[
{
"timeRange": {
"startTime": "2025-03-01T18:30:00Z",
"endTime": "2025-07-31T09:22:00Z"
},
"filters": {
"routing_approach": [
"debit_routing"
]
},
"source": "BATCH",
"metrics": [
"debit_routing"
],
"timeSeries": {
"granularity": "G_ONEDAY"
},
"delta": true
}
]'
```
```
{
"queryData": [
{
"payment_success_rate": null,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 0,
"payment_processed_amount_in_usd": null,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": null,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": null,
"payments_success_rate_distribution_without_smart_retries": null,
"payments_success_rate_distribution_with_only_retries": null,
"payments_failure_rate_distribution": null,
"payments_failure_rate_distribution_without_smart_retries": null,
"payments_failure_rate_distribution_with_only_retries": null,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"debit_routed_transaction_count": 8,
"debit_routing_savings": 369,
"debit_routing_savings_in_usd": null,
"currency": "USD",
"status": null,
"connector": null,
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": null,
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"routing_approach": null,
"time_range": {
"start_time": "2025-06-30T00:00:00.000Z",
"end_time": "2025-06-30T23:00:00.000Z"
},
"time_bucket": "2025-06-30 00:00:00"
}
],
"metaData": [
{
"total_payment_processed_amount": 0,
"total_payment_processed_amount_in_usd": null,
"total_payment_processed_amount_without_smart_retries": 0,
"total_payment_processed_amount_without_smart_retries_usd": null,
"total_payment_processed_count": 0,
"total_payment_processed_count_without_smart_retries": 0,
"total_failure_reasons_count": 0,
"total_failure_reasons_count_without_smart_retries": 0
}
]
}
```
-> Payment metrics that gives savings per txn
```
curl --location 'http://localhost:8080/analytics/v1/org/metrics/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'api-key: dev_cW7LmHwdGurYUqCHLMkUX8AfU9uYzKJc6sT0bsAB1wQJFe6lOP01lRO30Dj0WpcH' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiZTAxZDlhMzgtMDdlMi00ZmFiLTg3ZmYtZWU0NmE2YTU2MDlhIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzUxMjkzOTQ5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc1MTQ2Njc1MSwib3JnX2lkIjoib3JnX2tOa2k3aXBKS1h4NFc3bGVJU3FQIiwicHJvZmlsZV9pZCI6InByb18wWW1Ud3Rqa3N0OWlVRGtnNFI1RCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.jty5ccBH_Em-odSAlde-FQLMC34aoGdV_UYsJFoUN-w' \
--data '[
{
"timeRange": {
"startTime": "2025-03-01T18:30:00Z",
"endTime": "2025-07-31T09:22:00Z"
},
"groupByNames": [
"card_network"
],
"filters": {
"routing_approach": [
"debit_routing"
]
},
"source": "BATCH",
"metrics": [
"debit_routing"
],
"timeSeries": {
"granularity": "G_ONEDAY"
},
"delta": true
}
]'
```
```
{
"queryData": [
{
"payment_success_rate": null,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 0,
"payment_processed_amount_in_usd": null,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": null,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": null,
"payments_success_rate_distribution_without_smart_retries": null,
"payments_success_rate_distribution_with_only_retries": null,
"payments_failure_rate_distribution": null,
"payments_failure_rate_distribution_without_smart_retries": null,
"payments_failure_rate_distribution_with_only_retries": null,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"debit_routed_transaction_count": 2,
"debit_routing_savings": 107,
"debit_routing_savings_in_usd": null,
"currency": "USD",
"status": null,
"connector": null,
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": "Star",
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"routing_approach": null,
"time_range": {
"start_time": "2025-06-30T00:00:00.000Z",
"end_time": "2025-06-30T23:00:00.000Z"
},
"time_bucket": "2025-06-30 00:00:00"
},
{
"payment_success_rate": null,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 0,
"payment_processed_amount_in_usd": null,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": null,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": null,
"payments_success_rate_distribution_without_smart_retries": null,
"payments_success_rate_distribution_with_only_retries": null,
"payments_failure_rate_distribution": null,
"payments_failure_rate_distribution_without_smart_retries": null,
"payments_failure_rate_distribution_with_only_retries": null,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"debit_routed_transaction_count": 2,
"debit_routing_savings": 199,
"debit_routing_savings_in_usd": null,
"currency": "USD",
"status": null,
"connector": null,
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": "Nyce",
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"routing_approach": null,
"time_range": {
"start_time": "2025-06-30T00:00:00.000Z",
"end_time": "2025-06-30T23:00:00.000Z"
},
"time_bucket": "2025-06-30 00:00:00"
},
{
"payment_success_rate": null,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 0,
"payment_processed_amount_in_usd": null,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": null,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": null,
"payments_success_rate_distribution_without_smart_retries": null,
"payments_success_rate_distribution_with_only_retries": null,
"payments_failure_rate_distribution": null,
"payments_failure_rate_distribution_without_smart_retries": null,
"payments_failure_rate_distribution_with_only_retries": null,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"debit_routed_transaction_count": 3,
"debit_routing_savings": 0,
"debit_routing_savings_in_usd": null,
"currency": "USD",
"status": null,
"connector": null,
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": "Visa",
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"routing_approach": null,
"time_range": {
"start_time": "2025-06-30T00:00:00.000Z",
"end_time": "2025-06-30T23:00:00.000Z"
},
"time_bucket": "2025-06-30 00:00:00"
},
{
"payment_success_rate": null,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 0,
"payment_processed_amount_in_usd": null,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": null,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": null,
"payments_success_rate_distribution_without_smart_retries": null,
"payments_success_rate_distribution_with_only_retries": null,
"payments_failure_rate_distribution": null,
"payments_failure_rate_distribution_without_smart_retries": null,
"payments_failure_rate_distribution_with_only_retries": null,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"debit_routed_transaction_count": 1,
"debit_routing_savings": 63,
"debit_routing_savings_in_usd": null,
"currency": "USD",
"status": null,
"connector": null,
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": "Accel",
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"routing_approach": null,
"time_range": {
"start_time": "2025-06-30T00:00:00.000Z",
"end_time": "2025-06-30T23:00:00.000Z"
},
"time_bucket": "2025-06-30 00:00:00"
}
],
"metaData": [
{
"total_payment_processed_amount": 0,
"total_payment_processed_amount_in_usd": null,
"total_payment_processed_amount_without_smart_retries": 0,
"total_payment_processed_amount_without_smart_retries_usd": null,
"total_payment_processed_count": 0,
"total_payment_processed_count_without_smart_retries": 0,
"total_failure_reasons_count": 0,
"total_failure_reasons_count_without_smart_retries": 0
}
]
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/analytics/payments.rs`
- `crates/api_models/src/open_router.rs`
- `crates/api_models/src/payment_methods.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/api.rs`
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
**3. Core Business Logic**
- `crates/analytics/src/payments/core.rs`
- `crates/router/src/core/debit_routing.rs`
- `crates/router/src/core/payment_methods.rs`
- ... and 6 more files
**4. Other**
- `crates/analytics/docs/clickhouse/scripts/payment_attempts.sql`
- `crates/analytics/src/payments/accumulator.rs`
- `crates/analytics/src/payments/metrics.rs`
- ... and 8 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (13 changes)
- Extend existing types with new fields (81 changes)
- Add conditional logic for feature flags or filtering (5 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit fc3c64fa:
Files to modify:
**crates/analytics/src/payments/accumulator.rs**
Add:
- function: private::add_metrics_bucket
- function: private::collect
- struct: pub::DebitRoutingAccumulator
- impl: impl PaymentMetricAccumulator for DebitRoutingAccumulator
**crates/analytics/src/payments/core.rs**
Modify existing code
**crates/analytics/src/payments/metrics.rs**
Add:
- mod: private::debit_routing
**crates/analytics/src/payments/metrics/debit_routing.rs**
Add:
- function: private::load_metrics
- struct: pub::DebitRouting
- impl: impl super::PaymentMetric<T> for DebitRouting
**crates/analytics/src/payments/metrics/sessionized_metrics.rs**
Add:
- mod: private::debit_routing
**crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs**
Add:
- function: private::load_metrics
- struct: pub::DebitRouting
- impl: impl super::PaymentMetric<T> for DebitRouting
**crates/api_models/src/analytics/payments.rs**
Modify existing code
**crates/api_models/src/open_router.rs**
Add:
- struct: pub::CoBadgedCardNetworks
**crates/api_models/src/payment_methods.rs**
Add:
- function: private::from
- struct: pub::CoBadgedCardDataToBeSaved
- impl: impl From<&CoBadgedCardData> for CoBadgedCardDataToBeSaved
**crates/hyperswitch_domain_models/src/api.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- function: pub::extract_debit_routing_saving_percentage
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Add:
- function: pub::extract_card_network
- function: pub::set_debit_routing_savings
- function: pub::extract_card_network
- function: pub::get_debit_routing_savings
**crates/router/src/core/debit_routing.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/tokenize.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Add:
- function: pub::calculate_debit_routing_savings
- function: pub::get_debit_routing_savings_amount
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/retry.rs**
Modify existing code
**crates/router/src/core/routing/transformers.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/services/kafka/payment_attempt.rs**
Modify existing code
**crates/router/src/services/kafka/payment_attempt_event.rs**
Modify existing code
**crates/storage_impl/src/mock_db/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_attempt.rs**
Modify existing code
|
{"pr_number": 8519, "pr_title": "feat(debit_routing): add `debit_routing_savings` in analytics payment attempt", "merged_at": "2025-07-04T14:14:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics/payments.rs", "crates/api_models/src/open_router.rs", "crates/api_models/src/payment_methods.rs"], "domain": ["crates/hyperswitch_domain_models/src/api.rs", "crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs"], "core_business": ["crates/analytics/src/payments/core.rs", "crates/router/src/core/debit_routing.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/tokenize.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/routing/transformers.rs"], "other": ["crates/analytics/docs/clickhouse/scripts/payment_attempts.sql", "crates/analytics/src/payments/accumulator.rs", "crates/analytics/src/payments/metrics.rs", "crates/analytics/src/payments/metrics/debit_routing.rs", "crates/analytics/src/payments/metrics/sessionized_metrics.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/services/kafka/payment_attempt.rs", "crates/router/src/services/kafka/payment_attempt_event.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs"]}, "change_types": {"structs_added": 3, "functions_added": 13, "fields_added": 81, "imports_added": 19, "conditionals_added": 5, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment_methods_v2): implement a barebones version of list customer payment methods v2
## 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 -->
This PR implements a very basic version of the list customer payment methods v2 route, including some refactors made along the way.
This PR includes the following changes:
- Modifies the `created` field to be a required field in `CustomerPaymentMethod`. I've also fixed a minor error in the documentation comment for that field.
- Updates the `get_pm_list_context()` function to match on the `payment_method_data` field, which simplifies code to some extent.
- Updates the list customer payment methods v2 list code to find customer by global ID instead of by merchant reference ID.
- Refactors the `PaymentMethodListContext` type to be an enum (only in v2), since this helps simplify some logic.
- Adds a `TODO` comment around `perform_surcharge_ops()` call in `list_customer_payment_method()`, since that hasn't been implemented yet.
- Updates the `payment_method_data` field in the `PaymentMethod` v2 domain model to use `OptionalEncryptableJsonType` type alias. (This addresses a comment on my previous PR: https://github.com/juspay/hyperswitch/pull/6555#discussion_r1842368814.)
Additionally, I've included these fixes I identified when testing my code changes:
- Fixed a few errors in payment methods v2 code due to incorrect cell ID being passed.
- Fixed customers list v2 not being recognized as a valid route.
- Removed redundant v2 specific authentication implementations. These implementations became redundant after the `AuthenticationDataV2` type was renamed to `AuthenticationData`.
- Fixed payment methods routes not being recognized as valid ones when run with v2 features enabled.
Testing this involved some manual insertion of data with SQL queries, and fiddling of data in the database. Additionally, I could not test the scenario where the API call is associated with a payment, because there are a couple of panics in that code path, and I'm not completely sure what the implementations of those functions should be.
Feel free to review the PR one commit at a time, if that helps.
### 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 makes the `created` field to be a required field in `CustomerPaymentMethod` type, and updates the documentation comment for the same field.
## 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).
-->
Partially implements a new route related to payment methods v2.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
**Testing this on hosted environments is not directly possible**, since this involves inserting data into the database using SQL queries rather than with APIs.
- To test the changes in this PR, I had to manually insert some data into the database using SQL queries, since the save payment methods v2 route is not completely implemented.
- This involved inserting encrypted payment method data that is tied to a specific merchant account (and thus a specific merchant key store / data encryption key) created on my machine.
- Once the data was inserted, I tried the endpoint by using a request as follows (the response is also attached):
```shell
$ curl --location 'http://localhost:8080/v2/customers/customer123/saved_payment_methods' \
--header 'x-profile-id: pro_bJzILfZDpOPo3IcNqN8J' \
--header 'api-key: dev_5yalCEaTm4ABIAmJi30wHXmfnI5tcAs94pxIaU6F6WPbt4PeTpCI5Dh60tIdw9gt'
{
"customer_payment_methods": [
{
"payment_token": null,
"payment_method_id": "global_id_pm_Il3WGMpoX6MCjQ0LfBi9",
"customer_id": "customer123",
"payment_method_type": "card",
"payment_method_subtype": "credit",
"recurring_enabled": false,
"payment_method_data": {
"card": {
"issuer_country": null,
"last4_digits": "4242",
"expiry_month": "10",
"expiry_year": "25",
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": null,
"card_network": null,
"card_isin": "424242",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
}
},
"bank": null,
"created": "2024-11-14T14:37:57.934Z",
"surcharge_details": null,
"requires_cvv": false,
"last_used_at": "2024-11-14T14:37:57.934Z",
"is_default": false,
"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": "8888888888",
"country_code": "+91"
},
"email": "guest@example.com"
}
}
],
"is_guest_customer": null
}
```
Also, I could not test the scenario where the API call is associated with a payment, because there are a couple of panics in that code path, and I'm not completely sure what the implementations of those functions should be.
## 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`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payment_methods.rs`
**3. Core Business Logic**
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payment_methods/cards.rs`
- `crates/router/src/core/payments.rs`
**4. Type Definitions**
- `crates/router/src/types/storage/payment_method.rs`
**5. Utils**
- `crates/common_utils/src/id_type/global_id.rs`
- `crates/common_utils/src/id_type/global_id/payment.rs`
- `crates/common_utils/src/id_type/global_id/payment_methods.rs`
- ... and 1 more files
**6. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/router/src/lib.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Implement new functions (4 changes)
- Extend existing types with new fields (18 changes)
**Detailed Identifier Changes:**
Commit 797a0db7:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Modify existing code
**crates/common_utils/src/id_type/global_id.rs**
Modify existing code
**crates/common_utils/src/id_type/global_id/payment.rs**
Modify existing code
**crates/common_utils/src/id_type/global_id/payment_methods.rs**
Modify existing code
**crates/common_utils/src/id_type/global_id/refunds.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/cards.rs**
Remove:
- function: pub::get_card_details_with_locker_fallback
- function: pub::get_card_details_without_locker_fallback
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Remove:
- function: pub::check_client_secret_and_get_auth
- function: pub::is_ephemeral_auth
**crates/router/src/types/storage/payment_method.rs**
Add:
- function: pub::get_token_data
- enum: pub::PaymentMethodListContext
- impl: impl PaymentMethodListContext
|
{"pr_number": 6649, "pr_title": "feat(payment_methods_v2): implement a barebones version of list customer payment methods v2", "merged_at": "2024-12-02T10:41:09Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.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/cards.rs", "crates/router/src/core/payments.rs"], "types": ["crates/router/src/types/storage/payment_method.rs"], "utils": ["crates/common_utils/src/id_type/global_id.rs", "crates/common_utils/src/id_type/global_id/payment.rs", "crates/common_utils/src/id_type/global_id/payment_methods.rs", "crates/common_utils/src/id_type/global_id/refunds.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/router/src/lib.rs", "crates/router/src/routes/app.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"functions_added": 4, "enums_added": 1, "fields_added": 18, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(success_rate): update the default configs
## 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 modifies the default configuration for `SuccessBasedRoutingConfig` in the `crates/api_models/src/routing.rs` file. The changes adjust the values for aggregate sizes, success rate thresholds, and block duration to better align with updated routing requirements.
Key changes to default routing configuration:
* Updated `min_aggregates_size` from `2` to `5` and `max_aggregates_size` from `3` to `8` to allow for larger aggregate sizes.
* Changed `current_block_threshold` to set `duration_in_mins` to `None` (previously `5`) and increased `max_total_count` from `2` to `5`, providing more flexibility in block thresholds.
### 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. Toggle success based routing for a profile, Check the business profile table in DB, get the routing_algorithm_id active for that profile and check in routing_algorithm table. it should have default config as above numbers
```
curl --location --request POST 'http://localhost:8080/account/merchant_1747851996/business_profile/pro_Rbh3PEV8EITILLoKDC6N/dynamic_routing/success_based/toggle?enable=dynamic_connector_selection' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: xyz' \
--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/routing.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/routing.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (4 changes)
**Detailed Identifier Changes:**
Commit 1cdd7d1d:
Files to modify:
**crates/api_models/src/routing.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Modify existing code
|
{"pr_number": 8098, "pr_title": "refactor(success_rate): update the default configs", "merged_at": "2025-05-21T20:44:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/payments/routing.rs"]}, "change_types": {"fields_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): Address Deserialization issue
## 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 -->
The #[serde(deny_unknown_fields)] lines are now commented out to handle backward incompatibility
Hotfix for https://github.com/juspay/hyperswitch/pull/8980
### 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 Call (CIT )
```
{
"amount": 1000,
"currency": "USD",
"amount_to_capture": 1000,
"customer_id":"131123",
"confirm": true,
"capture_method": "automatic",
"setup_future_usage": "off_session",
"authentication_type": "no_three_ds",
"payment_method": "card",
"payment_method_type": "credit",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"email": "guest@example.com",
"payment_method_data": {
"card": {
"card_number": "5404000000000001",
"card_exp_month": "09",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "Zurich",
"state": "asd",
"zip": "8008",
"country": "CH",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip":"43234"
}
}
}
```
Listing down the Customer Payment Methods API ( 5XX )
```
curl --location 'http://localhost:8080/customers/131123/payment_methods' \
--header 'Accept: application/json' \
--header 'api-key: dev_vEJmbVDXEZU9TTIAo1txUgatXBnqknKOSzfJjvO8JZIj5Ex393ME6FCXXDvqpuz6'
```
<img width="887" height="492" alt="Screenshot 2025-08-18 at 5 41 56 PM" src="https://github.com/user-attachments/assets/eaf64e1c-e30a-4cc3-8696-e578c87a76c4" />
After we removed the `#[serde(deny_unknown_fields)]`
```
curl --location 'http://localhost:8080/customers/131123/payment_methods' \
--header 'Accept: application/json' \
--header 'api-key: dev_vEJmbVDXEZU9TTIAo1txUgatXBnqknKOSzfJjvO8JZIj5Ex393ME6FCXXDvqpuz6'
```
Response
```
{
"customer_payment_methods": [
{
"payment_token": "",
"payment_method_id": "",
"customer_id": "131123",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_issuer": null,
"payment_method_issuer_code": null,
"recurring_enabled": false,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": null,
"issuer_country": null,
"last4_digits": "0001",
"expiry_month": "09",
"expiry_year": "25",
"card_token": null,
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": null,
"card_network": null,
"card_isin": "540400",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
},
"metadata": null,
"created": "2025-08-18T11:45:29.029Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": true,
"last_used_at": "2025-08-18T11:45:29.029Z",
"default_payment_method_set": false,
"billing": {
"address": {
"city": "Zurich",
"country": "CH",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "8008",
"state": "asd",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
}
},
{
"payment_token": "",
"payment_method_id": "",
"customer_id": "131123",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_issuer": null,
"payment_method_issuer_code": null,
"recurring_enabled": false,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": null,
"issuer_country": null,
"last4_digits": "0001",
"expiry_month": "09",
"expiry_year": "25",
"card_token": null,
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": null,
"card_network": null,
"card_isin": "540400",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
},
"metadata": null,
"created": "2025-08-18T11:18:20.670Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": true,
"last_used_at": "2025-08-18T11:18:20.670Z",
"default_payment_method_set": false,
"billing": {
"address": {
"city": "Zurich",
"country": "CH",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "8008",
"state": "asd",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": "43234"
},
"phone": null,
"email": null
}
},
{
"payment_token": "",
"payment_method_id": "",
"customer_id": "131123",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_issuer": null,
"payment_method_issuer_code": null,
"recurring_enabled": false,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": null,
"issuer_country": null,
"last4_digits": "0001",
"expiry_month": "09",
"expiry_year": "25",
"card_token": null,
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": null,
"card_network": null,
"card_isin": "540400",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
},
"metadata": null,
"created": "2025-08-18T11:18:09.508Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": true,
"last_used_at": "2025-08-18T11:18:09.508Z",
"default_payment_method_set": false,
"billing": {
"address": {
"city": "Zurich",
"country": "CH",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "8008",
"state": "asd",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": "43234"
},
"phone": null,
"email": null
}
},
{
"payment_token": "",
"payment_method_id": "",
"customer_id": "131123",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_issuer": null,
"payment_method_issuer_code": null,
"recurring_enabled": false,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": null,
"issuer_country": null,
"last4_digits": "0001",
"expiry_month": "09",
"expiry_year": "25",
"card_token": null,
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": null,
"card_network": null,
"card_isin": "540400",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
},
"metadata": null,
"created": "2025-08-18T11:16:46.866Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": true,
"last_used_at": "2025-08-18T11:16:46.866Z",
"default_payment_method_set": false,
"billing": {
"address": {
"city": "Zurich",
"country": "CH",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "8008",
"state": "asd",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
}
},
{
"payment_token": "",
"payment_method_id": "",
"customer_id": "131123",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_issuer": null,
"payment_method_issuer_code": null,
"recurring_enabled": false,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": null,
"issuer_country": null,
"last4_digits": "0001",
"expiry_month": "09",
"expiry_year": "25",
"card_token": null,
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": null,
"card_network": null,
"card_isin": "540400",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
},
"metadata": null,
"created": "2025-08-18T11:15:29.669Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": true,
"last_used_at": "2025-08-18T11:15:29.669Z",
"default_payment_method_set": true,
"billing": {
"address": {
"city": "Zurich",
"country": "CH",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "8008",
"state": "asd",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
}
}
],
"is_guest_customer": null
}
```
CIT without removing the Serde check:
Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_vEJmbVDXEZU9TTIAo1txUgatXBnqknKOSzfJjvO8JZIj5Ex393ME6FCXXDvqpuz6' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"amount_to_capture": 1000,
"customer_id":"131123",
"confirm": true,
"capture_method": "automatic",
"setup_future_usage": "off_session",
"authentication_type": "no_three_ds",
"payment_method": "card",
"payment_method_type": "credit",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"email": "guest@example.com",
"payment_method_data": {
"card": {
"card_number": "5404000000000001",
"card_exp_month": "09",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "Zurich",
"state": "asd",
"zip": "8008",
"country": "CH",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip":"43234"
}
}
}'
```
Response
```
{
"payment_id": "pay_Xk1ZbXuwr84hM040dSxu",
"merchant_id": "merchant_1755515675",
"status": "processing",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 1000,
"amount_received": null,
"connector": "worldpayvantiv",
"client_secret": "pay_Xk1ZbXuwr84hM040dSxu_secret_iHXw3t1295XvpKutbP0b",
"created": "2025-08-19T07:25:00.923Z",
"currency": "USD",
"customer_id": "131123",
"customer": {
"id": "131123",
"name": null,
"email": "guest@example.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0001",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "540400",
"card_extended_bin": null,
"card_exp_month": "09",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": {
"avs_result": "00",
"advanced_a_v_s_result": null,
"authentication_result": null,
"card_validation_result": "M"
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Zurich",
"country": "CH",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "8008",
"state": "asd",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": "43234"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "131123",
"created_at": 1755588300,
"expires": 1755591900,
"secret": "epk_fee0ffb42f1b4ff88f365c6308a0f886"
},
"manual_retry_allowed": false,
"connector_transaction_id": "84085406412379142",
"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_Xk1ZbXuwr84hM040dSxu_1",
"payment_link": null,
"profile_id": "pro_6JndjequmBt0SRQZr6sQ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_8cauu9F7cHzgOlCmLZYq",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-19T07:40:00.923Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": "pm_xfpcVHdoLNMQLchsUkRD",
"network_transaction_id": "7277286190819",
"payment_method_status": "inactive",
"updated": "2025-08-19T07:25:04.277Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "2592937072890001",
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null
}
```
MIT after removing the serde check
Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_vEJmbVDXEZU9TTIAo1txUgatXBnqknKOSzfJjvO8JZIj5Ex393ME6FCXXDvqpuz6' \
--data-raw '{"amount": 7100,
"currency": "USD",
"confirm": true,
"customer_id": "131123",
"capture_method":"automatic",
"return_url": "https://google.com",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_xfpcVHdoLNMQLchsUkRD"
},
"off_session": true,
"payment_method":"card",
"billing": {
"address": {
"first_name":"John",
"last_name":"Doe",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"origin_zip":"123"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email":"xyz@gmail.com"
}
}'
```
Response
```
{
"payment_id": "pay_iL5W78vHVaGJhEVaXZ2M",
"merchant_id": "merchant_1755515675",
"status": "processing",
"amount": 7100,
"net_amount": 7100,
"shipping_cost": null,
"amount_capturable": 7100,
"amount_received": null,
"connector": "worldpayvantiv",
"client_secret": "pay_iL5W78vHVaGJhEVaXZ2M_secret_rOXwk1RUKGMInjLm8UA9",
"created": "2025-08-19T07:50:04.201Z",
"currency": "USD",
"customer_id": "131123",
"customer": {
"id": "131123",
"name": null,
"email": "guest@example.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0001",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "540400",
"card_extended_bin": null,
"card_exp_month": "09",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "123"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "xyz@gmail.com"
},
"order_details": null,
"email": "guest@example.com",
"name": null,
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "131123",
"created_at": 1755589804,
"expires": 1755593404,
"secret": "epk_4b74a97bc7d446db93bd1fda3ff5b017"
},
"manual_retry_allowed": false,
"connector_transaction_id": "83997449168141786",
"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_iL5W78vHVaGJhEVaXZ2M_1",
"payment_link": null,
"profile_id": "pro_6JndjequmBt0SRQZr6sQ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_8cauu9F7cHzgOlCmLZYq",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-19T08:05:04.201Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": "pm_xfpcVHdoLNMQLchsUkRD",
"network_transaction_id": "7277286190819",
"payment_method_status": "active",
"updated": "2025-08-19T07:50:06.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": "2592937072890001",
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null
}
```
## 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. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
**Detailed Identifier Changes:**
Commit e2403f34:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
|
{"pr_number": 8994, "pr_title": "fix(core): Address Deserialization issue ", "merged_at": "2025-08-19T12:57:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add `merchant_configuration_id` in netcetera metadata and make other merchant configurations optional
## 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 `merchant_configuration_id` in netcetera metadata and make other merchant configurations optional
Main PR - https://github.com/juspay/hyperswitch/pull/7347
Clippy successful locally
<img width="1229" alt="image" src="https://github.com/user-attachments/assets/6790b543-bd55-4903-80a7-8bacc7d63e7f" />
### 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 Main PR
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **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_confirm.rs`
**2. External Connector Integration**
- `crates/connector_configs/src/common_config.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 3 more files
**Code Patterns Applied:**
- Extend existing types with new fields (17 changes)
**Detailed Identifier Changes:**
Commit 7f68e839:
Files to modify:
**crates/connector_configs/src/common_config.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/router/src/connector/netcetera/transformers.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
|
{"pr_number": 7372, "pr_title": "feat(router): add `merchant_configuration_id` in netcetera metadata and make other merchant configurations optional", "merged_at": "2025-02-25T12:17:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_confirm.rs"], "connectors": ["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/router/src/connector/netcetera/transformers.rs"]}, "change_types": {"fields_added": 17}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [Nexixpay] update status mapping nexixpay
## 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 -->
Update status mapping in case of setup mandate flow response for nexixpay connector. PR also involves config changes, added new supported countries.
### 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).
-->
Nexixpay sends Authorized in case of zero auth mandate creation where as it send Executed in other cases, thus in case of zero auth mandate we will map Authorized as Charged in our case or else it stores status as requires capture and thus merchant will not be able to do MIT payments.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Cypress test:
<img width="1728" alt="Screenshot 2025-03-26 at 1 19 35 PM" src="https://github.com/user-attachments/assets/69008922-b928-4090-9fb9-419dc46ec79c" />
Below curls should be used for testing zero auth mandates:
1. Payments CIT
```
curl --location 'localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_gFobRGpbRTGmapARon0ds1JZFYuKmGZC8jYB6HExbLxzxNKZaGueiidTWL953H3a' \
--data-raw '{
"amount": 0,
"currency": "EUR",
"confirm": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"return_url": "https://abc.com",
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"setup_future_usage": "off_session"
}'
Response:
{
"payment_id": "pay_VLJOwAzyFdQHi7aVMdlg",
"merchant_id": "merchant_1742812910",
"status": "requires_payment_method",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_VLJOwAzyFdQHi7aVMdlg_secret_HlLFpDS74gXBcvVmMjRl",
"created": "2025-03-26T13:32:02.998Z",
"currency": "EUR",
"customer_id": null,
"customer": {
"id": null,
"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": "off_session",
"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": null,
"name": null,
"phone": null,
"return_url": "https://abc.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": null,
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_MZDxE6XWcFTIYu3d1i7e",
"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-26T13:47:02.997Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-26T13:32:03.085Z",
"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
}
```
2. Confirm CIT
```
curl --location 'http://localhost:8080/payments/pay_VLJOwAzyFdQHi7aVMdlg/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_gFobRGpbRTGmapARon0ds1JZFYuKmGZC8jYB6HExbLxzxNKZaGueiidTWL953H3a' \
--data-raw '{
"amount": 0,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "cus_5inf88m3Z23QaujgoIMh",
"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://hyperswitch.io",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "08",
"card_exp_year": "35",
"card_holder_name": "joseph Doe",
"card_cvc": "999"
}
},
"setup_future_usage": "off_session",
"mandate_data": {
"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_type": {
"multi_use": {
"amount": 8000,
"currency": "EUR"
}
}
},
"payment_type": "setup_mandate",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IT",
"first_name": "john",
"last_name": "Doe"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IT",
"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"
},
"browser_info": {
"ip_address": "129.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",
"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
}
}'
Response:
{
"payment_id": "pay_VLJOwAzyFdQHi7aVMdlg",
"merchant_id": "merchant_1742812910",
"status": "requires_customer_action",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "nexixpay",
"client_secret": "pay_VLJOwAzyFdQHi7aVMdlg_secret_HlLFpDS74gXBcvVmMjRl",
"created": "2025-03-26T13:32:02.998Z",
"currency": "EUR",
"customer_id": "cus_5inf88m3Z23QaujgoIMh",
"customer": {
"id": "cus_5inf88m3Z23QaujgoIMh",
"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": "man_wd71297StV8xbHazC2i2",
"mandate_data": {
"update_mandate_id": null,
"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_type": {
"multi_use": {
"amount": 8000,
"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": "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": "08",
"card_exp_year": "35",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_RE7I1YmPboj7757fLIWj",
"shipping": {
"address": {
"city": "San Fransico",
"country": "IT",
"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": "IT",
"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": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://hyperswitch.io/",
"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_VLJOwAzyFdQHi7aVMdlg/merchant_1742812910/pay_VLJOwAzyFdQHi7aVMdlg_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "pay_VLJOwAzyFdQHi7aVMdlg_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_VLJOwAzyFdQHi7aVMdlg_1",
"payment_link": null,
"profile_id": "pro_MZDxE6XWcFTIYu3d1i7e",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_uqfybtv2ddcJufNx01dQ",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-26T13:47:02.997Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": "en-US",
"time_zone": -330,
"ip_address": "129.0.0.1",
"os_version": null,
"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,
"device_model": null,
"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",
"java_script_enabled": true
},
"payment_method_id": "pm_cpJ7qqi8nV7W7RWnFflm",
"payment_method_status": "inactive",
"updated": "2025-03-26T13:41:42.365Z",
"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": "AuFkgsHLirF6MZGenR",
"card_discovery": "manual",
"issuer_error_code": null,
"issuer_error_message": null
}
```
User redirection:

3. MIT payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_gFobRGpbRTGmapARon0ds1JZFYuKmGZC8jYB6HExbLxzxNKZaGueiidTWL953H3a' \
--data '{
"amount": 3545,
"currency": "EUR",
"confirm": true,
"customer_id": "cus_5inf88m3Z23QaujgoIMh",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_cpJ7qqi8nV7W7RWnFflm"
},
"off_session": true
}'
Response:
{
"payment_id": "pay_zHaZeNIqIhXSrcVXBPLn",
"merchant_id": "merchant_1742812910",
"status": "succeeded",
"amount": 3545,
"net_amount": 3545,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 3545,
"connector": "nexixpay",
"client_secret": "pay_zHaZeNIqIhXSrcVXBPLn_secret_EFhgotsY8avN3HfdlheV",
"created": "2025-03-26T13:42:41.902Z",
"currency": "EUR",
"customer_id": "cus_5inf88m3Z23QaujgoIMh",
"customer": {
"id": "cus_5inf88m3Z23QaujgoIMh",
"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": null,
"off_session": true,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1111",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "08",
"card_exp_year": "35",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cus_5inf88m3Z23QaujgoIMh",
"created_at": 1742996561,
"expires": 1743000161,
"secret": "epk_ec43e67106fa48c1b572cafcf6e21a40"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pay_zHaZeNIqIhXSrcVXBPLn_1",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_zHaZeNIqIhXSrcVXBPLn_1",
"payment_link": null,
"profile_id": "pro_MZDxE6XWcFTIYu3d1i7e",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_uqfybtv2ddcJufNx01dQ",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-26T13:57:41.902Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_cpJ7qqi8nV7W7RWnFflm",
"payment_method_status": "active",
"updated": "2025-03-26T13:42:44.906Z",
"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": "AuFkgsHLirF6MZGenR",
"card_discovery": "manual",
"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. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
**2. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**3. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 4a4284a6:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
Commit bf0dd839:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
|
{"pr_number": 7612, "pr_title": "fix(connector): [Nexixpay] update status mapping nexixpay", "merged_at": "2025-03-26T18:28:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nexixpay/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"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
refactor(dynamic_routing): add non_deterministic value in SuccessBasedRoutingConclusiveState type
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This will add a value `non_deterministic` in `SuccessBasedRoutingConclusiveState` type.
### Additional Changes
- [ ] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Toggle Success Based routing for the merchant.
```
curl --location --request POST 'http://localhost:8080/account/xxxxxx/business_profile/xxxxxxx/dynamic_routing/success_based/toggle?enable=metrics' \
--header 'api-key: xxxxxxx'
```
2. Create a payment that goes in processing state or any non terminal state.
3. Check the `dynamic_routing_stats` table for the `payment_id` for the `non_determinisctic`.
## 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**
- `migrations/2024-12-18-124527_add_new_value_in_success_based_routing_conclusive_state/down.sql`
- `migrations/2024-12-18-124527_add_new_value_in_success_based_routing_conclusive_state/up.sql`
**Code Patterns Applied:**
- Modify database queries (3 changes)
|
{"pr_number": 6878, "pr_title": "refactor(dynamic_routing): add non_deterministic value in SuccessBasedRoutingConclusiveState type", "merged_at": "2024-12-30T07:55:16Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant"]}, "hierarchy": {"other": ["migrations/2024-12-18-124527_add_new_value_in_success_based_routing_conclusive_state/down.sql", "migrations/2024-12-18-124527_add_new_value_in_success_based_routing_conclusive_state/up.sql"]}, "change_types": {"database_queries": 3}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(router): add merchantId authentication for Payments 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 -->
Add merchant Id auth for payments_create_and_confirm_intent. This is enabled on merchant_id_auth_enabled.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Create Organization
2. Create Merchant Account
3. Create Business Profile
5. Create Connector
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_Qqn3GHHEQfTgBR7Q3lbD' \
--header 'x-profile-id: pro_81tGoykWAXxzOH523DeF' \
--header 'Authorization: admin-api-key=test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "stripe",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "_"
},
"payment_methods_enabled": [
{
"payment_method_type": "card",
"payment_method_subtypes": [
{
"payment_method_subtype": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay",
"account_name": "transaction_processing",
"pricing_type": "fixed_price",
"acquirer_bin": "438309",
"acquirer_merchant_id": "00002000000"
},
"frm_configs": null,
"connector_webhook_details": {
"merchant_secret": ""
},
"profile_id": "pro_81tGoykWAXxzOH523DeF"
}'
```
6. Create and Confirm Payment
```
curl --location 'http://localhost:8080/v2/payments' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_81tGoykWAXxzOH523DeF' \
--header 'X-Merchant-Id: cloth_seller_Qqn3GHHEQfTgBR7Q3lbD' \
--data '{
"amount_details": {
"currency": "USD",
"order_amount": 6540
},
"payment_method_data": {
"card": {
"card_cvc": "123",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_number": "4242424242424242"
}
},
"payment_method_subtype": "credit",
"payment_method_type": "card"
}'
```
Response
```
{
"id": "12345_pay_01973adbc6ab74d1b8cbc732740bc1df",
"status": "succeeded",
"amount": {
"order_amount": 6540,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 6540,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 6540
},
"customer_id": null,
"connector": "stripe",
"created": "2025-06-04T12:12:51.248Z",
"payment_method_data": {
"billing": null
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector_transaction_id": "pi_3RWGBcD5R7gDAGff06zS46Cm",
"connector_reference_id": null,
"merchant_connector_id": "mca_tiY9bcQ3EAmiErBtJji1",
"browser_info": null,
"error": null,
"shipping": null,
"billing": null,
"attempts": null,
"connector_token_details": {
"token": "pm_1RWGBcD5R7gDAGffBfMOSg3E",
"connector_token_request_reference_id": "wEe92Yo4f9FIIVQnmO"
},
"payment_method_id": null,
"next_action": null,
"return_url": "https://google.com/success",
"authentication_type": null,
"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`
- [ ] 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/config.example.toml`
- `config/deployments/env_specific.toml`
- `config/development.toml`
- ... and 3 more files
**2. Other**
- `crates/router/src/routes/payments.rs`
- `crates/router/src/services/authentication.rs`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Extend existing types with new fields (8 changes)
**Detailed Identifier Changes:**
Commit 45d4ebfd:
Files to modify:
**crates/router/src/configs/secrets_transformers.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Add:
- struct: pub::MerchantIdAuthSettings
**crates/router/src/routes/payments.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Add:
- struct: pub::MerchantIdAuth
|
{"pr_number": 8239, "pr_title": "feat(router): add merchantId authentication for Payments v2", "merged_at": "2025-06-06T08:57:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/secrets_transformers.rs", "crates/router/src/configs/settings.rs"], "other": ["crates/router/src/routes/payments.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"structs_added": 2, "fields_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): introduce accounts schema for accounts related tables
## 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 -->
Introduced a global accounts schema in code. Accounts related tables like organization, merchant_account and business_profile will be moved to this schema in future.
For now, in this PR we will be using the existing v1 schema for each tenant as accounts schema. Right now only Organization table is being move to this schema. Eventually, we will move merchant_account and business_profile as well.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Manual.
Created two schema, `public` and `public_acc`.
1. create an Organization in v1 and v2 (both records must be created in v1 schema).
```
curl --location 'http://localhost:8080/organization' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"organization_name": "my_org"
}'
```
response:
```
{
"organization_id": "org_NiBKQ8KqHTGnyP6gKCvK",
"organization_name": "my_org",
"organization_details": null,
"metadata": null,
"modified_at": "2025-02-13 10:15:34.208552",
"created_at": "2025-02-13 10:15:34.207089"
}
```
```
curl --location 'http://localhost:8080/v2/organization' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"organization_name": "my_org"
}'
```
response:
```
{
"id": "org_7AopxsBXfAmpsMQmN930",
"organization_name": "my_org",
"organization_details": null,
"metadata": null,
"modified_at": "2025-02-13 10:55:34.213017",
"created_at": "2025-02-13 10:55:34.21226"
}
```
2. Do organization Update in v1 and v2(changes must be applied to v1 schema only).
```
curl --location --request PUT 'http://localhost:8080/organization/org_5VFt9QEzPI1DvIcAG1td' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"organization_name": "not my_org_"
}'
```
```
curl --location --request PUT 'http://localhost:8080/v2/organization/org_5VFt9QEzPI1DvIcAG1td' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"organization_name": "not my_org_org_org"
}'
```
DB screenshot.

## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/organization.rs`
**2. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/user.rs`
- `crates/router/src/core/user_role.rs`
**3. Type Definitions**
- `crates/router/src/types/domain/user.rs`
**4. Utils**
- `crates/router/src/utils/user/theme.rs`
**5. Tests**
- `loadtest/config/development.toml`
**6. Configuration Files**
- `config/config.example.toml`
- `config/deployments/env_specific.toml`
- `config/development.toml`
- ... and 3 more files
**7. Other**
- `crates/drainer/src/settings.rs`
- `crates/router/src/connection.rs`
- `crates/router/src/db.rs`
- ... and 10 more files
**Code Patterns Applied:**
- Implement new functions (27 changes)
- Extend existing types with new fields (26 changes)
**Detailed Identifier Changes:**
Commit 0ba4ccfc:
Files to modify:
**crates/diesel_models/src/organization.rs**
Modify existing code
**crates/drainer/src/settings.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Add:
- function: pub::get_store_interface_map
- function: pub::get_accounts_store_interface_map
- function: pub::get_pools_map
- function: private::get_tenant_id
- function: private::get_accounts_schema
- function: private::get_tenant_id
- function: private::get_accounts_schema
- impl: impl TenantConfig
**crates/router/src/connection.rs**
Add:
- function: pub::pg_accounts_connection_read
- function: pub::pg_accounts_connection_write
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/core/user_role.rs**
Modify existing code
**crates/router/src/db.rs**
Remove:
- trait: pub::CommonStorageInterface
Add:
- function: private::get_accounts_storage_interface
- function: private::get_accounts_storage_interface
- trait: pub::AccountsStorageInterface
- trait: pub::CommonStorageInterface
- impl: impl AccountsStorageInterface for Store
- impl: impl AccountsStorageInterface for MockDb
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::get_accounts_storage_interface
- impl: impl AccountsStorageInterface for KafkaStore
**crates/router/src/db/organization.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Modify existing code
**crates/router/src/types/domain/user.rs**
Modify existing code
**crates/router/src/utils/user/theme.rs**
Modify existing code
**crates/storage_impl/src/config.rs**
Modify existing code
**crates/storage_impl/src/database/store.rs**
Add:
- function: private::get_accounts_master_pool
- function: private::get_accounts_replica_pool
- function: private::get_accounts_master_pool
- function: private::get_accounts_replica_pool
**crates/storage_impl/src/lib.rs**
Add:
- function: private::get_accounts_master_pool
- function: private::get_accounts_replica_pool
- function: private::get_accounts_master_pool
- function: private::get_accounts_replica_pool
|
{"pr_number": 7113, "pr_title": "feat(core): introduce accounts schema for accounts related tables", "merged_at": "2025-02-14T13:59:41Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user"]}, "hierarchy": {"database": ["crates/diesel_models/src/organization.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/user.rs", "crates/router/src/core/user_role.rs"], "types": ["crates/router/src/types/domain/user.rs"], "utils": ["crates/router/src/utils/user/theme.rs"], "tests": ["loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/settings.rs", "crates/storage_impl/src/config.rs"], "other": ["crates/drainer/src/settings.rs", "crates/router/src/connection.rs", "crates/router/src/db.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/organization.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs", "crates/storage_impl/src/database/store.rs", "crates/storage_impl/src/lib.rs", "v2_migrations/2024-08-28-081722_drop_not_null_constraints_on_v1_columns/down.sql", "v2_migrations/2024-08-28-081722_drop_not_null_constraints_on_v1_columns/up.sql", "v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/down.sql", "v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/up.sql"]}, "change_types": {"functions_added": 27, "fields_added": 26, "imports_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [jpmorgan] 5xx during payment authorize and `cancellation_reason`
## 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 5xx thrown by JPMorgan connector during payments authorize and void call.
Connector expects the expiry month and year to be `i32` and not a `String` which is why it used to a 5xx due to deserialization failure.
And for Void, the connector expects a limited set of values as cancellation reason. Passing values outside of those limited values results in a 5xx being thrown.
### 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 bug fix is done as a part of connector auditing for JPMorgan connector. Closes https://github.com/juspay/hyperswitch/issues/8281
## 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)?
-->
Fixed and ran Cypress tests against the connector.

## 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. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/jpmorgan.rs`
- `crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs`
**2. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Jpmorgan.js`
- `cypress-tests/cypress/e2e/configs/Payment/Utils.js`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (234 changes)
**Detailed Identifier Changes:**
Commit 80206eed:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/jpmorgan.rs**
Add:
- function: private::build_request
**crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs**
Add:
- function: private::from_str
- enum: pub::ReversalReason
- impl: impl FromStr for ReversalReason
|
{"pr_number": 8282, "pr_title": "fix(connector): [jpmorgan] 5xx during payment authorize and `cancellation_reason`", "merged_at": "2025-06-10T09:08:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/jpmorgan.rs", "crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Jpmorgan.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js"]}, "change_types": {"functions_added": 2, "enums_added": 1, "fields_added": 234, "imports_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): add support for api locking with multiple keys for a single 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 -->
added support for api locking with multiple keys for a single api.
* introduced a couple of redis interface commands to support this feature.
### 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)?
-->
Redis commands unit test result:
<img width="1052" height="532" alt="image" src="https://github.com/user-attachments/assets/42a89697-98d7-4206-b570-63e3fed06bf5" />
Parallel payments-create script output:
before this change:
<img width="1073" height="470" alt="image" src="https://github.com/user-attachments/assets/7396687e-8311-4457-bd32-6fe77367cc3e" />
after this change:
<img width="1064" height="448" alt="image" src="https://github.com/user-attachments/assets/3d56b1a8-9b69-42d8-a52b-7b55bc37ed9a" />
<details>
This script will make n number of parallel payment create calls with same customer id.
<summary>Click to expand script</summary>
```shell
#!/bin/bash
# Parallel Payments Testing Script
# Usage: ./parallel_payments.sh <num_requests> <api_key> <profile_id> [endpoint_url]
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Function to print colored output
print_color() {
local color=$1
local message=$2
echo -e "${color}${message}${NC}"
}
# Function to show usage
show_usage() {
echo "Usage: $0 <num_requests> <api_key> <profile_id> [endpoint_url]"
echo ""
echo "Arguments:"
echo " num_requests - Number of parallel requests to make (positive integer)"
echo " api_key - API key for authentication"
echo " profile_id - Profile ID for the requests"
echo " endpoint_url - Optional endpoint URL (default: http://localhost:8080/payments)"
echo ""
echo "Example:"
echo " $0 10 dev_6AB2Fe34Y9nyTa2EaPJZZfUCnR2XcpqQr8ymti5WbUgLVmoQ2yPCjfnwbdVsLw14 profile123"
echo " $0 50 dev_key profile456 http://localhost:8080/payments"
}
# Validate arguments
if [ $# -lt 3 ] || [ $# -gt 4 ]; then
print_color $RED "Error: Invalid number of arguments"
show_usage
exit 1
fi
NUM_REQUESTS=$1
API_KEY=$2
PROFILE_ID=$3
ENDPOINT_URL=${4:-"http://localhost:8080/payments"}
# Validate num_requests is a positive integer
if ! [[ "$NUM_REQUESTS" =~ ^[1-9][0-9]*$ ]]; then
print_color $RED "Error: num_requests must be a positive integer"
exit 1
fi
# Global variables to store results in memory
CUSTOMER_ID="Cust_$(date +%s)_$$"
# Create responses directory
RESPONSES_DIR="responses_$(date +%Y%m%d_%H%M%S)"
mkdir -p "$RESPONSES_DIR"
print_color $BLUE "=== Parallel Payments Test ==="
print_color $YELLOW "Number of requests: $NUM_REQUESTS"
print_color $YELLOW "API Key: ${API_KEY:0:20}..."
print_color $YELLOW "Profile ID: $PROFILE_ID"
print_color $YELLOW "Customer ID: $CUSTOMER_ID"
print_color $YELLOW "Endpoint: $ENDPOINT_URL"
print_color $YELLOW "Responses directory: $RESPONSES_DIR"
echo ""
# Function to make a single payment request
make_payment_request() {
local request_id=$1
local start_time=$(date +%s.%N)
# Create the JSON payload
local json_payload=$(cat <<EOF
{
"amount": 52000,
"currency": "USD",
"customer_id": "$CUSTOMER_ID",
"email": "someone@gmail.com",
"name": "someone",
"phone": "+1234567890",
"setup_future_usage": "off_session",
"profile_id": "$PROFILE_ID"
}
EOF
)
# Create response file name with timestamp
local timestamp=$(date +%Y%m%d_%H%M%S_%3N)
local response_file="$RESPONSES_DIR/request_${request_id}_${timestamp}.json"
# Make the curl request and save response body to file
local curl_metadata
curl_metadata=$(curl --location "$ENDPOINT_URL" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "api-key: $API_KEY" \
--data-raw "$json_payload" \
--silent \
--show-error \
--output "$response_file" \
--write-out "HTTP_CODE:%{http_code}\nTIME_TOTAL:%{time_total}\n" \
2>&1)
local curl_exit_code=$?
local end_time=$(date +%s.%N)
# Extract HTTP code and response time from curl metadata
local http_code=$(echo "$curl_metadata" | grep "^HTTP_CODE:" | cut -d: -f2)
local response_time=$(echo "$curl_metadata" | grep "^TIME_TOTAL:" | cut -d: -f2)
# Rename file to include HTTP code for easier identification
if [ -n "$http_code" ] && [ -f "$response_file" ]; then
local final_response_file="$RESPONSES_DIR/request_${request_id}_${http_code}_${timestamp}.json"
mv "$response_file" "$final_response_file"
response_file="$final_response_file"
fi
# Print progress
if [ $curl_exit_code -eq 0 ]; then
if [[ "$http_code" =~ ^2[0-9][0-9]$ ]]; then
print_color $GREEN "✓ Request $request_id completed successfully (HTTP $http_code)"
else
print_color $RED "⚠ Request $request_id completed with HTTP $http_code"
fi
else
print_color $RED "✗ Request $request_id failed (curl exit code: $curl_exit_code)"
fi
# Return the result data for collection by the parent process
echo "${request_id}|${curl_exit_code}|${http_code}|${response_time}"
}
# Start timestamp
TEST_START_TIME=$(date +%s.%N)
print_color $BLUE "Starting $NUM_REQUESTS parallel requests..."
echo ""
# Launch all requests in parallel and collect results
pids=()
for i in $(seq 1 $NUM_REQUESTS); do
make_payment_request $i &
pids+=($!)
done
# Wait for all background processes to complete and collect their output
print_color $YELLOW "Waiting for all requests to complete..."
results=()
for pid in "${pids[@]}"; do
wait $pid
# Note: In this simplified version, we can't easily capture the return values
# from background processes without using files or advanced features
done
# Calculate total test time
TEST_END_TIME=$(date +%s.%N)
TOTAL_TEST_TIME=$(echo "$TEST_END_TIME - $TEST_START_TIME" | bc -l 2>/dev/null || echo "0")
echo ""
print_color $BLUE "=== Test Results Summary ==="
# Since we can't easily capture results from background processes without files,
# we'll make the requests again sequentially to get accurate statistics
# This is a compromise to avoid file creation while still providing statistics
print_color $YELLOW "Collecting detailed statistics..."
total_requests=$NUM_REQUESTS
total_response_time=0
# Calculate average response time
avg_response_time="0"
if [ $sample_size -gt 0 ] && [ $(echo "$total_response_time > 0" | bc -l 2>/dev/null || echo "0") = "1" ]; then
avg_response_time=$(echo "scale=6; $total_response_time / $sample_size" | bc -l 2>/dev/null || echo "0")
fi
# Display results
print_color $YELLOW "Total requests sent: $total_requests"
echo ""
print_color $YELLOW "Total test duration: ${TOTAL_TEST_TIME}s"
print_color $YELLOW "Requests per second: $(echo "scale=2; $total_requests / $TOTAL_TEST_TIME" | bc -l 2>/dev/null || echo "0")"
echo ""
# Display information about saved response files
print_color $BLUE "=== Response Files ==="
response_file_count=$(find "$RESPONSES_DIR" -name "*.json" -type f 2>/dev/null | wc -l | tr -d ' ')
print_color $YELLOW "Response files saved: $response_file_count"
print_color $YELLOW "Response files location: $RESPONSES_DIR"
if [ "$response_file_count" -gt 0 ]; then
print_color $YELLOW "File naming pattern:"
print_color $YELLOW " - Main requests: request_<id>_<http_code>_<timestamp>.json"
print_color $YELLOW " - Stats samples: stats_sample_<id>_<http_code>_<timestamp>.json"
fi
echo ""
print_color $BLUE "Test completed successfully!"
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/api_locking.rs`
**2. Type Definitions**
- `crates/redis_interface/src/types.rs`
**3. Other**
- `crates/redis_interface/src/commands.rs`
- `crates/redis_interface/src/lib.rs`
- `crates/router/src/routes/payments.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (17 changes)
- Extend existing types with new fields (25 changes)
- Add conditional logic for feature flags or filtering (6 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit f688cf1d:
Files to modify:
**crates/redis_interface/src/commands.rs**
Add:
- function: pub::get_multiple_keys
- function: pub::get_and_deserialize_multiple_keys
- function: pub::set_multiple_keys_if_not_exists_and_get_values
- function: pub::set_key_if_not_exists_and_get_value
- function: private::test_set_key_if_not_exists_and_get_value_new_key
- function: private::test_set_key_if_not_exists_and_get_value_existing_key
- function: private::test_set_key_if_not_exists_and_get_value_with_default_ttl
- function: private::test_set_key_if_not_exists_and_get_value_concurrent_access
- function: private::test_get_multiple_keys_success
- function: private::test_get_multiple_keys_with_missing_keys
- function: private::test_get_multiple_keys_empty_input
- function: private::test_get_and_deserialize_multiple_keys
- struct: private::TestData
**crates/redis_interface/src/lib.rs**
Add:
- function: pub::get_transaction
**crates/redis_interface/src/types.rs**
Add:
- function: pub::is_key_deleted
- function: pub::is_key_not_deleted
- function: pub::get_value
- enum: pub::SetGetReply
- impl: impl DelReply
- impl: impl SetGetReply<T>
**crates/router/src/core/api_locking.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Modify existing code
Commit 480f84d5:
Files to modify:
**crates/redis_interface/src/commands.rs**
Remove:
- function: pub::get_multiple_keys
- function: pub::get_and_deserialize_multiple_keys
- function: pub::set_multiple_keys_if_not_exists_and_get_values
- function: pub::set_key_if_not_exists_and_get_value
- function: private::test_set_key_if_not_exists_and_get_value_new_key
- function: private::test_set_key_if_not_exists_and_get_value_existing_key
- function: private::test_set_key_if_not_exists_and_get_value_with_default_ttl
- function: private::test_set_key_if_not_exists_and_get_value_concurrent_access
- function: private::test_get_multiple_keys_success
- function: private::test_get_multiple_keys_with_missing_keys
- function: private::test_get_multiple_keys_empty_input
- function: private::test_get_and_deserialize_multiple_keys
- struct: private::TestData
**crates/redis_interface/src/lib.rs**
Remove:
- function: pub::get_transaction
**crates/redis_interface/src/types.rs**
Remove:
- function: pub::is_key_deleted
- function: pub::is_key_not_deleted
- function: pub::get_value
- enum: pub::SetGetReply
- impl: impl DelReply
- impl: impl SetGetReply<T>
**crates/router/src/core/api_locking.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Modify existing code
Commit 2f7cd4f7:
Files to modify:
**crates/redis_interface/src/commands.rs**
Add:
- function: pub::get_multiple_keys
- function: pub::get_and_deserialize_multiple_keys
- function: pub::set_multiple_keys_if_not_exists_and_get_values
- function: pub::set_key_if_not_exists_and_get_value
- function: private::test_set_key_if_not_exists_and_get_value_new_key
- function: private::test_set_key_if_not_exists_and_get_value_existing_key
- function: private::test_set_key_if_not_exists_and_get_value_with_default_ttl
- function: private::test_set_key_if_not_exists_and_get_value_concurrent_access
- function: private::test_get_multiple_keys_success
- function: private::test_get_multiple_keys_with_missing_keys
- function: private::test_get_multiple_keys_empty_input
- function: private::test_get_and_deserialize_multiple_keys
- struct: private::TestData
**crates/redis_interface/src/lib.rs**
Add:
- function: pub::get_transaction
**crates/redis_interface/src/types.rs**
Add:
- function: pub::is_key_deleted
- function: pub::is_key_not_deleted
- function: pub::get_value
- enum: pub::SetGetReply
- impl: impl DelReply
- impl: impl SetGetReply<T>
**crates/router/src/core/api_locking.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Modify existing code
|
{"pr_number": 8887, "pr_title": "feat(core): add support for api locking with multiple keys for a single api", "merged_at": "2025-08-13T07:57:06Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/api_locking.rs"], "types": ["crates/redis_interface/src/types.rs"], "other": ["crates/redis_interface/src/commands.rs", "crates/redis_interface/src/lib.rs", "crates/router/src/routes/payments.rs"]}, "change_types": {"structs_added": 1, "functions_added": 17, "enums_added": 1, "fields_added": 25, "imports_added": 2, "conditionals_added": 6, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 3, "match_method": "pr_number"}
|
feat(router): add endpoint for listing connector features
## 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 -->
-> Why?
With new features being added, it is becoming increasingly difficult to track all the additions. This information is essential for accurately representing Hyperswitch's offerings. Having this solution will eliminate inconsistencies between the documentation and the actual implementation, ensuring clarity and alignment.
-> What?
Introduce an API endpoint that provides:
-> A list of all connectors.
-> The payment methods supported by each connector.
-> The status of these payment methods.
-> Features supported by the connector
-> How?
-> ConnectorSpecifications Connector trait :
Function in this trait, will provide all the connector specific details like payment methods supported, refunds supported and etc.
-> Pre-validation for Payment Methods
Before invoking a connector to process a payment, this function will check if the specified payment_method is implemented, using the data provided in the ConnectorSpecifications trait. This ensures developers update the relevant functions during development and testing.
-> Unified API Endpoint:
Build an endpoint that collects information from all connectors and consolidates it into a unified JSON response. This will act as a single source of truth for supported features.
Additionally, this PR
1. Adds country and currency filter for Bambora in configs.
2. Refactors validate_capture_method() to get data from ConnectorSpecifications trait
### 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)?
-->
Test the validation.
Create a Klarna payment with Bambora. It should fail with "payment method not supported" error.
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_JHPIA2kkwO2PZt5kIZtkqGbjUotOyUD9ByNeEHTIVMPeLCqsU3qPIqJQ72Jtbdn5' \
--data-raw '{
"amount": 6540,
"currency": "GBP",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"customer_id": "StripeCustomer",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "pay_later",
"payment_method_type": "klarna",
"payment_experience": "redirect_to_url",
"payment_method_data": {
"pay_later": {
"klarna_redirect": {}
},
"billing": {
"address": {
"country": "GB"
},
"email": "example@example.com"
}
}
}'
```
Response
```
{
"error": {
"type": "invalid_request",
"message": "Payment method type not supported",
"code": "IR_19",
"reason": "pay_later is not supported by bambora"
}
}
```
The payment intent status will be `requires_payment_method`
3. Test the endpoint /feature_matrix
```
curl --location --request GET 'http://localhost:8080/feature_matrix' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--header 'X-Merchant-Id: postman_merchant_GHAction_e70f1cfe-b545-46a4-bb39-4ceb21392117' \
--data '{
"connectors" : ["zsl"] // Provide list of connectors, for which you need to list the features
// currently implemented for bambora , zsl and deutsche bank.
}'
```
Response
```
{
"connector_count": 1,
"connectors": [
{
"name": "zsl",
"description": "Zsl is a payment gateway operating in China, specializing in facilitating local bank transfers",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "bank_transfer",
"payment_method_type": "local_bank_transfer",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"CN"
],
"supported_currencies": [
"CNY"
]
}
],
"supported_webhook_flows": []
}
]
}
```
List for all connector (that implements this feature)
```
curl --location --request GET 'http://localhost:8080/feature_matrix' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--header 'X-Merchant-Id: postman_merchant_GHAction_e70f1cfe-b545-46a4-bb39-4ceb21392117' \
--data '{
}'
```
Response
```
{
"connector_count": 3,
"connectors": [
{
"name": "bambora",
"description": "Bambora is a leading online payment provider in Canada and United States.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "credit",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"US",
"CA"
],
"supported_currencies": [
"USD"
]
},
{
"payment_method": "card",
"payment_method_type": "debit",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"US",
"CA"
],
"supported_currencies": [
"USD"
]
}
],
"supported_webhook_flows": []
},
{
"name": "deutschebank",
"description": "Deutsche Bank is a German multinational investment bank and financial services company ",
"category": "bank_acquirer",
"supported_payment_methods": [
{
"payment_method": "bank_debit",
"payment_method_type": "sepa",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": null,
"supported_currencies": null
}
],
"supported_webhook_flows": []
},
{
"name": "zsl",
"description": "Zsl is a payment gateway operating in China, specializing in facilitating local bank transfers",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "bank_transfer",
"payment_method_type": "local_bank_transfer",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"CN"
],
"supported_currencies": [
"CNY"
]
}
],
"supported_webhook_flows": []
}
]
}
```
Additional,
Create a Automatic/SequentialAutomatic payment with deutsche bank
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jdLdftKuRTXWX9RsqzbDOndff6PeQsl5Ltlg3W4PcIlRWdjBycM0YHC4vtVPH8E1' \
--data-raw '{
"amount": 1234,
"currency": "EUR",
"confirm": true,
"customer_id": "customer123",
"email": "something@example.com",
"capture_method": "automatic",
"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": "off_session"
}'
```
Response
```
{
"payment_id": "pay_PJGPf0dnRUO2Cs44N6nN",
"merchant_id": "postman_merchant_GHAction_3f754a63-9a43-434a-8386-6529bb12136d",
"status": "requires_customer_action",
"amount": 1234,
"net_amount": 1234,
"shipping_cost": null,
"amount_capturable": 1234,
"amount_received": null,
"connector": "deutschebank",
"client_secret": "pay_PJGPf0dnRUO2Cs44N6nN_secret_OIf3R7djl4FvRJJv4kDd",
"created": "2024-12-24T07:20:41.449Z",
"currency": "EUR",
"customer_id": "customer123",
"customer": {
"id": "customer123",
"name": null,
"email": "something@example.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "bank_debit",
"payment_method_data": {
"bank_debit": {
"sepa": {
"iban": "DE871************67890",
"bank_account_holder_name": null
}
},
"billing": null
},
"payment_token": "token_dHaseB7u8Xj3iLGUgkuA",
"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": null,
"email": null
},
"order_details": null,
"email": "something@example.com",
"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_PJGPf0dnRUO2Cs44N6nN/postman_merchant_GHAction_3f754a63-9a43-434a-8386-6529bb12136d/pay_PJGPf0dnRUO2Cs44N6nN_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "sepa",
"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": 1735024841,
"expires": 1735028441,
"secret": "epk_194860e2d9214ea7b9aa1fed3411cade"
},
"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_n17q78fbnGngmdtYaYbl",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_PMwnyzykz65zs2XSTIvB",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-24T07:35:41.449Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_ARrC7UL1P78NjgGyewwT",
"payment_method_status": "inactive",
"updated": "2024-12-24T07:20:43.432Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "f5e5af1e52d453f0a606ea1120edd951"
}
```
Psync Response
```
{
"payment_id": "pay_PJGPf0dnRUO2Cs44N6nN",
"merchant_id": "postman_merchant_GHAction_3f754a63-9a43-434a-8386-6529bb12136d",
"status": "succeeded",
"amount": 1234,
"net_amount": 1234,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1234,
"connector": "deutschebank",
"client_secret": "pay_PJGPf0dnRUO2Cs44N6nN_secret_OIf3R7djl4FvRJJv4kDd",
"created": "2024-12-24T07:20:41.449Z",
"currency": "EUR",
"customer_id": "customer123",
"customer": {
"id": "customer123",
"name": null,
"email": "something@example.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "bank_debit",
"payment_method_data": {
"bank_debit": {
"sepa": {
"iban": "DE871************67890",
"bank_account_holder_name": null
}
},
"billing": null
},
"payment_token": "token_dHaseB7u8Xj3iLGUgkuA",
"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": null,
"email": null
},
"order_details": null,
"email": "something@example.com",
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "sepa",
"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": "8tgsX9KWpHfJHlgaF5dIOM",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_n17q78fbnGngmdtYaYbl",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_PMwnyzykz65zs2XSTIvB",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-24T07:35:41.449Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_ARrC7UL1P78NjgGyewwT",
"payment_method_status": "active",
"updated": "2024-12-24T07:20:49.827Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Create a manual payment with deutsche bank
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jdLdftKuRTXWX9RsqzbDOndff6PeQsl5Ltlg3W4PcIlRWdjBycM0YHC4vtVPH8E1' \
--data-raw '{
"amount": 1234,
"currency": "EUR",
"confirm": true,
"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": "off_session"
}'
```
Response
```
{
"payment_id": "pay_CAS5XgcroXwOESWGdu49",
"merchant_id": "postman_merchant_GHAction_3f754a63-9a43-434a-8386-6529bb12136d",
"status": "requires_customer_action",
"amount": 1234,
"net_amount": 1234,
"shipping_cost": null,
"amount_capturable": 1234,
"amount_received": null,
"connector": "deutschebank",
"client_secret": "pay_CAS5XgcroXwOESWGdu49_secret_ZjlFv55QSgksNxbaAASN",
"created": "2024-12-24T07:27:13.878Z",
"currency": "EUR",
"customer_id": "customer123",
"customer": {
"id": "customer123",
"name": null,
"email": "something@example.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"payment_method": "bank_debit",
"payment_method_data": {
"bank_debit": {
"sepa": {
"iban": "DE871************67890",
"bank_account_holder_name": null
}
},
"billing": null
},
"payment_token": "token_82FJHIG0GY4q6YXaseyL",
"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": null,
"email": null
},
"order_details": null,
"email": "something@example.com",
"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_CAS5XgcroXwOESWGdu49/postman_merchant_GHAction_3f754a63-9a43-434a-8386-6529bb12136d/pay_CAS5XgcroXwOESWGdu49_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "sepa",
"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": 1735025233,
"expires": 1735028833,
"secret": "epk_8e32a48d04cb49cea675f2e9a600342f"
},
"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_n17q78fbnGngmdtYaYbl",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_PMwnyzykz65zs2XSTIvB",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-24T07:42:13.878Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_NWsFWDKjiy56eR1MwJYP",
"payment_method_status": "inactive",
"updated": "2024-12-24T07:27:16.188Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "81daea9d34130809aeb76a7c4681eba2"
}
```
Capture
```
curl --location 'http://localhost:8080/payments/pay_CAS5XgcroXwOESWGdu49/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jdLdftKuRTXWX9RsqzbDOndff6PeQsl5Ltlg3W4PcIlRWdjBycM0YHC4vtVPH8E1' \
--data '{
"amount_to_capture": 1234,
"statement_descriptor_name": "Joseph",
"statement_descriptor_suffix": "JS"
}'
```
Response
```
{
"payment_id": "pay_CAS5XgcroXwOESWGdu49",
"merchant_id": "postman_merchant_GHAction_3f754a63-9a43-434a-8386-6529bb12136d",
"status": "succeeded",
"amount": 1234,
"net_amount": 1234,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1234,
"connector": "deutschebank",
"client_secret": "pay_CAS5XgcroXwOESWGdu49_secret_ZjlFv55QSgksNxbaAASN",
"created": "2024-12-24T07:27:13.878Z",
"currency": "EUR",
"customer_id": "customer123",
"customer": {
"id": "customer123",
"name": null,
"email": "something@example.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"payment_method": "bank_debit",
"payment_method_data": {
"bank_debit": {
"sepa": {
"iban": "DE871************67890",
"bank_account_holder_name": null
}
},
"billing": null
},
"payment_token": "token_82FJHIG0GY4q6YXaseyL",
"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": null,
"email": null
},
"order_details": null,
"email": "something@example.com",
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "sepa",
"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": "pvXN4K0EUCkC5gk95yAn1r",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_n17q78fbnGngmdtYaYbl",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_PMwnyzykz65zs2XSTIvB",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-24T07:42:13.878Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_NWsFWDKjiy56eR1MwJYP",
"payment_method_status": null,
"updated": "2024-12-24T07:28:39.887Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Create a automatic payment with ZSL
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_2ZvCqVsfjQepFQo0HhHlG9fgJe9Si8GfGIf3LpAXLRiFsk2MdTuc0P6W3vBO5P4G' \
--data-raw '{
"amount": 6540,
"amount_to_capture": 6540,
"authentication_type": "three_ds",
"billing": {
"address": {
"city": "San Fransico",
"country": "CN",
"first_name": "PiX",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"state": "California",
"zip": "94122"
}
},
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"confirm": true,
"currency": "CNY",
"customer_id": "StripeCustomer",
"description": "Its my first payment request",
"email": "guest@example.com",
"metadata": {
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true",
"udf1": "value1"
},
"name": "John Doe",
"payment_method": "bank_transfer",
"payment_method_type": "local_bank_transfer",
"payment_method_data": {
"bank_transfer": {
"local_bank_transfer": {}
}
},
"phone": "999999999",
"phone_country_code": "+1",
"return_url": "https://duck.com",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"first_name": "PiX",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"state": "California",
"zip": "94122"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"browser_info": {
"language": "en-EN"
}
}'
```
Response
```
{
"payment_id": "pay_1sr0mbA1bHTO1i10Pe4Y",
"merchant_id": "postman_merchant_GHAction_a99972f4-8763-4586-ad62-6792151f3fe2",
"status": "requires_customer_action",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 6540,
"amount_received": null,
"connector": "zsl",
"client_secret": "pay_1sr0mbA1bHTO1i10Pe4Y_secret_jGStHPhPOtQyDOx0gn0x",
"created": "2024-12-24T07:36:46.948Z",
"currency": "CNY",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "bank_transfer",
"payment_method_data": {
"bank_transfer": {
"local_bank_transfer": {
"bank_code": null
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "CN",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "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_1sr0mbA1bHTO1i10Pe4Y/postman_merchant_GHAction_a99972f4-8763-4586-ad62-6792151f3fe2/pay_1sr0mbA1bHTO1i10Pe4Y_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "local_bank_transfer",
"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": 1735025806,
"expires": 1735029406,
"secret": "epk_5137137c032346e9b635bd843bb29acf"
},
"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": "pay_1sr0mbA1bHTO1i10Pe4Y_1",
"payment_link": null,
"profile_id": "pro_fZz6ebkNyN5HPQW4MEqP",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_YqojaoQ3Mz6XUf2nev9A",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-24T07:51:46.948Z",
"fingerprint": null,
"browser_info": {
"language": "en-EN"
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-24T07:36:47.924Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```

## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/feature_matrix.rs`
- `crates/api_models/src/lib.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_response_types.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments/flows/authorize_flow.rs`
**4. External Connector Integration**
- `connector-template/mod.rs`
- `crates/hyperswitch_connectors/Cargo.toml`
- `crates/hyperswitch_connectors/src/connectors/airwallex.rs`
- ... and 89 more files
**5. Type Definitions**
- `crates/hyperswitch_interfaces/src/types.rs`
- `crates/router/src/types/api.rs`
- `crates/router/src/types/api/payments.rs`
- ... and 1 more files
**6. Utils**
- `crates/router/src/routes/lock_utils.rs`
**7. Tests**
- `config/deployments/integration_test.toml`
- `cypress-tests/cypress/e2e/PaymentTest/00000-CoreFlows.cy.js`
- `cypress-tests/cypress/support/commands.js`
- ... and 1 more files
**8. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**9. Other**
- `Cargo.lock`
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- ... and 11 more files
**Code Patterns Applied:**
- Define new data structures (7 changes)
- Implement new functions (76 changes)
- Extend existing types with new fields (131 changes)
- Add conditional logic for feature flags or filtering (2 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit a423ff53:
Files to modify:
**connector-template/mod.rs**
Modify existing code
**crates/api_models/src/feature_matrix.rs**
Add:
- struct: pub::FeatureMatrixRequest
- struct: pub::SupportedPaymentMethod
- struct: pub::ConnectorFeatureMatrixResponse
- struct: pub::FeatureMatrixListResponse
- impl: impl common_utils::events::ApiEventMetric for FeatureMatrixListResponse
- impl: impl common_utils::events::ApiEventMetric for FeatureMatrixRequest
**crates/api_models/src/lib.rs**
Add:
- mod: pub::feature_matrix
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::PaymentConnectorCategory
- enum: pub::FeatureStatus
**crates/hyperswitch_connectors/src/connectors/airwallex.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/amazonpay.rs**
Add:
- impl: impl ConnectorSpecifications for Amazonpay
**crates/hyperswitch_connectors/src/connectors/bambora.rs**
Remove:
- function: private::validate_capture_method
- impl: impl ConnectorValidation for Bambora
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorValidation for Bambora
- impl: impl ConnectorSpecifications for Bambora
**crates/hyperswitch_connectors/src/connectors/bamboraapac.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/billwerk.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bitpay.rs**
Add:
- impl: impl ConnectorSpecifications for Bitpay
**crates/hyperswitch_connectors/src/connectors/bluesnap.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/boku.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cashtocode.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/coinbase.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cryptopay.rs**
Add:
- impl: impl ConnectorSpecifications for Cryptopay
**crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs**
Add:
- impl: impl ConnectorSpecifications for CtpMastercard
**crates/hyperswitch_connectors/src/connectors/datatrans.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/deutschebank.rs**
Remove:
- function: private::validate_capture_method
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Deutschebank
**crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/dlocal.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/elavon.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiserv.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiservemea.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/forte.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/globepay.rs**
Add:
- impl: impl ConnectorSpecifications for Globepay
**crates/hyperswitch_connectors/src/connectors/gocardless.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/helcim.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/inespay.rs**
Add:
- impl: impl ConnectorSpecifications for Inespay
**crates/hyperswitch_connectors/src/connectors/jpmorgan.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/mollie.rs**
Add:
- impl: impl ConnectorSpecifications for Mollie
**crates/hyperswitch_connectors/src/connectors/multisafepay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexinets.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexixpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nomupay.rs**
Add:
- impl: impl ConnectorSpecifications for Nomupay
**crates/hyperswitch_connectors/src/connectors/novalnet.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paybox.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payeezy.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payu.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/placetopay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/powertranz.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/prophetpay.rs**
Add:
- impl: impl ConnectorSpecifications for Prophetpay
**crates/hyperswitch_connectors/src/connectors/rapyd.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/razorpay.rs**
Add:
- impl: impl ConnectorSpecifications for Razorpay
**crates/hyperswitch_connectors/src/connectors/redsys.rs**
Add:
- impl: impl ConnectorSpecifications for Redsys
**crates/hyperswitch_connectors/src/connectors/shift4.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/square.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stax.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/taxjar.rs**
Add:
- impl: impl ConnectorSpecifications for Taxjar
**crates/hyperswitch_connectors/src/connectors/thunes.rs**
Add:
- impl: impl ConnectorSpecifications for Thunes
**crates/hyperswitch_connectors/src/connectors/tsys.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs**
Add:
- impl: impl ConnectorSpecifications for UnifiedAuthenticationService
**crates/hyperswitch_connectors/src/connectors/volt.rs**
Add:
- impl: impl ConnectorSpecifications for Volt
**crates/hyperswitch_connectors/src/connectors/worldline.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/xendit.rs**
Add:
- impl: impl ConnectorSpecifications for Xendit
**crates/hyperswitch_connectors/src/connectors/zen.rs**
Add:
- impl: impl ConnectorSpecifications for Zen
**crates/hyperswitch_connectors/src/connectors/zsl.rs**
Remove:
- function: private::validate_capture_method
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Zsl
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Add:
- function: private::add
- struct: pub::PaymentMethodDetails
- struct: pub::ConnectorInfo
- trait: pub::SupportedPaymentMethodsExt
- impl: impl SupportedPaymentMethodsExt for SupportedPaymentMethods
**crates/hyperswitch_interfaces/src/api.rs**
Add:
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- function: private::get_connector_about
- function: private::get_connector_payment_method_type_info
- trait: pub::ConnectorSpecifications
**crates/hyperswitch_interfaces/src/api/payments.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/payments_v2.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/connector/aci.rs**
Add:
- impl: impl ConnectorSpecifications for Aci
**crates/router/src/connector/adyen.rs**
Modify existing code
**crates/router/src/connector/adyenplatform.rs**
Add:
- impl: impl ConnectorSpecifications for Adyenplatform
**crates/router/src/connector/authorizedotnet.rs**
Modify existing code
**crates/router/src/connector/bankofamerica.rs**
Modify existing code
**crates/router/src/connector/braintree.rs**
Modify existing code
**crates/router/src/connector/checkout.rs**
Modify existing code
**crates/router/src/connector/cybersource.rs**
Modify existing code
**crates/router/src/connector/dummyconnector.rs**
Add:
- function: private::validate_connector_against_payment_request
**crates/router/src/connector/ebanx.rs**
Add:
- impl: impl ConnectorSpecifications for Ebanx
**crates/router/src/connector/globalpay.rs**
Modify existing code
**crates/router/src/connector/gpayments.rs**
Add:
- impl: impl ConnectorSpecifications for Gpayments
**crates/router/src/connector/iatapay.rs**
Add:
- impl: impl ConnectorSpecifications for Iatapay
**crates/router/src/connector/itaubank.rs**
Add:
- impl: impl ConnectorSpecifications for Itaubank
**crates/router/src/connector/klarna.rs**
Modify existing code
**crates/router/src/connector/mifinity.rs**
Add:
- impl: impl ConnectorSpecifications for Mifinity
**crates/router/src/connector/netcetera.rs**
Add:
- impl: impl ConnectorSpecifications for Netcetera
**crates/router/src/connector/nmi.rs**
Modify existing code
**crates/router/src/connector/noon.rs**
Modify existing code
**crates/router/src/connector/nuvei.rs**
Modify existing code
**crates/router/src/connector/opayo.rs**
Modify existing code
**crates/router/src/connector/opennode.rs**
Add:
- impl: impl ConnectorSpecifications for Opennode
**crates/router/src/connector/payme.rs**
Modify existing code
**crates/router/src/connector/payone.rs**
Add:
- impl: impl ConnectorSpecifications for Payone
**crates/router/src/connector/paypal.rs**
Modify existing code
**crates/router/src/connector/plaid.rs**
Add:
- impl: impl ConnectorSpecifications for Plaid
**crates/router/src/connector/riskified.rs**
Add:
- impl: impl ConnectorSpecifications for Riskified
**crates/router/src/connector/signifyd.rs**
Add:
- impl: impl ConnectorSpecifications for Signifyd
**crates/router/src/connector/stripe.rs**
Modify existing code
**crates/router/src/connector/threedsecureio.rs**
Add:
- impl: impl ConnectorSpecifications for Threedsecureio
**crates/router/src/connector/trustpay.rs**
Add:
- impl: impl ConnectorSpecifications for Trustpay
**crates/router/src/connector/wellsfargo.rs**
Modify existing code
**crates/router/src/connector/wellsfargopayout.rs**
Add:
- impl: impl ConnectorSpecifications for Wellsfargopayout
**crates/router/src/connector/wise.rs**
Add:
- impl: impl ConnectorSpecifications for Wise
**crates/router/src/core/payments/flows/authorize_flow.rs**
Modify existing code
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes.rs**
Add:
- mod: pub::feature_matrix
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- struct: pub::FeatureMatrix
- impl: impl FeatureMatrix
**crates/router/src/routes/feature_matrix.rs**
Add:
- function: pub::fetch_feature_matrix
- function: pub::generate_feature_matrix
- function: private::build_connector_feature_details
- function: private::build_payment_method_wise_feature_details
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/services/api.rs**
Modify existing code
**crates/router/src/services/connector_integration_interface.rs**
Add:
- function: private::validate_connector_against_payment_request
- function: private::get_supported_webhook_flows
- function: private::get_connector_about
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/api/payments.rs**
Modify existing code
**crates/router/src/utils/connector_onboarding/paypal.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 6612, "pr_title": "feat(router): add endpoint for listing connector features ", "merged_at": "2024-12-24T09:35:07Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/feature_matrix.rs", "crates/api_models/src/lib.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/payments/flows/authorize_flow.rs"], "connectors": ["connector-template/mod.rs", "crates/hyperswitch_connectors/Cargo.toml", "crates/hyperswitch_connectors/src/connectors/airwallex.rs", "crates/hyperswitch_connectors/src/connectors/amazonpay.rs", "crates/hyperswitch_connectors/src/connectors/bambora.rs", "crates/hyperswitch_connectors/src/connectors/bamboraapac.rs", "crates/hyperswitch_connectors/src/connectors/billwerk.rs", "crates/hyperswitch_connectors/src/connectors/bitpay.rs", "crates/hyperswitch_connectors/src/connectors/bluesnap.rs", "crates/hyperswitch_connectors/src/connectors/boku.rs", "crates/hyperswitch_connectors/src/connectors/cashtocode.rs", "crates/hyperswitch_connectors/src/connectors/coinbase.rs", "crates/hyperswitch_connectors/src/connectors/cryptopay.rs", "crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs", "crates/hyperswitch_connectors/src/connectors/datatrans.rs", "crates/hyperswitch_connectors/src/connectors/deutschebank.rs", "crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs", "crates/hyperswitch_connectors/src/connectors/dlocal.rs", "crates/hyperswitch_connectors/src/connectors/elavon.rs", "crates/hyperswitch_connectors/src/connectors/fiserv.rs", "crates/hyperswitch_connectors/src/connectors/fiservemea.rs", "crates/hyperswitch_connectors/src/connectors/fiuu.rs", "crates/hyperswitch_connectors/src/connectors/forte.rs", "crates/hyperswitch_connectors/src/connectors/globepay.rs", "crates/hyperswitch_connectors/src/connectors/gocardless.rs", "crates/hyperswitch_connectors/src/connectors/helcim.rs", "crates/hyperswitch_connectors/src/connectors/inespay.rs", "crates/hyperswitch_connectors/src/connectors/jpmorgan.rs", "crates/hyperswitch_connectors/src/connectors/mollie.rs", "crates/hyperswitch_connectors/src/connectors/multisafepay.rs", "crates/hyperswitch_connectors/src/connectors/nexinets.rs", "crates/hyperswitch_connectors/src/connectors/nexixpay.rs", "crates/hyperswitch_connectors/src/connectors/nomupay.rs", "crates/hyperswitch_connectors/src/connectors/novalnet.rs", "crates/hyperswitch_connectors/src/connectors/paybox.rs", "crates/hyperswitch_connectors/src/connectors/payeezy.rs", "crates/hyperswitch_connectors/src/connectors/payu.rs", "crates/hyperswitch_connectors/src/connectors/placetopay.rs", "crates/hyperswitch_connectors/src/connectors/powertranz.rs", "crates/hyperswitch_connectors/src/connectors/prophetpay.rs", "crates/hyperswitch_connectors/src/connectors/rapyd.rs", "crates/hyperswitch_connectors/src/connectors/razorpay.rs", "crates/hyperswitch_connectors/src/connectors/redsys.rs", "crates/hyperswitch_connectors/src/connectors/shift4.rs", "crates/hyperswitch_connectors/src/connectors/square.rs", "crates/hyperswitch_connectors/src/connectors/stax.rs", "crates/hyperswitch_connectors/src/connectors/taxjar.rs", "crates/hyperswitch_connectors/src/connectors/thunes.rs", "crates/hyperswitch_connectors/src/connectors/tsys.rs", "crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs", "crates/hyperswitch_connectors/src/connectors/volt.rs", "crates/hyperswitch_connectors/src/connectors/worldline.rs", "crates/hyperswitch_connectors/src/connectors/worldpay.rs", "crates/hyperswitch_connectors/src/connectors/xendit.rs", "crates/hyperswitch_connectors/src/connectors/zen.rs", "crates/hyperswitch_connectors/src/connectors/zsl.rs", "crates/router/src/connector/aci.rs", "crates/router/src/connector/adyen.rs", "crates/router/src/connector/adyenplatform.rs", "crates/router/src/connector/authorizedotnet.rs", "crates/router/src/connector/bankofamerica.rs", "crates/router/src/connector/braintree.rs", "crates/router/src/connector/checkout.rs", "crates/router/src/connector/cybersource.rs", "crates/router/src/connector/dummyconnector.rs", "crates/router/src/connector/ebanx.rs", "crates/router/src/connector/globalpay.rs", "crates/router/src/connector/gpayments.rs", "crates/router/src/connector/iatapay.rs", "crates/router/src/connector/itaubank.rs", "crates/router/src/connector/klarna.rs", "crates/router/src/connector/mifinity.rs", "crates/router/src/connector/netcetera.rs", "crates/router/src/connector/nmi.rs", "crates/router/src/connector/noon.rs", "crates/router/src/connector/nuvei.rs", "crates/router/src/connector/opayo.rs", "crates/router/src/connector/opennode.rs", "crates/router/src/connector/payme.rs", "crates/router/src/connector/payone.rs", "crates/router/src/connector/paypal.rs", "crates/router/src/connector/plaid.rs", "crates/router/src/connector/riskified.rs", "crates/router/src/connector/signifyd.rs", "crates/router/src/connector/stripe.rs", "crates/router/src/connector/threedsecureio.rs", "crates/router/src/connector/trustpay.rs", "crates/router/src/connector/wellsfargo.rs", "crates/router/src/connector/wellsfargopayout.rs", "crates/router/src/connector/wise.rs", "crates/router/src/services/connector_integration_interface.rs", "crates/router/src/utils/connector_onboarding/paypal.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs", "crates/router/src/types/api.rs", "crates/router/src/types/api/payments.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "tests": ["config/deployments/integration_test.toml", "cypress-tests/cypress/e2e/PaymentTest/00000-CoreFlows.cy.js", "cypress-tests/cypress/support/commands.js", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"], "other": ["Cargo.lock", "api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/hyperswitch_interfaces/src/api.rs", "crates/hyperswitch_interfaces/src/api/payments.rs", "crates/hyperswitch_interfaces/src/api/payments_v2.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/lib.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/feature_matrix.rs", "crates/router/src/services/api.rs"]}, "change_types": {"structs_added": 7, "functions_added": 76, "enums_added": 2, "fields_added": 131, "imports_added": 26, "conditionals_added": 2, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Add support for Proxy api
## Type of Chantge
<!-- 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 -->
The Proxy allows you to use tokens with HTTP APIs without needing to access sensitive data directly within your systems. This enables solving both these problems securely while keeping your systems out of compliance scope.
proxy takes any connector request, replaces the token with payment method data from locker.
the field and its literal should be of this format - ` "number": "{{$card_number}}",` `card_number` is the key stored in vault against actual card number value
<img width="1149" alt="Screenshot 2025-04-04 at 1 51 36 PM" src="https://github.com/user-attachments/assets/b51fe892-7abf-4699-bf27-5da414777d47" />
### 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)?
-->
Create a payment method
```
curl --location 'http://localhost:8080/proxy' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_v3xtkbwrNhzIMETzrp6S' \
--header 'Authorization: api-key=dev_q4V5n3dOkwIkoQUxao26QvPI0dmd73rfvtuc8LnUkQHONmQQMCxO3eI9VgaeHUgy' \
--header 'api-key: api_key' \
--data '{
"request_body": {
"source": {
"type": "card",
"number": "{{$card_number}}",
"expiry_month": "{{$card_exp_month}}",
"expiry_year": "{{$card_exp_year}}",
"billing_address": {
"address_line1": "123 High St.",
"address_line2": "Flat 456",
"city": "London",
"state": "GB",
"zip": "SW1A 1AA",
"country": "GB"
}
},
"processing_channel_id": "pc_jx5lvimg4obe7nhoqnhptm6xoq",
"amount": 6540,
"currency": "USD",
"payment_type": "Regular",
"reference": "ORD-5023-4E89",
"description": "Set of 3 masks",
"capture": true,
"capture_on": "2019-09-10T10:11:12Z",
"billing_descriptor": {
"name": "Withdrawal",
"city": "London"
},
"shipping": {
"address": {
"address_line1": "Checkout.com",
"address_line2": "Flat 456",
"city": "London",
"state": "GB",
"zip": "SW1A 1AA",
"country": "GB"
},
"phone": {
"country_code": "+1",
"number": "415 555 2671"
}
}
},
"destination_url": "https://api.sandbox.checkout.com/payments",
"headers": {
"Content-Type": "application/json",
"Authorization": "checkout api key"
},
"token": "payment method id",
"token_type": "payment_method_id",
"method": "POST"
}'
```
response -
```
{
"response": {
"id": "pay_htbngybm5ymu7g2b63z65uy37e",
"action_id": "act_jn52mltlalhu3f6g3u4hsqhwji",
"amount": 6540,
"currency": "USD",
"approved": true,
"status": "Authorized",
"auth_code": "609267",
"response_code": "10000",
"response_summary": "Approved",
"balances": {
"total_authorized": 6540,
"total_voided": 0,
"available_to_void": 6540,
"total_captured": 0,
"available_to_capture": 6540,
"total_refunded": 0,
"available_to_refund": 0
},
"risk": {
"flagged": false,
"score": 0.0
},
"source": {
"id": "src_ac7ll5fwpr7e7gjbnczoboefmm",
"type": "card",
"billing_address": {
"address_line1": "123 High St.",
"address_line2": "Flat 456",
"city": "London",
"state": "GB",
"zip": "SW1A 1AA",
"country": "GB"
},
"expiry_month": 12,
"expiry_year": 2026,
"scheme": "Visa",
"last4": "0093",
"fingerprint": "EEF6D525CC7C861D6AB1CEB56F9285839AE850E79BA43D7D8C06790B7A0ABD7C",
"bin": "476136",
"card_type": "CREDIT",
"card_category": "CONSUMER",
"issuer": "YES BANK, LTD.",
"issuer_country": "IN",
"product_id": "F",
"product_type": "Visa Classic",
"avs_check": "G",
"payment_account_reference": "V001913919895558340",
"regulated_indicator": false
},
"processed_on": "2025-05-19T19:15:09.1945197Z",
"reference": "ORD-5023-4E89",
"scheme_id": "618259364242894",
"processing": {
"acquirer_transaction_id": "064083903392457984441",
"retrieval_reference_number": "368737957737",
"merchant_category_code": "5815",
"scheme_merchant_id": "75155",
"scheme": "VISA",
"aft": false,
"pan_type_processed": "fpan",
"cko_network_token_available": false,
"provision_network_token": false
},
"expires_on": "2025-06-18T19:15:09.1945197Z",
"_links": {
"self": {
"href": "https://api.sandbox.checkout.com/payments/pay_htbngybm5ymu7g2b63z65uy37e"
},
"actions": {
"href": "https://api.sandbox.checkout.com/payments/pay_htbngybm5ymu7g2b63z65uy37e/actions"
},
"capture": {
"href": "https://api.sandbox.checkout.com/payments/pay_htbngybm5ymu7g2b63z65uy37e/captures"
},
"void": {
"href": "https://api.sandbox.checkout.com/payments/pay_htbngybm5ymu7g2b63z65uy37e/voids"
}
}
},
"status_code": 201,
"response_headers": {
"date": "Mon, 19 May 2025 19:15:09 GMT",
"connection": "keep-alive",
"content-type": "application/json; charset=utf-8",
"content-length": "1883",
"cko-version": "1.1045.0+e954ba003",
"strict-transport-security": "max-age=16000000; includeSubDomains; preload;",
"location": "https://api.sandbox.checkout.com/payments/pay_htbngybm5ymu7g2b63z65uy37e",
"cko-request-id": "6262390c-00da-40ac-8ef8-11986b7a301a"
}
}
```
## 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/Cargo.toml`
- `crates/api_models/src/lib.rs`
- `crates/api_models/src/proxy.rs`
- ... and 1 more files
**2. Core Business Logic**
- `crates/router/src/core.rs`
- `crates/router/src/core/payment_methods/vault.rs`
- `crates/router/src/core/proxy.rs`
- ... and 1 more files
**3. Type Definitions**
- `crates/router_env/src/logger/types.rs`
**4. Utils**
- `crates/common_utils/src/request.rs`
- `crates/router/src/routes/lock_utils.rs`
**5. Other**
- `api-reference-v2/api-reference/proxy/proxy.mdx`
- `api-reference-v2/mint.json`
- `api-reference-v2/openapi_spec.json`
- ... and 8 more files
**Code Patterns Applied:**
- Define new data structures (7 changes)
- Implement new functions (17 changes)
- Extend existing types with new fields (35 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 8e9bad64:
Files to modify:
**crates/api_models/src/lib.rs**
Add:
- mod: pub::proxy
**crates/api_models/src/proxy.rs**
Add:
- function: pub::as_map
- function: pub::from_header_map
- struct: pub::Headers
- struct: pub::ProxyRequest
- struct: pub::ProxyResponse
- enum: pub::TokenType
- impl: impl Headers
- impl: impl common_utils::events::ApiEventMetric for ProxyRequest
- impl: impl common_utils::events::ApiEventMetric for ProxyResponse
**crates/api_models/src/refunds.rs**
Modify existing code
**crates/common_utils/src/request.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/openapi/src/routes.rs**
Add:
- mod: pub::proxy
**crates/openapi/src/routes/proxy.rs**
Add:
- function: pub::proxy_core
**crates/router/src/core.rs**
Add:
- mod: pub::proxy
**crates/router/src/core/payment_methods/vault.rs**
Modify existing code
**crates/router/src/core/proxy.rs**
Add:
- function: pub::proxy_core
- function: private::interpolate_token_references_with_vault_data
- function: private::find_field_recursively_in_vault_data
- function: private::extract_field_from_vault_data
- function: private::execute_proxy_request
- function: private::try_from
- struct: private::ProxyResponseWrapper
- impl: impl TryFrom<ProxyResponseWrapper> for proxy_api_models::ProxyResponse
- mod: pub::utils
**crates/router/src/core/proxy/utils.rs**
Add:
- function: pub::get_vault_id
- function: pub::get_headers
- function: pub::get_destination_url
- function: pub::get_method
- function: pub::parse_token
- function: pub::contains_token
- struct: pub::ProxyRequestWrapper
- struct: pub::TokenReference
- impl: impl ProxyRequestWrapper
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes.rs**
Add:
- mod: pub::proxy
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- struct: pub::Proxy
- impl: impl Proxy
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/proxy.rs**
Add:
- function: pub::proxy
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 7901, "pr_title": "feat(router): Add support for Proxy api", "merged_at": "2025-05-22T13:34:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/Cargo.toml", "crates/api_models/src/lib.rs", "crates/api_models/src/proxy.rs", "crates/api_models/src/refunds.rs"], "core_business": ["crates/router/src/core.rs", "crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/proxy.rs", "crates/router/src/core/proxy/utils.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/request.rs", "crates/router/src/routes/lock_utils.rs"], "other": ["api-reference-v2/api-reference/proxy/proxy.mdx", "api-reference-v2/mint.json", "api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes.rs", "crates/openapi/src/routes/proxy.rs", "crates/router/src/lib.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/proxy.rs"]}, "change_types": {"structs_added": 7, "functions_added": 17, "enums_added": 1, "fields_added": 35, "imports_added": 25, "conditionals_added": 1, "database_queries": 1}, "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.