prompt
stringlengths
83
247k
response
stringlengths
121
36.1k
metadata
stringlengths
314
42.3k
fix(connectors): [Hipay] Fix 3DS Mandatory Fields ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Added Support for Domestic Card Network Added Mandatory Fields for 3ds -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 <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue 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 Separate testing is required for this <img width="1053" alt="Screenshot 2025-03-24 at 12 48 52 PM" src="https://github.com/user-attachments/assets/275e4624-9734-40db-9e8a-b288171d85b0" /> ## 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.rs` **2. Core Business Logic** - `crates/router/src/core/payments/flows.rs` - `crates/router/src/core/payments/flows/complete_authorize_flow.rs` - `crates/router/src/core/payments/helpers.rs` - ... and 1 more files **3. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` - `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` - `crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs` - ... and 3 more files **4. Type Definitions** - `crates/router/src/types.rs` **5. Tests** - `cypress-tests/cypress/e2e/configs/Payment/Hipay.js` **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (3 changes) - Extend existing types with new fields (143 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 446716ee: Files to modify: **crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs** Add: - struct: pub::HipayBrowserInfo - struct: pub::ThreeDSPaymentData **crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_data.rs** Modify existing code **crates/router/src/configs/defaults/payment_connector_required_fields.rs** Modify existing code **crates/router/src/connector/stripe/transformers.rs** Modify existing code **crates/router/src/core/payments/flows.rs** Modify existing code **crates/router/src/core/payments/flows/complete_authorize_flow.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/payments/tokenization.rs** Modify existing code **crates/router/src/types.rs** Modify existing code
{"pr_number": 7603, "pr_title": "fix(connectors): [Hipay] Fix 3DS Mandatory Fields", "merged_at": "2025-04-01T18:13:59Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "card", "transaction"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/payments/flows.rs", "crates/router/src/core/payments/flows/complete_authorize_flow.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/tokenization.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs", "crates/router/src/configs/defaults/payment_connector_required_fields.rs", "crates/router/src/connector/stripe/transformers.rs"], "types": ["crates/router/src/types.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Hipay.js"]}, "change_types": {"structs_added": 2, "functions_added": 3, "fields_added": 143, "imports_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): [adyenplatform] update error mapping ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR fixes two critical issues in Adyen Platform connector and payout core flow error handling: 1. **Enhanced error message construction**: Modified `build_error_response` in `crates/hyperswitch_connectors/src/connectors/adyenplatform.rs` to include the `detail` field when `invalid_fields` is not present. This provides users with comprehensive error information, especially for business logic errors where Adyen provides detailed explanations. 2. **Fixed improper PayoutFailed usage**: Removed multiple instances of `PayoutFailed` from core payouts flow that were being thrown after connector calls. This was bypassing proper connector error handling and preventing detailed error messages from reaching the API response. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. --> This PR allows mapping the right error codes and messages from Adyenplatform to HyperSwitch's payout API response in case of failures. **Solution**: This change ensures that all available error information from Adyen is properly communicated to users, improving the debugging experience and reducing support overhead. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> <details> <summary>1. Create a payout in an account without any funds</summary> cURL (AUD has 0 balance) curl --location --request POST 'http://localhost:8080/payouts/create' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_7fXFUFajfCYtS5aKrQXJMyIiBLr2gw3Y862wqkp6qXHpl88H0hQaEr89xAnvsxvp' \ --data-raw '{"amount":1,"currency":"AUD","profile_id":"pro_E9Z7dCKDd54NaVYCFFhF","customer":{"id":"cus_X7urM1AQqvpECo6G5XkW","name":"New Name"},"connector":["adyenplatform"],"description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111111111111111","expiry_month":"01","expiry_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","city":"San Fransico","state":"CA","country":"IT","first_name":"John","last_name":"Doe"},"email":"[email protected]"},"recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}' Response {"payout_id":"payout_cX5OwgVAuqaHJkF9zxeu","merchant_id":"merchant_1757926554","merchant_order_reference_id":null,"amount":1,"currency":"AUD","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":"JP Morgan","card_network":"Visa","card_type":"CREDIT","card_issuing_country":"INDIA","bank_code":"JP_JPM","last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"city":"San Fransico","country":"IT","line1":"1467","line2":"Harrison Street","line3":null,"zip":null,"state":"CA","first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"[email protected]"},"auto_fulfill":true,"customer_id":"cus_X7urM1AQqvpECo6G5XkW","customer":{"id":"cus_X7urM1AQqvpECo6G5XkW","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_cX5OwgVAuqaHJkF9zxeu_secret_eIw5TJyjUYBydBp3Aa5c","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_m86KCMmTaeQ2mTtSgfRA","status":"failed","error_message":"notEnoughBalance","error_code":"Refused","profile_id":"pro_E9Z7dCKDd54NaVYCFFhF","created":"2025-09-15T11:55:40.044Z","connector_transaction_id":null,"priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":"UE_9000","unified_message":"Something went wrong","payout_method_id":null} Expectation - Payout must fail - error_message and error_code must be populated </details> <details> <summary>2. Create a payout using invalid transfer details</summary> cURL (Invalid postcode) curl --location --request POST 'http://localhost:8080/payouts/create' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_7fXFUFajfCYtS5aKrQXJMyIiBLr2gw3Y862wqkp6qXHpl88H0hQaEr89xAnvsxvp' \ --data-raw '{"amount":1,"currency":"EUR","profile_id":"pro_E9Z7dCKDd54NaVYCFFhF","customer":{"id":"cus_X7urM1AQqvpECo6G5XkW","name":"New Name"},"connector":["adyenplatform"],"description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111111111111111","expiry_month":"01","expiry_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","city":"San Fransico","state":"CA","zip":"123","country":"IT","first_name":"John","last_name":"Doe"},"email":"[email protected]"},"recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}' Response {"payout_id":"payout_lAUUuhWCoj1qVo9jwHeQ","merchant_id":"merchant_1757926554","merchant_order_reference_id":null,"amount":1,"currency":"EUR","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":"JP Morgan","card_network":"Visa","card_type":"CREDIT","card_issuing_country":"INDIA","bank_code":"JP_JPM","last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"city":"San Fransico","country":"IT","line1":"1467","line2":"Harrison Street","line3":null,"zip":"123","state":"CA","first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"[email protected]"},"auto_fulfill":true,"customer_id":"cus_X7urM1AQqvpECo6G5XkW","customer":{"id":"cus_X7urM1AQqvpECo6G5XkW","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_lAUUuhWCoj1qVo9jwHeQ_secret_Bl8J3MXCywJd0j2EzzGk","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_m86KCMmTaeQ2mTtSgfRA","status":"failed","error_message":"Invalid transfer information provided\nInvalid fields: [{\"name\":\"counterparty.cardHolder.address.postalCode\",\"value\":\"123\",\"message\":\"Not valid for IT. Allowed formats: NNNNN.\"}]","error_code":"30_081","profile_id":"pro_E9Z7dCKDd54NaVYCFFhF","created":"2025-09-15T11:57:20.960Z","connector_transaction_id":null,"priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":"UE_9000","unified_message":"Something went wrong","payout_method_id":null} cURL (Invalid expiry) curl --location --request POST 'http://localhost:8080/payouts/create' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_7fXFUFajfCYtS5aKrQXJMyIiBLr2gw3Y862wqkp6qXHpl88H0hQaEr89xAnvsxvp' \ --data-raw '{"amount":1,"currency":"EUR","profile_id":"pro_E9Z7dCKDd54NaVYCFFhF","customer":{"id":"cus_X7urM1AQqvpECo6G5XkW","name":"New Name"},"connector":["adyenplatform"],"description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111111111111111","expiry_month":"01","expiry_year":"2024","card_holder_name":"John Doe"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","city":"San Fransico","state":"CA","country":"IT","first_name":"John","last_name":"Doe"},"email":"[email protected]"},"recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}' Response {"payout_id":"payout_ME3BMSySpDKtX5tsZI7S","merchant_id":"merchant_1757926554","merchant_order_reference_id":null,"amount":1,"currency":"EUR","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":"JP Morgan","card_network":"Visa","card_type":"CREDIT","card_issuing_country":"INDIA","bank_code":"JP_JPM","last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"2024","card_holder_name":"John Doe"}},"billing":{"address":{"city":"San Fransico","country":"IT","line1":"1467","line2":"Harrison Street","line3":null,"zip":null,"state":"CA","first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"[email protected]"},"auto_fulfill":true,"customer_id":"cus_X7urM1AQqvpECo6G5XkW","customer":{"id":"cus_X7urM1AQqvpECo6G5XkW","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_ME3BMSySpDKtX5tsZI7S_secret_T2I0yoRxYatQobkNfApR","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_m86KCMmTaeQ2mTtSgfRA","status":"failed","error_message":"Invalid transfer information provided\nInvalid fields: [{\"name\":\"counterparty.cardIdentification.expiryYear\",\"value\":\"2024\",\"message\":\"Expiry date must be in the future\"},{\"name\":\"counterparty.cardIdentification.expiryMonth\",\"value\":\"01\",\"message\":\"Expiry date must be in the future\"}]","error_code":"30_081","profile_id":"pro_E9Z7dCKDd54NaVYCFFhF","created":"2025-09-15T11:58:19.648Z","connector_transaction_id":null,"priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":"UE_9000","unified_message":"Something went wrong","payout_method_id":null} cURL (Invalid state) curl --location --request POST 'http://localhost:8080/payouts/create' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_7fXFUFajfCYtS5aKrQXJMyIiBLr2gw3Y862wqkp6qXHpl88H0hQaEr89xAnvsxvp' \ --data-raw '{"amount":1,"currency":"EUR","profile_id":"pro_E9Z7dCKDd54NaVYCFFhF","customer":{"id":"cus_X7urM1AQqvpECo6G5XkW","name":"New Name"},"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","state":"CA","country":"AU","first_name":"John","last_name":"Doe"},"email":"[email protected]"},"recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}' Response {"payout_id":"payout_7s7zCL1wMqTmSk304LJg","merchant_id":"merchant_1757926554","merchant_order_reference_id":null,"amount":1,"currency":"EUR","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":"JP Morgan","card_network":"Visa","card_type":"CREDIT","card_issuing_country":"INDIA","bank_code":"JP_JPM","last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"city":"San Fransico","country":"AU","line1":"1467","line2":"Harrison Street","line3":null,"zip":null,"state":"CA","first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"[email protected]"},"auto_fulfill":true,"customer_id":"cus_X7urM1AQqvpECo6G5XkW","customer":{"id":"cus_X7urM1AQqvpECo6G5XkW","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_7s7zCL1wMqTmSk304LJg_secret_AlVXYS4afLwAvtoiuA12","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_m86KCMmTaeQ2mTtSgfRA","status":"failed","error_message":"Invalid transfer information provided\nInvalid fields: [{\"name\":\"counterparty.cardHolder.address.stateOrProvince\",\"value\":\"CA\",\"message\":\"Not valid for AU. Allowed values: [VIC, ACT, NSW, NT, TAS, QL... For full list visit documentation.\"}]","error_code":"30_081","profile_id":"pro_E9Z7dCKDd54NaVYCFFhF","created":"2025-09-15T11:59:00.645Z","connector_transaction_id":null,"priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":"UE_9000","unified_message":"Something went wrong","payout_method_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 **payment** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payouts.rs` **2. 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 (19 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit 1c0fc496: 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 **crates/router/src/core/payouts.rs** Modify existing code
{"pr_number": 9384, "pr_title": "fix(connector): [adyenplatform] update error mapping", "merged_at": "2025-09-18T14:31:52Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "merchant", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/payouts.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/adyenplatform.rs", "crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs"]}, "change_types": {"fields_added": 19, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(payment_method): add validation for proxy card details ## 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 proxy card as a valid payment method subtype for cards ### 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)? --> Need proxy module for testing ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/payment_methods.rs` **Detailed Identifier Changes:** Commit ccdae877: Files to modify: **crates/api_models/src/payment_methods.rs** Modify existing code
{"pr_number": 9136, "pr_title": "fix(payment_method): add validation for proxy card details", "merged_at": "2025-09-01T15:28:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "card"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(users): Force 2FA in production environment ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR forces users to use 2FA in production. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [x] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> `config/deployments/production.toml` ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> Closes #6592. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> This change will only affect production. 1. 2FA Status API - `is_skippable` field is added in the response. ``` curl --location 'http://localhost:8080/user/2fa/v2' \ --header 'Authorization: JWT' \ ``` ``` { "status": null, "is_skippable": true } ``` 2. Terminate 2FA API - This API will now not allow skip 2FA if the `force_two_factor_auth` ``` curl --location 'http://localhost:8080/user/2fa/terminate?skip_two_factor_auth=true' \ --header 'Authorization: JWT' \ ``` ``` { "error": { "type": "invalid_request", "message": "Two factor auth required", "code": "UR_40" } } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Configuration Files** - `config/deployments/production.toml`
{"pr_number": 6596, "pr_title": "refactor(users): Force 2FA in production environment", "merged_at": "2024-11-19T13:18:51Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"config": ["config/deployments/production.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
fix(feature_matrix): refunds are supported by jpmorgan ## 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 marks refunds as supported by JPMorgan connector. Although this does not affect refund flow, the feature matrix marking is wrong. ### 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). --> I added refunds support 3 weeks ago in #8436 and this was missed. closes #8698 ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Hit feature matrix endpoint: ```sh curl --location 'http://localhost:8080/feature_matrix' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' ``` ```json { ... "supported_payment_methods": [ { "payment_method": "card", "payment_method_type": "credit", "payment_method_type_display_name": "Credit Card", "mandates": "not_supported", "refunds": "supported", "supported_capture_methods": [ "automatic", "manual" ], "three_ds": "not_supported", "no_three_ds": "supported", "supported_card_networks": [ "AmericanExpress", "DinersClub", "Discover", "JCB", "Mastercard", ... }, { "payment_method": "card", "payment_method_type": "debit", "payment_method_type_display_name": "Debit Card", "mandates": "not_supported", "refunds": "supported", "supported_capture_methods": [ "automatic", "manual" ], "three_ds": "not_supported", "no_three_ds": "supported", "supported_card_networks": [ "AmericanExpress", "DinersClub", "Discover", "JCB", "Mastercard", "UnionPay", "Visa" ], "supported_countries": [ "FRA", "BEL", ... } ``` ## 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` **Code Patterns Applied:** - Extend existing types with new fields (2 changes) **Detailed Identifier Changes:** Commit 5c78abd7: Files to modify: **crates/hyperswitch_connectors/src/connectors/jpmorgan.rs** Modify existing code
{"pr_number": 8699, "pr_title": "fix(feature_matrix): refunds are supported by jpmorgan", "merged_at": "2025-07-24T13:32:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "refund", "connector"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/jpmorgan.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): worldpay - add dynamic fields and update terminal status mapping ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description This PR contains changes to - update status mapping for Worldpay - payments and refunds - add required fields for Worldpay - fix refund retrieve bug for Worldpay Described in detail - #6316 point # 5 ### 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 - Keeps the behavior of CaptureMethod uniform across connectors - Introduces default fields for Worldpay cards ## How did you test it? - Run Worldpay's cypress test cases <img width="746" alt="Screenshot 2024-11-27 at 4 15 21 PM" src="https://github.com/user-attachments/assets/79860a69-8f5e-48d8-8a74-6bfc3d15196e"> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [x] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Database Layer (Queries & Schema)** - `crates/diesel_models/src/query/payment_attempt.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs` **3. Core Business Logic** - `crates/router/src/core/refunds.rs` **4. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/worldpay.rs` - `crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs` - `crates/router/src/configs/defaults/payment_connector_required_fields.rs` **5. Tests** - `cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js` - `cypress-tests/cypress/fixtures/confirm-body.json` - `cypress-tests/cypress/fixtures/create-confirm-body.json` - ... and 5 more files **6. Other** - `crates/router/src/db/kafka_store.rs` - `crates/storage_impl/src/mock_db/payment_attempt.rs` - `crates/storage_impl/src/payments/payment_attempt.rs` **Code Patterns Applied:** - Implement new functions (2 changes) - Extend existing types with new fields (243 changes) - Add conditional logic for feature flags or filtering (2 changes) - Modify database queries (4 changes) **Detailed Identifier Changes:** Commit 5a98ed65: Files to modify: **crates/diesel_models/src/query/payment_attempt.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/worldpay.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs** Add: - function: private::from - impl: impl From<PaymentOutcome> for enums::RefundStatus **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code **crates/router/src/configs/defaults/payment_connector_required_fields.rs** Add: - function: pub::get_worldpay_billing_required_fields **crates/router/src/core/refunds.rs** Modify existing code **crates/router/src/db/kafka_store.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_attempt.rs** Modify existing code **crates/storage_impl/src/payments/payment_attempt.rs** Modify existing code
{"pr_number": 6468, "pr_title": "feat(connector): worldpay - add dynamic fields and update terminal status mapping", "merged_at": "2024-11-28T14:50:09Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "refund"]}, "hierarchy": {"database": ["crates/diesel_models/src/query/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs"], "core_business": ["crates/router/src/core/refunds.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/worldpay.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs", "crates/router/src/configs/defaults/payment_connector_required_fields.rs"], "tests": ["cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js", "cypress-tests/cypress/fixtures/confirm-body.json", "cypress-tests/cypress/fixtures/create-confirm-body.json", "cypress-tests/cypress/fixtures/create-mandate-cit.json", "cypress-tests/cypress/fixtures/create-mandate-mit.json", "cypress-tests/cypress/fixtures/create-pm-id-mit.json", "cypress-tests/cypress/fixtures/save-card-confirm-body.json", "cypress-tests/cypress/support/commands.js"], "other": ["crates/router/src/db/kafka_store.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs"]}, "change_types": {"functions_added": 2, "fields_added": 243, "conditionals_added": 2, "database_queries": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
chore: add migrations for Currency type in DB ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description This PR adds a diesel migration for including below variants in Currency ENUM in database ```AFN BTN CDF ERN IRR ISK KPW SDG SYP TJS TMT ZMW ZWL ``` ### 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? Ran migrations locally. ## 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** - `migrations/2025-01-03-084904_add_currencies/down.sql` - `migrations/2025-01-03-084904_add_currencies/up.sql` **Code Patterns Applied:** - Modify database queries (4 changes)
{"pr_number": 6980, "pr_title": "chore: add migrations for Currency type in DB", "merged_at": "2025-01-03T11:24:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["migrations/2025-01-03-084904_add_currencies/down.sql", "migrations/2025-01-03-084904_add_currencies/up.sql"]}, "change_types": {"database_queries": 4}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
fix(connector): [Cybersource] fix the required fields for wallet mandate payments ## 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 --> https://github.com/juspay/hyperswitch/pull/6911 Fix required fileds for wallet mandate payments for cybersource and bank of america. ### 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 payment with cybersource request : ``` { "amount":1001, "currency": "USD", "confirm": false, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 1001, "customer_id": "StripeCustomer", "setup_future_usage": "off_session", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "card_cvc": "737" } }, "billing": { "address": { "line1": "1467", "line2": "CA", "line3": "CA", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "CA", "line3": "CA", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8", "language": "nl-NL", "color_depth": 24, "ip_address": "127.2.2.0", "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } } ``` Response: ``` { "payment_id": "pay_HjHrD9XnoriWQVytEFmc", "merchant_id": "merchant_1734704620", "status": "requires_confirmation", "amount": 1001, "net_amount": 1001, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": null, "client_secret": "pay_HjHrD9XnoriWQVytEFmc_secret_t0UYFhsIvlDTXCvg9z4t", "created": "2024-12-20T14:23:55.092Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_Q5NlsmCeYrfoB6JJxvH3", "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "CA", "line3": "CA", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "CA", "line3": "CA", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "StripeCustomer", "created_at": 1734704635, "expires": 1734708235, "secret": "epk_2e7a190e0d7d41a8b11feb9141c46717" }, "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_ZKIFiKWGKtp5xl2aACJn", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": null, "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-12-20T14:38:55.091Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.2.2.0", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2024-12-20T14:23:55.295Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` merchant payment method list ``` curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_HjHrD9XnoriWQVytEFmc_secret_t0UYFhsIvlDTXCvg9z4t' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_080b5724d4cd41b0811811a492eb4992' \ --data '' ``` response : ``` { "redirect_url": "https://google.com/success", "currency": "USD", "payment_methods": [ { "payment_method": "wallet", "payment_method_types": [ { "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.line1": { "required_field": "payment_method_data.billing.address.line1", "display_name": "line1", "field_type": "user_address_line1", "value": "1467" }, "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.address.city": { "required_field": "payment_method_data.billing.address.city", "display_name": "city", "field_type": "user_address_city", "value": "San Fransico" }, "billing.address.country": { "required_field": "payment_method_data.billing.address.country", "display_name": "country", "field_type": { "user_address_country": { "options": [ "ALL" ] } }, "value": "US" }, "billing.address.state": { "required_field": "payment_method_data.billing.address.state", "display_name": "state", "field_type": "user_address_state", "value": "California" }, "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.email": { "required_field": "payment_method_data.billing.email", "display_name": "email", "field_type": "user_email_address", "value": "[email protected]" } }, "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.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": "[email protected]" }, "billing.address.city": { "required_field": "payment_method_data.billing.address.city", "display_name": "city", "field_type": "user_address_city", "value": "San Fransico" }, "billing.address.country": { "required_field": "payment_method_data.billing.address.country", "display_name": "country", "field_type": { "user_address_country": { "options": [ "ALL" ] } }, "value": "US" }, "billing.address.line1": { "required_field": "payment_method_data.billing.address.line1", "display_name": "line1", "field_type": "user_address_line1", "value": "1467" }, "billing.address.zip": { "required_field": "payment_method_data.billing.address.zip", "display_name": "zip", "field_type": "user_address_pincode", "value": "94122" }, "billing.address.state": { "required_field": "payment_method_data.billing.address.state", "display_name": "state", "field_type": "user_address_state", "value": "California" } }, "surcharge_details": null, "pm_auth_connector": null } ] }, { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ { "card_network": "DinersClub", "surcharge_details": null, "eligible_connectors": [ "cybersource" ] }, { "card_network": "Discover", "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": { "billing.address.state": { "required_field": "payment_method_data.billing.address.state", "display_name": "state", "field_type": "user_address_state", "value": "California" }, "billing.address.line1": { "required_field": "payment_method_data.billing.address.line1", "display_name": "line1", "field_type": "user_address_line1", "value": "1467" }, "payment_method_data.card.card_exp_month": { "required_field": "payment_method_data.card.card_exp_month", "display_name": "card_exp_month", "field_type": "user_card_expiry_month", "value": null }, "payment_method_data.card.card_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": "[email protected]" }, "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.zip": { "required_field": "payment_method_data.billing.address.zip", "display_name": "zip", "field_type": "user_address_pincode", "value": "94122" }, "payment_method_data.card.card_number": { "required_field": "payment_method_data.card.card_number", "display_name": "card_number", "field_type": "user_card_number", "value": null }, "billing.address.first_name": { "required_field": "payment_method_data.billing.address.first_name", "display_name": "card_holder_name", "field_type": "user_full_name", "value": "joseph" }, "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.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": "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.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_number": { "required_field": "payment_method_data.card.card_number", "display_name": "card_number", "field_type": "user_card_number", "value": null }, "billing.address.zip": { "required_field": "payment_method_data.billing.address.zip", "display_name": "zip", "field_type": "user_address_pincode", "value": "94122" }, "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.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.last_name": { "required_field": "payment_method_data.billing.address.last_name", "display_name": "card_holder_name", "field_type": "user_full_name", "value": "Doe" }, "billing.email": { "required_field": "payment_method_data.billing.email", "display_name": "email", "field_type": "user_email_address", "value": "[email protected]" }, "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 }, "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_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.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 } ``` ## 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` **Code Patterns Applied:** - Extend existing types with new fields (8 changes) **Detailed Identifier Changes:** Commit 1ebd494c: Files to modify: **crates/router/src/configs/defaults/payment_connector_required_fields.rs** Modify existing code
{"pr_number": 6921, "pr_title": "fix(connector): [Cybersource] fix the required fields for wallet mandate payments", "merged_at": "2024-12-23T14:13:00Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/configs/defaults/payment_connector_required_fields.rs"]}, "change_types": {"fields_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connectors): [Worldpayvantiv] add card support ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Hotfix for https://github.com/juspay/hyperswitch/pull/8219 Add worldpay vantiv as a payment connector. Integrated non 3ds cards flow. > Note: Report Group for each transaction is collected from the payment's metadata. If not provided - then the default report group provided in the MCA is used > Note: Currency for the transaction is not passed in the payment request to the connector. As the connector process payments based on the creds. The currency for a transaction is not included in the payment request sent to the connector. Instead, the connector determines the currency based on the credentials (merchant account) used for processing. Pass the merchant_config_currency field in the MCA metadata > Note: Performing a psync after a void, capture, or refund may return an incorrect status. This is because Worldpay Vantiv does not support retrieving the status of void or capture operations, and the response will reflect the status of the original authorization instead. MCA Metadata - required ``` "metadata": { "report_group" : "Hello", "merchant_config_currency":"USD" } ``` Payments Metadata - optional ``` "metadata": { "report_group" : "Hello" } ``` ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Find the PR for cypress testcases here https://github.com/juspay/hyperswitch/pull/8234 <details> <summary>MCA Create</summary> > Note: Add Metadata ``` curl --location 'http://localhost:8080/account/postman_merchant_GHAction_0e943b6a-2420-40b9-9038-014526c6d5c4/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_f5rS4tT7dwe1ASV4c9vswu99Exi1XhbtkQkq8WlQ4kJkwggWd1j5PMlyMOBRxC7X' \ --data-raw '{ "connector_type": "payment_processor", "connector_name": "worldpayvantiv", "business_country": "US", "business_label": "default", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "***********8", "key1": "***********", "api_secret": "********" }, "test_mode": false, "disabled": false, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "debit", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "report_group" : "Hello", "merchant_config_currency":"EUR" } }' ``` Response ``` {"connector_type":"payment_processor","connector_name":"worldpayvantiv","connector_label":"worldpayvantiv_US_default","merchant_connector_id":"mca_mDfUiiycKohM3lhqPzmF","profile_id":"pro_sKicDP92EtTBg8xTcMvo","connector_account_details":{"auth_type":"SignatureKey","api_key":"YA****************AG","key1":"e@************{S","api_secret":"VI*******ST"},"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"},"test_mode":false,"disabled":false,"frm_configs":null,"business_country":"US","business_label":"default","business_sub_label":null,"applepay_verified_domains":null,"pm_auth_config":null,"status":"active","additional_merchant_data":null,"connector_wallets_details":null} ``` </details> <details> <summary> Payment - Automatic Capture</summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_f5rS4tT7dwe1ASV4c9vswu99Exi1XhbtkQkq8WlQ4kJkwggWd1j5PMlyMOBRxC7X' \ --data-raw '{ "return_url": "https://example.com", "confirm": true, "customer_acceptance": null, "description": "Test Payment", "email": "[email protected]", "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" }, "payment_method": "card", "amount": 5000, "authentication_type": "no_three_ds", "payment_method_data": { "card": { "card_number": "4470330769941000", "card_exp_month": "01", "card_exp_year": "27", "card_cvc": "123" } }, "currency": "EUR" }' ``` Response ``` {"payment_id":"pay_0DS5p4fWlx7o3YrJImLd","merchant_id":"postman_merchant_GHAction_0e943b6a-2420-40b9-9038-014526c6d5c4","status":"succeeded","amount":5000,"net_amount":5000,"shipping_cost":null,"amount_capturable":0,"amount_received":5000,"connector":"worldpayvantiv","client_secret":"pay_0DS5p4fWlx7o3YrJImLd_secret_nxG6CBMA6jyl2GJCwLQo","created":"2025-06-03T10:00:29.128Z","currency":"EUR","customer_id":null,"customer":{"id":null,"name":null,"email":"[email protected]","phone":null,"phone_country_code":null},"description":"Test Payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"1000","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"447033","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"27","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":"https://example.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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"309835803353942786","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_0DS5p4fWlx7o3YrJImLd","payment_link":null,"profile_id":"pro_sKicDP92EtTBg8xTcMvo","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_mDfUiiycKohM3lhqPzmF","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-03T10:15:29.128Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-03T10:00:29.551Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null} ``` </details> <details> <summary> Payment - Manual Capture</summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_f5rS4tT7dwe1ASV4c9vswu99Exi1XhbtkQkq8WlQ4kJkwggWd1j5PMlyMOBRxC7X' \ --data-raw '{ "return_url": "https://example.com", "confirm": true, "customer_acceptance": null, "description": "Test Payment", "capture_method": "manual", "email": "[email protected]", "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" }, "payment_method": "card", "amount": 5000, "authentication_type": "no_three_ds", "payment_method_data": { "card": { "card_number": "4470330769941000", "card_exp_month": "01", "card_exp_year": "27", "card_cvc": "123" } }, "currency": "EUR" }' ``` Response ``` {"payment_id":"pay_w1skMTTK9fahKyRPaxFn","merchant_id":"postman_merchant_GHAction_0e943b6a-2420-40b9-9038-014526c6d5c4","status":"requires_capture","amount":5000,"net_amount":5000,"shipping_cost":null,"amount_capturable":5000,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_w1skMTTK9fahKyRPaxFn_secret_riJAK83eAjjroVnvZpom","created":"2025-06-03T10:01:55.966Z","currency":"EUR","customer_id":null,"customer":{"id":null,"name":null,"email":"[email protected]","phone":null,"phone_country_code":null},"description":"Test Payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1000","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"447033","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"27","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":"https://example.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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"037145635133998069","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_w1skMTTK9fahKyRPaxFn","payment_link":null,"profile_id":"pro_sKicDP92EtTBg8xTcMvo","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_mDfUiiycKohM3lhqPzmF","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-03T10:16:55.966Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-03T10:01:56.302Z","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} ``` Capture ``` curl --location 'http://localhost:8080/payments/pay_w1skMTTK9fahKyRPaxFn/capture' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_f5rS4tT7dwe1ASV4c9vswu99Exi1XhbtkQkq8WlQ4kJkwggWd1j5PMlyMOBRxC7X' \ --data '{ "amount_to_capture": 10, "statement_descriptor_name": "Joseph", "statement_descriptor_suffix": "JS" }' ``` Response ``` {"payment_id":"pay_w1skMTTK9fahKyRPaxFn","merchant_id":"postman_merchant_GHAction_0e943b6a-2420-40b9-9038-014526c6d5c4","status":"partially_captured","amount":5000,"net_amount":5000,"shipping_cost":null,"amount_capturable":0,"amount_received":10,"connector":"worldpayvantiv","client_secret":"pay_w1skMTTK9fahKyRPaxFn_secret_riJAK83eAjjroVnvZpom","created":"2025-06-03T10:01:55.966Z","currency":"EUR","customer_id":null,"customer":{"id":null,"name":null,"email":"[email protected]","phone":null,"phone_country_code":null},"description":"Test Payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1000","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"447033","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"27","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":"https://example.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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"507635677444597930","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_w1skMTTK9fahKyRPaxFn","payment_link":null,"profile_id":"pro_sKicDP92EtTBg8xTcMvo","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_mDfUiiycKohM3lhqPzmF","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-03T10:16:55.966Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-03T10:02:35.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} ``` </details> <details> <summary> Payment - Manual and Void</summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_f5rS4tT7dwe1ASV4c9vswu99Exi1XhbtkQkq8WlQ4kJkwggWd1j5PMlyMOBRxC7X' \ --data-raw '{ "return_url": "https://example.com", "confirm": true, "customer_acceptance": null, "description": "Test Payment", "capture_method": "manual", "email": "[email protected]", "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" }, "payment_method": "card", "amount": 5000, "authentication_type": "no_three_ds", "payment_method_data": { "card": { "card_number": "4470330769941000", "card_exp_month": "01", "card_exp_year": "27", "card_cvc": "123" } }, "currency": "EUR" }' ``` Response ``` {"payment_id":"pay_1VguBrodKij7MjODXDUx","merchant_id":"postman_merchant_GHAction_0e943b6a-2420-40b9-9038-014526c6d5c4","status":"requires_capture","amount":5000,"net_amount":5000,"shipping_cost":null,"amount_capturable":5000,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_1VguBrodKij7MjODXDUx_secret_0NK6mTyzXyIksKIscFdg","created":"2025-06-03T10:03:40.285Z","currency":"EUR","customer_id":null,"customer":{"id":null,"name":null,"email":"[email protected]","phone":null,"phone_country_code":null},"description":"Test Payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1000","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"447033","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"27","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":"https://example.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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"811673778835197805","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_1VguBrodKij7MjODXDUx","payment_link":null,"profile_id":"pro_sKicDP92EtTBg8xTcMvo","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_mDfUiiycKohM3lhqPzmF","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-03T10:18:40.285Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-03T10:03:40.653Z","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} ``` Void ``` curl --location 'http://localhost:8080/payments/pay_qRZdNBi5Uqbub8TPwW4g/cancel' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_f5rS4tT7dwe1ASV4c9vswu99Exi1XhbtkQkq8WlQ4kJkwggWd1j5PMlyMOBRxC7X' \ --data '{"cancellation_reason":"requested_by_customer"}' ``` Response ``` {"payment_id":"pay_qRZdNBi5Uqbub8TPwW4g","merchant_id":"postman_merchant_GHAction_0e943b6a-2420-40b9-9038-014526c6d5c4","status":"cancelled","amount":5000,"net_amount":5000,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_qRZdNBi5Uqbub8TPwW4g_secret_3pTlx8WqwVgOzNL13YRZ","created":"2025-06-03T10:11:25.750Z","currency":"EUR","customer_id":null,"customer":{"id":null,"name":null,"email":"[email protected]","phone":null,"phone_country_code":null},"description":"Test Payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1000","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"447033","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"27","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":"https://example.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":"requested_by_customer","error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"274134101692557291","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_qRZdNBi5Uqbub8TPwW4g","payment_link":null,"profile_id":"pro_sKicDP92EtTBg8xTcMvo","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_mDfUiiycKohM3lhqPzmF","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-03T10:26:25.750Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-03T10:11: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","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null} ``` </details> <details> <summary> Payment and Refund </summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_f5rS4tT7dwe1ASV4c9vswu99Exi1XhbtkQkq8WlQ4kJkwggWd1j5PMlyMOBRxC7X' \ --data-raw '{ "return_url": "https://example.com", "confirm": true, "customer_acceptance": null, "description": "Test Payment", "email": "[email protected]", "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" }, "payment_method": "card", "amount": 5000, "authentication_type": "no_three_ds", "payment_method_data": { "card": { "card_number": "4470330769941000", "card_exp_month": "01", "card_exp_year": "27", "card_cvc": "123" } }, "currency": "EUR" }' ``` Response ``` {"payment_id":"pay_zRc36Lj42iKAOFxZgSxo","merchant_id":"postman_merchant_GHAction_0e943b6a-2420-40b9-9038-014526c6d5c4","status":"succeeded","amount":5000,"net_amount":5000,"shipping_cost":null,"amount_capturable":0,"amount_received":5000,"connector":"worldpayvantiv","client_secret":"pay_zRc36Lj42iKAOFxZgSxo_secret_IrmD7ftImm8kFInOIdmr","created":"2025-06-03T10:06:14.096Z","currency":"EUR","customer_id":null,"customer":{"id":null,"name":null,"email":"[email protected]","phone":null,"phone_country_code":null},"description":"Test Payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"1000","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"447033","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"27","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":"https://example.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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"615543068718754950","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_zRc36Lj42iKAOFxZgSxo","payment_link":null,"profile_id":"pro_sKicDP92EtTBg8xTcMvo","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_mDfUiiycKohM3lhqPzmF","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-03T10:21:14.096Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-03T10:06:14.472Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"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} ``` Refund ``` curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_f5rS4tT7dwe1ASV4c9vswu99Exi1XhbtkQkq8WlQ4kJkwggWd1j5PMlyMOBRxC7X' \ --data '{ "payment_id": "pay_zRc36Lj42iKAOFxZgSxo", "amount": 10, "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response ``` {"refund_id":"ref_u50Ektt5srnf8HobAdxT","payment_id":"pay_zRc36Lj42iKAOFxZgSxo","amount":10,"currency":"EUR","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-03T10:06:40.909Z","updated_at":"2025-06-03T10:06:41.300Z","connector":"worldpayvantiv","profile_id":"pro_sKicDP92EtTBg8xTcMvo","merchant_connector_id":"mca_mDfUiiycKohM3lhqPzmF","split_refunds":{"stripe_split_refund":{"revert_platform_fee":true,"revert_transfer":true}},"issuer_error_code":null,"issuer_error_message":null} ``` </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/admin.rs` **2. External Connector Integration** - `crates/common_enums/src/connector_enums.rs` - `crates/connector_configs/src/connector.rs` - `crates/connector_configs/toml/development.toml` - ... and 7 more files **3. Type Definitions** - `crates/router/src/types/api.rs` - `crates/router/src/types/transformers.rs` **4. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **5. Configuration Files** - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - `config/development.toml` - ... and 1 more files **6. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` **Code Patterns Applied:** - Define new data structures (21 changes) - Implement new functions (28 changes) - Extend existing types with new fields (516 changes) - Add conditional logic for feature flags or filtering (16 changes) **Detailed Identifier Changes:** Commit ec4b4479: 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/worldpayvantiv.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs** Remove: - function: private::from - struct: pub::WorldpayvantivPaymentsRequest - struct: pub::WorldpayvantivAuthType - impl: impl From<(StringMinorUnit, T)> for WorldpayvantivRouterData<T> Add: - function: private::from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::try_from - function: private::get_attempt_status - struct: pub::WorldpayvantivAuthType - struct: pub::WorldpayvantivPaymentMetadata - struct: pub::WorldpayvantivMetadataObject - struct: pub::CnpOnlineRequest - struct: pub::Void - struct: pub::Capture - struct: pub::Authorization - struct: pub::Sale - struct: pub::RefundRequest - struct: pub::TransactionQuery - struct: pub::WorldpayvantivCardData - struct: pub::CnpOnlineResponse - struct: pub::CaptureResponse - struct: pub::AuthorizationResponse - struct: pub::SaleResponse - struct: pub::VoidResponse - struct: pub::QueryTransactionResponse - struct: pub::ResultsMax10 - struct: pub::CreditResponse - enum: pub::OrderSource - enum: pub::WorldpayvativCardType - enum: pub::WorldpayvantivPaymentFlow - impl: impl From<(MinorUnit, T)> for WorldpayvantivRouterData<T> - impl: impl TryFrom<&Option<common_utils::pii::SecretSerdeValue>> for change_context - impl: impl TryFrom<common_enums::CardNetwork> for WorldpayvativCardType - impl: impl TryFrom<&WorldpayvantivRouterData<&PaymentsAuthorizeRouterData>> for CnpOnlineRequest - impl: impl TryFrom<&WorldpayvantivRouterData<&PaymentsCaptureRouterData>> for CnpOnlineRequest - impl: impl TryFrom<&WorldpayvantivRouterData<&RefundsRouterData<F>>> for CnpOnlineRequest - impl: impl TryFrom<&RefundSyncRouterData> for CnpOnlineRequest - impl: impl TryFrom<RefundsResponseRouterData<Execute, CnpOnlineResponse>> for RefundsRouterData<Execute> - mod: pub::worldpayvantiv_constants **crates/hyperswitch_connectors/src/connectors/worldpayxml.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Modify existing code **crates/payment_methods/src/configs/payment_connector_required_fields.rs** Modify existing code **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/types/api.rs** Modify existing code **crates/router/src/types/transformers.rs** Modify existing code
{"pr_number": 8246, "pr_title": "feat(connectors): [Worldpayvantiv] add card support", "merged_at": "2025-06-05T06:25:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldpayxml.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs"], "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/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"structs_added": 21, "functions_added": 28, "enums_added": 4, "fields_added": 516, "imports_added": 6, "conditionals_added": 16}, "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 hotfix raised against https://github.com/juspay/hyperswitch/pull/8991 ### 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": "[email protected]", "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": "[email protected]", "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": "[email protected]", "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 167ec853: 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": 8995, "pr_title": "fix(connector): [Wise] change amount conversion unit", "merged_at": "2025-08-19T15:29:21Z", "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"}
feat(connector): [FISERV] Added ApplePay Wallet ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR is about adding ApplePay Payment Method in Hyperswitch. This has both the Hyperswitch level Decryption Flow as well as the Connector Level Decryption Flow. NOTE: The connector returns an error as missing fields probably because this particular payment method is not enabled from the connector's end. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> https://developer.fiserv.com/product/CommerceHub/docs/?path=docs/Online-Mobile-Digital/Wallets-AltPayments/Apple-Pay/Apple-Pay-Web-REST.md&branch=main https://developer.fiserv.com/product/CommerceHub/docs/?path=docs/Resources/Guides/Payment-Sources/Decrypted-Wallet.md&branch=main ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ApplePay (Hyperswitch level Decryption Flow) MCA Create : cURL: ``` curl --location 'http://localhost:8080/account/merchant_1752758081/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_g89XN9cueAh4pSQUzkDPoHMZdBqx71OHkC7RWEN5tRuyHfuukKf3EvJlVbHDZTHU' \ --header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \ --data '{ "connector_type": "payment_processor", "connector_name": "fiserv", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "API_KEY", "key1": "MERCHANT_ID", "api_secret": "API_SECRET" }, "test_mode": true, "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_type": "debit", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "bank_transfer", "payment_method_types": [ { "payment_method_type": "pix", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "google_pay", "payment_experience": "invoke_sdk_client", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "paypal", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "apple_pay", "payment_experience": "invoke_sdk_client", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "payment_method_type": "klarna", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "affirm", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "afterpay_clearpay", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "terminal_id": "10000001", "apple_pay_combined": { "manual": { "session_token_data": { "initiative": "web", "certificate": "", "display_name": "Applepay", "certificate_keys": "", "initiative_context": "hyperswitch-demo-store.netlify.app", "merchant_identifier": "merchant.com.stripe.sang", "merchant_business_country": "US", "payment_processing_details_at": "Hyperswitch", "payment_processing_certificate": "", "payment_processing_certificate_key": "" }, "payment_request_data": { "label": "Applepay", "supported_networks": [ "visa", "masterCard", "amex", "discover" ], "merchant_capabilities": [ "supports3DS" ] } } } }, "connector_webhook_details": { "merchant_secret": "" }, "business_country": "US", "business_label": "default" }' ``` Payments Create: cURL: ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_g89XN9cueAh4pSQUzkDPoHMZdBqx71OHkC7RWEN5tRuyHfuukKf3EvJlVbHDZTHU' \ --header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \ --data-raw '{ "amount": 650, "currency": "USD", "confirm": true, "business_country": "US", "business_label": "default", "amount_to_capture": 650, "customer_id": "cu_1752502119", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "setup_future_usage": "off_session", "authentication_type": "no_three_ds", "return_url": "https://google.com", "email": "[email protected]", "name": "Joseph Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "payment_method": "wallet", "payment_method_type": "apple_pay", "billing": { "address": { "line1": "1467", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "in sit", "user_agent": "amet irure esse" } }, "payment_method_data": { "wallet": { "apple_pay": { "payment_data": "", "payment_method": { "display_name": "Discover 2780", "network": "Discover", "type": "credit" }, "transaction_identifier": "" } } } }' ``` How to get this Payment data token? use the same certificates for any other connector. Make the payment go through. From the confirm call, you can get the payment data. Response: ``` { "payment_id": "pay_9j9yB94x2K0qYJQphQar", "merchant_id": "merchant_1752758081", "status": "failed", "amount": 650, "net_amount": 650, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "fiserv", "client_secret": "pay_9j9yB94x2K0qYJQphQar_secret_xLJgzYugilFS94JUW06S", "created": "2025-07-17T13:23:31.584Z", "currency": "USD", "customer_id": "cu_1752502119", "customer": { "id": "cu_1752502119", "name": "Joseph Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "apple_pay": { "last4": "2780", "card_network": "Discover", "type": "credit" } }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": null, "line3": null, "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "[email protected]", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": "100", "error_message": "Invalid or Missing Field Data", "unified_code": "UE_9000", "unified_message": "Something went wrong", "payment_experience": null, "payment_method_type": "apple_pay", "connector_label": "fiserv_US_default", "business_country": "US", "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1752502119", "created_at": 1752758611, "expires": 1752762211, "secret": "epk_ec67acda9d1040a9b2bc485aaa98d038" }, "manual_retry_allowed": true, "connector_transaction_id": null, "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_W6n4bH9SswzOUuIdN6Lz", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_KflfYITEK5eom2aVRhPy", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-17T13:38:31.584Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-07-17T13:23:35.717Z", "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 } ``` ## Cypress test <details> <summary> Fiserv </summary> <img width="490" height="1129" alt="Screenshot 2025-08-04 at 4 05 05 PM" src="https://github.com/user-attachments/assets/9cf42d9a-d499-47bc-8cd3-d2e053a024bb" /> </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/connector_configs/toml/development.toml` - `crates/connector_configs/toml/production.toml` - `crates/connector_configs/toml/sandbox.toml` - ... and 2 more files **2. Tests** - `config/deployments/integration_test.toml` **3. 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 (5 changes) - Implement new functions (2 changes) - Extend existing types with new fields (53 changes) **Detailed Identifier Changes:** Commit 8bb8b206: Files to modify: **crates/hyperswitch_connectors/src/connectors/fiserv.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs** Remove: - enum: pub::FiservWalletType Add: - struct: pub::ApplePayWalletDetails - struct: pub::ApplePayHeader - struct: pub::DecryptedWalletDetails - struct: pub::ApplePayDecryptedData - enum: pub::FiservWalletType
{"pr_number": 8670, "pr_title": "feat(connector): [FISERV] Added ApplePay Wallet", "merged_at": "2025-08-12T07:25:47Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/fiserv.rs", "crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs"], "tests": ["config/deployments/integration_test.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 5, "functions_added": 2, "enums_added": 1, "fields_added": 53, "imports_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [Elavon] Implement cards Flow ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Added Cards flow for Elavon (ThreeDs not implemented) Added Mandates Flow Void Flow is not available for Elavon ### 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 Added Cards flow for Elavon ## How did you test it? **Auth +Capture** ``` Request curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_X02U5PA0RU9fDydCUhM951NOSCQEtkvMhpkxrciTOb0VcAMczyu4ylxEz70210JH' \ --data-raw '{ "amount": 1400, "currency": "USD", "confirm": true, "capture_method": "automatic", "email": "[email protected]", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "01", "card_exp_year": "29", "card_holder_name": "joseph Doe", "card_cvc": "124" } } }' Response { "payment_id": "pay_PBGAjDQVwA1SfUkqIQaU", "merchant_id": "merchant_1730784635", "status": "succeeded", "amount": 1400, "net_amount": 1400, "shipping_cost": null, "amount_capturable": 0, "amount_received": 1400, "connector": "elavon", "client_secret": "pay_PBGAjDQVwA1SfUkqIQaU_secret_DvxqB3TUPX5sjWwlIk4h", "created": "2024-11-05T15:59:25.325Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "29", "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": "051124C45-603CD7B4-47C7-426E-B63E-E8217043459C", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_yzFt1TBeVUEs9Pc4O4J4", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_4xwh6f3O1nkokP1N5N7u", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-11-05T16:14:25.325Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-11-05T15:59:28.882Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` **Auth Only** ``` Request curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_X02U5PA0RU9fDydCUhM951NOSCQEtkvMhpkxrciTOb0VcAMczyu4ylxEz70210JH' \ --data-raw '{ "amount": 1400, "currency": "USD", "confirm": true, "capture_method": "manual", "email": "[email protected]", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "01", "card_exp_year": "29", "card_holder_name": "joseph Doe", "card_cvc": "124" } } }' Response { "payment_id": "pay_cFs9lujpuOm2lJJ7yLUq", "merchant_id": "merchant_1730784635", "status": "requires_capture", "amount": 1400, "net_amount": 1400, "shipping_cost": null, "amount_capturable": 1400, "amount_received": null, "connector": "elavon", "client_secret": "pay_cFs9lujpuOm2lJJ7yLUq_secret_kJwPzcJNoCekNw0Xoy2A", "created": "2024-11-05T16:01:53.192Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "29", "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": "051124O2C-332C3670-20A1-42DA-B71F-BC54AED2807A", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_yzFt1TBeVUEs9Pc4O4J4", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_4xwh6f3O1nkokP1N5N7u", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-11-05T16:16:53.192Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-11-05T16:01:54.567Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` **Capture** ``` Request curl --location 'http://localhost:8080/payments/pay_cFs9lujpuOm2lJJ7yLUq/capture' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_X02U5PA0RU9fDydCUhM951NOSCQEtkvMhpkxrciTOb0VcAMczyu4ylxEz70210JH' \ --data '{ "amount_to_capture": 650, "statement_descriptor_name": "Joseph", "statement_descriptor_suffix": "JS" }' Response { "payment_id": "pay_cFs9lujpuOm2lJJ7yLUq", "merchant_id": "merchant_1730784635", "status": "partially_captured", "amount": 1400, "net_amount": 1400, "shipping_cost": null, "amount_capturable": 0, "amount_received": 650, "connector": "elavon", "client_secret": "pay_cFs9lujpuOm2lJJ7yLUq_secret_kJwPzcJNoCekNw0Xoy2A", "created": "2024-11-05T16:01:53.192Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "29", "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": "051124O2C-332C3670-20A1-42DA-B71F-BC54AED2807A", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_yzFt1TBeVUEs9Pc4O4J4", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_4xwh6f3O1nkokP1N5N7u", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-11-05T16:16:53.192Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-11-05T16:02:14.492Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` **Refunds** ``` Request curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_6rV2U010InOypaGTo6iqMHMvFapQAlBBg8LnGKYaP5f7HljVy9PIcYpF8SBovgDU' \ --data '{ "payment_id": "pay_cFs9lujpuOm2lJJ7yLUq", "amount": 600, "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' Response { "refund_id": "ref_vZfboHyu9uG15sgsyBr4", "payment_id": "pay_cFs9lujpuOm2lJJ7yLUq", "amount": 600, "currency": "USD", "status": "succeeded", "reason": "Customer returned product", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "error_message": null, "error_code": null, "created_at": "2024-11-05T16:02:43.922Z", "updated_at": "2024-11-05T16:02:49.037Z", "connector": "elavon", "profile_id": "pro_yzFt1TBeVUEs9Pc4O4J4", "merchant_connector_id": "mca_4xwh6f3O1nkokP1N5N7u", "charges": null } ``` **Psync** ``` Request curl --location 'http://localhost:8080/payments/pay_cFs9lujpuOm2lJJ7yLUq?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_6rV2U010InOypaGTo6iqMHMvFapQAlBBg8LnGKYaP5f7HljVy9PIcYpF8SBovgDU' \ --data '' Response { "payment_id": "pay_cFs9lujpuOm2lJJ7yLUq", "merchant_id": "merchant_1730784635", "status": "partially_captured", "amount": 1400, "net_amount": 1400, "shipping_cost": null, "amount_capturable": 0, "amount_received": 650, "connector": "elavon", "client_secret": "pay_cFs9lujpuOm2lJJ7yLUq_secret_kJwPzcJNoCekNw0Xoy2A", "created": "2024-11-05T16:01:53.192Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": [ { "refund_id": "ref_vZfboHyu9uG15sgsyBr4", "payment_id": "pay_cFs9lujpuOm2lJJ7yLUq", "amount": 600, "currency": "USD", "status": "succeeded", "reason": "Customer returned product", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "error_message": null, "error_code": null, "created_at": "2024-11-05T16:02:43.922Z", "updated_at": "2024-11-05T16:02:49.037Z", "connector": "elavon", "profile_id": "pro_yzFt1TBeVUEs9Pc4O4J4", "merchant_connector_id": "mca_4xwh6f3O1nkokP1N5N7u", "charges": 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": "01", "card_exp_year": "29", "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": "051124O2C-332C3670-20A1-42DA-B71F-BC54AED2807A", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_yzFt1TBeVUEs9Pc4O4J4", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_4xwh6f3O1nkokP1N5N7u", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-11-05T16:16:53.192Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-11-05T16:02:14.492Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` <img width="714" alt="Screenshot 2024-11-25 at 12 27 14 PM" src="https://github.com/user-attachments/assets/af4ec465-6b2b-4b5a-81e9-9c5f789bcb63"> <img width="727" alt="Screenshot 2024-11-25 at 12 22 41 PM" src="https://github.com/user-attachments/assets/0ccca900-fbe0-4865-9a49-7e44be179246"> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/connector_enums.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/router_request_types.rs` **3. Core Business Logic** - `crates/router/src/core/admin.rs` - `crates/router/src/core/utils.rs` **4. 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 **5. Type Definitions** - `crates/router/src/types/api.rs` - `crates/router/src/types/transformers.rs` **6. Tests** - `config/deployments/integration_test.toml` - `cypress-tests/cypress/e2e/PaymentUtils/Elavon.js` - `cypress-tests/cypress/e2e/PaymentUtils/Utils.js` - ... and 1 more files **7. Configuration Files** - `.typos.toml` - `config/config.example.toml` - `config/deployments/production.toml` - ... and 3 more files **8. Other** - `Cargo.lock` - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` **Code Patterns Applied:** - Define new data structures (8 changes) - Implement new functions (21 changes) - Extend existing types with new fields (657 changes) - Add conditional logic for feature flags or filtering (7 changes) **Detailed Identifier Changes:** Commit 68876811: Files to modify: **crates/api_models/src/connector_enums.rs** Modify existing code **crates/common_enums/src/connector_enums.rs** Modify existing code **crates/connector_configs/src/connector.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/elavon.rs** Remove: - function: private::get_auth_header - function: private::build_error_response - impl: impl ConnectorValidation for Elavon - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Elavon - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Elavon Add: - function: pub::struct_to_xml - function: private::get_request_body - function: private::build_request - function: private::validate_capture_method - function: private::validate_mandate_payment - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Elavon - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Elavon - impl: impl ConnectorValidation for Elavon **crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs** Remove: - function: private::from - function: private::from - struct: pub::ElavonPaymentsRequest - enum: pub::ElavonPaymentStatus Add: - function: private::from - function: private::get_refund_status - function: private::from - function: private::get_sync_status - struct: pub::CardPaymentRequest - struct: pub::MandatePaymentRequest - enum: pub::TransactionType - enum: pub::SyncTransactionType - impl: impl From<&ElavonSyncResponse> for enums::AttemptStatus **crates/hyperswitch_connectors/src/utils.rs** Add: - function: pub::deserialize_xml_to_struct **crates/hyperswitch_domain_models/src/router_request_types.rs** Modify existing code **crates/router/src/configs/defaults/payment_connector_required_fields.rs** Modify existing code **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/core/utils.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/utils.rs** Modify existing code
{"pr_number": 6485, "pr_title": "feat(connector): [Elavon] Implement cards Flow", "merged_at": "2024-11-25T14:38:04Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/connector_enums.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/Cargo.toml", "crates/hyperswitch_connectors/src/connectors/elavon.rs", "crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/configs/defaults/payment_connector_required_fields.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "cypress-tests/cypress/e2e/PaymentUtils/Elavon.js", "cypress-tests/cypress/e2e/PaymentUtils/Utils.js", "loadtest/config/development.toml"], "config": [".typos.toml", "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"]}, "change_types": {"structs_added": 8, "functions_added": 21, "enums_added": 6, "fields_added": 657, "imports_added": 11, "conditionals_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(configs): [Trustpay] add support for AT,DE,IT country for instant_banktransfer ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description - add AT,DE,IT country for instant_banktransfer ### 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 a Merchant account 2. Create ApI key 3. Create trustpay MCA ``` curl --location 'http://localhost:8080/account/merchant_1744709039/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_nQkG6G0Aa0WnoFVCyaJnTFbT44vJkiPKjSzG3vEEdVzhMEKnunJboev2sYPbFBbc' \ --data '{ "connector_type": "payment_processor", "connector_name": "trustpay", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "_", "key1": "_", "api_secret": "_" }, "test_mode": false, "disabled": false, "payment_methods_enabled": [ { "payment_method": "bank_transfer", "payment_method_types": [ { "payment_method_type": "sepa_bank_transfer", "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "instant_bank_transfer", "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "ach", "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata":{ "currency_id": 1, "platform_id": 6, "ledger_account_id": "01JP4KPNNMF0S26GVP99RZXGWP" } }' ``` 4. Create a Payment using EUR currency and these AT,DE,IT countries. ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_nQkG6G0Aa0WnoFVCyaJnTFbT44vJkiPKjSzG3vEEdVzhMEKnunJboev2sYPbFBbc' \ --data-raw ' { "amount": 6540, "currency": "EUR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "StripeCustomer", "email": "[email protected]", "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": "bank_transfer", "payment_method_type" :"instant_bank_transfer", "payment_method_data": { "bank_transfer": { "instant_bank_transfer": { } } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "AT", "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": "IT", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" } }' ``` Response ``` { "payment_id": "pay_dB9fFlgfkoPZtzX88qMX", "merchant_id": "merchant_1744709039", "status": "requires_customer_action", "amount": 6540, "net_amount": 6540, "shipping_cost": null, "amount_capturable": 6540, "amount_received": null, "connector": "trustpay", "client_secret": "pay_dB9fFlgfkoPZtzX88qMX_secret_7l2t0yqRy5BLn4166TO5", "created": "2025-04-15T10:27:39.329Z", "currency": "EUR", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "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": { "instant_bank_transfer": {} }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "IT", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "AT", "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": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": { "type": "redirect_to_url", "redirect_to_url": "http://localhost:8080/payments/redirect/pay_dB9fFlgfkoPZtzX88qMX/merchant_1744709039/pay_dB9fFlgfkoPZtzX88qMX_1" }, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "instant_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": 1744712859, "expires": 1744716459, "secret": "epk_cc529029cc0a4f87a189e3af949449bc" }, "manual_retry_allowed": null, "connector_transaction_id": "6559721361", "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_donHMJiW4xATDBLVLCAg", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_BzpBdvVdKTUQP1dtlvJ5", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-04-15T10:42:39.329Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-04-15T10:27:40.098Z", "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 } ``` Complete Payment using redirection ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **2. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 2 more files
{"pr_number": 7815, "pr_title": "feat(configs): [Trustpay] add support for AT,DE,IT country for instant_banktransfer", "merged_at": "2025-04-15T13:48:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
refactor(core): filter default routing config response based on connector type ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> We are filtering the response for payment and payout processors. So this works as follows: If Payment's route is hit only PaymentProcessors will be listed and nothing else like PayoutConnectors etc. Payment : ``` curl --location 'http://localhost:8080/routing/default/profile' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' ``` If Payout's route is hit, only Payout's connector will be shown and nothing else. Payout : ``` curl --location 'http://localhost:8080/routing/payout/default/profile' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' ``` ![Screenshot 2025-03-04 at 12 51 02 PM](https://github.com/user-attachments/assets/e465d666-e405-4615-82dc-ce5ae1d2dd81) <img width="1333" alt="Screenshot 2025-03-04 at 1 02 15 PM" src="https://github.com/user-attachments/assets/a587b7c3-ee87-4caf-8b29-dcb281a1e6f4" /> ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Tested after creating JWT locally and adding 1 payment and 1 payout connector. Payment : ``` curl --location 'http://localhost:8080/routing/default/profile' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' ``` Payout : ``` curl --location 'http://localhost:8080/routing/payout/default/profile' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/routing.rs` **Code Patterns Applied:** - Extend existing types with new fields (1 changes) - Modify database queries (1 changes) **Detailed Identifier Changes:** Commit 18db67c7: Files to modify: **crates/router/src/core/routing.rs** Modify existing code
{"pr_number": 7199, "pr_title": "refactor(core): filter default routing config response based on connector type", "merged_at": "2025-03-11T15:00:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/routing.rs"]}, "change_types": {"fields_added": 1, "imports_added": 3, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
ci(postman): update assertion error message for nmi collection ## 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 --> Postman Tests for `nmi` were failing on SBX (but not on Integ) because `Flow Testcases/Variation Cases/Scenario9-Create a mandate payment` responded an error message as `debit mandate payment is not supported by nmi` on SBX and `credit mandate payment is not supported by nmi` on Integ when we are using Card `4111111111111111`. So, I thought of two solutions. First, check whether the error message contains "mandate payment is not supported by nmi" or second, change the card number for which the error message in both the environments are same. I chose the second way finally. And, there is a slight change, which I missed in #7159. <!-- However, I made a change in #7159, which goes like the following ![image](https://github.com/user-attachments/assets/62b3ed2a-bbe2-426f-8a30-eb4f980b51ba) Because it was failing expecting the error message to be " mandate payment is not supported by nmi" but it should include the same instead of equal to. --> ### 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 `Flow Testcases/Variation Cases/Scenario9-Create a mandate payment` passing on Integ and failing on SBX. #7764 ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ### Before | Integ | Sandbox | | -------- | ------- | | <img width="850" alt="image" src="https://github.com/user-attachments/assets/c66e4b3b-5cf3-49ee-998a-fe7ab388c0f9" /> | <img width="850" alt="image" src="https://github.com/user-attachments/assets/4a26f840-405b-41e8-86f2-3be32aa88056" /> | ### After | Integ | Sandbox | | -------- | ------- | | <img width="850" alt="image" src="https://github.com/user-attachments/assets/eb2b3d92-0431-4887-86a9-53f5db6be2eb" /> | <img width="850" alt="image" src="https://github.com/user-attachments/assets/e0334b87-9bf7-43ab-b20e-fdd87e5531c7" /> | ## 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** - `postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/event.test.js` **2. Other** - `postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/request.json`
{"pr_number": 7765, "pr_title": "ci(postman): update assertion error message for nmi collection", "merged_at": "2025-04-17T07:51:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "card"]}, "hierarchy": {"tests": ["postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/event.test.js"], "other": ["postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/request.json"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
feat(core): Add Network Details in Payments Response ## 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 a new NetworkDetails struct containing network_advice_code to capture network-level response information from payment processors. Key Changes: 1)Added network_details JSONB column to payment_attempt table 2)Extended PaymentsResponse API to include optional network_details field 3)Updated payment attempt models and error handling to populate network advice codes 4)Added database migration and comprehensive model updates across the codebase ### Additional Changes - [x] This PR modifies the API contract - [x] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_XklbTvcVeccpWoNiRvzfyhYyKrGS80Pn2vsdIBhpFnotH19HLDRCRZdqeEoIjoYM' \ --data-raw '{ "amount": 4324, "currency": "EUR", "confirm": true, "setup_future_usage": "on_session", "customer_id": "nidthxxinn", "return_url": "https://www.google.com", "capture_method": "automatic", "payment_method": "card", "payment_method_type": "credit", "authentication_type": "no_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": "[email protected]", "payment_method_data": { "card": { "card_number": "4000000000009995", "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": "John Smith", "card_cvc": "100" } } } ' ``` Response ``` { "payment_id": "pay_HliAZcNZ4FY0Oj8MEgUA", "merchant_id": "postman_merchant_GHAction_496676b2-8518-4cfe-b166-ac01248809e3", "status": "failed", "amount": 4324, "net_amount": 4324, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "nuvei", "client_secret": "pay_HliAZcNZ4FY0Oj8MEgUA_secret_aUxY7BbfNXf9nMBBATf6", "created": "2025-09-04T10:53:50.873Z", "currency": "EUR", "customer_id": "nidthxxinn", "customer": { "id": "nidthxxinn", "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "9995", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "400000", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": "John Smith", "payment_checks": { "avs_description": null, "avs_result_code": null, "cvv_2_reply_code": null, "cvv_2_description": null, "merchant_advice_code": null, "merchant_advice_code_description": null }, "authentication_data": {} }, "billing": null }, "payment_token": "token_bMKiQPWFx6XGrRVMONJn", "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": "[email protected]", "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": "1019", "error_message": "Invalid FailureUrl", "unified_code": "UE_9000", "unified_message": "Something went wrong", "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "nidthxxinn", "created_at": 1756983230, "expires": 1756986830, "secret": "epk_e03741a25a544f759d4914ec6f09cb53" }, "manual_retry_allowed": true, "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_x2eMfnp2IDjZd3ZFGmeF", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_uLFQ0zyXKbAMjNmpf00b", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-09-04T11:08:50.873Z", "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-09-04T10:53:51.741Z", "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, "network_details": { "network_advice_code": 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.rs` - `crates/diesel_models/src/schema_v2.rs` - ... and 1 more files **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs` **4. Core Business Logic** - `crates/router/src/core/payments/helpers.rs` - `crates/router/src/core/payments/operations/payment_create.rs` - `crates/router/src/core/payments/operations/payment_response.rs` - ... and 2 more files **5. Type Definitions** - `crates/router/src/types/storage/payment_attempt.rs` **6. Utils** - `crates/router/src/utils/user/sample_data.rs` **7. Tests** - `crates/router/tests/payments.rs` - `crates/router/tests/payments2.rs` **8. Other** - `api-reference/v1/openapi_spec_v1.json` - `crates/openapi/src/openapi.rs` - `crates/router/src/db/events.rs` - ... and 5 more files **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (3 changes) - Extend existing types with new fields (72 changes) **Detailed Identifier Changes:** Commit 75bf58d6: Files to modify: **crates/api_models/src/payments.rs** Add: - struct: pub::NetworkDetails **crates/diesel_models/src/payment_attempt.rs** Add: - struct: pub::NetworkDetails **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/diesel_models/src/user/sample_data.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code **crates/openapi/src/openapi.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/payments/operations/payment_create.rs** Modify existing code **crates/router/src/core/payments/operations/payment_response.rs** Modify existing code **crates/router/src/core/payments/retry.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Add: - function: private::foreign_from - function: private::foreign_from - function: private::foreign_from - impl: impl ForeignFrom<DieselNetworkDetails> for NetworkDetails - impl: impl ForeignFrom<NetworkDetails> for DieselNetworkDetails - impl: impl ForeignFrom<&hyperswitch_domain_models::router_data::ErrorResponse> for DieselNetworkDetails **crates/router/src/db/events.rs** Modify existing code **crates/router/src/types/storage/payment_attempt.rs** Modify existing code **crates/router/src/utils/user/sample_data.rs** Modify existing code **crates/router/src/workflows/payment_sync.rs** Modify existing code **crates/router/tests/payments.rs** Modify existing code **crates/router/tests/payments2.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_attempt.rs** Modify existing code **crates/storage_impl/src/payments/payment_attempt.rs** Modify existing code
{"pr_number": 9273, "pr_title": "feat(core): Add Network Details in Payments Response", "merged_at": "2025-09-09T14:10:52Z", "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.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"], "core_business": ["crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router/src/types/storage/payment_attempt.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "tests": ["crates/router/tests/payments.rs", "crates/router/tests/payments2.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "crates/openapi/src/openapi.rs", "crates/router/src/db/events.rs", "crates/router/src/workflows/payment_sync.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "migrations/2025-09-09-171443_add_network_details_in_attempt_table/down.sql", "migrations/2025-09-09-171443_add_network_details_in_attempt_table/up.sql"]}, "change_types": {"structs_added": 2, "functions_added": 3, "fields_added": 72}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): Connector Feature Matrix Bugfix ## 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 --> Connector Feature Matrix Bugfix: 1. Removed Dispute webhook from stax 2. Capture methods added in Inespay 3. Card Authentication type corrected in Fiserv and Bluesnap 4. Added Refund webhook in shift4. <img width="1728" alt="Screenshot 2025-05-16 at 5 45 57 PM" src="https://github.com/user-attachments/assets/4937e50b-891b-43af-aa26-0047a330cdec" /> <img width="1728" alt="Screenshot 2025-05-16 at 5 46 07 PM" src="https://github.com/user-attachments/assets/04b92964-ac7f-455d-af31-cd07c6402a1e" /> <img width="1728" alt="Screenshot 2025-05-16 at 5 56 52 PM" src="https://github.com/user-attachments/assets/9937575b-0664-45e0-b0a1-a6bfa1a4691a" /> <img width="1728" alt="Screenshot 2025-05-16 at 5 46 24 PM" src="https://github.com/user-attachments/assets/57e5c954-6907-4ecd-bf85-234a499839fe" /> ### 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)? --> **Inespay:** 1. Connector Create: ``` curl --location 'http://localhost:8080/account/merchant_1747315819/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_BUcsFuR3w3w7vjKM0tcjfKW7qklB8oCMMRgCFtkUQ1IeDSqkNS9mDdOTX9n0N7et' \ --data '{ "connector_type": "payment_processor", "connector_name": "inespay", "connector_account_details": { "auth_type": "BodyKey", "api_key": "abc", "key1": "abc" }, "test_mode": false, "disabled": false, "payment_methods_enabled": [ { "payment_method": "bank_debit", "payment_method_types": [ { "payment_method_type": "sepa", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false } ] } ], "connector_webhook_details": { "merchant_secret": "abc", "additional_secret": null } }' ``` 2. Payments Create: ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_BUcsFuR3w3w7vjKM0tcjfKW7qklB8oCMMRgCFtkUQ1IeDSqkNS9mDdOTX9n0N7et' \ --data '{ "amount": 6540, "currency": "EUR", "confirm": true, "amount_to_capture": 6540, "capture_method": "automatic", "customer_id": "StripbmnxeCustomer", "description": "Its my first payment request", "return_url": "https://google.com", "payment_method": "bank_debit", "payment_method_type": "sepa", "payment_method_data": { "bank_debit": { "sepa_bank_debit": { "iban": "ES5031831357110123456789" } } } }' ``` Response: ``` { "payment_id": "pay_8xPAfSygQ7OZyVTEGh6E", "merchant_id": "merchant_1747651759", "status": "requires_customer_action", "amount": 6540, "net_amount": 6540, "shipping_cost": null, "amount_capturable": 6540, "amount_received": null, "connector": "inespay", "client_secret": "abc", "created": "2025-05-19T10:49:33.910Z", "currency": "EUR", "customer_id": "StripbmnxeCustomer", "customer": { "id": "StripbmnxeCustomer", "name": null, "email": null, "phone": null, "phone_country_code": null }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "bank_debit", "payment_method_data": { "bank_debit": { "sepa": { "iban": "ES503**************56789", "bank_account_holder_name": null } }, "billing": null }, "payment_token": null, "shipping": null, "billing": null, "order_details": null, "email": null, "name": null, "phone": null, "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": { "type": "redirect_to_url", "redirect_to_url": "url" }, "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": "StripbmnxeCustomer", "created_at": 1747651773, "expires": 1747655373, "secret": "abc" }, "manual_retry_allowed": null, "connector_transaction_id": "abc", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_pdFB4GnFpiIgBRIc3fuX", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_cOG6jcmy92Whx1RubSUH", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-19T11:04:33.909Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-19T10:49:35.741Z", "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 } ``` **Fiserv:** 1. Connector Create: ``` curl --location 'http://localhost:8080/account/merchant_1747315819/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_BUcsFuR3w3w7vjKM0tcjfKW7qklB8oCMMRgCFtkUQ1IeDSqkNS9mDdOTX9n0N7et' \ --data '{ "connector_type": "payment_processor", "connector_name": "fiserv", "connector_label": "fiserv_default", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "abc", "key1": "abc", "api_secret": "abc" }, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "Visa" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "Interac" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "AmericanExpress" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "JCB" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "DinersClub" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "Discover" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "CartesBancaires" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "UnionPay" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "Visa" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "Interac" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "AmericanExpress" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "JCB" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "DinersClub" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "Discover" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "CartesBancaires" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "UnionPay" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false } ] } ], "connector_webhook_details": null, "metadata": { "terminal_id": "abc" }, "test_mode": true, "disabled": false, "frm_configs": null, "business_country": null, "business_label": null, "business_sub_label": null, "pm_auth_config": null, "status": "active", "additional_merchant_data": null, "connector_wallets_details": null }' ``` 2. Payments Create(Test with capture_method automatic and manual): ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_mscn98NySrDRZKPNGrezG7yBU75ZDdlyvSwjLYg2z9sdnRhtmaEI8Y2tJZnuG2kE' \ --data-raw '{ "amount": 6540, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "StripeCustomer", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4147463011110083", "card_exp_month": "10", "card_exp_year": "31", "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" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response: ``` { "payment_id": "pay_CAwExh2Jav0uq0O0i5sQ", "merchant_id": "merchant_1747651759", "status": "succeeded", "amount": 6540, "net_amount": 6540, "shipping_cost": null, "amount_capturable": 0, "amount_received": 6540, "connector": "fiserv", "client_secret": "abc", "created": "2025-05-19T10:52:12.456Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "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": "0083", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "414746", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "31", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "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": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "StripeCustomer", "created_at": 1747651932, "expires": 1747655532, "secret": "abc" }, "manual_retry_allowed": false, "connector_transaction_id": "abc", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "abc", "payment_link": null, "profile_id": "pro_pdFB4GnFpiIgBRIc3fuX", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_WEUzJrYx2fICDme30pL8", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-19T11:07:12.456Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-19T10:52:17.591Z", "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 } ``` **Bluesnap:** 1. Connector Create: ``` curl --location 'http://localhost:8080/account/merchant_1747315819/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_mscn98NySrDRZKPNGrezG7yBU75ZDdlyvSwjLYg2z9sdnRhtmaEI8Y2tJZnuG2kE' \ --data '{ "connector_type": "payment_processor", "connector_name": "bluesnap", "connector_label": "bluesnap_default", "connector_account_details": { "auth_type": "BodyKey", "api_key": "abc", "key1": "abc" }, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "Visa" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "Interac" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "AmericanExpress" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "JCB" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "DinersClub" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "Discover" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "CartesBancaires" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "UnionPay" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false } ] } ], "connector_webhook_details": null, "metadata": {}, "test_mode": true, "disabled": false, "frm_configs": null, "business_country": null, "business_label": null, "business_sub_label": null, "pm_auth_config": null, "status": "active", "additional_merchant_data": null, "connector_wallets_details": null }' ``` 2. Payments Create(Test with capture method manual/automatic and three_ds/no_three_ds): ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_mscn98NySrDRZKPNGrezG7yBU75ZDdlyvSwjLYg2z9sdnRhtmaEI8Y2tJZnuG2kE' \ --data-raw '{ "amount": 6540, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "StripeCustomer", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4147463011110083", "card_exp_month": "10", "card_exp_year": "31", "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" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/connector_configs/toml/development.toml` - `crates/connector_configs/toml/production.toml` - `crates/connector_configs/toml/sandbox.toml` - ... and 5 more files **Code Patterns Applied:** - Extend existing types with new fields (7 changes) **Detailed Identifier Changes:** Commit 8b0fd048: Files to modify: **crates/hyperswitch_connectors/src/connectors/bluesnap.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/fiserv.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/inespay.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/shift4.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/stax.rs** Modify existing code
{"pr_number": 8047, "pr_title": "fix(connector): Connector Feature Matrix Bugfix", "merged_at": "2025-05-22T10:40:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/bluesnap.rs", "crates/hyperswitch_connectors/src/connectors/fiserv.rs", "crates/hyperswitch_connectors/src/connectors/inespay.rs", "crates/hyperswitch_connectors/src/connectors/shift4.rs", "crates/hyperswitch_connectors/src/connectors/stax.rs"]}, "change_types": {"fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(core): accept merchant_connector_details in Refunds create and retrieve flow ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> - Accept merchant_connector_credentials in the Request Body of Refunds create and retrieve - Add a new POST endpoint refunds_retrieve_with_gateway_creds ### 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 Payment ``` curl --location 'http://localhost:8080/v2/payments' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: pro_MZ7No2Au2o91fUbrWj08' \ --header 'X-Merchant-Id: cloth_seller_J3hxNSDRUbwimfSoYeEg' \ --data-raw '{ "amount_details": { "order_amount": 100, "currency": "INR" }, "merchant_connector_details": { "connector_name": "razorpay", "merchant_connector_creds": { "auth_type": "BodyKey", "api_key": "_", "key1": "_" } }, "capture_method":"automatic", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method_data": { "upi": { "upi_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": "[email protected]" } }, "payment_method_subtype": "upi_collect", "payment_method_type": "upi" }' ``` Response ``` { "id": "12345_pay_0197a0d312d471e0ba69036052e92244", "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-24T07:24:36.954Z", "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": "[email protected]" } }, "payment_method_type": "upi", "payment_method_subtype": "upi_collect", "connector_transaction_id": "pay_Qkwwc2ZlELc25m", "connector_reference_id": null, "merchant_connector_id": null, "browser_info": null, "error": null, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": { "type": "wait_screen_information", "display_from_timestamp": 1750749880460394000, "display_to_timestamp": 1750750180460394000, "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, "merchant_reference_id": null } ``` - Psync ``` curl --location 'http://localhost:8080/v2/payments/12345_pay_0197a0d312d471e0ba69036052e92244' \ --header 'x-profile-id: pro_MZ7No2Au2o91fUbrWj08' \ --header 'x-merchant-id: cloth_seller_J3hxNSDRUbwimfSoYeEg' \ --header 'Content-Type: application/json' \ --data '{ "merchant_connector_details": { "connector_name": "razorpay", "merchant_connector_creds": { "auth_type": "BodyKey", "api_key": "_", "key1": "_" } }, "force_sync" : true }' ``` Response ``` { "id": "12345_pay_0197a0d312d471e0ba69036052e92244", "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": null, "connector": "razorpay", "created": "2025-06-24T07:24:36.954Z", "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": "[email protected]" } }, "payment_method_type": "upi", "payment_method_subtype": "upi_collect", "connector_transaction_id": "pay_Qkwwc2ZlELc25m", "connector_reference_id": null, "merchant_connector_id": null, "browser_info": null, "error": null, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/", "authentication_type": "no_three_ds", "authentication_type_applied": null, "is_iframe_redirection_enabled": null, "merchant_reference_id": null } ``` - Create Refund ``` curl --location 'http://localhost:8080/v2/refunds' \ --header 'x-merchant-id: cloth_seller_J3hxNSDRUbwimfSoYeEg' \ --header 'x-profile-id: pro_MZ7No2Au2o91fUbrWj08' \ --header 'Content-Type: application/json' \ --data '{ "payment_id": "12345_pay_0197a0d312d471e0ba69036052e92244", "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" }, "merchant_connector_details": { "connector_name": "razorpay", "merchant_connector_creds": { "auth_type": "BodyKey", "api_key": "_", "key1": "_" } } }' ``` Response ``` { "id": "12345_ref_0197a0d34fb87872a8548d097294f8b4", "payment_id": "12345_pay_0197a0d312d471e0ba69036052e92244", "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-24T07:24:52.586Z", "updated_at": "2025-06-24T07:24:54.600Z", "connector": "razorpay", "profile_id": "pro_MZ7No2Au2o91fUbrWj08", "merchant_connector_id": null, "connector_refund_reference_id": null } ``` - Refund Retrieve ``` curl --location 'http://localhost:8080/v2/refunds/12345_ref_0197a0977b8e7160a7f4a2690fe4d0df' \ --header 'x-merchant-id: cloth_seller_J3hxNSDRUbwimfSoYeEg' \ --header 'x-profile-id: pro_MZ7No2Au2o91fUbrWj08' \ --header 'Content-Type: application/json' \ --data '{ "merchant_connector_details": { "connector_name": "razorpay", "merchant_connector_creds": { "auth_type": "BodyKey", "api_key": "_", "key1": "_" } }, "force_sync" : true }' ``` Response ``` { "id": "12345_ref_0197a0977b8e7160a7f4a2690fe4d0df", "payment_id": "12345_pay_0197a097435b7813b8a4f7b6ed6968ba", "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-24T06:19:31.637Z", "updated_at": "2025-06-24T07:24:58.858Z", "connector": "razorpay", "profile_id": "pro_MZ7No2Au2o91fUbrWj08", "merchant_connector_id": null, "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` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/payments.rs` - `crates/api_models/src/refunds.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/merchant_connector_account.rs` - `crates/hyperswitch_domain_models/src/payments.rs` **3. Core Business Logic** - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/helpers.rs` - `crates/router/src/core/refunds_v2.rs` - ... and 1 more files **4. Type Definitions** - `crates/common_types/src/domain.rs` **5. Other** - `api-reference/v2/openapi_spec_v2.json` - `crates/openapi/src/openapi_v2.rs` - `crates/router/src/routes/app.rs` - ... and 1 more files **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (5 changes) - Extend existing types with new fields (46 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit b185d85f: Files to modify: **crates/api_models/src/payments.rs** Remove: - struct: pub::MerchantConnectorDetails **crates/api_models/src/refunds.rs** Add: - struct: pub::RefundsRetrievePayload **crates/common_types/src/domain.rs** Add: - struct: pub::MerchantConnectorAuthDetails **crates/hyperswitch_domain_models/src/merchant_connector_account.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments.rs** Modify existing code **crates/openapi/src/openapi_v2.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/refunds_v2.rs** Add: - function: pub::internal_trigger_refund_to_gateway - function: pub::internal_sync_refund_with_gateway **crates/router/src/core/utils.rs** Modify existing code **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/refunds.rs** Add: - function: pub::refunds_retrieve_with_gateway_creds
{"pr_number": 8441, "pr_title": "feat(core): accept merchant_connector_details in Refunds create and retrieve flow", "merged_at": "2025-06-26T14:23:16Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs", "crates/api_models/src/refunds.rs"], "domain": ["crates/hyperswitch_domain_models/src/merchant_connector_account.rs", "crates/hyperswitch_domain_models/src/payments.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/refunds_v2.rs", "crates/router/src/core/utils.rs"], "types": ["crates/common_types/src/domain.rs"], "other": ["api-reference/v2/openapi_spec_v2.json", "crates/openapi/src/openapi_v2.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/refunds.rs"]}, "change_types": {"structs_added": 2, "functions_added": 5, "fields_added": 46, "imports_added": 1, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix: updated the docker setup ## 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 --> Enhanced the script to pre-configure a user and a dummy connector in the control center for the local setup. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the 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 #8091 ## How did you test 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="1306" alt="Screenshot 2025-05-21 at 2 17 17 PM" src="https://github.com/user-attachments/assets/1ab1766c-c124-4a52-afb6-1e3aae48a6c1" /> <img width="606" alt="Screenshot 2025-05-21 at 2 17 30 PM" src="https://github.com/user-attachments/assets/03e03b28-71b3-4ebf-b8b7-642d6db1d1a7" /> ## 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** - `README.md` - `scripts/setup.sh` **Code Patterns Applied:** - Add conditional logic for feature flags or filtering (18 changes)
{"pr_number": 8093, "pr_title": "fix: updated the docker setup", "merged_at": "2025-05-21T09:51:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector"]}, "hierarchy": {"other": ["README.md", "scripts/setup.sh"]}, "change_types": {"conditionals_added": 18}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
fix(errors): Entry not found error as 4xx instead of 5xx ## 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 --> A recent change in [this PR](https://github.com/juspay/hyperswitch/pull/7537) removed the usage of DomainStorageError in all the places and started using StorageError everywhere. Previously, DataStorage and RedisError were manually converted into StorageError based on few conditions which was missing in the mentioned PR resulting in resource_not_found being thrown as 5xx instead of 4xx. ``` StorageError::DatabaseError(i) => match i.current_context() { DatabaseError::DatabaseConnectionError => DataStorageError::DatabaseConnectionError, // TODO: Update this error type to encompass & propagate the missing type (instead of generic `db value not found`) DatabaseError::NotFound => { DataStorageError::ValueNotFound(String::from("db value not found")) } // TODO: Update this error type to encompass & propagate the duplicate type (instead of generic `db value not found`) DatabaseError::UniqueViolation => DataStorageError::DuplicateValue { entity: "db entity", key: None, }, err => DataStorageError::DatabaseError(error_stack::report!(*err)), } ``` This PR handles the manual conversion logic for DataStorageError and RedisError ### 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). --> Resource_not_found being thrown as 5xx instead of 4xx <details> <summary>Create a payment with confirm false and try to confirm the payment with invalid publishable key</summary> Request Create a payment curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_KuDhgIFqeK0Qn8YjYAouk6ztEqJnElMO79hYsBooODvx09okKXcmeEj8bUU6mwXq' \ --data-raw '{ "amount": 1000, "currency": "USD", "confirm": false, "capture_method": "automatic", "authentication_type": "no_three_ds", "customer_id": "ad", "profile_id": "pro_3LcIbwh0xcM5yfjgk3ie", "email": "[email protected]", "description": "Hello this is description", "shipping": { "address": { "state": "zsaasdas", "city": "Banglore", "country": "US", "line1": "sdsdfsdf", "line2": "hsgdbhd", "line3": "alsksoe", "zip": "571201", "first_name": "joseph", "last_name": "doe" }, "phone": { "number": "123456789", "country_code": "+1" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "123456789", "country_code": "+1" } }, "setup_future_usage": "off_session", "order_details": null }' confirm the payment with invalid publishable key curl --location 'http://localhost:8080/payments/pay_mBeU1Aorcd7KB81NXAgV/confirm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_42efcc8f61704637b51150f3413a1f8ca' \ --data '{ "payment_method": "card", "payment_method_type": "credit", "client_secret": "pay_mBeU1Aorcd7KB81NXAgV_secret_BC5WU8N6YMeIKOcgm2qH", "profile_id": "pro_3LcIbwh0xcM5yfjgk3ie", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "CLBRW dffdg", "card_cvc": "737" } }, "payment_type": "new_mandate", "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" } } }' Confirm Payment Response 500 Internal Server Error { "error": { "type": "api", "message": "Something went wrong", "code": "HE_00" } } </details> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> <details> <summary>Create a payment with confirm false and try to confirm the payment with invalid publishable key</summary> Request Create a payment curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_KuDhgIFqeK0Qn8YjYAouk6ztEqJnElMO79hYsBooODvx09okKXcmeEj8bUU6mwXq' \ --data-raw '{ "amount": 1000, "currency": "USD", "confirm": false, "capture_method": "automatic", "authentication_type": "no_three_ds", "customer_id": "ad", "profile_id": "pro_3LcIbwh0xcM5yfjgk3ie", "email": "[email protected]", "description": "Hello this is description", "shipping": { "address": { "state": "zsaasdas", "city": "Banglore", "country": "US", "line1": "sdsdfsdf", "line2": "hsgdbhd", "line3": "alsksoe", "zip": "571201", "first_name": "joseph", "last_name": "doe" }, "phone": { "number": "123456789", "country_code": "+1" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "123456789", "country_code": "+1" } }, "setup_future_usage": "off_session", "order_details": null }' confirm the payment with invalid publishable key curl --location 'http://localhost:8080/payments/pay_sdeU1Aorcd7KB81NXASD/confirm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_42efcc8f61704637b51150f3413a1f8ca' \ --data '{ "payment_method": "card", "payment_method_type": "credit", "client_secret": "pay_sdeU1Aorcd7KB81NXASD_secret_BC5WU8N6YMeIKOcgm2qH", "profile_id": "pro_3LcIbwh0xcM5yfjgk3ie", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "CLBRW dffdg", "card_cvc": "737" } }, "payment_type": "new_mandate", "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" } } }' Confirm Payment Response 401 Unathorized { "error": { "type": "invalid_request", "message": "API key not provided or invalid API key used", "code": "IR_01" } } </details> <details> <summary>Retrieve invalid payment id</summary> Request curl --location 'http://localhost:8080/payments/pay_FgG1La2kxeukSzIHUl8ns' \ --header 'Accept: application/json' \ --header 'x-feature: router-custom-dbd' \ --header 'api-key: dev_r6d1taIlStKeCplYDnDuPFrDT3Be1ZDq6pf0fTOOXioRoIi2pSOF5Jc8kzJJqNdz' Response 404 Not found { "error": { "type": "invalid_request", "message": "Payment does not exist in our records", "code": "HE_02" } } </details> <details> <summary>Retrieve invalid refund id</summary> Request curl --location 'http://localhost:8080/refunds/ref_kL0UzbPptCK3qZLXH6KO' \ --header 'Accept: application/json' \ --header 'api-key: dev_r6d1taIlStKeCplYDnDuPFrDT3Be1ZDq6pf0fTOOXioRoIi2pSOF5Jc8kzJJqNdz' Response 404 Not found { "error": { "type": "invalid_request", "message": "Refund does not exist in our records.", "code": "HE_02" } } </details> <details> <summary>Retrieve invalid merchant id</summary> Request curl --location 'http://localhost:8080/accounts/merchant_1743660591s' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' Response 404 Not found { "error": { "type": "invalid_request", "message": "Merchant account does not exist in our records", "code": "HE_02" } } </details> <details> <summary>Retrieve customers using invalid API key</summary> Request curl --location 'http://localhost:8080/customers/list' \ --header 'Accept: application/json' \ --header 'api-key: dev_r6d1taIlStKeCplYDnDuPFrDT3Be1ZDq6pf0fTOOXioRoIi2pSOF5Jc8kzJJqNdz' Response 401 Unauthorized { "error": { "type": "invalid_request", "message": "API key not provided or invalid API key used", "code": "IR_01" } } </details> <details> <summary>Retrieve session tokens using invalid Publishable key</summary> Request curl --location 'http://localhost:8080/payments/session_tokens' \ --header 'accept: */*' \ --header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \ --header 'api-key: pk_dev_b72a47690f4f4a95a8a447b8221b5370s' \ --header 'x-browser-name: Chrome' \ --header 'x-browser-version: 127.0.0' \ --header 'x-client-platform: web' \ --header 'x-client-version: 0.91.7' \ --header 'x-merchant-domain: www-merchant.com' \ --header 'x-payment-confirm-source: sdk' \ --data '{ "payment_id": "pay_pZNPfQY46nMLV5X225oW", "client_secret": "pay_pZNPfQY46nMLV5X225oW_secret_wrQsBzqleBKnhoOu3bLR", "wallets": [], "delayed_session_token": false }' Response 401 Unauthorized { "error": { "type": "invalid_request", "message": "API key not provided or invalid API key used", "code": "IR_01" } } </details> <details> <summary>Retrieve merchant account payment methods using invalid Publishable key</summary> Request curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_pZNPfQY46nMLV5X225oW_secret_wrQsBzqleBKnhoOu3bLR' \ --header 'accept: */*' \ --header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \ --header 'api-key: pk_dev_b72a47690f4f4a95a8a447b8221b5370s' \ --header 'content-type: application/json' \ --header 'priority: u=1, i' \ --header 'sec-ch-ua: "Not)A;Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"' \ --header 'sec-ch-ua-mobile: ?0' \ --header 'sec-ch-ua-platform: "macOS"' \ --header 'sec-fetch-dest: empty' \ --header 'sec-fetch-mode: cors' \ --header 'sec-fetch-site: same-origin' \ --header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36' \ --header 'x-browser-name: Chrome' \ --header 'x-browser-version: 127.0.0' \ --header 'x-client-platform: web' \ --header 'x-client-version: 0.91.7' \ --header 'x-payment-confirm-source: sdk' Response 401 Unauthorized { "error": { "type": "invalid_request", "message": "API key not provided or invalid API key used", "code": "IR_01" } } </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Other** - `crates/storage_impl/src/errors.rs` **Code Patterns Applied:** - Extend existing types with new fields (2 changes) **Detailed Identifier Changes:** Commit b25f071a: Files to modify: **crates/storage_impl/src/errors.rs** Modify existing code
{"pr_number": 7712, "pr_title": "fix(errors): Entry not found error as 4xx instead of 5xx", "merged_at": "2025-04-03T12:18:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"other": ["crates/storage_impl/src/errors.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [SILVERFLOW] Integrate cards non 3ds payments ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Cards Non-3DS payments added for silverflow (Alpha Integration). Ref: https://www.silverflow.com/ ### 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/8592 ## How did you test it? Compilation and Clippy checks by cargo build and cargo clippy No cypress due to Alpha integration. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/connector_configs/toml/development.toml` - `crates/connector_configs/toml/production.toml` - `crates/connector_configs/toml/sandbox.toml` - ... and 3 more files **Code Patterns Applied:** - Define new data structures (30 changes) - Implement new functions (30 changes) - Extend existing types with new fields (274 changes) - Add conditional logic for feature flags or filtering (3 changes) **Detailed Identifier Changes:** Commit b5219519: Files to modify: **crates/hyperswitch_connectors/src/connectors/silverflow.rs** Remove: - struct: pub::Silverflow Add: - function: private::get_webhook_source_verification_algorithm - function: private::get_webhook_source_verification_signature - struct: pub::Silverflow **crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs** Add: - function: private::from - struct: pub::Amount - struct: pub::MerchantAcceptorResolver - struct: pub::SilverflowPaymentsRequest - struct: pub::PaymentType - impl: impl From<(MinorUnit, T)> for SilverflowRouterData<T> **crates/test_utils/src/connector_auth.rs** Modify existing code
{"pr_number": 8591, "pr_title": "feat(connector): [SILVERFLOW] Integrate cards non 3ds payments", "merged_at": "2025-07-24T06:43:09Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "card"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/silverflow.rs", "crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs", "crates/test_utils/src/connector_auth.rs"]}, "change_types": {"structs_added": 30, "functions_added": 30, "enums_added": 6, "fields_added": 274, "imports_added": 6, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): adyen connector creates connector's customer reference on the fly fixed ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Adyen now uses `connector_customer_id` to form `shopper_reference` if the field is present, else falls to previous implementation. ### 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="1081" alt="Screenshot 2025-06-24 at 4 01 08 PM" src="https://github.com/user-attachments/assets/08ad7563-b19a-41a5-8729-74aa3b5f6295" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs` **2. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **3. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 2 more files **Code Patterns Applied:** - Implement new functions (1 changes) **Detailed Identifier Changes:** Commit 7ad29326: Files to modify: **crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs** Modify existing code
{"pr_number": 8447, "pr_title": "fix(connector): adyen connector creates connector's customer reference on the fly fixed", "merged_at": "2025-06-24T17:23:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "user", "connector"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/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": {"functions_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(payments_list): handle same payment/attempt ids for different merchants ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Changed the query to apply the merchant_id filter after the join. This ensures valid rows aren’t excluded too early and fixes an issue where **payments with the same IDs but different merchants** were being handled incorrectly. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context Closes [#6916](https://github.com/juspay/hyperswitch/issues/6916) ## How did you test it? Tried to have to merchant id that have same payment/atttempt id. And tested for the logic: <img width="1078" alt="Screenshot 2024-12-23 at 7 31 50 PM" src="https://github.com/user-attachments/assets/0cc062fd-e10a-45f2-adbb-549dc9eb34c1" /> <img width="1056" alt="Screenshot 2024-12-23 at 4 32 48 PM" src="https://github.com/user-attachments/assets/db383407-087e-43b7-948f-4065e58202f2" /> Now the list api is working as expected for merchants who have same payment id Request: ``` curl 'http://localhost:8080/payments/list' \ -H 'Accept: */*' \ -H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \ -H 'Connection: keep-alive' \ -H 'Content-Type: application/json' \ -H 'Origin: http://localhost:9000' \ -H 'Referer: http://localhost:9000/' \ -H 'Sec-Fetch-Dest: empty' \ -H 'Sec-Fetch-Mode: cors' \ -H 'Sec-Fetch-Site: same-site' \ -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' \ -H 'api-key: hyperswitch' \ -H 'authorization: Bearer JWT' \ -H 'sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "macOS"' \ --data-raw '{"offset":0,"limit":50,"start_time":"2024-11-22T18:30:00Z","amount_filter":{"start_amount":null,"end_amount":null}}' ``` Response ``` { "count": 1, "total_count": 1, "data": [ { "payment_id": "x", "merchant_id": "merchant_1734940244", "status": "succeeded", "amount": 12300, "net_amount": 18000, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "stripe_test", "client_secret": "test_gFFhcIbCS0LkwFmaCdAl_secret_GmvAjH9YCyyXzoJVaBCT", "created": "2024-12-17T04:07:36.000Z", "currency": "USD", "customer_id": "hs-dashboard-user", "customer": null, "description": "This is a sample payment", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": null, "payment_method": "card", "payment_method_data": null, "payment_token": null, "shipping": null, "billing": null, "order_details": null, "email": null, "name": null, "phone": null, "return_url": null, "authentication_type": "three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": null, "connector_transaction_id": "test_W7bBdLqIBIxUMkpKsvu9_1", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_N7DbBIewrQYTC9qagLJY", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": null, "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": null, "expires_on": null, "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": null, "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ] } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Other** - `crates/storage_impl/src/payments/payment_intent.rs` **Code Patterns Applied:** - Modify database queries (7 changes) **Detailed Identifier Changes:** Commit 2e472e3f: Files to modify: **crates/storage_impl/src/payments/payment_intent.rs** Modify existing code
{"pr_number": 6917, "pr_title": "fix(payments_list): handle same payment/attempt ids for different merchants", "merged_at": "2024-12-24T13:29:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"other": ["crates/storage_impl/src/payments/payment_intent.rs"]}, "change_types": {"database_queries": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): Add recovery support for stripebilling ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Context: In case of some billing connectors we dont get the enough data in the webhook itself to support creation of payment intent and payment attempt in our system. So previously we derived a flow named "AdditionalRevenuerecoveryDetails" in this PR:#7402 which name is now changed to "BillingConnectorPaymentSync". This flow is used to fetch payment details of the invoices from the billing connectors using an API call to that billing connector. In this pr we are calling the flow and getting the details which are needed to create payment intent and attempt in our system. 1. Creates a connector integration in stripe billing that supports the API call. 2. Call the flow in recovery_incoming.rs file and using that details further we are creating the payment intent and attempt and verifying them. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 3. `crates/router/src/configs` 4. `loadtest/config` --> ## Motivation and Context ## Testing 1. Go to stripe create a new webhook endpoint with a dummy url to get webhook secret key. 2. create a payment processor stripe ``` curl --location 'http://localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: cloth_seller_mQRYaJduFokPeZ54W6bN' \ --header 'x-profile-id: pro_me6dnNKlhwuq32xhfjCA' \ --header 'Authorization: admin-api-key=test_admin' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "payment_processor", "connector_name": "stripe", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "api-key }, "payment_methods_enabled": [ { "payment_method_type": "card_redirect", "payment_method_subtypes": [ { "payment_method_subtype": "card_redirect", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "card", "payment_method_subtypes": [ { "payment_method_subtype": "credit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "debit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "wallet", "payment_method_subtypes": [ { "payment_method_subtype": "google_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "apple_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "we_chat_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "ali_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "paypal", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "mb_way", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "pay_later", "payment_method_subtypes": [ { "payment_method_subtype": "klarna", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "affirm", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "afterpay_clearpay", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "walley", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "bank_redirect", "payment_method_subtypes": [ { "payment_method_subtype": "giropay", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "ideal", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "eps", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "bancontact_card", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "przelewy24", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "sofort", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "blik", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "trustly", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "online_banking_finland", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "online_banking_poland", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "bank_transfer", "payment_method_subtypes": [ { "payment_method_subtype": "ach", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "sepa", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "bacs", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "bank_debit", "payment_method_subtypes": [ { "payment_method_subtype": "ach", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "sepa", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "bacs", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "becs", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay", "account_name": "transaction_processing", "pricing_type": "fixed_price", "acquirer_bin": "438309", "acquirer_merchant_id": "00002000000" }, "frm_configs": null, "connector_webhook_details": { "merchant_secret": "" }, "profile_id": "pro_me6dnNKlhwuq32xhfjCA" }' ``` change the profile id and other feilds while creating you own one 3. copy the mca id of stripe and paste it in the billing mca curl in feature metadata ``` curl --location 'http://localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: cloth_seller_mQRYaJduFokPeZ54W6bN' \ --header 'x-profile-id: pro_me6dnNKlhwuq32xhfjCA' \ --header 'Authorization: admin-api-key=test_admin' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "billing_processor", "connector_name": "stripebilling", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "{your api key}" }, "payment_methods_enabled": [ { "payment_method_type": "card", "payment_method_subtypes": [ { "payment_method_subtype": "credit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "debit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay", "account_name": "transaction_processing", "pricing_type": "fixed_price", "acquirer_bin": "438309", "acquirer_merchant_id": "00002000000" }, "frm_configs": null, "feature_metadata" : { "revenue_recovery":{ "max_retry_count" : 16, "billing_connector_retry_threshold": 2, "billing_account_reference": { "{your stripe mca id here}": "stripebilling" } } }, "connector_webhook_details": { "merchant_secret": "{webhook secret you have copied here}" }, "profile_id": "pro_me6dnNKlhwuq32xhfjCA" }' ``` 4. copy the mca id, profile id and merchant id to construct the endpoint of the webhook. 5. install ngrok and run the service it will give you a https url for your local host port. 6. copy the https url of ngrok 7. construct the webhook endpoint : url/v2/webhooks/merchant_id/profile_id/billing_mca_id 8. paste this endpoint in the place of dummy url you have used to create endpoint in stripe dashboard 9. now create a test subscription use this card "4000 0000 0000 0341" while creating a test subscription and the billing day should start from the next day. If you are creating a test subscription today billing date should start from tommorow. 10. now move the clock past one month. 11. no observe the payment intent table and payment attempt table in db and verify those details with ones we are getting. Images of the logs: <img width="1728" alt="Screenshot 2025-03-11 at 5 52 53 PM" src="https://github.com/user-attachments/assets/0a97b656-2417-4812-b9cd-a808183411ea" /> <img width="1728" alt="Screenshot 2025-03-11 at 5 53 10 PM" src="https://github.com/user-attachments/assets/5a9872f1-45a3-4bf5-978c-6e477df36c9f" /> <img width="1728" alt="Screenshot 2025-03-11 at 5 53 21 PM" src="https://github.com/user-attachments/assets/5cbac559-09d8-4939-b2a6-04bc8f50a1bc" /> <img width="1728" alt="Screenshot 2025-03-11 at 5 54 32 PM" src="https://github.com/user-attachments/assets/3eb3fb41-afd4-4a05-8c8b-715310a79d7d" /> <img width="1710" alt="Screenshot 2025-03-10 at 4 52 08 PM" src="https://github.com/user-attachments/assets/05477fdc-656b-42cd-ba27-880d5748cc19" /> <img width="1190" alt="Screenshot 2025-03-10 at 4 52 20 PM" src="https://github.com/user-attachments/assets/d9900f24-2b8f-45c5-b6c5-bd5dcd62357d" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
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. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/revenue_recovery.rs` - `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs` - `crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs` - ... and 3 more files **3. Core Business Logic** - `crates/router/src/core/admin.rs` - `crates/router/src/core/errors.rs` - `crates/router/src/core/payments/flows.rs` - ... and 3 more files **4. External Connector Integration** - `crates/common_enums/src/connector_enums.rs` - `crates/connector_configs/src/connector.rs` - `crates/hyperswitch_connectors/src/connectors/stripebilling.rs` - ... and 4 more files **5. Type Definitions** - `crates/hyperswitch_interfaces/src/types.rs` - `crates/router/src/types.rs` - `crates/router/src/types/api.rs` - ... and 1 more files **6. Configuration Files** - `config/config.example.toml` - `config/development.toml` - `config/docker_compose.toml` - ... and 2 more files **7. 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 (9 changes) - Implement new functions (31 changes) - Extend existing types with new fields (134 changes) **Detailed Identifier Changes:** Commit cfe22694: Files to modify: **crates/api_models/src/webhooks.rs** Add: - function: pub::get_connector_transaction_id_as_string - impl: impl ObjectReferenceId **crates/common_enums/src/connector_enums.rs** Modify existing code **crates/connector_configs/src/connector.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/stripebilling.rs** Add: - function: private::get_headers - function: private::get_content_type - function: private::get_revenue_recovery_attempt_details - function: private::get_revenue_recovery_invoice_details - impl: impl api::revenue_recovery::BillingConnectorPaymentsSyncIntegration for Stripebilling **crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs** Add: - function: pub::get_webhook_object_from_body - function: pub::get_invoice_webhook_data_from_body - function: private::try_from - function: private::from - struct: pub::StripebillingRecoveryDetailsData - impl: impl StripebillingWebhookBody - impl: impl StripebillingInvoiceBody - impl: impl TryFrom<StripebillingInvoiceBody> for revenue_recovery::RevenueRecoveryInvoiceData - impl: impl From<StripebillingFundingTypes> for common_enums::PaymentMethodType - mod: pub::auth_headers **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/revenue_recovery.rs** Add: - function: private::from - function: private::from - impl: impl From<&BillingConnectorPaymentsSyncResponse> for RevenueRecoveryInvoiceData - impl: impl From<&BillingConnectorPaymentsSyncResponse> for RevenueRecoveryAttemptData **crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs** Remove: - struct: pub::GetAdditionalRevenueRecoveryFlowCommonData Add: - struct: pub::BillingConnectorPaymentsSyncFlowData **crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs** Remove: - struct: pub::GetAdditionalRevenueRecoveryDetails Add: - struct: pub::BillingConnectorPaymentsSync **crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs** Remove: - struct: pub::GetAdditionalRevenueRecoveryRequestData Add: - struct: pub::BillingConnectorPaymentsSyncRequest **crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs** Remove: - struct: pub::GetAdditionalRevenueRecoveryResponseData Add: - struct: pub::BillingConnectorPaymentsSyncResponse **crates/hyperswitch_domain_models/src/types.rs** Modify existing code **crates/hyperswitch_interfaces/src/api.rs** Modify existing code **crates/hyperswitch_interfaces/src/api/revenue_recovery.rs** Modify existing code **crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs** Remove: - trait: pub::RevenueRecoveryV2 Add: - trait: pub::RevenueRecoveryV2 **crates/hyperswitch_interfaces/src/conversion_impls.rs** Add: - function: private::from_old_router_data - function: private::to_old_router_data - impl: impl RouterDataConversion<T, Req, Resp> for BillingConnectorPaymentsSyncFlowData **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** Remove: - struct: pub::GetAdditionalRevenueRecoveryDetailsCall Add: - struct: pub::BillingConnectorPaymentsSyncCall **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/core/errors.rs** Modify existing code **crates/router/src/core/payments/flows.rs** Modify existing code **crates/router/src/core/webhooks/incoming_v2.rs** Modify existing code **crates/router/src/core/webhooks/recovery_incoming.rs** Add: - function: private::get_recovery_invoice_details - function: private::get_recovery_invoice_transaction_details - function: private::get_recovery_payment_attempt - function: private::handle_billing_connector_payment_sync_call - function: private::get_billing_connector_payment_details - function: private::inner - function: private::construct_router_data_for_billing_connector_payment_sync_call - function: private::inner - struct: pub::BillingConnectorPaymentsSyncResponseData - struct: pub::BillingConnectorPaymentsSyncFlowRouterData - impl: impl BillingConnectorPaymentsSyncResponseData - impl: impl BillingConnectorPaymentsSyncFlowRouterData **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 **crates/router/src/types/transformers.rs** Modify existing code
{"pr_number": 7461, "pr_title": "feat(connector): Add recovery support for stripebilling", "merged_at": "2025-04-02T07:49:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/webhooks.rs"], "domain": ["crates/hyperswitch_domain_models/src/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/router_data_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/admin.rs", "crates/router/src/core/errors.rs", "crates/router/src/core/payments/flows.rs", "crates/router/src/core/revenue_recovery.rs", "crates/router/src/core/webhooks/incoming_v2.rs", "crates/router/src/core/webhooks/recovery_incoming.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/hyperswitch_connectors/src/connectors/stripebilling.rs", "crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/hyperswitch_interfaces/src/connector_integration_v2.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs", "crates/router/src/types.rs", "crates/router/src/types/api.rs", "crates/router/src/types/transformers.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": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/hyperswitch_interfaces/src/api.rs", "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": 9, "functions_added": 31, "fields_added": 134, "imports_added": 11}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(router): add support for apple pay pre-decrypted token in the payments confirm call ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This pull request adds support pass the decryted apple pay token directly in the confirm call. This pull also request introduces significant changes to the handling of Apple Pay payment data across multiple modules, improving the structure, validation, and usage of encrypted and decrypted Apple Pay data. It also refactors related code to enhance type safety and modularity. Below is a summary of the most important changes grouped by themes. ### 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 apple pay pre decrypt flow -> Enable apple pay for a connector a connector that supports decryption and do not configure any apple pay certificates. -> Make a payment by passing pre decrypted apple pay token in the confirm call ``` { "amount": 7445, "currency": "USD", "confirm": true, "business_country": "US", "business_label": "default", "amount_to_capture": 7445, "customer_id": "cu_{{$timestamp}}", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "setup_future_usage": "on_session", "authentication_type": "no_three_ds", "return_url": "https://google.com", "email": "[email protected]", "name": "Joseph Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "payment_method": "wallet", "payment_method_type": "apple_pay", "billing": { "address": { "line1": "1467", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "in sit", "user_agent": "amet irure esse" } }, "payment_method_data": { "wallet": { "apple_pay": { "payment_data": { "application_primary_account_number": "4242424242424242", "application_expiration_month": "09", "application_expiration_year": "30", "payment_data": { "online_payment_cryptogram": "AQAA*******yB5A=", "eci_indicator": "5" } }, "payment_method": { "display_name": "Discover 9319", "network": "Discover", "type": "debit" }, "transaction_identifier": "c635c5b3af900d7bd81fecd7028f1262f9d030754ee65ec7afd988a678194751" } } } } ``` ``` { "payment_id": "pay_rsndpQQg3q5d6MZcC90t", "merchant_id": "merchant_1754031338", "status": "succeeded", "amount": 7445, "net_amount": 7445, "shipping_cost": null, "amount_capturable": 0, "amount_received": 7445, "connector": "cybersource", "client_secret": "pay_rsndpQQg3q5d6MZcC90t_secret_3WokDjcCK7LkjIHKoERT", "created": "2025-08-01T07:55:32.248Z", "currency": "USD", "customer_id": "cu_1754034932", "customer": { "id": "cu_1754034932", "name": "Joseph Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "apple_pay": { "last4": "9319", "card_network": "Discover", "type": "debit" } }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": null, "line3": null, "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "[email protected]", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "apple_pay", "connector_label": "cybersource_US_default_default", "business_country": "US", "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1754034932", "created_at": 1754034932, "expires": 1754038532, "secret": "epk_6a7deed7c99d4abc955276e5528f0edf" }, "manual_retry_allowed": false, "connector_transaction_id": "7540349324566718504805", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_rsndpQQg3q5d6MZcC90t_1", "payment_link": null, "profile_id": "pro_BdMNcMGamneoVpCbUGjD", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_N7zyBtWcYsXLn1xxwiZL", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-01T08:10:32.248Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-08-01T07:55:32.744Z", "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 } ``` logs indicating apple pay pre decrypt flow <img width="2040" height="338" alt="image" src="https://github.com/user-attachments/assets/94af13ac-af0a-4092-8f19-d0bd59b7f2fc" /> logs showing decrypted apple pay token being sent to the connector <img width="2031" height="403" alt="image" src="https://github.com/user-attachments/assets/c0fc463d-5907-48ea-93cb-584396139bad" /> ### Test apple pay hyperswitch decryption flow -> Enable apple pay for a connector by selecting payment_processing_details_at `Hyperswitch` -> Make a apple pay payment ``` { "amount": 1, "currency": "EUR", "confirm": true, "business_country": "US", "business_label": "default", "amount_to_capture": 1, "customer_id": "cu_{{$timestamp}}", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "setup_future_usage": "on_session", "authentication_type": "no_three_ds", "return_url": "https://google.com", "email": "[email protected]", "name": "Joseph Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "payment_method": "wallet", "payment_method_type": "apple_pay", "billing": { "address": { "line1": "1467", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "in sit", "user_agent": "amet irure esse" } }, "payment_method_data": { "wallet": { "apple_pay": { "payment_data": "eyJkYXRhIjoiK3N4aGdBODIvSC9hZ1E5ZnJ2WklMNXJmaDl0REtheFd2aFhlZ0ZFeVhuM2ZPVnpDVWRNOXhaOWhXRnNSZ0toUlFRY0JNQndHQ1NxR1NJYjNEUUVKQlRFUEZ3MHlOVEEyTURReE1URTBNekJhTUNnR0NTcUdTSWIzRFFFSk5ERWJNQmt3Q3dZSllJWklBV1VEQkFJQm9Rb0dDQ3FHU000OUJBTUNNQzhHQ1NxR1NJYjNEUUVKQkRFaUJDRGlkOTVsU2gyKy9MZW9wdDlYZ0txOFJTTlJZbWxmSjcvYmtEWGZEeWQrM0RBS0JnZ3Foa2pPUFFRREFnUkhNRVVDSVFEWGxXN3JZREZEODFqb2tTWHBBVjE0aFZtTjBXOFBGUkIrY0IvVXFDUVp5Z0lnWlVGb2FXb21aZVMranJvblVqdTNwNE5FWDFmeGYrc2xhOVRLL1pCb0VSTUFBQUFBQUFBPSIsImhlYWRlciI6eyJwdWJsaWNLZXlIYXNoIjoiMVlTbEwwWUo3cE84ZThHWVVhZFN0dXRWRUdRNU5LS2N2aHJOd2IvRE9nOD0iLCJlcGhlbWVyYWxQdWJsaWNLZXkiOiJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUxZXFPemRFWTJmTnlwaWovT3NhaEFFZjk2a3h3RjNKbUZrNG5ITXdsVnJ5ZWwyeTdMbHgrdDhTekY0ZVQxRE1FZWlnYkY2Sk9zMlV3Z3QxUnFpK09zQT09IiwidHJhbnNhY3Rpb25JZCI6ImZmODBlNzk4ODhiMTU5MjRhYjY2N2EyMmI3YWNjZTlkYjYzNjQxODI3ZDVkOTQ2MWYwZDBkODU0ZWM1ZTFkNTEifSwidmVyc2lvbiI6IkVDX3YxIn0=", "payment_method": { "display_name": "Discover 9319", "network": "Discover", "type": "debit" }, "transaction_identifier": "c635c5b3af900d7bd81fecd7028f1262f9d030754ee65ec7afd988a678194751" } } } } ``` ``` { "payment_id": "pay_Q8ydSHV3zjSZOutKTRCN", "merchant_id": "merchant_1754035609", "status": "succeeded", "amount": 1, "net_amount": 1, "shipping_cost": null, "amount_capturable": 0, "amount_received": 1, "connector": "cybersource", "client_secret": "pay_Q8ydSHV3zjSZOutKTRCN_secret_aj6St1LLygIZ78PHEaDH", "created": "2025-08-01T08:17:55.511Z", "currency": "EUR", "customer_id": "cu_1754036275", "customer": { "id": "cu_1754036275", "name": "Joseph Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "apple_pay": { "last4": "9319", "card_network": "Discover", "type": "debit" } }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": null, "line3": null, "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "[email protected]", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "apple_pay", "connector_label": "cybersource_US_default_default", "business_country": "US", "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1754036275", "created_at": 1754036275, "expires": 1754039875, "secret": "epk_3f50b029f83d4d72876d0a9efe3547ea" }, "manual_retry_allowed": false, "connector_transaction_id": "7540362767046209204805", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_Q8ydSHV3zjSZOutKTRCN_1", "payment_link": null, "profile_id": "pro_oPnag2LsACnLlbDFDkgf", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_3IV2FB3yWpFmLr0b9Z3N", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-01T08:32:55.511Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-08-01T08:17:57.043Z", "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 } ``` Logs indicating decrypt apple pay token <img width="1481" height="441" alt="image" src="https://github.com/user-attachments/assets/aec80973-3b31-4b9f-8f3e-d13310b435d6" /> Logs showing decrypted token in the connector request <img width="2045" height="566" alt="image" src="https://github.com/user-attachments/assets/22a4d603-2280-4690-b3bc-3b92c77976ff" /> ### Test connector decryption flow -> Enabled apple pay with payment processing details at "Connector" ``` { "amount": 6500, "currency": "USD", "confirm": true, "business_country": "US", "business_label": "default", "amount_to_capture": 6500, "customer_id": "cu_{{$timestamp}}", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "setup_future_usage": "off_session", "authentication_type": "no_three_ds", "return_url": "https://google.com", "email": "[email protected]", "name": "Joseph Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "payment_method": "wallet", "payment_method_type": "apple_pay", "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "in sit", "user_agent": "amet irure esse" } }, "payment_method_data": { "wallet": { "apple_pay": { "payment_data": "=", "payment_method": { "display_name": "Visa 0121", "network": "Visa", "type": "credit" }, "transaction_identifier": "c91059b67493677daf9e18ad07d26bc767d931d87b377d7b0062878696509342" } } } } ``` ``` { "payment_id": "pay_KzSYCSHQEDEusanXEBfM", "merchant_id": "merchant_1754045350", "status": "succeeded", "amount": 6500, "net_amount": 6500, "shipping_cost": null, "amount_capturable": 0, "amount_received": 6500, "connector": "adyen", "client_secret": "pay_KzSYCSHQEDEusanXEBfM_secret_y7T1LarPEoR2E9CRnlCP", "created": "2025-08-01T11:00:57.986Z", "currency": "USD", "customer_id": "cu_1754046058", "customer": { "id": "cu_1754046058", "name": "Joseph Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "apple_pay": { "last4": "0121", "card_network": "Visa", "type": "credit" } }, "billing": null }, "payment_token": null, "shipping": null, "billing": null, "order_details": null, "email": "[email protected]", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "apple_pay", "connector_label": "adyen_US_default", "business_country": "US", "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1754046058", "created_at": 1754046057, "expires": 1754049657, "secret": "epk_c04d44072b9f45ccb4b62f50131096f6" }, "manual_retry_allowed": false, "connector_transaction_id": "TSKD2XD2GPXBGZV5", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_KzSYCSHQEDEusanXEBfM_1", "payment_link": null, "profile_id": "pro_deLVMQyHA9B0On0hO1OP", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_NwmhWrK6Lwwkfbn0zjna", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-01T11:15:57.986Z", "fingerprint": null, "browser_info": null, "payment_method_id": "pm_r51tT1dt6mwNbGAfvgz9", "payment_method_status": "active", "updated": "2025-08-01T11:00:59.822Z", "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": "VWM6LZJ2RM6XPST5", "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 } ``` ## 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` **3. Core Business Logic** - `crates/router/src/core/payments.rs` **4. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs` - `crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs` - `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` - ... and 16 more files **5. Type Definitions** - `crates/common_types/Cargo.toml` - `crates/common_types/src/payments.rs` - `crates/router/src/types.rs` **6. Tests** - `config/deployments/integration_test.toml` **7. Configuration Files** - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - `config/development.toml` **8. Other** - `Cargo.lock` - `api-reference/v1/openapi_spec_v1.json` - `api-reference/v2/openapi_spec_v2.json` - ... and 2 more files **Code Patterns Applied:** - Define new data structures (5 changes) - Implement new functions (21 changes) - Extend existing types with new fields (94 changes) - Add conditional logic for feature flags or filtering (3 changes) **Detailed Identifier Changes:** Commit b91e6d95: Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/common_types/src/payments.rs** Add: - function: pub::get_encrypted_apple_pay_payment_data_optional - function: pub::get_decrypted_apple_pay_payment_data_optional - function: pub::get_encrypted_apple_pay_payment_data_mandatory - function: pub::get_decrypted_apple_pay_payment_data_mandatory - function: pub::get_two_digit_expiry_year - function: pub::get_four_digit_expiry_year - function: pub::get_expiry_month - function: pub::get_expiry_date_as_mmyy - struct: pub::ApplePayPredecryptData - struct: pub::ApplePayCryptogramData - enum: pub::ApplePayPaymentData - impl: impl ApplePayPaymentData - impl: impl ApplePayPredecryptData **crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/archipel/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/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/mollie/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/payu/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs** Add: - function: private::from - struct: pub::CardholderAuthentication - impl: impl From<WorldPayVativApplePayNetwork> for WorldpayvativCardType **crates/hyperswitch_connectors/src/utils.rs** Remove: - function: private::get_two_digit_expiry_year - function: private::get_four_digit_expiry_year - function: private::get_expiry_month - trait: pub::ApplePayDecrypt - impl: impl ApplePayDecrypt for Box<ApplePayPredecryptData> **crates/hyperswitch_domain_models/src/payment_method_data.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/connector/utils.rs** Remove: - function: private::get_four_digit_expiry_year - function: private::get_expiry_month - trait: pub::ApplePayDecrypt - impl: impl ApplePayDecrypt for Box<ApplePayPredecryptData> **crates/router/src/core/payments.rs** Add: - function: private::check_predecrypted_token - function: private::check_predecrypted_token **crates/router/src/types.rs** Modify existing code **crates/router/tests/connectors/worldpay.rs** Modify existing code
{"pr_number": 8815, "pr_title": "feat(router): add support for apple pay pre-decrypted token in the payments confirm call", "merged_at": "2025-08-05T08:19:29Z", "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"], "core_business": ["crates/router/src/core/payments.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs", "crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bankofamerica/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/mollie/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/utils.rs", "crates/router/tests/connectors/worldpay.rs"], "types": ["crates/common_types/Cargo.toml", "crates/common_types/src/payments.rs", "crates/router/src/types.rs"], "tests": ["config/deployments/integration_test.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml"], "other": ["Cargo.lock", "api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 5, "functions_added": 21, "enums_added": 2, "fields_added": 94, "imports_added": 9, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(router): prioritise `connector_mandate_id` over `network_transaction_id` during MITs ## 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 --> During the MIT if the decided connector is same as the connector with which the mandate is created then the MIT should be processed with the connector mandate _id. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> Connector mandate id based payments have better auth rates than the card details with network transaction id. ## How did you test 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 business profile and enable connector agnostic mandate feature ``` curl --location 'http://localhost:8080/account/merchant_1737444280/business_profile/pro_h1bdGYYiQic3IHdVU1Mm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data '{ "is_connector_agnostic_mit_enabled": true }' ``` ``` { "merchant_id": "merchant_1737444280", "profile_id": "pro_h1bdGYYiQic3IHdVU1Mm", "profile_name": "US_default", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "payment_response_hash_key": "g9sOqQ4SnAvNAjupw2CYjfkOlasfwYVIILUieujxrvuklwkPFAUjaPR6k48uxLd0", "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": true, "payout_link_config": null, "outgoing_webhook_custom_http_headers": null, "tax_connector_id": null, "is_tax_connector_enabled": false, "is_network_tokenization_enabled": false, "is_auto_retries_enabled": false, "max_auto_retries_enabled": null, "is_click_to_pay_enabled": false, "authentication_product_ids": null } ``` #### Create a off session payment ``` curl --location 'http://localhost:8080/payments' \ --header 'Accept: application/json' \ --header 'api-key: <api-key>' \ --header 'Content-Type: application/json' \ --data-raw '{ "amount": 500, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "cu_1737444547", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "name name", "card_cvc": "737" } }, "setup_future_usage": "off_session", "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "in sit", "user_agent": "amet irure esse" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX", "last_name": "ss" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": {}, "order_details": [ { "product_name": "Apple iphone 15", "quantity": 1, "amount": 0, "account_name": "transaction_processing" } ] }' ``` ``` { "payment_id": "pay_KqygCo0YGgtq5kwRg7ya", "merchant_id": "merchant_1737444280", "status": "succeeded", "amount": 500, "net_amount": 500, "shipping_cost": null, "amount_capturable": 0, "amount_received": 500, "connector": "stripe", "client_secret": "pay_KqygCo0YGgtq5kwRg7ya_secret_Dem5r9Q8FYZom1eRjrt0", "created": "2025-01-21T07:28:13.410Z", "currency": "USD", "customer_id": "cu_1737444493", "customer": { "id": "cu_1737444493", "name": "John Doe", "email": "[email protected]", "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": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "name name", "payment_checks": { "cvc_check": "pass", "address_line1_check": "pass", "address_postal_code_check": "pass" }, "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": "John", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "PiX", "last_name": "ss" }, "phone": null, "email": null }, "order_details": [ { "brand": null, "amount": 0, "category": null, "quantity": 1, "tax_rate": null, "product_id": null, "product_name": "Apple iphone 15", "product_type": null, "sub_category": null, "product_img_link": null, "product_tax_code": null, "total_tax_amount": null, "requires_shipping": null } ], "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1737444493", "created_at": 1737444493, "expires": 1737448093, "secret": "epk_5565c9134045451ab40c5712bfa952b2" }, "manual_retry_allowed": false, "connector_transaction_id": "pi_3QjbsgEOqOywnAIx1CT15pu2", "frm_message": null, "metadata": {}, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi_3QjbsgEOqOywnAIx1CT15pu2", "payment_link": null, "profile_id": "pro_h1bdGYYiQic3IHdVU1Mm", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_yzI9tnLJezjQey1LjoCo", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-01-21T07:43:13.410Z", "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_LR6jCdVNR85W6L1jYIeX", "payment_method_status": "active", "updated": "2025-01-21T07:28:15.652Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": "pm_1QjbsgEOqOywnAIxpfltM04Z" } ``` -> Image showing `network_transaction_id` shored in db ![image](https://github.com/user-attachments/assets/b5aa3307-4ffd-4dcd-9f7a-023c6ebd17c6) #### Recurring payment with same connector -> Create a payment for the same customer with confirm false ``` curl --location 'http://localhost:8080/payments' \ --header 'Accept: application/json' \ --header 'api-key: <api-key>' \ --header 'Content-Type: application/json' \ --data '{ "amount": 10000, "currency": "USD", "capture_method": "automatic", "authentication_type": "three_ds", "confirm": false, "customer_id": "cu_1737444493" }' ``` ``` { "payment_id": "pay_pG0kiVb7LLFH8zL2MwFk", "merchant_id": "merchant_1737444280", "status": "requires_payment_method", "amount": 10000, "net_amount": 10000, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": null, "client_secret": "pay_pG0kiVb7LLFH8zL2MwFk_secret_ArZFjbGaLgfS9Xz75hcM", "created": "2025-01-21T07:31:42.526Z", "currency": "USD", "customer_id": "cu_1737444493", "customer": { "id": "cu_1737444493", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": null, "payment_method_data": null, "payment_token": null, "shipping": null, "billing": null, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": null, "authentication_type": "three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1737444493", "created_at": 1737444702, "expires": 1737448302, "secret": "epk_eb66ffa2b7be44958a581a9774279fef" }, "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_h1bdGYYiQic3IHdVU1Mm", "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-21T07:46:42.526Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-01-21T07:31:42.545Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` -> List customer payment methods with the `client_secret` ``` curl --location 'http://localhost:8080/customers/payment_methods?client_secret=pay_pG0kiVb7LLFH8zL2MwFk_secret_ArZFjbGaLgfS9Xz75hcM' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_b40ef36c556f4da5b6d4682fe66bceeb' ``` ``` { "customer_payment_methods": [ { "payment_token": "token_sBwkrgItKqpd07yTPDVG", "payment_method_id": "pm_LR6jCdVNR85W6L1jYIeX", "customer_id": "cu_1737444493", "payment_method": "card", "payment_method_type": "credit", "payment_method_issuer": null, "payment_method_issuer_code": null, "recurring_enabled": true, "installment_payment_enabled": false, "payment_experience": [ "redirect_to_url" ], "card": { "scheme": null, "issuer_country": null, "last4_digits": "1111", "expiry_month": "03", "expiry_year": "2030", "card_token": null, "card_holder_name": "name name", "card_fingerprint": null, "nick_name": null, "card_network": null, "card_isin": "411111", "card_issuer": null, "card_type": null, "saved_to_locker": true }, "metadata": null, "created": "2025-01-21T07:28:15.607Z", "bank": null, "surcharge_details": null, "requires_cvv": true, "last_used_at": "2025-01-21T07:28:15.607Z", "default_payment_method_set": true, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "name", "last_name": "name" }, "phone": null, "email": null } } ], "is_guest_customer": false } ``` -> Confirm the payment with the above listed token and the `client_secret` ``` curl --location 'http://localhost:8080/payments/pay_pG0kiVb7LLFH8zL2MwFk/confirm' \ --header 'api-key: pk_dev_b40ef36c556f4da5b6d4682fe66bceeb' \ --header 'Content-Type: application/json' \ --data-raw '{ "payment_token": "token_sBwkrgItKqpd07yTPDVG", "payment_method_type": "credit", "payment_method": "card", "setup_future_usage": "off_session", "client_secret": "pay_pG0kiVb7LLFH8zL2MwFk_secret_ArZFjbGaLgfS9Xz75hcM", "billing": { "address": { "city": "test", "country": "US", "line1": "here", "line2": "there", "line3": "anywhere", "zip": "560095", "state": "Washington", "first_name": "One", "last_name": "Two" }, "phone": { "number": "1234567890", "country_code": "+1" }, "email": "[email protected]" } }' ``` ``` { "payment_id": "pay_pG0kiVb7LLFH8zL2MwFk", "merchant_id": "merchant_1737444280", "status": "succeeded", "amount": 10000, "net_amount": 10000, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10000, "connector": "stripe", "client_secret": "pay_pG0kiVb7LLFH8zL2MwFk_secret_ArZFjbGaLgfS9Xz75hcM", "created": "2025-01-21T07:31:42.526Z", "currency": "USD", "customer_id": "cu_1737444493", "customer": { "id": "cu_1737444493", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "name name", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_sBwkrgItKqpd07yTPDVG", "shipping": null, "billing": { "address": { "city": "test", "country": "US", "line1": "here", "line2": "there", "line3": "anywhere", "zip": "560095", "state": "Washington", "first_name": "One", "last_name": "Two" }, "phone": { "number": "1234567890", "country_code": "+1" }, "email": "[email protected]" }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": null, "authentication_type": "three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "pi_3Qjbx2EOqOywnAIx0fDT7TiV", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi_3Qjbx2EOqOywnAIx0fDT7TiV", "payment_link": null, "profile_id": "pro_h1bdGYYiQic3IHdVU1Mm", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_yzI9tnLJezjQey1LjoCo", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-01-21T07:46:42.526Z", "fingerprint": null, "browser_info": { "os_type": null, "language": null, "time_zone": null, "ip_address": "::1", "os_version": null, "user_agent": null, "color_depth": null, "device_model": null, "java_enabled": null, "screen_width": null, "accept_header": null, "screen_height": null, "java_script_enabled": null }, "payment_method_id": "pm_LR6jCdVNR85W6L1jYIeX", "payment_method_status": "active", "updated": "2025-01-21T07:32:45.176Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": "pm_1QjbsgEOqOywnAIxpfltM04Z" } ``` -> Logs indicating `connector_mandate_id` was used to make MIT ![image](https://github.com/user-attachments/assets/49064be0-8548-4312-b95a-1f7ea04c0b24) #### Recurring payment with different connector Since the initial CIT was processed using the Stripe payment method, the table will only contain the connector mandate ID for Stripe. Now that Cybersource has been chosen for the MIT, the payment should be processed through Cybersource using the network_transaction_id, and it should succeed. -> Configure another connector (stripe, adyen, or cybersource), other than the one used in CIT -> Create a payment for same customer with confirm false ``` curl --location 'http://localhost:8080/payments' \ --header 'Accept: application/json' \ --header 'api-key: <api-key>' \ --header 'Content-Type: application/json' \ --data '{ "amount": 10000, "currency": "USD", "capture_method": "automatic", "authentication_type": "three_ds", "confirm": false, "customer_id": "cu_1737444493" }' ``` ``` { "payment_id": "pay_HEjhNaSLzmzi9i7hNQAf", "merchant_id": "merchant_1737444280", "status": "requires_payment_method", "amount": 10000, "net_amount": 10000, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": null, "client_secret": "pay_HEjhNaSLzmzi9i7hNQAf_secret_HukTuQYWnuiDSV6cHmz9", "created": "2025-01-21T07:43:14.695Z", "currency": "USD", "customer_id": "cu_1737444493", "customer": { "id": "cu_1737444493", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": null, "payment_method_data": null, "payment_token": null, "shipping": null, "billing": null, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": null, "authentication_type": "three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1737444493", "created_at": 1737445394, "expires": 1737448994, "secret": "epk_e470828aef5346b78806253351aa5283" }, "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_h1bdGYYiQic3IHdVU1Mm", "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-21T07:58:14.695Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-01-21T07:43:14.712Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` -> List customer payment methods using the `client_secret` ``` curl --location 'http://localhost:8080/customers/payment_methods?client_secret=pay_HEjhNaSLzmzi9i7hNQAf_secret_HukTuQYWnuiDSV6cHmz9' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_b40ef36c556f4da5b6d4682fe66bceeb' ``` ``` { "customer_payment_methods": [ { "payment_token": "token_NG5a2aePYBabkiDr0WTP", "payment_method_id": "pm_LR6jCdVNR85W6L1jYIeX", "customer_id": "cu_1737444493", "payment_method": "card", "payment_method_type": "credit", "payment_method_issuer": null, "payment_method_issuer_code": null, "recurring_enabled": true, "installment_payment_enabled": false, "payment_experience": [ "redirect_to_url" ], "card": { "scheme": null, "issuer_country": null, "last4_digits": "1111", "expiry_month": "03", "expiry_year": "2030", "card_token": null, "card_holder_name": "name name", "card_fingerprint": null, "nick_name": null, "card_network": null, "card_isin": "411111", "card_issuer": null, "card_type": null, "saved_to_locker": true }, "metadata": null, "created": "2025-01-21T07:28:15.607Z", "bank": null, "surcharge_details": null, "requires_cvv": true, "last_used_at": "2025-01-21T07:32:45.157Z", "default_payment_method_set": true, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "name", "last_name": "name" }, "phone": null, "email": null } } ], "is_guest_customer": false } ``` -> Since the initial CIT was processed using the Stripe payment method, the table will only contain the connector mandate ID for Stripe. Now that Cybersource has been chosen for the MIT, the payment should be processed through Cybersource using the network_transaction_id, and it should succeed. ``` curl --location 'http://localhost:8080/payments/pay_HEjhNaSLzmzi9i7hNQAf/confirm' \ --header 'api-key: pk_dev_b40ef36c556f4da5b6d4682fe66bceeb' \ --header 'Content-Type: application/json' \ --data-raw '{ "payment_token": "token_NG5a2aePYBabkiDr0WTP", "payment_method_type": "credit", "payment_method": "card", "setup_future_usage": "off_session", "client_secret": "pay_HEjhNaSLzmzi9i7hNQAf_secret_HukTuQYWnuiDSV6cHmz9", "routing": { "type": "single", "data": { "connector": "cybersource", "merchant_connector_id": "mca_Nz1gr4IIjucxP22LHe1C" } }, "billing": { "address": { "city": "test", "country": "US", "line1": "here", "line2": "there", "line3": "anywhere", "zip": "560095", "state": "Washington", "first_name": "One", "last_name": "Two" }, "phone": { "number": "1234567890", "country_code": "+1" }, "email": "[email protected]" } }' ``` ``` { "payment_id": "pay_HEjhNaSLzmzi9i7hNQAf", "merchant_id": "merchant_1737444280", "status": "succeeded", "amount": 10000, "net_amount": 10000, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10000, "connector": "cybersource", "client_secret": "pay_HEjhNaSLzmzi9i7hNQAf_secret_HukTuQYWnuiDSV6cHmz9", "created": "2025-01-21T07:43:14.695Z", "currency": "USD", "customer_id": "cu_1737444493", "customer": { "id": "cu_1737444493", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "name name", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_NG5a2aePYBabkiDr0WTP", "shipping": null, "billing": { "address": { "city": "test", "country": "US", "line1": "here", "line2": "there", "line3": "anywhere", "zip": "560095", "state": "Washington", "first_name": "One", "last_name": "Two" }, "phone": { "number": "1234567890", "country_code": "+1" }, "email": "[email protected]" }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": null, "authentication_type": "three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "7374456386026828504805", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_HEjhNaSLzmzi9i7hNQAf_1", "payment_link": null, "profile_id": "pro_h1bdGYYiQic3IHdVU1Mm", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_Nz1gr4IIjucxP22LHe1C", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-01-21T07:58:14.695Z", "fingerprint": null, "browser_info": { "os_type": null, "language": null, "time_zone": null, "ip_address": "::1", "os_version": null, "user_agent": null, "color_depth": null, "device_model": null, "java_enabled": null, "screen_width": null, "accept_header": null, "screen_height": null, "java_script_enabled": null }, "payment_method_id": "pm_LR6jCdVNR85W6L1jYIeX", "payment_method_status": "active", "updated": "2025-01-21T07:47:19.698Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` -> Logs indicating `network_transaction_id` was used to make MIT ![image](https://github.com/user-attachments/assets/59a70e78-5142-4a17-9837-350e8ea4c41b) ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payments.rs` **Code Patterns Applied:** - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 5ff57fa3: Files to modify: **crates/router/src/core/payments.rs** Modify existing code
{"pr_number": 7081, "pr_title": "refactor(router): prioritise `connector_mandate_id` over `network_transaction_id` during MITs", "merged_at": "2025-01-28T21:02:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs"]}, "change_types": {"conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(dashboard): Wasm fix for xendit connector ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix ## Description <!-- Describe your changes in detail --> Wasm fix for xendit connector ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **connector_integration** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/connector_configs/toml/development.toml` - `crates/connector_configs/toml/production.toml` - `crates/connector_configs/toml/sandbox.toml`
{"pr_number": 7459, "pr_title": "fix(dashboard): Wasm fix for xendit connector", "merged_at": "2025-03-07T10:24:04Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
fix(payments): populate payment_method_type in payment_attempt for cards ## 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 PR for https://github.com/juspay/hyperswitch/pull/6519 ### 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/operations/payment_confirm.rs` - `crates/router/src/core/payments/operations/payment_create.rs` - `crates/router/src/core/payments/transformers.rs` **Code Patterns Applied:** - Implement new functions (1 changes) - Add conditional logic for feature flags or filtering (3 changes) **Detailed Identifier Changes:** Commit 6230eb49: Files to modify: **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/transformers.rs** Add: - function: private::foreign_from - impl: impl ForeignFrom<(Self, Option<&api_models::payments::AdditionalPaymentData>)> for Option<enums::PaymentMethodType>
{"pr_number": 6557, "pr_title": "fix(payments): populate payment_method_type in payment_attempt for cards", "merged_at": "2024-11-13T13:42:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/transformers.rs"]}, "change_types": {"functions_added": 1, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
chore(dynamic-fields): remove billing details as required fields for Worldpay connector ## 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 removes billing details as required fields for Worldpay connector. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context This change helps in not showing the billing details as required fields on the payment widget. ## How did you test it? Locally, by rendering payment links. <details> <summary>Fetch account payment method list</summary> cURL curl 'http://localhost:8080/account/payment_methods?client_secret=pay_62mvQc0WyVZ5pe8QxqhR_secret_K6C6bulFCe6jdm6GogvF' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:137.0) Gecko/20100101 Firefox/137.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Referer: http://localhost:9050/' -H 'api-key: pk_dev_36edab4ded2a4a8abdbcffaa254eb7e4' -H 'content-type: application/json' -H 'x-browser-name: Firefox' -H 'x-browser-version: 137.0' -H 'x-client-platform: web' -H 'x-client-version: 0.122.6' -H 'x-payment-confirm-source: sdk' -H 'Origin: http://localhost:9050' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-site' -H 'Priority: u=4' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' Response { "redirect_url": "https://google.com/success", "currency": "EUR", "payment_methods": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ { "card_network": "Visa", "surcharge_details": null, "eligible_connectors": [ "worldpay" ] } ], "bank_names": null, "bank_debits": null, "bank_transfers": null, "required_fields": { "payment_method_data.card.card_number": { "required_field": "payment_method_data.card.card_number", "display_name": "card_number", "field_type": "user_card_number", "value": null }, "payment_method_data.card.card_exp_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_exp_year": { "required_field": "payment_method_data.card.card_exp_year", "display_name": "card_exp_year", "field_type": "user_card_expiry_year", "value": null } }, "surcharge_details": null, "pm_auth_connector": null }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ { "card_network": "Visa", "surcharge_details": null, "eligible_connectors": [ "worldpay" ] } ], "bank_names": null, "bank_debits": null, "bank_transfers": null, "required_fields": { "payment_method_data.card.card_exp_year": { "required_field": "payment_method_data.card.card_exp_year", "display_name": "card_exp_year", "field_type": "user_card_expiry_year", "value": null }, "payment_method_data.card.card_number": { "required_field": "payment_method_data.card.card_number", "display_name": "card_number", "field_type": "user_card_number", "value": null }, "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 } }, "surcharge_details": null, "pm_auth_connector": null } ] } ], "mandate_payment": null, "merchant_name": "NewAge Retailer", "show_surcharge_breakup_screen": false, "payment_type": "normal", "request_external_three_ds_authentication": false, "collect_shipping_details_from_wallets": false, "collect_billing_details_from_wallets": false, "is_tax_calculation_enabled": false } </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/payment_methods/src/configs/payment_connector_required_fields.rs` **Detailed Identifier Changes:** Commit 8a68cc7c: Files to modify: **crates/payment_methods/src/configs/payment_connector_required_fields.rs** Modify existing code
{"pr_number": 7853, "pr_title": "chore(dynamic-fields): remove billing details as required fields for Worldpay connector", "merged_at": "2025-04-22T08:46:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"connectors": ["crates/payment_methods/src/configs/payment_connector_required_fields.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards ## Type of Change <!-- Put an `x` in the boxes that apply --> - [X] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Added `type_selection_indicator` as 1 for all cards Reason for this change - Without this field Mastercard card payments are currently failing for a france-based merchant acquirer CMCIC in prod for cybersource, it expects type_selection_indicator as 1. Please note, this change is a fix on top of this [PR](https://github.com/juspay/hyperswitch/pull/7828) This change not only makes type_selection_indicator as 1 for co-badged cards, but for all cards in general. ### 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)? --> ### call /payment for Mastercard via cybersource `{ "amount": 700, "currency": "EUR", "confirm": true, "payment_link": false, "capture_on": "2029-09-10T10:11:12Z", "amount_to_capture": 700, "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method_data": { "card": { "card_number": "5512459816707531", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "card_cvc": "737" }, "billing": { "address": { "line1": "1467", "line2": "CA", "city": "Thise", "state": "Alsace", "zip": "94122", "country": "FR", "first_name": "Henry", "last_name": "Henry" } } }, "payment_method": "card", "payment_method_type": "credit", "browser_info": { "color_depth": 24, "java_enabled": true, "java_script_enabled": true, "language": "en-GB", "screen_height": 720, "screen_width": 1280, "time_zone": -330, "ip_address": "208.127.127.193", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" }, "metadata": { "disable_avs": true, "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "order_details": [ { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" } ] }` <img width="880" height="762" alt="Screenshot 2025-07-16 at 3 47 00 PM" src="https://github.com/user-attachments/assets/f1806a41-1ed6-4ea5-a84d-27b8ad9ca2f8" /> ### call /payment for Cobadged card via cybersource `{ "amount": 700, "currency": "EUR", "confirm": true, "payment_link": false, "capture_on": "2029-09-10T10:11:12Z", "amount_to_capture": 700, "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method_data": { "card": { "card_number": "4010061700000021", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "card_cvc": "737" }, "billing": { "address": { "line1": "1467", "line2": "CA", "city": "Thise", "state": "Alsace", "zip": "94122", "country": "FR", "first_name": "Henry", "last_name": "Henry" } } }, "payment_method": "card", "payment_method_type": "credit", "browser_info": { "color_depth": 24, "java_enabled": true, "java_script_enabled": true, "language": "en-GB", "screen_height": 720, "screen_width": 1280, "time_zone": -330, "ip_address": "208.127.127.193", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" }, "metadata": { "disable_avs": true, "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "order_details": [ { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" } ] }` <img width="880" height="762" alt="Screenshot 2025-07-16 at 3 46 05 PM" src="https://github.com/user-attachments/assets/c9471fdb-fbc0-431d-9dee-b8c3fb014c1f" /> ### call /payment for Visa card via cybersource `curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_wJkBplfvotDkAw5pv07JsMffdYFmnZTWKf0Rn6fWokE05NNZatQ4V2uEK0y1Re7e' \ --data-raw '{ "amount": 700, "currency": "EUR", "confirm": true, "payment_link": false, "capture_on": "2029-09-10T10:11:12Z", "amount_to_capture": 700, "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method_data": { "card": { "card_number": "4111 1111 1111 1111", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "card_cvc": "737" }, "billing": { "address": { "line1": "1467", "line2": "CA", "city": "Thise", "state": "Alsace", "zip": "94122", "country": "FR", "first_name": "Henry", "last_name": "Henry" } } }, "payment_method": "card", "payment_method_type": "credit", "browser_info": { "color_depth": 24, "java_enabled": true, "java_script_enabled": true, "language": "en-GB", "screen_height": 720, "screen_width": 1280, "time_zone": -330, "ip_address": "208.127.127.193", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" }, "metadata": { "disable_avs": true, "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "order_details": [ { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" } ] }'` <img width="841" height="752" alt="Screenshot 2025-07-21 at 5 49 40 PM" src="https://github.com/user-attachments/assets/1763b260-5e20-4e72-85ad-cc199b688011" /> ### call /payment for Mastercard card via cybersource for 3ds external authentication **Step 1:** ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_wJkBplfvotDkAw5pv07JsMffdYFmnZTWKf0Rn6fWokE05NNZatQ4V2uEK0y1Re7e' \ --data-raw '{ "amount": 10000, "currency": "EUR", "confirm": true, "payment_link": false, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 10000, "customer_id": "StripeCustomer", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "request_external_three_ds_authentication": true, "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "5512459816707531", "card_exp_month": "12", "card_exp_year": "2025", "card_cvc": "000", "card_network": "Mastercard" } }, "billing": { "address": { "line1": "1467", "line2": "CA", "line3": "CA", "city": "Musterhausen", "state": "California", "zip": "12345", "country": "US", "first_name": "Debarati", "last_name": "Ghatak" }, "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", "connector": ["cybersource"], "metadata": { "dg": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` <img width="880" height="762" alt="Screenshot 2025-07-16 at 3 49 17 PM" src="https://github.com/user-attachments/assets/980ceb6b-a634-45e0-a0bc-40db4379bfbf" /> **Step 2:** ``` curl --location 'http://localhost:8080/payments/pay_TxOCC3qWDM0tsOzBuYgK/3ds/authentication' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_66166a663cb4429c88ab4f6d9990698d' \ --data '{ "client_secret": "pay_TxOCC3qWDM0tsOzBuYgK_secret_Zop3d4G9eQ2qUh47Z60N", "device_channel": "BRW", "threeds_method_comp_ind": "Y" } ' ``` <img width="880" height="762" alt="Screenshot 2025-07-16 at 3 51 16 PM" src="https://github.com/user-attachments/assets/2b116033-351a-43ef-a76b-92aa4458d9cf" /> **Step 3:** `curl --location --request POST 'http://localhost:8080/payments/pay_HJ3ZfWWCFSRgMLk3Q0iT/merchant_1752829376/authorize/cybersource'` <img width="880" height="762" alt="Screenshot 2025-07-16 at 3 49 27 PM" src="https://github.com/user-attachments/assets/27b4af0b-4b51-4989-a6cd-9bfceaff4119" /> ## 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/cybersource/transformers.rs` **Code Patterns Applied:** - Extend existing types with new fields (6 changes) **Detailed Identifier Changes:** Commit 2bac3e0a: Files to modify: **crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs** Modify existing code
{"pr_number": 8663, "pr_title": "fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards ", "merged_at": "2025-07-21T14:21:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs"]}, "change_types": {"fields_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [Novalnet] Add support for disputes ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [X] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Added dispute support for novalnet. Novalnet supports 2 webhook events for disputes 1. Chargeback 2. Representment (dispute won) Novalnet does not support emails/webhooks for Arbitration and Pre-Arbitration stages. ### 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). --> NA ## How did you test 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 locally with dispute webhook simulators given in novalnet documentation **Chargeback webhook simulator:** https://developer.novalnet.com/asynchronousnotification/parameterspassed?payment=chargeback_creditcard_chargeback#parameter-list **Representment webhook simulator:** https://developer.novalnet.com/asynchronousnotification/parameterspassed?payment=credit_creditcard_representment#parameter-list **Chargeback webhook output** <img width="1304" alt="Screenshot 2024-11-13 at 18 57 33" src="https://github.com/user-attachments/assets/5595648d-4fca-46e8-90d6-8921b94f11e0"> **Representment webhook output** <img width="1304" alt="Screenshot 2024-11-13 at 18 59 13" src="https://github.com/user-attachments/assets/a8364b0f-daef-4a02-ad72-930dc6d3c64c"> ## Checklist <!-- Put an `x` in the boxes that apply --> - [X] I formatted the code `cargo +nightly fmt --all` - [X] I addressed lints thrown by `cargo clippy` - [X] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/novalnet.rs` - `crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs` **Code Patterns Applied:** - Implement new functions (3 changes) - Extend existing types with new fields (11 changes) **Detailed Identifier Changes:** Commit 6881ce2e: Files to modify: **crates/hyperswitch_connectors/src/connectors/novalnet.rs** Add: - function: private::get_dispute_details **crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs** Add: - function: pub::get_novalnet_dispute_status - function: pub::option_to_result - enum: pub::WebhookDisputeStatus
{"pr_number": 6560, "pr_title": "feat(connector): [Novalnet] Add support for disputes ", "merged_at": "2024-11-18T14:22:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "webhook"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/novalnet.rs", "crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs"]}, "change_types": {"functions_added": 3, "enums_added": 1, "fields_added": 11}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(router): add payment method Wallet check for decrypted wallet payment method token logic ## 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 --> Updated to check if the payment method is Wallet before proceeding with the wallet decryption operation. main branch pr https://github.com/juspay/hyperswitch/pull/8744 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> -> Make a card payment without sending the payment method type ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-feature: router-custom' \ --header 'x-tenant-id: hyperswitch' \ --header 'api-key: dev_TkMYapm8vMYMcImjnH6Gkud5hM6jGVayHZTi3WSVU8eYUiMItzwlRYQlN3RtHIkD' \ --data-raw '{ "amount": 1000000, "amount_to_capture": 1000000, "currency": "USD", "confirm": true, "capture_method": "automatic", "setup_future_usage": "on_session", "capture_on": "2022-09-10T10:11:12Z", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "customer_id": "cu_1753349404", "return_url": "http://127.0.0.1:4040", "payment_method": "card", "payment_method_data": { "card": { "card_number": "4111111111111111", "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": "[email protected]" }, "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_IUCHPAl9h0w2pU42MSjP", "merchant_id": "merchant_1753349359", "status": "succeeded", "amount": 1000000, "net_amount": 1000000, "shipping_cost": null, "amount_capturable": 0, "amount_received": 1000000, "connector": "adyen", "client_secret": "pay_IUCHPAl9h0w2pU42MSjP_secret_qtpg5D3tmmR47Pa9zemV", "created": "2025-07-24T09:29:57.265Z", "currency": "USD", "customer_id": "cu_1753349397", "customer": { "id": "cu_1753349397", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "payment_checks": 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": "[email protected]" }, "order_details": null, "email": "[email protected]", "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": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1753349397", "created_at": 1753349397, "expires": 1753352997, "secret": "epk_e313bd1d47874c7fa7379c5c8d69fe53" }, "manual_retry_allowed": false, "connector_transaction_id": "N7DWCX9JCT8SXC75", "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_IUCHPAl9h0w2pU42MSjP_1", "payment_link": null, "profile_id": "pro_gtFgPCNzLPlZCIzitXyr", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_F4voD3pzs9339zlOTZeT", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-24T09:44:57.265Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-07-24T09:29:58.665Z", "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 } ``` -> apple pay hyperswitch decrypt ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_fG0Py6LkKzjLXPtMoUgqPAnmfzCxcRuf7nuOERwaXv1PBWEjjaqFARqp8PJL7yCZ' \ --data-raw '{ "amount": 6500, "currency": "USD", "confirm": true, "business_country": "US", "business_label": "default", "amount_to_capture": 6500, "customer_id": "cu_1753349907", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "setup_future_usage": "on_session", "authentication_type": "no_three_ds", "return_url": "https://google.com", "email": "[email protected]", "name": "Joseph Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "payment_method": "wallet", "payment_method_type": "apple_pay", "billing": { "address": { "line1": "1467", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "in sit", "user_agent": "amet irure esse" } } , "payment_method_data": { "wallet": { "apple_pay": { "payment_data": "=", "payment_method": { "display_name": "Discover 9319", "network": "Discover", "type": "debit" }, "transaction_identifier": "c635c5b3af900d7bd81fecd7028f1262f9d030754ee65ec7afd988a678194751" } } } }' ``` ``` { "payment_id": "pay_ehf8EOyIovaVY9IQudiA", "merchant_id": "merchant_1753349865", "status": "succeeded", "amount": 6500, "net_amount": 6500, "shipping_cost": null, "amount_capturable": 0, "amount_received": 6500, "connector": "stripe", "client_secret": "pay_ehf8EOyIovaVY9IQudiA_secret_kSZD9Lzhn0I7WWc10KJu", "created": "2025-07-24T09:38:18.751Z", "currency": "USD", "customer_id": "cu_1753349899", "customer": { "id": "cu_1753349899", "name": "Joseph Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "apple_pay": { "last4": "9319", "card_network": "Discover", "type": "debit" } }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": null, "line3": null, "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "[email protected]", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "apple_pay", "connector_label": "stripe_US_default", "business_country": "US", "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1753349899", "created_at": 1753349898, "expires": 1753353498, "secret": "epk_679a71f8c93842d397d49838846707c6" }, "manual_retry_allowed": false, "connector_transaction_id": "pi_3RoLbUEOqOywnAIx0OUznkxA", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi_3RoLbUEOqOywnAIx0OUznkxA", "payment_link": null, "profile_id": "pro_AHhiUwwtdVJF4wpev3kl", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_Nm3XaDfdM55WDDfkPSLi", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-24T09:53:18.751Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-07-24T09:38:21.475Z", "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 } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payments.rs` **Code Patterns Applied:** - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 52e193c8: Files to modify: **crates/router/src/core/payments.rs** Modify existing code
{"pr_number": 8747, "pr_title": "fix(router): add payment method Wallet check for decrypted wallet payment method token logic", "merged_at": "2025-07-24T11:44:58Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs"]}, "change_types": {"conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(subscription): Add support to estimate for a subscription in 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 --> This pull request introduces support for fetching subscription estimates from Chargebee, alongside the existing subscription plans functionality. It adds new data structures, request/response types, and integration logic to handle the "Get Subscription Estimate" flow end-to-end. The changes span the domain models, interface types, and the Chargebee connector implementation. ### 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 #9055 ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Compilation and PR checks are enough for now, as this is a new feature. Testing can be done after the external endpoint is added. ## 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/subscriptions.rs` - `crates/hyperswitch_domain_models/src/router_request_types/subscriptions.rs` - ... and 2 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/router/src/services/api.rs` **Code Patterns Applied:** - Define new data structures (11 changes) - Implement new functions (9 changes) - Extend existing types with new fields (89 changes) **Detailed Identifier Changes:** Commit a7518373: Files to modify: **crates/hyperswitch_connectors/src/connectors/chargebee.rs** 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::GetSubscriptionEstimateFlow for Chargebee - impl: impl ConnectorIntegration< GetSubscriptionEstimate, GetSubscriptionEstimateRequest, GetSubscriptionEstimateResponse, > for Chargebee **crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs** Add: - function: private::try_from - function: private::try_from - struct: pub::ChargebeeSubscriptionEstimateRequest - struct: pub::SubscriptionEstimateResponse - struct: pub::ChargebeeEstimate - struct: pub::SubscriptionEstimate - struct: pub::InvoiceEstimate - struct: pub::LineItem - impl: impl TryFrom<ResponseRouterData<F, SubscriptionEstimateResponse, T, GetSubscriptionEstimateResponse>> for RouterData<F, T, GetSubscriptionEstimateResponse> - impl: impl TryFrom<&GetSubscriptionEstimateRouterData> for ChargebeeSubscriptionEstimateRequest **crates/hyperswitch_connectors/src/connectors/recurly.rs** Add: - impl: impl api::subscriptions_v2::GetSubscriptionEstimateV2 for Recurly - impl: impl ConnectorIntegrationV2< GetSubscriptionEstimate, GetSubscriptionEstimateData, GetSubscriptionEstimateRequest, GetSubscriptionEstimateResponse, > for Recurly **crates/hyperswitch_connectors/src/default_implementations.rs** Add: - impl: impl GetSubscriptionEstimateFlow for $connector - impl: impl ConnectorIntegration< GetSubscriptionEstimate, GetSubscriptionEstimateRequest, GetSubscriptionEstimateResponse > for $connector - impl: impl GetSubscriptionEstimateFlow for connectors::DummyConnector<T> - impl: impl ConnectorIntegration< GetSubscriptionEstimate, GetSubscriptionEstimateRequest, GetSubscriptionEstimateResponse, > for connectors::DummyConnector<T> **crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs** Add: - struct: pub::GetSubscriptionEstimateData **crates/hyperswitch_domain_models/src/router_flow_types/subscriptions.rs** Add: - struct: pub::GetSubscriptionEstimate **crates/hyperswitch_domain_models/src/router_request_types/subscriptions.rs** Add: - struct: pub::GetSubscriptionEstimateRequest **crates/hyperswitch_domain_models/src/router_response_types/subscriptions.rs** Add: - struct: pub::GetSubscriptionEstimateResponse - struct: pub::SubscriptionLineItem **crates/hyperswitch_domain_models/src/types.rs** Modify existing code **crates/hyperswitch_interfaces/src/api/subscriptions.rs** Add: - trait: pub::GetSubscriptionEstimateFlow - trait: pub::GetSubscriptionEstimateFlow **crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs** Add: - trait: private::GetSubscriptionEstimateV2 **crates/hyperswitch_interfaces/src/types.rs** Modify existing code **crates/router/src/services/api.rs** Modify existing code
{"pr_number": 9336, "pr_title": "feat(subscription): Add support to estimate for a subscription in chargebee", "merged_at": "2025-09-24T16:58:56Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_data_v2/flow_common_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/router/src/services/api.rs"]}, "change_types": {"structs_added": 11, "functions_added": 9, "fields_added": 89}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
chore(docker): prefix Hyperswitch Docker image URIs with `docker.juspay.io` ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR updates Hyperswitch Docker images to be prefixed by `docker.juspay.io`. This includes the same changes as #7368, I've cherry picked the same commit. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue 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). --> N/A ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> N/A ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **connector_integration** feature, you'll need to modify these architectural layers: **1. Configuration Files** - `config/deployments/README.md` - `docker-compose-development.yml` - `docker-compose.yml` **2. Other** - `aws/hyperswitch_aws_setup.sh` **Code Patterns Applied:** - Extend existing types with new fields (10 changes)
{"pr_number": 7592, "pr_title": "chore(docker): prefix Hyperswitch Docker image URIs with `docker.juspay.io`", "merged_at": "2025-03-21T11:37:07Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": []}, "hierarchy": {"config": ["config/deployments/README.md", "docker-compose-development.yml", "docker-compose.yml"], "other": ["aws/hyperswitch_aws_setup.sh"]}, "change_types": {"fields_added": 10}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
feat(deploy): Add one-click Docker setup script Implements a comprehensive bash script that simplifies the Hyperswitch Docker setup process with the following features: - Prerequisites checking for Docker and Docker Compose - Port availability validation - Multiple deployment profiles (Minimal, Standard, Full, Development) - Automatic configuration setup - Service health monitoring - Detailed documentation in README.md and docs/one_click_setup.md Resolves issue #7761 ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Sharing SS from local: <img width="635" alt="Screenshot 2025-04-24 at 5 59 43 AM" src="https://github.com/user-attachments/assets/2450115e-bb2d-4bc4-91ee-c53be713f9e2" /> ## 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** - `README.md` - `docs/one_click_setup.md` - `docs/try_local_system.md` - ... and 1 more files **Code Patterns Applied:** - Add conditional logic for feature flags or filtering (15 changes)
{"pr_number": 7804, "pr_title": "feat(deploy): Add one-click Docker setup script", "merged_at": "2025-05-02T12:35:09Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"other": ["README.md", "docs/one_click_setup.md", "docs/try_local_system.md", "scripts/setup.sh"]}, "change_types": {"conditionals_added": 15}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
refactor(payment_methods): update `connector_mandate_details` for card metadata changes ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Allow update of `connector_mandate_details` for card in case of metadata changes(in case of expiry changes). First the value is set as inactive and if a successful payment has been made then set it back to active ### 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? - Nothreeds > - Create a MA and a MCA > - Make a off_Session save card payment > - Make a off_Session payment again with the same card just and changes expiry > - After a successful payment the Connector Mandate Details would be overriden <img width="1725" alt="Screenshot 2024-12-16 at 4 21 51 PM" src="https://github.com/user-attachments/assets/2c68dc5e-f27c-400d-9b16-3080029ccfb3" /> - Follow the same step for 3threeds > - Create a MA and a MCA > - Make a off_Session save card payment > - Make a off_Session payment again with the same card just and changed expiry > -Before a successful redirection ( the connector mandate is inactive) <img width="1725" alt="Screenshot 2024-12-16 at 4 23 50 PM" src="https://github.com/user-attachments/assets/69c74c67-f596-447e-baac-ea5191b3a7f0" /> > - After a successful redirection ( the connector mandate is active) <img width="1725" alt="Screenshot 2024-12-16 at 4 24 24 PM" src="https://github.com/user-attachments/assets/b141a8b1-2d91-4f68-b478-928d4f6149f2" /> ## 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/operations/payment_response.rs` - `crates/router/src/core/payments/tokenization.rs` **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (10 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit d19c1a19: Files to modify: **crates/router/src/core/payments/operations/payment_response.rs** Modify existing code **crates/router/src/core/payments/tokenization.rs** Modify existing code
{"pr_number": 6848, "pr_title": "refactor(payment_methods): update `connector_mandate_details` for card metadata changes", "merged_at": "2024-12-27T06:21:58Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/tokenization.rs"]}, "change_types": {"functions_added": 1, "fields_added": 10, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): [AUTHORIZEDOTNET] error for customer already exists refactored ## 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 --> When customer_id with length greater than 20 is passed in payload along with email, customer will be created only with email and not id (because length validation will fail). Now when we again use some other customer_id with length greater than 20 with the same email, createConnectorCustomer will try to create the customer with only email, which will throw error "customer already exists". In this PR, this error is handled more gracefully. ### 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)? --> <details> <summary>1. Setup mandate with customer_id of length <20 (succeeded)</summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_vywLjCVAUrdt6UthM5IqcTyv65chQfDT2398nB75hxHTZKAYwdWuVT9HtIhF1k30' \ --data-raw '{ "amount": 0, "currency": "USD", "confirm": true, "description": "test payment", "customer": { "id": "sweta23", "name": "Sweta Sharma", "email": "[email protected]", "phone": "1234567890", "phone_country_code": "+1" }, "setup_future_usage": "off_session", "payment_type": "setup_mandate", "off_session": true, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "07", "card_exp_year": "26", "card_holder_name": "Joseph Does", "card_cvc": "123" } }, "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" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "email": "[email protected]" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "email": "[email protected]" } }' ``` Response: ``` {"payment_id":"pay_N6Do7VwFOVfDXPOTLGZB","merchant_id":"merchant_1754560901","status":"succeeded","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"authorizedotnet","client_secret":"pay_N6Do7VwFOVfDXPOTLGZB_secret_NLDdcSquBBQtFQaShcpC","created":"2025-08-07T10:15:16.052Z","currency":"USD","customer_id":"sweta23","customer":{"id":"sweta23","name":"Sweta Sharma","email":"[email protected]","phone":"1234567890","phone_country_code":"+1"},"description":"test payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","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":"07","card_exp_year":"26","card_holder_name":"Joseph Does","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":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"[email protected]"},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"Sweta Sharma","phone":"1234567890","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":"sweta23","created_at":1754561716,"expires":1754565316,"secret":"epk_cc4ac2db87514b889728441a112d3c7a"},"manual_retry_allowed":false,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_GO5YlPU7Fw9afGAgKK4O","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_nzcvNFTorOAz9Lk1Ym5G","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-07T10:30:16.052Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_65rmVMQuIUPEVy5eSJrS","network_transaction_id":null,"payment_method_status":"active","updated":"2025-08-07T10:15:17.155Z","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":"932160212-931445431","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} ``` </details> <details> <summary>2. Setup mandate with customer_id of length <20 with same id but different email from 1 (succeeded as different customer was created with unique combination of id and email)</summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_vywLjCVAUrdt6UthM5IqcTyv65chQfDT2398nB75hxHTZKAYwdWuVT9HtIhF1k30' \ --data-raw '{ "amount": 0, "currency": "USD", "confirm": true, "description": "test payment", "customer": { "id": "sweta24", "name": "Sweta Sharma", "email": "[email protected]", "phone": "1234567890", "phone_country_code": "+1" }, "setup_future_usage": "off_session", "payment_type": "setup_mandate", "off_session": true, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "07", "card_exp_year": "26", "card_holder_name": "Joseph Does", "card_cvc": "123" } }, "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" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "email": "[email protected]" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "email": "[email protected]" } }' ``` Response: ``` {"payment_id":"pay_4jUhnhYAK4NZlgStZIGG","merchant_id":"merchant_1754560901","status":"succeeded","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"authorizedotnet","client_secret":"pay_4jUhnhYAK4NZlgStZIGG_secret_OPWKeEpLnbexlGnjWYYN","created":"2025-08-07T10:22:37.359Z","currency":"USD","customer_id":"sweta24","customer":{"id":"sweta24","name":"Sweta Sharma","email":"[email protected]","phone":"1234567890","phone_country_code":"+1"},"description":"test payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","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":"07","card_exp_year":"26","card_holder_name":"Joseph Does","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":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"[email protected]"},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"Sweta Sharma","phone":"1234567890","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":"sweta24","created_at":1754562157,"expires":1754565757,"secret":"epk_64d1291bd7c74ec19efdcef03843f0a9"},"manual_retry_allowed":false,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_GO5YlPU7Fw9afGAgKK4O","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_nzcvNFTorOAz9Lk1Ym5G","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-07T10:37:37.359Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_rHvihdXAKzI1HYa9qS8d","network_transaction_id":null,"payment_method_status":"active","updated":"2025-08-07T10:22:39.783Z","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":"932160316-931445547","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} ``` </details> <details> <summary>3. With customer_id of length >20 (successful)</summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_vywLjCVAUrdt6UthM5IqcTyv65chQfDT2398nB75hxHTZKAYwdWuVT9HtIhF1k30' \ --data-raw '{ "amount": 0, "currency": "USD", "confirm": true, "description": "test payment", "customer": { "id": "cus_xLXvspPunHCXtZvkctHY", "name": "Sweta Sharma", "email": "[email protected]", "phone": "1234567890", "phone_country_code": "+1" }, "setup_future_usage": "off_session", "payment_type": "setup_mandate", "off_session": true, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "07", "card_exp_year": "26", "card_holder_name": "Joseph Does", "card_cvc": "123" } }, "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" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "email": "[email protected]" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "email": "[email protected]" } }' ``` Response: ``` {"payment_id":"pay_LLYavdduHu7DIyZnSNe9","merchant_id":"merchant_1754560901","status":"succeeded","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"authorizedotnet","client_secret":"pay_LLYavdduHu7DIyZnSNe9_secret_zCdK0sOfUtetvsNnbft4","created":"2025-08-07T10:24:18.228Z","currency":"USD","customer_id":"cus_xLXvspPunHCXtZvkctHY","customer":{"id":"cus_xLXvspPunHCXtZvkctHY","name":"Sweta Sharma","email":"[email protected]","phone":"1234567890","phone_country_code":"+1"},"description":"test payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","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":"07","card_exp_year":"26","card_holder_name":"Joseph Does","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":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"[email protected]"},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"Sweta Sharma","phone":"1234567890","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":"cus_xLXvspPunHCXtZvkctHY","created_at":1754562258,"expires":1754565858,"secret":"epk_5816901c2eff47ffafe17ddcef36c9b2"},"manual_retry_allowed":false,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_GO5YlPU7Fw9afGAgKK4O","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_nzcvNFTorOAz9Lk1Ym5G","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-07T10:39:18.228Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_2jyZFC9ywn2kZOid2jta","network_transaction_id":null,"payment_method_status":"active","updated":"2025-08-07T10:24:19.651Z","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":"932160327-931445558","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} ``` </details> <details> <summary>4 Setup mandate with customer_id of length >20 with same id but different email from 3 (failed with 4xx, customer creation failed, control went to setupmandate and couldn't find connector_customer_id)</summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_vywLjCVAUrdt6UthM5IqcTyv65chQfDT2398nB75hxHTZKAYwdWuVT9HtIhF1k30' \ --data-raw '{ "amount": 0, "currency": "USD", "confirm": true, "description": "test payment", "customer": { "id": "cus_xLXvspPunHCXtZvkcpQA", "name": "Sweta Sharma", "email": "[email protected]", "phone": "1234567890", "phone_country_code": "+1" }, "setup_future_usage": "off_session", "payment_type": "setup_mandate", "off_session": true, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "07", "card_exp_year": "26", "card_holder_name": "Joseph Does", "card_cvc": "123" } }, "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" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "email": "[email protected]" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "email": "[email protected]" } }' ``` Response: ``` { "error": { "type": "invalid_request", "message": "Missing required param: connector_customer_id", "code": "IR_04" } } ``` </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` **Code Patterns Applied:** - Extend existing types with new fields (2 changes) **Detailed Identifier Changes:** Commit 76d275e5: Files to modify: **crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs** Modify existing code
{"pr_number": 8866, "pr_title": "fix(connector): [AUTHORIZEDOTNET] error for customer already exists refactored", "merged_at": "2025-08-07T12:03:49Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(router): add proxy-confirm-intent api for payments in v2 flow ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> - Developed the proxy-confirm-intent API, specifically designed for Merchant-Initiated Transactions (MIT) payments. This is a generic and reusable API that facilitates MIT payment confirmations. - Its working is similar to confirm-intent api but in proxy flow we will be not having customer's details, rather we need mca_id and psp_token in order to confirm intent. - This API will help in PCR as it totally depends on recurring payments(MIT transaction) so, it needs proxy-confirm-intent. - This PR also includes support for Set/Unsetting the active attempt id ### 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? cURL:- ```bash curl --location 'http://localhost:8080/v2/payments/12345_pay_01953c48fdf57f5394faf843bf06187e/proxy-confirm-intent' \ --header 'x-profile-id: pro_73hfy7wgWWd7ujLBjvrJ' \ --header 'x-client-secret: 12345_pay_01953c48fdf57f5394faf843bf06187e_secret_01953c48fdff7da3983c22d6b08c811d' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_bPve88AB4DOwPb7YWfDFFqsddBaC*************************************' \ --data '{ "amount":{ "order_amount":100, "currency":"USD" }, "recurring_details":{ "processor_payment_token":"card_1QqvxW06IkU6uKNZuPtSKnJ5" }, "connector":"stripe", "merchant_connector_id":"mca_lXRIeVR2IPZXA2hpSSpO" }' ``` edited create_intent cURL(added feature_metadata field):- ```bash { "amount_details": { "order_amount": 100, "currency": "USD" }, "capture_method":"automatic", "authentication_type": "no_three_ds", "billing": { "address": { "first_name": "John", "last_name": "Dough" }, "email": "[email protected]" }, "shipping": { "address": { "first_name": "John", "last_name": "Dough", "city": "Karwar", "zip": "581301", "state": "Karnataka" }, "email": "[email protected]" }, "feature_metadata":{ "payment_revenue_recovery_metadata":{ "total_retry_count":3, "payment_connector_transmission":"ConnectorCallSucceeded", "billing_connector_id":"{{mca_id}}", "active_attempt_payment_connector_id":"{{mca_id}}", "billing_connector_payment_details":{ "payment_processor_token":"card_1QqvxW06IkU6uKNZuPtSKnJ5", "connector_customer_id":"cus_RkQYGuTepCnglS" }, "payment_method_type": "card", "payment_method_subtype": "credit" } } } ``` Response(for successful attempt):- ```bash { "id": "12345_pay_01953c48fdf57f5394faf843bf06187e", "status": "succeeded", "amount": { "order_amount": 1000, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 1000, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": 1000 }, "customer_id": null, "connector": "stripe", "client_secret": "12345_pay_01953c48fdf57f5394faf843bf06187e_secret_01953c48fdff7da3983c22d6b08c811d", "created": "2025-02-25T08:46:11.456Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "debit", "next_action": null, "connector_transaction_id": "pi_3QwJmO06IkU6uKNZ0QVgMCLQ", "connector_reference_id": null, "connector_token_details": { "token": "card_1QqvxW06IkU6uKNZuPtSKnJ5" }, "merchant_connector_id": "mca_lXRIeVR2IPZXA2hpSSpO", "browser_info": null, "error": null, "authentication_type": "no_three_ds", "applied_authentication_type": "no_three_ds" } ``` Response(for failed attempts):- ```bash { "id": "12345_pay_019547506e2e75718af58131686d1efb", "status": "failed", "amount": { "order_amount": 1000, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 1000, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": null }, "customer_id": null, "connector": "stripe", "client_secret": "12345_pay_019547506e2e75718af58131686d1efb_secret_019547506e347163a7fadce3d1c1790e", "created": "2025-02-27T12:10:08.309Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "debit", "connector_transaction_id": null, "connector_reference_id": null, "merchant_connector_id": "mca_t11HCw4XOgXTTVJ1l8IZ", "browser_info": null, "error": { "code": "resource_missing", "message": "resource_missing", "unified_code": null, "unified_message": null }, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": "no_three_ds", "authentication_type_applied": "no_three_ds" } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/enums.rs` - `crates/api_models/src/payment_methods.rs` - `crates/api_models/src/payments.rs` **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/payment_attempt.rs` - `crates/diesel_models/src/payment_intent.rs` - `crates/diesel_models/src/types.rs` **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments.rs` - `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs` - `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` - ... and 2 more files **4. Core Business Logic** - `crates/router/src/core/passive_churn_recovery/types.rs` - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/operations.rs` - ... and 4 more files **5. Type Definitions** - `crates/router_env/src/logger/types.rs` **6. Utils** - `crates/router/src/routes/lock_utils.rs` **7. Configuration Files** - `.typos.toml` **8. Other** - `api-reference-v2/openapi_spec.json` - `crates/common_enums/src/enums.rs` - `crates/openapi/src/openapi_v2.rs` - ... and 2 more files **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (42 changes) - Extend existing types with new fields (199 changes) - Add conditional logic for feature flags or filtering (2 changes) - Modify database queries (2 changes) **Detailed Identifier Changes:** Commit 30f321bc: Files to modify: **crates/api_models/src/enums.rs** Add: - enum: pub::UpdateActiveAttempt **crates/api_models/src/payment_methods.rs** Modify existing code **crates/api_models/src/payments.rs** Add: - struct: pub::ProxyPaymentsRequest **crates/common_enums/src/enums.rs** Modify existing code **crates/diesel_models/src/payment_attempt.rs** Modify existing code **crates/diesel_models/src/payment_intent.rs** Modify existing code **crates/diesel_models/src/types.rs** Add: - function: pub::get_payment_method_sub_type - function: pub::get_payment_method_type - impl: impl FeatureMetadata **crates/hyperswitch_domain_models/src/payments.rs** Add: - function: pub::proxy_create_attempt_amount_details - function: private::get_payment_method_sub_type - function: private::get_payment_method_type - function: pub::set_payment_connector_transmission - function: pub::get_connector_customer_id_from_feature_metadata - function: pub::get_connector_customer_id - impl: impl PaymentConfirmData<F> **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_intent.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_data.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_request_types.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/router/src/core/passive_churn_recovery/types.rs** Modify existing code **crates/router/src/core/payments.rs** Add: - function: pub::proxy_for_payments_operation_core - function: pub::proxy_for_payments_core - function: pub::proxy_for_call_connector_service - function: private::get_merchant_connector_id_in_attempt - function: private::get_merchant_connector_id_in_attempt - function: private::get_merchant_connector_id_in_attempt - function: private::get_merchant_connector_id_in_attempt **crates/router/src/core/payments/operations.rs** Add: - mod: pub::proxy_payments_intent **crates/router/src/core/payments/operations/payment_confirm_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payment_update_intent.rs** Modify existing code **crates/router/src/core/payments/operations/proxy_payments_intent.rs** Add: - function: private::validate_status_for_operation - function: private::to_validate_request - function: private::to_get_tracker - function: private::to_domain - function: private::to_update_tracker - function: private::to_validate_request - function: private::to_get_tracker - function: private::to_domain - function: private::to_update_tracker - function: private::validate_request - function: private::get_trackers - function: private::get_customer_details - function: private::make_pm_data - function: private::perform_routing - function: private::update_trackers - function: private::update_tracker - struct: pub::PaymentProxyIntent - impl: impl ValidateStatusForOperation for PaymentProxyIntent - impl: impl Operation<F, ProxyPaymentsRequest> for &PaymentProxyIntent - impl: impl Operation<F, ProxyPaymentsRequest> for PaymentProxyIntent - impl: impl ValidateRequest<F, ProxyPaymentsRequest, PaymentConfirmData<F>> for PaymentProxyIntent - impl: impl GetTracker<F, PaymentConfirmData<F>, ProxyPaymentsRequest> for PaymentProxyIntent - impl: impl Domain<F, ProxyPaymentsRequest, PaymentConfirmData<F>> for PaymentProxyIntent - impl: impl UpdateTracker<F, PaymentConfirmData<F>, ProxyPaymentsRequest> for PaymentProxyIntent - impl: impl PostUpdateTracker<F, PaymentConfirmData<F>, types::PaymentsAuthorizeData> for PaymentProxyIntent **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/routes/payments.rs** Add: - function: pub::proxy_confirm_intent **crates/router_env/src/logger/types.rs** Modify existing code
{"pr_number": 7215, "pr_title": "feat(router): add proxy-confirm-intent api for payments in v2 flow", "merged_at": "2025-03-05T09:02:52Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/enums.rs", "crates/api_models/src/payment_methods.rs", "crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/types.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/passive_churn_recovery/types.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_update_intent.rs", "crates/router/src/core/payments/operations/proxy_payments_intent.rs", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "config": [".typos.toml"], "other": ["api-reference-v2/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs"]}, "change_types": {"structs_added": 2, "functions_added": 42, "enums_added": 1, "fields_added": 199, "imports_added": 15, "conditionals_added": 2, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(core): [Network Tokenization] pre network tokenization ## 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 new field in business_profile (is_pre_network_tokenization_enabled). Based on that field the card will be tokenized before first payment. If the payment get succeeded the card and network token data will be stored in the locker afterwards. ### 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. Enable is_network_tokenization_enabled and is_pre_network_tokenization_enabled in business_profile 2. Create a card payment with a network tokenization supported connector. (Customer acceptance should be there) Connector Create(Cybersource): ``` curl --location 'http://localhost:8080/account/merchant_1747299015/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_6YZ1hGvUYrgBzKrKO25WteTts6KvLVXCodhEmuqaogJZvLhGIEVSVNftVcZytpdE' \ --data '{ "connector_type": "payment_processor", "connector_name": "cybersource", "connector_account_details": { "auth_type": "SignatureKey", "api_secret": "abc", "api_key": "abc", "key1": "abc" }, "test_mode": true, "disabled": false, "payment_methods_enabled": [ { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "google_pay", "payment_experience": "invoke_sdk_client", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 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": [ "Visa", "Mastercard", "AmericanExpress" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "status_url": "url", "account_name": "transaction_processing", "pricing_type": "fixed_price", "acquirer_bin": "438309", "acquirer_merchant_id": "00002000000" }, "business_country": "US", "business_label": "default", "frm_configs": null, "connector_webhook_details": { "merchant_secret": "abc" } }' ``` Payments Create: ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data-raw '{ "amount": 10, "amount_to_capture": 10, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "customer1747403711", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "setup_future_usage": "on_session", "return_url": "http://127.0.0.1:4040", "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "in sit", "user_agent": "amet irure esse" } }, "payment_method": "card", "payment_method_data": { "card": { "card_number": "4761360080000093", "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": "joseph Doe", "card_cvc": "947" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" }, "email": "[email protected]" }, "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" } }' ``` Response: ``` { "payment_id": "pay_hW2g73Y3LCCl8K59On4s", "merchant_id": "merchant_1747404722", "status": "succeeded", "amount": 10, "net_amount": 10, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10, "connector": "cybersource", "client_secret": "abc", "created": "2025-05-16T14:13:37.029Z", "currency": "USD", "customer_id": "customer1747404817", "customer": { "id": "customer1747404817", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "0093", "card_type": "DEBIT", "card_network": "Visa", "card_issuer": "BANKMUSCAT (SAOG)", "card_issuing_country": "OMAN", "card_isin": "476136", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "2026", "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": null, "last_name": null }, "phone": null, "email": "[email protected]" }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "http://127.0.0.1:4040/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "customer1747404817", "created_at": 1747404816, "expires": 1747408416, "secret": "abc" }, "manual_retry_allowed": false, "connector_transaction_id": "abc", "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_hW2g73Y3LCCl8K59On4s_1", "payment_link": null, "profile_id": "pro_cjkyoVtfdaQY5JKvfh3v", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_WI36rV75QJhAyHC02iup", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-16T14:28:37.028Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-16T14:13:44.489Z", "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 } ``` **Logs:** Raw Connector Request: ``` raw_connector_request: Object {"processingInformation": Object {"actionList": Null, "actionTokenTypes": Null, "authorizationOptions": Object {"initiator": Null, "merchantIntitiatedTransaction": Null, "ignoreAvsResult": Null, "ignoreCvResult": Null}, "commerceIndicator": String("internet"), "capture": Bool(true), "captureOptions": Null, "paymentSolution": Null}, "paymentInformation": Object {"tokenizedCard": Object {"number": String("460400**********"), "expirationMonth": String("*** alloc::string::String ***"), "expirationYear": String("*** alloc::string::String ***"), "cryptogram": String("*** alloc::string::String ***"), "transactionType": String("1")}}, "orderInformation": Object {"amountDetails": Object {"totalAmount": String("0.10"), "currency": String("USD")}, "billTo": Object {"firstName": String("*** alloc::string::String ***"), "lastName": String("*** alloc::string::String ***"), "address1": String("*** alloc::string::String ***"), "locality": String("San Fransico"), "administrativeArea": String("*** alloc::string::String ***"), "postalCode": String("*** alloc::string::String ***"), "country": String("US"), "email": String("*****@example.com")}}, "clientReferenceInformation": Object {"code": String("pay_hW2g73Y3LCCl8K59On4s_1")}, "merchantDefinedInformation": Array [Object {"key": Number(1), "value": String("login_date=\"2019-09-10T10:11:12Z\"")}, Object {"key": Number(2), "value": String("new_customer=\"true\"")}, Object {"key": Number(3), "value": String("udf1=\"value1\"")}]} ``` ## 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` **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/business_profile.rs` - `crates/hyperswitch_domain_models/src/payment_method_data.rs` - `crates/hyperswitch_domain_models/src/payments.rs` **4. Core Business Logic** - `crates/router/src/core/admin.rs` - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/helpers.rs` - ... and 3 more files **5. Type Definitions** - `crates/router/src/types/api/admin.rs` **6. Tests** - `cypress-tests/cypress/e2e/configs/Payment/Noon.js` - `cypress-tests/cypress/support/commands.js` **7. Other** - `migrations/2025-05-16-064616_add_is_pre_network_tokenization_enabled_in_business_profile/down.sql` - `migrations/2025-05-16-064616_add_is_pre_network_tokenization_enabled_in_business_profile/up.sql` - `v2_migrations/2025-05-05-073505_remove_is_pre_network_tokenization_enabled_from_business_profile/down.sql` - ... and 1 more files **Code Patterns Applied:** - Define new data structures (3 changes) - Implement new functions (7 changes) - Extend existing types with new fields (106 changes) - Add conditional logic for feature flags or filtering (12 changes) - Modify database queries (3 changes) **Detailed Identifier Changes:** Commit da90d74b: 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/hyperswitch_domain_models/src/business_profile.rs** Modify existing code **crates/hyperswitch_domain_models/src/payment_method_data.rs** Add: - function: private::from - function: private::from - impl: impl From<Card> for payment_methods::CardDetail - impl: impl From<NetworkTokenData> for payment_methods::CardDetail **crates/hyperswitch_domain_models/src/payments.rs** Add: - struct: pub::CardAndNetworkTokenDataForVault - struct: pub::NetworkTokenDataForVault - struct: pub::CardDataForVault **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/core/payments.rs** Add: - function: pub::is_pre_network_tokenization_enabled - function: pub::get_vault_operation_for_pre_network_tokenization **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/payments/operations/payment_response.rs** Modify existing code **crates/router/src/core/payments/tokenization.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Add: - function: private::from - impl: impl From<pm_types::TokenResponse> for domain::NetworkTokenData **crates/router/src/types/api/admin.rs** Modify existing code
{"pr_number": 6873, "pr_title": "feat(core): [Network Tokenization] pre network tokenization", "merged_at": "2025-05-19T11:07:05Z", "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"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/payments.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/tokenization.rs", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router/src/types/api/admin.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Noon.js", "cypress-tests/cypress/support/commands.js"], "other": ["migrations/2025-05-16-064616_add_is_pre_network_tokenization_enabled_in_business_profile/down.sql", "migrations/2025-05-16-064616_add_is_pre_network_tokenization_enabled_in_business_profile/up.sql", "v2_migrations/2025-05-05-073505_remove_is_pre_network_tokenization_enabled_from_business_profile/down.sql", "v2_migrations/2025-05-05-073505_remove_is_pre_network_tokenization_enabled_from_business_profile/up.sql"]}, "change_types": {"structs_added": 3, "functions_added": 7, "fields_added": 106, "imports_added": 1, "conditionals_added": 12, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(request_body): Added FRM data in payment request ## 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 --> Added `FRM` data in payment request for connector `Adyen` ### 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="1276" alt="Screenshot 2025-03-26 at 6 00 22 PM" src="https://github.com/user-attachments/assets/45edff47-a9c8-4e55-81d9-d030d4dbf081" /> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_1tUvTWvHj4yX8wc3kkROOR01P8ikqRzDkcj3ZUdcpLmTjhkuW6f7LPj1s7RhO3Nc' \ --data-raw '{ "amount": 100, "currency": "USD", "confirm": true, "payment_link": false, "capture_on": "2029-09-10T10:11:12Z", "amount_to_capture": 100, "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_data": { "card": { "card_number": "4917610000000000", "card_exp_month": "03", "card_exp_year": "30", "card_cvc": "737", "card_network": "Visa" }, "billing": { "address": { "line1": "1467", "line2": "CA", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "Sweta", "last_name": "Sharma" }, "email": "[email protected]", "phone": { "number": "9999999999", "country_code": "+91" } } }, "email": "[email protected]", "payment_method": "card", "payment_method_type": "credit", "browser_info": { "color_depth": 24, "java_enabled": true, "java_script_enabled": true, "language": "en-GB", "screen_height": 720, "screen_width": 1280, "time_zone": -330, "ip_address": "208.127.127.193", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" }, "metadata": { "device_fingerprint": "abc123devicefingerprint2", "riskdata.basket.item1.itemID": "1234567890", "riskdata.basket.item1.productTitle": "Wireless Bluetooth Headphones", "riskdata.basket.item1.amountPerItem": "79.99", "riskdata.basket.item1.currency": "USD", "riskdata.basket.item1.upc": "012345678901", "riskdata.basket.item1.brand": "BrandX", "riskdata.basket.item1.manufacturer": "BrandX Manufacturing Inc.", "riskdata.basket.item1.category": "Electronics", "riskdata.basket.item1.quantity": "1", "riskdata.basket.item1.color": "Black", "riskdata.basket.item1.size": "One Size", "riskdata.deviceCountry": "US", "riskdata.houseNumberorName": "1234", "riskdata.accountCreationDate": "2015-08-01", "riskdata.affiliateChannel": "Online Store", "riskdata.avgOrderValue": "120.50", "riskdata.deliveryMethod": "Standard Shipping", "riskdata.emailName": "swetasharma", "riskdata.emailDomain": "example.com", "riskdata.lastOrderDate": "2024-12-25", "riskdata.merchantReference": "ORD12345XYZ", "riskdata.paymentMethod": "Visa", "riskdata.promotionName": "Holiday Sale", "riskdata.secondaryPhoneNumber": "9876543210", "riskdata.timefromLogintoOrder": "15 minutes", "riskdata.totalSessionTime": "45 minutes", "riskdata.totalAuthorizedAmountInLast30Days": "500.00", "riskdata.totalOrderQuantity": "10", "riskdata.totalLifetimeValue": "1500.00", "riskdata.visitsMonth": "8", "riskdata.visitsWeek": "3", "riskdata.visitsYear": "30", "riskdata.shipToName": "Sweta Sharma", "riskdata.first8charactersofAddressLine1Zip": "94122", "riskdata.affiliateOrder": false }, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "CA", "zip": "94122", "state": "California", "first_name": "Sweta", "last_name": "Sharma" }, "phone": { "number": "9999999999", "country_code": "+91" }, "email": "[email protected]" } }' ``` Response ``` { "payment_id": "pay_4RPSha2liSpcRUJNA6cj", "merchant_id": "merchant_1742923962", "status": "requires_customer_action", "amount": 100, "net_amount": 100, "shipping_cost": null, "amount_capturable": 100, "amount_received": null, "connector": "adyen", "client_secret": "pay_4RPSha2liSpcRUJNA6cj_secret_oaNtTvAFxiHxCk0GxifB", "created": "2025-03-26T06:24:55.256Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": null, "payment_method": "card", "payment_method_data": { "card": { "last4": "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": "30", "card_holder_name": "Sweta Sharma", "payment_checks": null, "authentication_data": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "CA", "line3": null, "zip": "94122", "state": "California", "first_name": "Sweta", "last_name": "Sharma" }, "phone": { "number": "9999999999", "country_code": "+91" }, "email": "[email protected]" } }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "CA", "line3": null, "zip": "94122", "state": "California", "first_name": "Sweta", "last_name": "Sharma" }, "phone": { "number": "9999999999", "country_code": "+91" }, "email": "[email protected]" }, "billing": null, "order_details": null, "email": null, "name": null, "phone": null, "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": { "type": "redirect_to_url", "redirect_to_url": "http://localhost:8080/payments/redirect/pay_4RPSha2liSpcRUJNA6cj/merchant_1742923962/pay_4RPSha2liSpcRUJNA6cj_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": null, "manual_retry_allowed": null, "connector_transaction_id": "G8Z7RX4G8BCDCQV5", "frm_message": null, "metadata": { "device_fingerprint": "abc123devicefingerprint2", "riskdata.basket.item1.itemID": "1234567890", "riskdata.basket.item1.productTitle": "Wireless Bluetooth Headphones", "riskdata.basket.item1.amountPerItem": "79.99", "riskdata.basket.item1.currency": "USD", "riskdata.basket.item1.upc": "012345678901", "riskdata.basket.item1.brand": "BrandX", "riskdata.basket.item1.manufacturer": "BrandX Manufacturing Inc.", "riskdata.basket.item1.category": "Electronics", "riskdata.basket.item1.quantity": "1", "riskdata.basket.item1.color": "Black", "riskdata.basket.item1.size": "One Size", "riskdata.deviceCountry": "US", "riskdata.houseNumberorName": "1234", "riskdata.accountCreationDate": "2015-08-01", "riskdata.affiliateChannel": "Online Store", "riskdata.avgOrderValue": "120.50", "riskdata.deliveryMethod": "Standard Shipping", "riskdata.emailName": "swetasharma", "riskdata.emailDomain": "example.com", "riskdata.lastOrderDate": "2024-12-25", "riskdata.merchantReference": "ORD12345XYZ", "riskdata.paymentMethod": "Visa", "riskdata.promotionName": "Holiday Sale", "riskdata.secondaryPhoneNumber": "9876543210", "riskdata.timefromLogintoOrder": "15 minutes", "riskdata.totalSessionTime": "45 minutes", "riskdata.totalAuthorizedAmountInLast30Days": "500.00", "riskdata.totalOrderQuantity": "10", "riskdata.totalLifetimeValue": "1500.00", "riskdata.visitsMonth": "8", "riskdata.visitsWeek": "3", "riskdata.visitsYear": "30", "riskdata.shipToName": "Sweta Sharma", "riskdata.first8charactersofAddressLine1Zip": "94122", "riskdata.affiliateOrder": false }, "connector_metadata": null, "feature_metadata": null, "reference_id": "G8Z7RX4G8BCDCQV5", "payment_link": null, "profile_id": "pro_9AiAESD5MrUBnko9THxG", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_vtrNcsyy5demMast3m1e", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-03-26T06:39:55.256Z", "fingerprint": null, "browser_info": { "language": "en-GB", "time_zone": -330, "ip_address": "208.127.127.193", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0", "color_depth": 24, "java_enabled": true, "screen_width": 1280, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 720, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-03-26T06:24:57.280Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": "manual", "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/adyen/transformers.rs` **Code Patterns Applied:** - Define new data structures (1 changes) - Implement new functions (4 changes) - Extend existing types with new fields (37 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit b00deb96: Files to modify: **crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs** Add: - function: private::get_str - function: private::get_bool - function: pub::get_risk_data - function: private::get_device_fingerprint - struct: pub::RiskData
{"pr_number": 7615, "pr_title": "refactor(request_body): Added FRM data in payment request", "merged_at": "2025-03-28T12:12:51Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs"]}, "change_types": {"structs_added": 1, "functions_added": 4, "fields_added": 37, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [chargebee] consumes required fields to support transaction monitoring ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description To support the transaction monitoring feature for charge bee we need to consume the following fields : Billing Address details for invoices such as city, state, country, zip and invoices next billing time and retry count. Since all these details are in invoice level we should be storing them in payment intent. Billing address will be stored in billing_address column of the payment intent table and for adds a new column in feature metadata of the payment intent and the retry_count logic will be like the following: Why do we need to consume retry count? If a merchant onboards and merchant has previous subscription there is a chance that we will miss those webhooks before before registering our webhook endpoint in the billing connector. Since retry count will not be synched in our system and billing connectors. To avoid this we will be consuming retry count and use the count as the retry count for the payment intent. For further webhooks we increment the count by 1. In chargebee we wont receive retry count directly. So we will consume the listed payments and its length will be equal to retry count. ### Additional Changes - [x] This PR modifies the API contract - [x] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> 1. Create an stripe mca. ``` curl --location 'http://localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: {{merchant_id}}' \ --header 'x-profile-id: {{profile_id}}' \ --header 'Authorization: {{admin_api_key}}' \ --header 'api-key: {{admin_api_key}}' \ --data '{ "connector_type": "payment_processor", "connector_name": "stripe", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "{{connector_api_key}}" }, "payment_methods_enabled": [ { "payment_method_type": "card_redirect", "payment_method_subtypes": [ { "payment_method_subtype": "card_redirect", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "card", "payment_method_subtypes": [ { "payment_method_subtype": "credit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "debit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "wallet", "payment_method_subtypes": [ { "payment_method_subtype": "google_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "apple_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "we_chat_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "ali_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "paypal", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "mb_way", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "pay_later", "payment_method_subtypes": [ { "payment_method_subtype": "klarna", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "affirm", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "afterpay_clearpay", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "walley", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "bank_redirect", "payment_method_subtypes": [ { "payment_method_subtype": "giropay", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "ideal", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "eps", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "bancontact_card", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "przelewy24", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "sofort", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "blik", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "trustly", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "online_banking_finland", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "online_banking_poland", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "bank_transfer", "payment_method_subtypes": [ { "payment_method_subtype": "ach", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "sepa", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "bacs", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "bank_debit", "payment_method_subtypes": [ { "payment_method_subtype": "ach", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "sepa", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "bacs", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "becs", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay", "account_name": "transaction_processing", "pricing_type": "fixed_price", "acquirer_bin": "438309", "acquirer_merchant_id": "00002000000" }, "frm_configs": null, "connector_webhook_details": { "merchant_secret": "" }, "profile_id": {{profile_id}} }' ``` 2. copy the mca id of the stripe and paste it in the body of following curl where {{mca_id}} and this curl creates chargebee mca. ``` curl --location 'http://localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: {{merchant_id}}' \ --header 'x-profile-id: {{profile_id}}' \ --header 'Authorization: {{admin_api_key}}' \ --header 'api-key: {{admin_api_key}}' \ --data '{ "connector_type": "billing_processor", "connector_name": "chargebee", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "{{billing_connector_api_key}}" }, "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_id}}": "gw_AzZixQUeNJUxX9ye" } } }, "metadata": { "site": "nish-test" }, "profile_id": "{{profile_id}}" }' ``` 4. Hit the following curl and check the database to see whether the billing address in payment intent and next billing time in the payment intent feature metadata is populated or not. ``` curl --location 'http://localhost:8080/v2/webhooks/recovery/{{merchant_id}}/{{profile_id}}/{{mca_id_of_chargebee}}' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic Y2hhcmdlYmVlOnBhc3N3b3Jk' \ --data-raw '{ "id": "ev_169vy3UaPFn4L4mf", "occurred_at": 1737361021, "source": "admin_console", "user": "[email protected]", "object": "event", "api_version": "v2", "content": { "transaction": { "id": "txn_169vy3UaPFmC44mp", "customer_id": "Azq8o5UaLqWWvyGd", "subscription_id": "Azq8o5UaLr2WnyHG", "gateway_account_id": "gw_AzZixQUeNJUxX9ye", "payment_source_id": "pm_169vy3UaPDo0t4hL", "payment_method": "card", "gateway": "stripe", "type": "payment", "date": 1737361019, "exchange_rate": 1, "amount": 5, "id_at_gateway": "ch_3QjGAJSHworDX2hs0B120C0S", "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": "23", "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": "[email protected]", "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": "[email protected]", "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": "[email protected]", "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_AzZixQUeNJUxX9ye", "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": "[email protected]", "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" } ] }' ``` the feature metadata should look like this in payment intent ``` { "redirect_response": null, "search_tags": null, "apple_pay_recurring_details": null, "payment_revenue_recovery_metadata": { "total_retry_count": 1, "payment_connector_transmission": "ConnectorCallUnsuccessful", "billing_connector_id": "mca_joRfrPe6jcm7uVtk6DYA", "active_attempt_payment_connector_id": "mca_l7RQiQxRa77rGgd0UdQx", "billing_connector_payment_details": { "payment_processor_token": "card_1QjG2dSHworDX2hs6YIjKdML", "connector_customer_id": "cus_RcUo8xTwe0sHP7" }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector": "stripe", "invoice_next_billing_time": "2025-02-19 18:19:53.0" } } ``` and the payment intent table should have billing address in it in an encrypted form ## 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/types.rs` **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/lib.rs` - `crates/hyperswitch_domain_models/src/payments.rs` - `crates/hyperswitch_domain_models/src/revenue_recovery.rs` **4. Core Business Logic** - `crates/router/src/core/payments/operations/payment_attempt_record.rs` - `crates/router/src/core/payments/transformers.rs` - `crates/router/src/core/webhooks/recovery_incoming.rs` **5. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs` - `crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs` - `crates/hyperswitch_interfaces/src/connector_integration_interface.rs` **6. Utils** - `crates/common_utils/src/id_type/global_id/payment.rs` **7. Other** - `api-reference-v2/openapi_spec.json` - `crates/hyperswitch_interfaces/src/webhooks.rs` **Code Patterns Applied:** - Define new data structures (3 changes) - Implement new functions (5 changes) - Extend existing types with new fields (58 changes) **Detailed Identifier Changes:** Commit 5fa54e5e: Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/common_utils/src/id_type/global_id/payment.rs** Modify existing code **crates/diesel_models/src/types.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs** Add: - function: private::from - function: private::from - struct: pub::ChargebeeSubscriptionData - struct: pub::ChargebeeInvoicePayments - impl: impl From<ChargebeeInvoiceData> for api_models::payments::Address - impl: impl From<ChargebeeInvoiceBillingAddress> for api_models::payments::AddressDetails **crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs** Modify existing code **crates/hyperswitch_domain_models/src/lib.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments.rs** Modify existing code **crates/hyperswitch_domain_models/src/revenue_recovery.rs** Modify existing code **crates/hyperswitch_interfaces/src/connector_integration_interface.rs** Add: - function: private::get_revenue_recovery_invoice_details - function: private::get_revenue_recovery_attempt_details **crates/hyperswitch_interfaces/src/webhooks.rs** Add: - function: private::get_billing_address_for_invoice **crates/router/src/core/payments/operations/payment_attempt_record.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/webhooks/recovery_incoming.rs** Modify existing code
{"pr_number": 7774, "pr_title": "feat(connector): [chargebee] consumes required fields to support transaction monitoring", "merged_at": "2025-04-16T08:29:29Z", "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/types.rs"], "domain": ["crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/revenue_recovery.rs"], "core_business": ["crates/router/src/core/payments/operations/payment_attempt_record.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/webhooks/recovery_incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs", "crates/hyperswitch_interfaces/src/connector_integration_interface.rs"], "utils": ["crates/common_utils/src/id_type/global_id/payment.rs"], "other": ["api-reference-v2/openapi_spec.json", "crates/hyperswitch_interfaces/src/webhooks.rs"]}, "change_types": {"structs_added": 3, "functions_added": 5, "fields_added": 58}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(core): Add support for process tracker retrieve api in v2 ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description This PR contains the following - Opened an endpoint to dashboard for process tracker's revenue_recovery workflow to retrieve the schedule time , to display the time the next retry has been scheduled - Also it includes the naming changes, for consistent naming , we have changed the file names to revenue_recovery instead of passive churn recovery ### 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? - When there is a revenue recovery payment entry in the process tracker table - The following api would retrieve the Schedule time with other details ``` curl curl --location 'http://localhost:8080/v2/process_tracker/revenue_recovery_workflow/12345_pay_019589860d917d31a743ede3e7371a1d' \ --header 'Authorization: Bearer {{jwt_auth}}' \ --header 'x-profile-id: pro_0MEQ528BeDG65NUwOj1y' ``` <img width="1297" alt="Screenshot 2025-03-23 at 11 43 19 PM" src="https://github.com/user-attachments/assets/813063e8-6357-4d2a-b83d-b1dbe154d407" /> ## 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/events.rs` - `crates/api_models/src/events/revenue_recovery.rs` - `crates/api_models/src/lib.rs` - ... and 2 more files **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/enums.rs` - `crates/diesel_models/src/process_tracker.rs` **3. Core Business Logic** - `crates/router/src/core.rs` - `crates/router/src/core/passive_churn_recovery.rs` - `crates/router/src/core/passive_churn_recovery/transformers.rs` - ... and 2 more files **4. Type Definitions** - `crates/router/src/types/storage.rs` - `crates/router/src/types/storage/passive_churn_recovery.rs` - `crates/router_env/src/logger/types.rs` **5. Utils** - `crates/common_utils/src/events.rs` - `crates/common_utils/src/id_type/global_id/payment.rs` - `crates/router/src/routes/lock_utils.rs` **6. Other** - `api-reference-v2/openapi_spec.json` - `crates/common_enums/src/enums.rs` - `crates/openapi/src/openapi_v2.rs` - ... and 12 more files **Code Patterns Applied:** - Define new data structures (3 changes) - Implement new functions (9 changes) - Extend existing types with new fields (32 changes) **Detailed Identifier Changes:** Commit 87140bfc: Files to modify: **crates/api_models/src/events.rs** Add: - mod: pub::revenue_recovery **crates/api_models/src/events/revenue_recovery.rs** Add: - function: private::get_api_event_type - function: private::get_api_event_type - impl: impl ApiEventMetric for RevenueRecoveryResponse - impl: impl ApiEventMetric for RevenueRecoveryId **crates/api_models/src/lib.rs** Add: - mod: pub::process_tracker **crates/api_models/src/process_tracker.rs** Add: - mod: pub::revenue_recovery **crates/api_models/src/process_tracker/revenue_recovery.rs** Add: - struct: pub::RevenueRecoveryResponse - struct: pub::RevenueRecoveryId **crates/common_enums/src/enums.rs** Add: - enum: pub::ProcessTrackerStatus - enum: pub::ProcessTrackerRunner **crates/common_utils/src/events.rs** Modify existing code **crates/common_utils/src/id_type/global_id/payment.rs** Add: - function: pub::get_execute_revenue_recovery_id - function: pub::get_psync_revenue_recovery_id **crates/diesel_models/src/enums.rs** Remove: - enum: pub::ProcessTrackerStatus **crates/diesel_models/src/process_tracker.rs** Remove: - enum: pub::ProcessTrackerRunner **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/openapi/src/routes.rs** Add: - mod: pub::revenue_recovery **crates/openapi/src/routes/revenue_recovery.rs** Add: - function: pub::revenue_recovery_pt_retrieve_api **crates/router/src/bin/scheduler.rs** Modify existing code **crates/router/src/core.rs** Remove: - mod: pub::passive_churn_recovery Add: - mod: pub::revenue_recovery **crates/router/src/core/webhooks/recovery_incoming.rs** Modify existing code **crates/router/src/lib.rs** Modify existing code **crates/router/src/routes.rs** Add: - mod: pub::process_tracker **crates/router/src/routes/app.rs** Add: - function: pub::server - struct: pub::ProcessTracker - impl: impl ProcessTracker **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/routes/process_tracker.rs** Add: - mod: pub::revenue_recovery **crates/router/src/routes/process_tracker/revenue_recovery.rs** Add: - function: pub::revenue_recovery_pt_retrieve_api **crates/router/src/services/authorization/permission_groups.rs** Modify existing code **crates/router/src/services/authorization/permissions.rs** Modify existing code **crates/router/src/types/storage.rs** Remove: - mod: pub::passive_churn_recovery Add: - mod: pub::revenue_recovery **crates/router/src/workflows.rs** Remove: - mod: pub::passive_churn_recovery_workflow Add: - mod: pub::revenue_recovery **crates/router_env/src/logger/types.rs** Modify existing code
{"pr_number": 7602, "pr_title": "feat(core): Add support for process tracker retrieve api in v2", "merged_at": "2025-03-27T12:12:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/events.rs", "crates/api_models/src/events/revenue_recovery.rs", "crates/api_models/src/lib.rs", "crates/api_models/src/process_tracker.rs", "crates/api_models/src/process_tracker/revenue_recovery.rs"], "database": ["crates/diesel_models/src/enums.rs", "crates/diesel_models/src/process_tracker.rs"], "core_business": ["crates/router/src/core.rs", "crates/router/src/core/passive_churn_recovery.rs", "crates/router/src/core/passive_churn_recovery/transformers.rs", "crates/router/src/core/passive_churn_recovery/types.rs", "crates/router/src/core/webhooks/recovery_incoming.rs"], "types": ["crates/router/src/types/storage.rs", "crates/router/src/types/storage/passive_churn_recovery.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/events.rs", "crates/common_utils/src/id_type/global_id/payment.rs", "crates/router/src/routes/lock_utils.rs"], "other": ["api-reference-v2/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes.rs", "crates/openapi/src/routes/revenue_recovery.rs", "crates/router/src/bin/scheduler.rs", "crates/router/src/lib.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/process_tracker.rs", "crates/router/src/routes/process_tracker/revenue_recovery.rs", "crates/router/src/services/authorization/permission_groups.rs", "crates/router/src/services/authorization/permissions.rs", "crates/router/src/workflows.rs", "crates/router/src/workflows/passive_churn_recovery_workflow.rs"]}, "change_types": {"structs_added": 3, "functions_added": 9, "enums_added": 2, "fields_added": 32, "imports_added": 17}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(payment-link): update traditional chinese local ## 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 traditional chinese locale for payment link 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). --> 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)? --> use below curl for payment link create and wait for 60 secs for payment link to get expired: ``` 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", "currency": "EUR", "payment_link": true, "session_expiry": 60, "return_url": "https://google.com", "payment_link_config": { "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/8c4e4fcb-f5ab-4988-b559-5712e5f9f473" /> ## 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": 8935, "pr_title": "feat(payment-link): update traditional chinese local", "merged_at": "2025-08-13T10:06:47Z", "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: update API response for JSON deserialization errors ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Described in #6609 ### 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? Locally. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Utils** - `crates/router/src/utils.rs` **2. Tests** - `cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js` - `cypress-tests-v2/cypress/e2e/configs/Payment/Utils.js` - `cypress-tests/cypress/e2e/PaymentUtils/Commons.js` - ... and 2 more files **Code Patterns Applied:** - Extend existing types with new fields (48 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit 40d3c38b: Files to modify: **crates/router/src/utils.rs** Modify existing code
{"pr_number": 6610, "pr_title": "refactor: update API response for JSON deserialization errors", "merged_at": "2024-11-21T22:26:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"utils": ["crates/router/src/utils.rs"], "tests": ["cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js", "cypress-tests-v2/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/PaymentUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentUtils/Paybox.js", "cypress-tests/cypress/e2e/PaymentUtils/Utils.js"]}, "change_types": {"fields_added": 48, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
chore(keymanager): add tenant-id to keymanager requests ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Enhancement ## Description <!-- Describe your changes in detail --> Adds tenant-id for every requests to keymanager ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue 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). --> Added tenant id header for the keymanager service to classify key ids based on tenants. ## How did you test 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 Merchant Account with x-tenant-id as `public` ```bash curl --location 'http://localhost:8080/accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-feature: integ-custom' \ --header 'x-tenant-id: public' \ --header 'api-key: test_admin' \ --data-raw '{ "merchant_id": "1735815159", "locker_id": "m0010", "merchant_name": "NewAge Retailer", "merchant_details": { "primary_contact_person": "John Test", "primary_email": "[email protected]", "primary_phone": "sunt laborum", "secondary_contact_person": "John Test2", "secondary_email": "[email protected]", "secondary_phone": "cillum do dolor id", "website": "www.example.com", "about_business": "Online Retail with a wide selection of organic products for North America", "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } }, "return_url": "https://google.com/success", "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true }, "sub_merchants_enabled": false, "metadata": { "city": "NY", "unit": "245" }, "primary_business_details": [ { "country": "US", "business": "default" } ] }' ``` - Get the `x-request-id` for the request and query it in grafana and see the if the tenant_id is `public` ![Screenshot 2025-01-02 at 4 24 01 PM](https://github.com/user-attachments/assets/eb9f2933-7390-4fa0-a9c7-33e6b522bc1e) ## 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 **search_filter** feature, you'll need to modify these architectural layers: **1. Type Definitions** - `crates/common_utils/src/types/keymanager.rs` - `crates/router/src/types/domain/types.rs` **2. Utils** - `crates/common_utils/src/consts.rs` - `crates/common_utils/src/id_type/tenant.rs` - `crates/common_utils/src/keymanager.rs` **3. Tests** - `loadtest/config/development.toml` **4. Configuration Files** - `config/config.example.toml` - `config/deployments/env_specific.toml` - `config/development.toml` - ... and 3 more files **Code Patterns Applied:** - Implement new functions (4 changes) - Extend existing types with new fields (10 changes) **Detailed Identifier Changes:** Commit 79013024: Files to modify: **crates/common_utils/src/consts.rs** Modify existing code **crates/common_utils/src/id_type/tenant.rs** Add: - function: pub::get_default_global_tenant_id **crates/common_utils/src/keymanager.rs** Modify existing code **crates/common_utils/src/types/keymanager.rs** Add: - trait: pub::GetKeymanagerTenant **crates/router/src/configs/defaults.rs** Add: - function: private::default - impl: impl Default for super::settings::GlobalTenant **crates/router/src/configs/settings.rs** Modify existing code **crates/router/src/types/domain/types.rs** Modify existing code
{"pr_number": 6968, "pr_title": "chore(keymanager): add tenant-id to keymanager requests", "merged_at": "2025-01-06T15:34:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"types": ["crates/common_utils/src/types/keymanager.rs", "crates/router/src/types/domain/types.rs"], "utils": ["crates/common_utils/src/consts.rs", "crates/common_utils/src/id_type/tenant.rs", "crates/common_utils/src/keymanager.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/defaults.rs", "crates/router/src/configs/settings.rs"]}, "change_types": {"functions_added": 4, "fields_added": 10, "imports_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(router): set the eligible connector in the payment attempt for nti based mit flow ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> In the MIT flow when the recurring details is of type "type": "network_transaction_id_and_card_details" the eligible connector needs to be set in the 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)? --> Create merchant connector account for cybersource -> Make a MIT payment with `"type": "network_transaction_id_and_card_details"` ``` curl --location 'http://localhost:8080/payments' \ --header 'Accept: application/json' \ --header 'api-key: dev_OJYRaFClX8PIIwCNrPWUMttJWZrAXUNbBiyA1GvyYyaxRK5EsqODd2ON8KTOlTMa' \ --header 'Content-Type: application/json' \ --data-raw '{ "amount": 499, "currency": "USD", "confirm": true, "capture_method": "automatic", "email": "[email protected]", "payment_method": "card", "payment_method_type": "credit", "off_session": true, "recurring_details": { "type": "network_transaction_id_and_card_details", "data": { "card_number": "5454545454545454", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "name name", "network_transaction_id": "737" } }, "billing": { "address": { "city": "test", "country": "US", "line1": "here", "line2": "there", "line3": "anywhere", "zip": "560095", "state": "Washington", "first_name": "One", "last_name": "Two" }, "phone": { "number": "1234567890", "country_code": "+1" }, "email": "[email protected]" } }' ``` ``` { "payment_id": "pay_ZEs9n2F6Yp0oy50G8VmN", "merchant_id": "merchant_1729157921", "status": "succeeded", "amount": 499, "net_amount": 499, "amount_capturable": 0, "amount_received": 499, "connector": "cybersource", "client_secret": "pay_ZEs9n2F6Yp0oy50G8VmN_secret_fC2BsOIUxNEDzAtimD0X", "created": "2024-10-17T09:39:04.760Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "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": "5454", "card_type": "CREDIT", "card_network": null, "card_issuer": "BANKHANDLOWYWWARSZAWIE.S.A.", "card_issuing_country": "POLAND", "card_isin": "545454", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": null, "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "test", "country": "US", "line1": "here", "line2": "there", "line3": "anywhere", "zip": "560095", "state": "Washington", "first_name": "One", "last_name": "Two" }, "phone": { "number": "1234567890", "country_code": "+1" }, "email": "[email protected]" }, "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": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "7291579463536087703954", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_ZEs9n2F6Yp0oy50G8VmN_1", "payment_link": null, "profile_id": "pro_F0y6R0BOaHFdIv6wsaT8", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_HMDXW38hX91dX1Z5z1xC", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-10-17T09:54:04.760Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-10-17T09:39:07.091Z", "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.rs` **Detailed Identifier Changes:** Commit 1a3d0a60: Files to modify: **crates/router/src/core/payments.rs** Modify existing code
{"pr_number": 6347, "pr_title": "fix(router): set the eligible connector in the payment attempt for nti based mit flow", "merged_at": "2024-10-17T13:55:22Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(core): add all_keys_required in confirm and psync payload ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD closes this [issue](https://github.com/juspay/hyperswitch/issues/7997) ## Description <!-- Describe your changes in detail --> Added all_keys_required in confirm and psync payload. If all_keys_required is passed as true, we will send the whole connector response. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Postman Test Confirm call (with `all_keys_required` passed as `true`) Request (taking AuthorizeDotNet as connector) ``` curl --location 'http://localhost:8080/payments/pay_MsmPKoZNKAk0zpoBuA5Z/confirm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'all_keys_required: true' \ --header 'api-key: ••••••' \ --data ' { "connector": ["authorizedotnet"], "all_keys_required": true, "capture_method": "automatic", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "370000000000002", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "123" } } } ' ``` Response: ``` { "payment_id": "pay_UHNVQh54xvuv97CixQVF", "merchant_id": "merchant_1746796056", "status": "succeeded", "amount": 35308, "net_amount": 35308, "shipping_cost": null, "amount_capturable": 0, "amount_received": 35308, "connector": "authorizedotnet", "client_secret": "pay_UHNVQh54xvuv97CixQVF_secret_aUvQnXDaU6Op4uFuWHC1", "created": "2025-05-09T13:08:19.469Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "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": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_xZJ3bAv0dVvWBWpuYRga", "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": "joseph", "last_name": "Doe" }, "phone": null, "email": null }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": null, "authentication_type": "three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "80040892370", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "80040892370", "payment_link": null, "profile_id": "pro_NLQkgFo4oL87ujOInwp1", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_Bjt7NDYXrZmazh9Tdavu", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-09T13:23:19.469Z", "fingerprint": null, "browser_info": { "os_type": null, "language": null, "time_zone": null, "ip_address": "::1", "os_version": null, "user_agent": null, "color_depth": null, "device_model": null, "java_enabled": null, "screen_width": null, "accept_header": null, "screen_height": null, "accept_language": "en", "java_script_enabled": null }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-09T13:18:33.486Z", "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, "whole_connector_response": "{\"transactionResponse\":{\"responseCode\":\"1\",\"authCode\":\"140GJ4\",\"avsResultCode\":\"Y\",\"cvvResultCode\":\"P\",\"cavvResultCode\":\"2\",\"transId\":\"80040892370\",\"refTransID\":\"\",\"transHash\":\"\",\"testRequest\":\"0\",\"accountNumber\":\"XXXX0000\",\"accountType\":\"Visa\",\"messages\":[{\"code\":\"1\",\"description\":\"This transaction has been approved.\"}],\"transHashSha2\":\"EDD14C10BDDBD427B768E42099F1AF0D089221FA13F9CA55D8B6323C8449585476AFEE55B4A054EE7FD26F73D4B85EF147B0552F0DB4EE17F4F60F8FB16CA2B9\",\"SupplementalDataQualificationIndicator\":0,\"networkTransId\":\"Z9TSL0XISGMU542D7Z5TF0A\"},\"refId\":\"\",\"messages\":{\"resultCode\":\"Ok\",\"message\":[{\"code\":\"I00001\",\"text\":\"Successful.\"}]}}" } ``` Psync: URL: ``` {{baseUrl}}/payments/:id?expand_captures=true&expand_attempts=true&all_keys_required=true ``` Response: ``` { "payment_id": "pay_UHNVQh54xvuv97CixQVF", "merchant_id": "merchant_1746796056", "status": "succeeded", "amount": 35308, "net_amount": 35308, "shipping_cost": null, "amount_capturable": 0, "amount_received": 35308, "connector": "authorizedotnet", "client_secret": "pay_UHNVQh54xvuv97CixQVF_secret_aUvQnXDaU6Op4uFuWHC1", "created": "2025-05-09T13:08:19.469Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": null, "refunds": null, "disputes": null, "attempts": [ { "attempt_id": "pay_UHNVQh54xvuv97CixQVF_1", "status": "charged", "amount": 35308, "order_tax_amount": null, "currency": "USD", "connector": "authorizedotnet", "error_message": null, "payment_method": "card", "connector_transaction_id": "80040892370", "capture_method": "automatic", "authentication_type": "three_ds", "created_at": "2025-05-09T13:08:19.470Z", "modified_at": "2025-05-09T13:18:33.485Z", "cancellation_reason": null, "mandate_id": null, "error_code": null, "payment_token": "token_xZJ3bAv0dVvWBWpuYRga", "connector_metadata": { "creditCard": { "cardNumber": "XXXX0000", "expirationDate": "XXXX" } }, "payment_experience": null, "payment_method_type": "credit", "reference_id": "80040892370", "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": "0000", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "491761", "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_xZJ3bAv0dVvWBWpuYRga", "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": "joseph", "last_name": "Doe" }, "phone": null, "email": null }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": null, "authentication_type": "three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "80040892370", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "80040892370", "payment_link": null, "profile_id": "pro_NLQkgFo4oL87ujOInwp1", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_Bjt7NDYXrZmazh9Tdavu", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-09T13:23:19.469Z", "fingerprint": null, "browser_info": { "os_type": null, "language": null, "time_zone": null, "ip_address": "::1", "os_version": null, "user_agent": null, "color_depth": null, "device_model": null, "java_enabled": null, "screen_width": null, "accept_header": null, "screen_height": null, "accept_language": "en", "java_script_enabled": null }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-09T13:19:32.525Z", "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, "whole_connector_response": "{\"transaction\":{\"transId\":\"80040892370\",\"submitTimeUTC\":\"2025-05-09T13:18:33.043Z\",\"submitTimeLocal\":\"2025-05-09T06:18:33.043\",\"transactionType\":\"authCaptureTransaction\",\"transactionStatus\":\"capturedPendingSettlement\",\"responseCode\":1,\"responseReasonCode\":1,\"responseReasonDescription\":\"Approval\",\"authCode\":\"140GJ4\",\"AVSResponse\":\"Y\",\"cardCodeResponse\":\"P\",\"order\":{\"description\":\"pay_UHNVQh54xvuv97CixQVF_1\",\"discountAmount\":0.0,\"taxIsAfterDiscount\":false},\"authAmount\":353.08,\"settleAmount\":353.08,\"taxExempt\":false,\"payment\":{\"creditCard\":{\"cardNumber\":\"XXXX0000\",\"expirationDate\":\"XXXX\",\"cardType\":\"Visa\"}},\"billTo\":{\"firstName\":\"joseph\",\"lastName\":\"Doe\",\"address\":\"1467\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"},\"recurringBilling\":false,\"customerIP\":\"110.227.219.118\",\"product\":\"Card Not Present\",\"marketType\":\"eCommerce\",\"networkTransId\":\"Z9TSL0XISGMU542D7Z5TF0A\",\"authorizationIndicator\":\"final\"},\"messages\":{\"resultCode\":\"Ok\",\"message\":[{\"code\":\"I00001\",\"text\":\"Successful.\"}]}}" } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/payments.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/router_data.rs` **3. Core Business Logic** - `crates/router/src/core/authentication/transformers.rs` - `crates/router/src/core/authentication/utils.rs` - `crates/router/src/core/disputes.rs` - ... and 62 more files **4. External Connector Integration** - `crates/hyperswitch_connectors/src/utils.rs` - `crates/router/src/types/api/verify_connector.rs` - `crates/router/tests/connectors/aci.rs` - ... and 1 more files **5. Type Definitions** - `crates/router/src/types.rs` **6. Tests** - `crates/router/tests/payments.rs` - `crates/router/tests/payments2.rs` **7. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` - `crates/hyperswitch_interfaces/src/conversion_impls.rs` - ... and 4 more files **Code Patterns Applied:** - Implement new functions (15 changes) - Extend existing types with new fields (123 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit 071b0732: Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_data.rs** Modify existing code **crates/hyperswitch_interfaces/src/conversion_impls.rs** Modify existing code **crates/router/src/compatibility/stripe/payment_intents.rs** Modify existing code **crates/router/src/compatibility/stripe/setup_intents.rs** Modify existing code **crates/router/src/core/authentication/transformers.rs** Modify existing code **crates/router/src/core/authentication/utils.rs** Modify existing code **crates/router/src/core/disputes.rs** Modify existing code **crates/router/src/core/files/helpers.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.rs** Modify existing code **crates/router/src/core/mandate/utils.rs** Modify existing code **crates/router/src/core/payment_methods.rs** Modify existing code **crates/router/src/core/payments.rs** Add: - function: private::get_all_keys_required - function: private::get_whole_connector_response - function: private::get_all_keys_required - function: private::get_whole_connector_response - function: private::get_all_keys_required - function: private::get_whole_connector_response - function: private::get_all_keys_required - function: private::get_whole_connector_response - function: private::get_all_keys_required - function: private::get_whole_connector_response **crates/router/src/core/payments/access_token.rs** Modify existing code **crates/router/src/core/payments/customers.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/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** Modify existing code **crates/router/src/core/payments/operations/payment_approve.rs** Modify existing code **crates/router/src/core/payments/operations/payment_cancel.rs** Modify existing code **crates/router/src/core/payments/operations/payment_capture.rs** Modify existing code **crates/router/src/core/payments/operations/payment_complete_authorize.rs** Modify existing code **crates/router/src/core/payments/operations/payment_confirm.rs** Modify existing code **crates/router/src/core/payments/operations/payment_create.rs** Modify existing code **crates/router/src/core/payments/operations/payment_post_session_tokens.rs** Modify existing code **crates/router/src/core/payments/operations/payment_reject.rs** Modify existing code **crates/router/src/core/payments/operations/payment_response.rs** Modify existing code **crates/router/src/core/payments/operations/payment_session.rs** Modify existing code **crates/router/src/core/payments/operations/payment_start.rs** Modify existing code **crates/router/src/core/payments/operations/payment_status.rs** Modify existing code **crates/router/src/core/payments/operations/payment_update.rs** Modify existing code **crates/router/src/core/payments/operations/payment_update_metadata.rs** Modify existing code **crates/router/src/core/payments/operations/payments_incremental_authorization.rs** Modify existing code **crates/router/src/core/payments/operations/tax_calculation.rs** Modify existing code **crates/router/src/core/payments/retry.rs** Modify existing code **crates/router/src/core/payments/session_operation.rs** Modify existing code **crates/router/src/core/payments/tokenization.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/payouts.rs** Modify existing code **crates/router/src/core/payouts/access_token.rs** Modify existing code **crates/router/src/core/refunds.rs** Modify existing code **crates/router/src/core/refunds_v2.rs** Modify existing code **crates/router/src/core/relay.rs** Modify existing code **crates/router/src/core/relay/utils.rs** Modify existing code **crates/router/src/core/revenue_recovery/api.rs** Modify existing code **crates/router/src/core/revenue_recovery/types.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/incoming.rs** Modify existing code **crates/router/src/core/webhooks/incoming_v2.rs** Modify existing code **crates/router/src/core/webhooks/recovery_incoming.rs** Modify existing code **crates/router/src/core/webhooks/utils.rs** Modify existing code **crates/router/src/routes/payments.rs** Modify existing code **crates/router/src/services/api.rs** Remove: - impl: impl Authenticate for api_models::payments::PaymentsRetrieveRequest Add: - function: private::get_all_keys_required - function: private::get_all_keys_required - function: private::get_all_keys_required - impl: impl Authenticate for api_models::payments::PaymentsConfirmIntentRequest - impl: impl Authenticate for api_models::payments::ProxyPaymentsRequest - impl: impl Authenticate for api_models::payments::PaymentsRetrieveRequest **crates/router/src/types.rs** Modify existing code **crates/router/src/types/api/verify_connector.rs** Modify existing code **crates/router/tests/connectors/aci.rs** Modify existing code **crates/router/tests/connectors/utils.rs** Modify existing code **crates/router/tests/payments.rs** Modify existing code **crates/router/tests/payments2.rs** Modify existing code
{"pr_number": 7998, "pr_title": "feat(core): add all_keys_required in confirm and psync payload", "merged_at": "2025-05-19T14:00:36Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/authentication/utils.rs", "crates/router/src/core/disputes.rs", "crates/router/src/core/files/helpers.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.rs", "crates/router/src/core/mandate/utils.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/access_token.rs", "crates/router/src/core/payments/customers.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/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_approve.rs", "crates/router/src/core/payments/operations/payment_cancel.rs", "crates/router/src/core/payments/operations/payment_capture.rs", "crates/router/src/core/payments/operations/payment_complete_authorize.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_post_session_tokens.rs", "crates/router/src/core/payments/operations/payment_reject.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/payment_session.rs", "crates/router/src/core/payments/operations/payment_start.rs", "crates/router/src/core/payments/operations/payment_status.rs", "crates/router/src/core/payments/operations/payment_update.rs", "crates/router/src/core/payments/operations/payment_update_metadata.rs", "crates/router/src/core/payments/operations/payments_incremental_authorization.rs", "crates/router/src/core/payments/operations/tax_calculation.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/session_operation.rs", "crates/router/src/core/payments/tokenization.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/payouts.rs", "crates/router/src/core/payouts/access_token.rs", "crates/router/src/core/refunds.rs", "crates/router/src/core/refunds_v2.rs", "crates/router/src/core/relay.rs", "crates/router/src/core/relay/utils.rs", "crates/router/src/core/revenue_recovery/api.rs", "crates/router/src/core/revenue_recovery/types.rs", "crates/router/src/core/unified_authentication_service/utils.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/incoming.rs", "crates/router/src/core/webhooks/incoming_v2.rs", "crates/router/src/core/webhooks/recovery_incoming.rs", "crates/router/src/core/webhooks/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/utils.rs", "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"], "tests": ["crates/router/tests/payments.rs", "crates/router/tests/payments2.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/hyperswitch_interfaces/src/conversion_impls.rs", "crates/router/src/compatibility/stripe/payment_intents.rs", "crates/router/src/compatibility/stripe/setup_intents.rs", "crates/router/src/routes/payments.rs", "crates/router/src/services/api.rs"]}, "change_types": {"functions_added": 15, "fields_added": 123, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(refunds): set Instant as the default RefundType ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description - set Instant as the default RefundType ### 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 a Merchant 2. Create a API Key 3. Create Stripe MCA 4. Create a Stripe Payment ``` { "amount": 6540, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "StripeCustomer", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "setup_future_usage": "off_session", "payment_method": "card", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "123" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "sundari" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "sundari" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "routing": { "type": "single", "data": "stripe" } } ``` Response ``` { "payment_id": "pay_dJRGgJCV4FAFIvmAi5No", "merchant_id": "postman_merchant_GHAction_7cf2ef98-05dd-4667-9704-6cc558a1eb76", "status": "succeeded", "amount": 6540, "net_amount": 6540, "shipping_cost": null, "amount_capturable": 0, "amount_received": 6540, "connector": "stripe", "client_secret": "pay_dJRGgJCV4FAFIvmAi5No_secret_0D9ybij4Vw5Khx77Q213", "created": "2025-04-16T06:15:49.117Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": "CREDIT", "card_network": "Visa", "card_issuer": "STRIPE PAYMENTS UK LIMITED", "card_issuing_country": "UNITEDKINGDOM", "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "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": { "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": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "sundari", "last_name": null }, "phone": null, "email": null }, "order_details": null, "email": "[email protected]", "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": 1744784149, "expires": 1744787749, "secret": "epk_681b7b15521c43fca2660f37d9e0e62d" }, "manual_retry_allowed": false, "connector_transaction_id": "pi_3REPGDD5R7gDAGff1KI5u3aK", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi_3REPGDD5R7gDAGff1KI5u3aK", "payment_link": null, "profile_id": "pro_cqVeaynmyv9rePnQmBJ9", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_b4Ikzjk24EKcNP5ZIMrT", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-04-16T06:30:49.117Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-04-16T06:15:50.318Z", "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 } ``` 5. Create a refund and don't pass refund_type ``` curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_6DE9TuqLLyGxlTvI6twET8TUPo341DE3sjqdUKwmZgbPaYavAGmymyUBgGXRO27k' \ --data '{ "payment_id": "pay_dJRGgJCV4FAFIvmAi5No", "amount": 600, "reason": "Customer returned product", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response ``` { "refund_id": "ref_MxPPzIGgKWPx1z2V4Xmf", "payment_id": "pay_dJRGgJCV4FAFIvmAi5No", "amount": 600, "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-04-16T06:15:59.663Z", "updated_at": "2025-04-16T06:16:00.642Z", "connector": "stripe", "profile_id": "pro_cqVeaynmyv9rePnQmBJ9", "merchant_connector_id": "mca_b4Ikzjk24EKcNP5ZIMrT", "split_refunds": null, "issuer_error_code": null, "issuer_error_message": null } ``` Refund will go to succeeded, as now we have set default refund_type as Instant. Before this change all the refund was being Scheduled, if we don't pass `"refund_type": "instant"` In db we can see `refund_type | instant_refund` <img width="703" alt="Screenshot 2025-04-16 at 12 14 11 PM" src="https://github.com/user-attachments/assets/14cca86e-2d83-4b34-ae69-01b22114437e" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/analytics/refunds.rs` - `crates/api_models/src/refunds.rs` **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/enums.rs` **Detailed Identifier Changes:** Commit ac66cbe3: Files to modify: **crates/api_models/src/analytics/refunds.rs** Modify existing code **crates/api_models/src/refunds.rs** Modify existing code **crates/diesel_models/src/enums.rs** Modify existing code
{"pr_number": 7824, "pr_title": "refactor(refunds): set Instant as the default RefundType", "merged_at": "2025-04-28T11:50:25Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics/refunds.rs", "crates/api_models/src/refunds.rs"], "database": ["crates/diesel_models/src/enums.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [CHECKBOOK] 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 Closes this [issue](https://github.com/juspay/hyperswitch/issues/8493) ## Description <!-- Describe your changes in detail --> Added template code for [Checkbook](https://docs.checkbook.io/reference/) ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test 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 required ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/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 95077c64: 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::checkbook **crates/hyperswitch_connectors/src/connectors/checkbook.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::Checkbook - impl: impl Checkbook - impl: impl api::Payment for Checkbook - impl: impl api::PaymentSession for Checkbook - impl: impl api::ConnectorAccessToken for Checkbook - impl: impl api::MandateSetup for Checkbook - impl: impl api::PaymentAuthorize for Checkbook - impl: impl api::PaymentSync for Checkbook - impl: impl api::PaymentCapture for Checkbook - impl: impl api::PaymentVoid for Checkbook - impl: impl api::Refund for Checkbook - impl: impl api::RefundExecute for Checkbook - impl: impl api::RefundSync for Checkbook - impl: impl api::PaymentToken for Checkbook - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Checkbook - impl: impl ConnectorCommonExt<Flow, Request, Response> for Checkbook - impl: impl ConnectorCommon for Checkbook - impl: impl ConnectorValidation for Checkbook - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Checkbook - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Checkbook - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Checkbook - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Checkbook - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Checkbook - impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Checkbook - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Checkbook - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Checkbook - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Checkbook - impl: impl webhooks::IncomingWebhook for Checkbook - impl: impl ConnectorSpecifications for Checkbook - mod: pub::transformers **crates/hyperswitch_connectors/src/connectors/checkbook/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::CheckbookRouterData - struct: pub::CheckbookPaymentsRequest - struct: pub::CheckbookCard - struct: pub::CheckbookAuthType - struct: pub::CheckbookPaymentsResponse - struct: pub::CheckbookRefundRequest - struct: pub::RefundResponse - struct: pub::CheckbookErrorResponse - enum: pub::CheckbookPaymentStatus - enum: pub::RefundStatus - impl: impl From<(FloatMajorUnit, T)> for CheckbookRouterData<T> - impl: impl TryFrom<&CheckbookRouterData<&PaymentsAuthorizeRouterData>> for CheckbookPaymentsRequest - impl: impl TryFrom<&ConnectorAuthType> for CheckbookAuthType - impl: impl From<CheckbookPaymentStatus> for common_enums::AttemptStatus - impl: impl TryFrom<ResponseRouterData<F, CheckbookPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData> - impl: impl TryFrom<&CheckbookRouterData<&RefundsRouterData<F>>> for CheckbookRefundRequest - 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/checkbook.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::CheckbookTest - impl: impl ConnectorActions for CheckbookTest - impl: impl utils::Connector for CheckbookTest **crates/router/tests/connectors/main.rs** Add: - mod: private::checkbook **crates/test_utils/src/connector_auth.rs** Modify existing code
{"pr_number": 8494, "pr_title": "feat(connector): [CHECKBOOK] Add Template Code", "merged_at": "2025-07-02T10:27:27Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "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/checkbook.rs", "crates/hyperswitch_connectors/src/connectors/checkbook/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/checkbook.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"]}, "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"}
feat(routing): Add api-refs for new decision engine endpoints ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This pr adds api refs for routing ``` "v1/routing/routing--evaluate", "v1/routing/routing--feedback", "v1/routing/routing--rule-evaluate" ``` Moved `RoutingEvaluateRequest`, `RoutingEvaluateResponse`, `DeRoutableConnectorChoice`, `ValueType`, `MetadataValue`, `NumberComparison`, and `ComparisonType` to api_models so that we can use RoutingEvaluateRequest and RoutingEvaluateResponse in to openapi crate. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> **for "v1/routing/routing--evaluate",** <img width="1423" height="860" alt="image" src="https://github.com/user-attachments/assets/2f8bcd33-7b79-4e56-8e6b-c3d58717609c" /> **for "v1/routing/routing--feedback",** <img width="1461" height="882" alt="image" src="https://github.com/user-attachments/assets/f59d3313-1e02-4776-9471-e116e522a271" /> **for "v1/routing/routing--rule-evaluate"** <img width="1481" height="860" alt="image" src="https://github.com/user-attachments/assets/2b299094-a7d6-49d9-92d3-111d29c7cedd" /> <img width="771" height="207" alt="image" src="https://github.com/user-attachments/assets/abef2fb0-2e66-417b-b6d4-216a640d4c34" /> ## 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/open_router.rs` - `crates/api_models/src/routing.rs` **2. Core Business Logic** - `crates/router/src/core/payments/routing/utils.rs` **3. Other** - `api-reference/docs.json` - `api-reference/v1/openapi_spec_v1.json` - `api-reference/v1/routing/routing--evaluate.mdx` - ... and 5 more files **Code Patterns Applied:** - Define new data structures (5 changes) - Implement new functions (5 changes) - Extend existing types with new fields (18 changes) **Detailed Identifier Changes:** Commit 4dea30ff: Files to modify: **crates/api_models/src/open_router.rs** Modify existing code **crates/api_models/src/routing.rs** Add: - function: private::deserialize_connector_choices - function: private::from - struct: pub::RoutingEvaluateRequest - struct: pub::RoutingEvaluateResponse - struct: pub::DeRoutableConnectorChoice - struct: pub::MetadataValue - struct: pub::NumberComparison - enum: pub::ValueType - enum: pub::ComparisonType - impl: impl common_utils::events::ApiEventMetric for RoutingEvaluateRequest - impl: impl common_utils::events::ApiEventMetric for RoutingEvaluateResponse - impl: impl From<DeRoutableConnectorChoice> for RoutableConnectorChoice **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/routes/routing.rs** Add: - function: pub::call_decide_gateway_open_router - function: pub::call_update_gateway_score_open_router - function: pub::evaluate_routing_rule **crates/router/src/core/payments/routing/utils.rs** Remove: - function: private::deserialize_connector_choices - function: private::from - struct: pub::RoutingEvaluateRequest - struct: pub::RoutingEvaluateResponse - struct: pub::DeRoutableConnectorChoice - struct: pub::MetadataValue - struct: pub::NumberComparison - enum: pub::ValueType - enum: pub::ComparisonType - impl: impl common_utils::events::ApiEventMetric for RoutingEvaluateRequest - impl: impl common_utils::events::ApiEventMetric for RoutingEvaluateResponse - impl: impl From<DeRoutableConnectorChoice> for RoutableConnectorChoice **crates/router/src/routes/routing.rs** Modify existing code
{"pr_number": 8709, "pr_title": "feat(routing): Add api-refs for new decision engine endpoints", "merged_at": "2025-07-29T11:33:19Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/open_router.rs", "crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/payments/routing/utils.rs"], "other": ["api-reference/docs.json", "api-reference/v1/openapi_spec_v1.json", "api-reference/v1/routing/routing--evaluate.mdx", "api-reference/v1/routing/routing--feedback.mdx", "api-reference/v1/routing/routing--rule-evaluate.mdx", "crates/openapi/src/openapi.rs", "crates/openapi/src/routes/routing.rs", "crates/router/src/routes/routing.rs"]}, "change_types": {"structs_added": 5, "functions_added": 5, "enums_added": 2, "fields_added": 18}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connectors): [Template] add Worldpayvantiv ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Add Payment connector template for Worldpayvantiv. Worldpay Vantiv, also known as the Worldpay CNP API, is a robust XML-based interface used to process online (card-not-present) transactions such as e-commerce purchases, subscription billing, and digital payments Doc Reference - http://support.worldpay.com/support/CNP-API/content/introduction.htm ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **payment** feature, you'll need to modify these architectural layers: **1. 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 9 more files **4. Type Definitions** - `crates/router/src/types/api.rs` - `crates/router/src/types/transformers.rs` **5. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **6. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 2 more files **Code Patterns Applied:** - Define new data structures (10 changes) - Implement new functions (78 changes) - Extend existing types with new fields (158 changes) **Detailed Identifier Changes:** Commit fd844c3d: 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::worldpayvantiv **crates/hyperswitch_connectors/src/connectors/worldpayvantiv.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::Worldpayvantiv - impl: impl Worldpayvantiv - impl: impl api::Payment for Worldpayvantiv - impl: impl api::PaymentSession for Worldpayvantiv - impl: impl api::ConnectorAccessToken for Worldpayvantiv - impl: impl api::MandateSetup for Worldpayvantiv - impl: impl api::PaymentAuthorize for Worldpayvantiv - impl: impl api::PaymentSync for Worldpayvantiv - impl: impl api::PaymentCapture for Worldpayvantiv - impl: impl api::PaymentVoid for Worldpayvantiv - impl: impl api::Refund for Worldpayvantiv - impl: impl api::RefundExecute for Worldpayvantiv - impl: impl api::RefundSync for Worldpayvantiv - impl: impl api::PaymentToken for Worldpayvantiv - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Worldpayvantiv - impl: impl ConnectorCommonExt<Flow, Request, Response> for Worldpayvantiv - impl: impl ConnectorCommon for Worldpayvantiv - impl: impl ConnectorValidation for Worldpayvantiv - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Worldpayvantiv - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Worldpayvantiv - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Worldpayvantiv - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Worldpayvantiv - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Worldpayvantiv - impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Worldpayvantiv - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Worldpayvantiv - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Worldpayvantiv - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Worldpayvantiv - impl: impl webhooks::IncomingWebhook for Worldpayvantiv - impl: impl ConnectorSpecifications for Worldpayvantiv - mod: pub::transformers **crates/hyperswitch_connectors/src/connectors/worldpayvantiv/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::WorldpayvantivRouterData - struct: pub::WorldpayvantivPaymentsRequest - struct: pub::WorldpayvantivCard - struct: pub::WorldpayvantivAuthType - struct: pub::WorldpayvantivPaymentsResponse - struct: pub::WorldpayvantivRefundRequest - struct: pub::RefundResponse - struct: pub::WorldpayvantivErrorResponse - enum: pub::WorldpayvantivPaymentStatus - enum: pub::RefundStatus - impl: impl From<(StringMinorUnit, T)> for WorldpayvantivRouterData<T> - impl: impl TryFrom<&WorldpayvantivRouterData<&PaymentsAuthorizeRouterData>> for WorldpayvantivPaymentsRequest - impl: impl TryFrom<&ConnectorAuthType> for WorldpayvantivAuthType - impl: impl From<WorldpayvantivPaymentStatus> for common_enums::AttemptStatus - impl: impl TryFrom<ResponseRouterData<F, WorldpayvantivPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData> - impl: impl TryFrom<&WorldpayvantivRouterData<&RefundsRouterData<F>>> for WorldpayvantivRefundRequest - 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::worldpayvantiv **crates/router/tests/connectors/worldpayvantiv.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::WorldpayvantivTest - impl: impl ConnectorActions for WorldpayvantivTest - impl: impl utils::Connector for WorldpayvantivTest **crates/test_utils/src/connector_auth.rs** Modify existing code
{"pr_number": 8226, "pr_title": "feat(connectors): [Template] add Worldpayvantiv ", "merged_at": "2025-06-04T10:31:32Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "connector", "card"]}, "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/worldpayvantiv.rs", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv/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/worldpayvantiv.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": 158, "imports_added": 20}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor: Refactored Response types for subscription APIs ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This pull request introduces several improvements to the subscription flow, primarily focused on more robust handling and propagation of billing address information, as well as better error handling for missing required fields. The changes ensure that billing address is consistently validated and passed through various layers of the subscription logic, reducing ambiguity and potential runtime errors. **Billing Address Handling and Validation** * Added a `billing` field to `ConfirmSubscriptionPaymentDetails` and `PaymentResponseData` structs, ensuring billing address is captured and available throughout the subscription process. [[1]](diffhunk://#diff-3d85d9e288cc67856867986ee406a3102ce1d0cf9fe5c8f9efed3a578608f817R215) [[2]](diffhunk://#diff-3d85d9e288cc67856867986ee406a3102ce1d0cf9fe5c8f9efed3a578608f817R298-R299) * Implemented `get_billing_address` method for both `ConfirmSubscriptionRequest` and `CreateAndConfirmSubscriptionRequest` to centralize billing address validation and error reporting. [[1]](diffhunk://#diff-3d85d9e288cc67856867986ee406a3102ce1d0cf9fe5c8f9efed3a578608f817R340-L338) [[2]](diffhunk://#diff-3d85d9e288cc67856867986ee406a3102ce1d0cf9fe5c8f9efed3a578608f817R392-R401) **Subscription Flow Updates** * Updated subscription confirmation and creation logic to use the new `get_billing_address` method, improving error handling for missing billing addresses and ensuring billing information is required and validated at each step. [[1]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL194-R202) [[2]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL208-R223) [[3]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL341-R387) **API and Handler Changes** * Refactored `BillingHandler` and `InvoiceHandler` to require billing address as a mandatory parameter and utilize the new validation logic, removing previous optional handling and associated error checks. [[1]](diffhunk://#diff-57a5a7402c9b28e022a6839808acf84b88808f76da82ce1c76a80660c8869ec6L181-R181) [[2]](diffhunk://#diff-57a5a7402c9b28e022a6839808acf84b88808f76da82ce1c76a80660c8869ec6L193-R193) [[3]](diffhunk://#diff-bacee0b3d81189090ca0d5f72fc58118b681a7dd4aab772679f2dec2a585a073L195-R195) [[4]](diffhunk://#diff-bacee0b3d81189090ca0d5f72fc58118b681a7dd4aab772679f2dec2a585a073L223-R223) **Response Structure Improvements** * Modified `ConfirmSubscriptionResponse` to include `plan_id` and `price_id` as parameters, ensuring these values are propagated and available in API responses. [[1]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cR290-R291) [[2]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cR443-R444) [[3]](diffhunk://#diff-1d71cc03e82ba9b3c7478b6304bd763431e20cc723881a1623ab3127301b8976R230-R241) ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> 1. Create customer ``` curl --location 'http://localhost:8080/customers' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_DgD8IWX4nBy8XZI5XJha27stqGvh9mfnfeSyH7PLxYqYr4ZCOF6aycXZXNyOkU8B' \ --data-raw '{ "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "IN", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "123456789", "country_code": "+1" } } }' ``` 2. Create subscription ``` curl --location 'http://localhost:8080/subscriptions/create' \ --header 'Content-Type: application/json' \ --header 'X-Profile-Id: pro_rxWaJhbTDRHSo5nqDDZ6' \ --header 'api-key: dev_DgD8IWX4nBy8XZI5XJha27stqGvh9mfnfeSyH7PLxYqYr4ZCOF6aycXZXNyOkU8B' \ --data '{ "customer_id": "cus_g3vEov3pMEH39eu0o3AD", "amount": 14100, "currency": "USD", "payment_details": { "authentication_type": "no_three_ds", "setup_future_usage": "off_session", "capture_method": "automatic", "return_url": "https://google.com" } }' ``` Response - ``` {"id":"sub_TVkrlPLfpnM3JfCXnx2L","merchant_reference_id":null,"status":"created","plan_id":null,"profile_id":"pro_rxWaJhbTDRHSo5nqDDZ6","client_secret":"sub_TVkrlPLfpnM3JfCXnx2L_secret_1UWOvS3OgtxVlaLIiPle","merchant_id":"merchant_1760093241","coupon_code":null,"customer_id":"cus_g3vEov3pMEH39eu0o3AD","payment":{"payment_id":"pay_xxI7RaquqlqNl1FwAYi1","status":"requires_payment_method","amount":14100,"currency":"USD","connector":null,"payment_method_id":null,"payment_experience":null,"error_code":null,"error_message":null,"payment_method_type":null,"client_secret":"pay_xxI7RaquqlqNl1FwAYi1_secret_A3ViVqfJ5qS6bV8HT7c5","billing":null,"shipping":null},"invoice":{"id":"invoice_q5PCCVEBci5MdEteiKSS","subscription_id":"sub_TVkrlPLfpnM3JfCXnx2L","merchant_id":"merchant_1760093241","profile_id":"pro_rxWaJhbTDRHSo5nqDDZ6","merchant_connector_id":"mca_EpPEpyIdEG3y2DVLoWo8","payment_intent_id":"pay_xxI7RaquqlqNl1FwAYi1","payment_method_id":null,"customer_id":"cus_g3vEov3pMEH39eu0o3AD","amount":14100,"currency":"USD","status":"invoice_created"}} ``` 3. Confirm Subscription ``` curl --location 'http://localhost:8080/subscriptions/sub_TVkrlPLfpnM3JfCXnx2L/confirm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'X-Profile-Id: pro_rxWaJhbTDRHSo5nqDDZ6' \ --header 'api-key: dev_DgD8IWX4nBy8XZI5XJha27stqGvh9mfnfeSyH7PLxYqYr4ZCOF6aycXZXNyOkU8B' \ --data '{ "item_price_id": "cbdemo_enterprise-suite-monthly", "customer_id": "cus_g3vEov3pMEH39eu0o3AD", "description": "Hello this is description", "payment_details": { "shipping": { "address": { "state": "zsaasdas", "city": "Banglore", "country": "US", "line1": "sdsdfsdf", "line2": "hsgdbhd", "line3": "alsksoe", "zip": "571201", "first_name": "joseph", "last_name": "doe" }, "phone": { "number": "123456789", "country_code": "+1" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "123456789", "country_code": "+1" } }, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "CLBRW dffdg", "card_cvc": "737" } }, "customer_acceptance": { "acceptance_type": "online", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "127.0.0.1", "user_agent": "amet irure esse" } } } }' ``` Response - ``` { "id": "sub_TVkrlPLfpnM3JfCXnx2L", "merchant_reference_id": null, "status": "active", "plan_id": null, "price_id": "cbdemo_enterprise-suite-monthly", "coupon": null, "profile_id": "pro_rxWaJhbTDRHSo5nqDDZ6", "payment": { "payment_id": "pay_xxI7RaquqlqNl1FwAYi1", "status": "succeeded", "amount": 14100, "currency": "USD", "connector": "stripe", "payment_method_id": "pm_OvQX5WSh5R6uOf0khtKK", "payment_experience": null, "error_code": null, "error_message": null, "payment_method_type": "credit", "client_secret": "pay_xxI7RaquqlqNl1FwAYi1_secret_A3ViVqfJ5qS6bV8HT7c5", "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe", "origin_zip": null }, "phone": { "number": "123456789", "country_code": "+1" }, "email": null }, "shipping": { "address": { "city": "Banglore", "country": "US", "line1": "sdsdfsdf", "line2": "hsgdbhd", "line3": "alsksoe", "zip": "571201", "state": "zsaasdas", "first_name": "joseph", "last_name": "doe", "origin_zip": null }, "phone": { "number": "123456789", "country_code": "+1" }, "email": null } }, "customer_id": "cus_g3vEov3pMEH39eu0o3AD", "invoice": { "id": "invoice_q5PCCVEBci5MdEteiKSS", "subscription_id": "sub_TVkrlPLfpnM3JfCXnx2L", "merchant_id": "merchant_1760093241", "profile_id": "pro_rxWaJhbTDRHSo5nqDDZ6", "merchant_connector_id": "mca_EpPEpyIdEG3y2DVLoWo8", "payment_intent_id": "pay_xxI7RaquqlqNl1FwAYi1", "payment_method_id": "pm_OvQX5WSh5R6uOf0khtKK", "customer_id": "cus_g3vEov3pMEH39eu0o3AD", "amount": 14100, "currency": "USD", "status": "payment_pending" }, "billing_processor_subscription_id": "sub_TVkrlPLfpnM3JfCXnx2L" } ``` ## 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/subscription.rs` **2. Core Business Logic** - `crates/router/src/core/subscription.rs` - `crates/router/src/core/subscription/invoice_handler.rs` - `crates/router/src/core/subscription/subscription_handler.rs` **Code Patterns Applied:** - Implement new functions (2 changes) - Extend existing types with new fields (7 changes) **Detailed Identifier Changes:** Commit 435bc117: Files to modify: **crates/api_models/src/subscription.rs** Add: - function: pub::get_billing_address - impl: impl CreateAndConfirmSubscriptionRequest **crates/router/src/core/subscription.rs** Modify existing code **crates/router/src/core/subscription/invoice_handler.rs** Modify existing code **crates/router/src/core/subscription/subscription_handler.rs** Modify existing code
{"pr_number": 9788, "pr_title": "refactor: Refactored Response types for subscription APIs", "merged_at": "2025-10-13T11:00:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/subscription.rs"], "core_business": ["crates/router/src/core/subscription.rs", "crates/router/src/core/subscription/invoice_handler.rs", "crates/router/src/core/subscription/subscription_handler.rs"]}, "change_types": {"functions_added": 2, "fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
chore: resolve v2 warnings in common_utils ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR resolves the v2 warnings generated in common_utils. ### 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 sanity of common_utils on both v1 and v2 ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `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. Utils** - `crates/common_utils/src/id_type/global_id.rs` - `crates/common_utils/src/id_type/global_id/customer.rs` - `crates/common_utils/src/id_type/global_id/payment.rs` - ... and 1 more files **Code Patterns Applied:** **Detailed Identifier Changes:** Commit 338a9537: Files to modify: **crates/common_utils/src/id_type/global_id.rs** Modify existing code **crates/common_utils/src/id_type/global_id/customer.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/refunds.rs** Modify existing code
{"pr_number": 7358, "pr_title": "chore: resolve v2 warnings in common_utils", "merged_at": "2025-05-13T06:56:09Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"utils": ["crates/common_utils/src/id_type/global_id.rs", "crates/common_utils/src/id_type/global_id/customer.rs", "crates/common_utils/src/id_type/global_id/payment.rs", "crates/common_utils/src/id_type/global_id/refunds.rs"]}, "change_types": {"imports_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
ci(cypress): Fix Iatapay UPI redirection ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [x] CI/CD ## Description Fixed payment failures caused by changes in the Iatapay redirection page by triggering the Simulate button during the redirection flow. ## Motivation and Context Iatapay UPI is failing due to new element added in the redirection page ## How did you test it? Ran locally <img width="1295" height="670" alt="Screenshot 2025-10-13 at 3 15 08 PM" src="https://github.com/user-attachments/assets/69fbed33-bcd6-474b-9d7f-f1824790c91c" /> <img width="772" height="622" alt="Screenshot 2025-10-13 at 3 17 03 PM" src="https://github.com/user-attachments/assets/391eb55e-8965-4e37-a541-3f9977482fa9" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **payment** feature, you'll need to modify these architectural layers: **1. Tests** - `cypress-tests/cypress/support/redirectionHandler.js`
{"pr_number": 9811, "pr_title": "ci(cypress): Fix Iatapay UPI redirection", "merged_at": "2025-10-13T11:49:13Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
feat(connector): [BRAINTREE] Add revoke mandate flow ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Add mandate revoke flow to Braintree https://developer.paypal.com/braintree/graphql/guides/payment_methods/#delete ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> https://github.com/juspay/hyperswitch/issues/7526 ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Revoking an existing mandate using tunnel needs to be tested: Request: ``` curl --location 'http://localhost:8080/vs/v1/payment_methods/man_OVY39ecmn6QDAxh18qIe/detach' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'User-Agent: helloMozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36' \ --header 'api-key: HIDDEN' \ --data-urlencode 'merchant_connector_details%5Bencoded_data%5D=HIDDEN' ``` Response: ``` { "mandate_id": "man_OVY39ecmn6QDAxh18qIe", "status": "revoked", "error_code": null, "error_message": null } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/braintree.rs` - `crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs` - `crates/hyperswitch_connectors/src/default_implementations.rs` **Code Patterns Applied:** - Define new data structures (5 changes) - Implement new functions (8 changes) - Extend existing types with new fields (26 changes) **Detailed Identifier Changes:** Commit 2f55be45: Files to modify: **crates/hyperswitch_connectors/src/connectors/braintree.rs** Add: - function: private::get_headers - function: private::get_url - function: private::build_request - function: private::get_request_body - function: private::handle_response - function: private::get_error_response - impl: impl api::ConnectorMandateRevoke for Braintree - impl: impl ConnectorIntegration<MandateRevoke, MandateRevokeRequestData, MandateRevokeResponseData> for Braintree **crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs** Add: - function: private::try_from - function: private::try_from - struct: pub::DeletePaymentMethodFromVaultInputData - struct: pub::VariableDeletePaymentMethodFromVaultInput - struct: pub::BraintreeRevokeMandateRequest - struct: pub::RevokeMandateResponse - struct: pub::DeletePaymentMethodFromVault - enum: pub::BraintreeRevokeMandateResponse - impl: impl TryFrom<&types::MandateRevokeRouterData> for BraintreeRevokeMandateRequest - impl: impl TryFrom< ResponseRouterData< F, BraintreeRevokeMandateResponse, MandateRevokeRequestData, MandateRevokeResponseData, >, > for RouterData<F, MandateRevokeRequestData, MandateRevokeResponseData> **crates/hyperswitch_connectors/src/default_implementations.rs** Modify existing code
{"pr_number": 7525, "pr_title": "feat(connector): [BRAINTREE] Add revoke mandate flow", "merged_at": "2025-03-15T11:52:36Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/braintree.rs", "crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs"]}, "change_types": {"structs_added": 5, "functions_added": 8, "enums_added": 1, "fields_added": 26}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connectors): [worldpayvantiv] map cnp_txn_id to connector_txn_id and enforce max length for customer_id and connector_request_reference_id ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This Pr fixes the following 1.Maps cnp_txn_id to connector_transaction_id in error responses when cnp_txn_id is present. 2.Enforces maximum length validation for customer_id and connector_request_reference_id. 3.Maps merchant_order_reference to customer_reference. Since we currently don’t accept any customer-provided ID, merchant_order_reference is used as the customer_reference. ## How did you test 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> Test Payment Reference ID</summary> </br> <details> <summary> Payment Create without passing payment_id </summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_N4Kk872pMhxmIKSazZbKqAzQfpHKxRtRKqB6JHDvd2Dy3yvBeIjvbRNfP7CMpNw0' \ --data '{ "amount":100, "currency": "USD", "confirm": true, "capture_method": "automatic", "customer_id": "aaaa", "payment_method": "card", "payment_method_data": { "card": { "card_number": "371449635398431", "card_exp_month": "03", "card_exp_year": "30", "card_cvc": "7373" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } }' ``` Response ``` {"payment_id":"pay_RtqW1aiJvJqKbbou3dBf","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"processing","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_RtqW1aiJvJqKbbou3dBf_secret_j55H6oN8k7awIJ9wlE8x","created":"2025-08-22T08:38:01.856Z","currency":"USD","customer_id":"aaaa","customer":{"id":"aaaa","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":{"avs_result":"02","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":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":null,"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":1755851881,"expires":1755855481,"secret":"epk_e4f67de6065a47f69b7dd62a6b676536"},"manual_retry_allowed":false,"connector_transaction_id":"84085436440119947","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":"722914851615","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T08:53:01.856Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-22T08:38:05.188Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"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_RtqW1aiJvJqKbbou3dBf","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"succeeded","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":100,"connector":"worldpayvantiv","client_secret":"pay_RtqW1aiJvJqKbbou3dBf_secret_j55H6oN8k7awIJ9wlE8x","created":"2025-08-22T08:38:01.856Z","currency":"USD","customer_id":"aaaa","customer":{"id":"aaaa","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":{"avs_result":"02","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":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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"84085436440119947","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":"722914851615","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T08:53:01.856Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-22T08:38:16.022Z","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} ``` </details> </br> <details> <summary>Payment Create by passing payment_id with 28 characters</summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_N4Kk872pMhxmIKSazZbKqAzQfpHKxRtRKqB6JHDvd2Dy3yvBeIjvbRNfP7CMpNw0' \ --data '{ "amount":100, "currency": "USD", "confirm": true, "capture_method": "automatic", "payment_id": "1234567891234567891234567891", "customer_id": "aaaa", "payment_method": "card", "payment_method_data": { "card": { "card_number": "371449635398431", "card_exp_month": "03", "card_exp_year": "30", "card_cvc": "7373" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } }' ``` Response ``` {"payment_id":"1234567891234567891234567891","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"processing","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":"worldpayvantiv","client_secret":"1234567891234567891234567891_secret_0Rjkpe7kGLRs93Q6Q20i","created":"2025-08-22T08:41:22.344Z","currency":"USD","customer_id":"aaaa","customer":{"id":"aaaa","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":{"avs_result":"02","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":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":null,"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":1755852082,"expires":1755855682,"secret":"epk_ae78361207794ae793784a79a4bf0440"},"manual_retry_allowed":false,"connector_transaction_id":"84085436440147989","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":"350830977505","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T08:56:22.344Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-22T08:41:23.419Z","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} ``` Psync ``` {"payment_id":"1234567891234567891234567891","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"succeeded","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":100,"connector":"worldpayvantiv","client_secret":"1234567891234567891234567891_secret_0Rjkpe7kGLRs93Q6Q20i","created":"2025-08-22T08:41:22.344Z","currency":"USD","customer_id":"aaaa","customer":{"id":"aaaa","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":{"avs_result":"02","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":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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"84085436440147989","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":"350830977505","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T08:56:22.344Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-22T08:42:35.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,"enable_partial_authorization":null} ``` </details> </br> <details> <summary>Payment Create by passing payment_id with more than 30 characters </summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_N4Kk872pMhxmIKSazZbKqAzQfpHKxRtRKqB6JHDvd2Dy3yvBeIjvbRNfP7CMpNw0' \ --data '{ "amount":100, "currency": "USD", "confirm": true, "capture_method": "automatic", "payment_id": "X7a9Bq2Lm8Rt4Nv6Pw3KyeHd0Gd5797965", "customer_id": "aaaa", "payment_method": "card", "payment_method_data": { "card": { "card_number": "371449635398431", "card_exp_month": "03", "card_exp_year": "30", "card_cvc": "7373" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } }' ``` Response ``` {"payment_id":"X7a9Bq2Lm8Rt4Nv6Pw3KyeHd0Gd5797965","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"processing","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":"worldpayvantiv","client_secret":"X7a9Bq2Lm8Rt4Nv6Pw3KyeHd0Gd5797965_secret_TVtDnJmiIjcNYg8eAeyX","created":"2025-08-22T08:50:27.027Z","currency":"USD","customer_id":"aaaa","customer":{"id":"aaaa","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":{"avs_result":"02","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":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":null,"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":1755852626,"expires":1755856226,"secret":"epk_9b06dad3189642e6b509d28d42cf0ce1"},"manual_retry_allowed":false,"connector_transaction_id":"84085436620745420","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":"878812383960","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T09:05:27.027Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-22T08:50:27.475Z","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} ``` > Note: In this case is_config_enabled_to_send_payment_id_as_connector_request_id is not enabled hence we will send the id we generate Psync ``` {"payment_id":"X7a9Bq2Lm8Rt4Nv6Pw3KyeHd0Gd5797965","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"succeeded","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":100,"connector":"worldpayvantiv","client_secret":"X7a9Bq2Lm8Rt4Nv6Pw3KyeHd0Gd5797965_secret_TVtDnJmiIjcNYg8eAeyX","created":"2025-08-22T08:50:27.027Z","currency":"USD","customer_id":"aaaa","customer":{"id":"aaaa","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":{"avs_result":"02","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":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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"84085436620745420","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":"878812383960","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T09:05:27.027Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-22T08:52:51.713Z","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} ``` </details> <details> <summary> Payment Create by passing payment_id with 28 characters with is_config_enabled_to_send_payment_id_as_connector_request_id enabled </summary> ```curl curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_N4Kk872pMhxmIKSazZbKqAzQfpHKxRtRKqB6JHDvd2Dy3yvBeIjvbRNfP7CMpNw0' \ --data '{ "amount":100, "currency": "USD", "confirm": true, "capture_method": "automatic", "payment_id": "X7a9Bq2Lm8Rt4Nv6Pw3Ky5Hd0Gc", "customer_id": "aaaa", "payment_method": "card", "payment_method_data": { "card": { "card_number": "371449635398431", "card_exp_month": "03", "card_exp_year": "30", "card_cvc": "7373" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } }' ``` Response ``` {"error":{"type":"invalid_request","message":"The payment with the specified payment_id already exists in our records","code":"HE_01","reason":"PaymentId(\"X7a9Bq2Lm8Rt4Nv6Pw3Ky5Hd0Gc\") already exists"}} ``` </details> </details> </br> <details><summary>Test customer ID</summary> Create a payment id with 51 characters -> the payment should not fail ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_N4Kk872pMhxmIKSazZbKqAzQfpHKxRtRKqB6JHDvd2Dy3yvBeIjvbRNfP7CMpNw0' \ --data '{ "amount":100, "currency": "USD", "confirm": true, "capture_method": "automatic", "customer_id": "Ab9xL2qWeRtY7uIoPzK4sDfGhJmNcVbX1tUyQwErZaSdFgHiJk", "payment_method": "card", "payment_method_data": { "card": { "card_number": "371449635398431", "card_exp_month": "03", "card_exp_year": "30", "card_cvc": "7373" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } }' ``` Response ``` {"payment_id":"pay_iKl3IPwXyePRNlXcatnT","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"processing","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_iKl3IPwXyePRNlXcatnT_secret_gwSugh28oFpJYZ8ms6kD","created":"2025-08-22T11:34:29.994Z","currency":"USD","customer_id":"Ab9xL2qWeRtY7uIoPzK4sDfGhJmNcVbX1tUyQwErZaSdFgHiJk","customer":{"id":"Ab9xL2qWeRtY7uIoPzK4sDfGhJmNcVbX1tUyQwErZaSdFgHiJk","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":{"avs_result":"02","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":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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"Ab9xL2qWeRtY7uIoPzK4sDfGhJmNcVbX1tUyQwErZaSdFgHiJk","created_at":1755862469,"expires":1755866069,"secret":"epk_754d6c55ce6e42499ef22a6a9f560879"},"manual_retry_allowed":false,"connector_transaction_id":"84085439258716242","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":"6WOPuD6Jt-s0ONpyKdwTiSOJUjCh","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T11:49:29.994Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-22T11:34:32.478Z","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} ``` Psync ``` {"payment_id":"pay_iKl3IPwXyePRNlXcatnT","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"succeeded","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":100,"connector":"worldpayvantiv","client_secret":"pay_iKl3IPwXyePRNlXcatnT_secret_gwSugh28oFpJYZ8ms6kD","created":"2025-08-22T11:34:29.994Z","currency":"USD","customer_id":"Ab9xL2qWeRtY7uIoPzK4sDfGhJmNcVbX1tUyQwErZaSdFgHiJk","customer":{"id":"Ab9xL2qWeRtY7uIoPzK4sDfGhJmNcVbX1tUyQwErZaSdFgHiJk","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":{"avs_result":"02","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":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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"84085439258716242","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":"6WOPuD6Jt-s0ONpyKdwTiSOJUjCh","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T11:49:29.994Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-22T11:35:15.956Z","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} ``` </details> </br> <details> <summary>Test connector_transaction_id mapping</summary> Create a CIT payment ```curl curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_N4Kk872pMhxmIKSazZbKqAzQfpHKxRtRKqB6JHDvd2Dy3yvBeIjvbRNfP7CMpNw0' \ --data '{ "amount":100, "currency": "USD", "confirm": true, "capture_method": "automatic", "customer_id": "aaaa", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "371449635398431", "card_exp_month": "03", "card_exp_year": "30", "card_cvc": "7373" } }, "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" } }' ``` Response ```json {"payment_id":"pay_gpuWWaVNgGjsFO9Qf2Ht","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"processing","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_gpuWWaVNgGjsFO9Qf2Ht_secret_ZzlzHt4aO4Nd9aEtwLhF","created":"2025-08-22T11:39:35.676Z","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":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":{"avs_result":"02","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":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":null,"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":1755862775,"expires":1755866375,"secret":"epk_677ebe9f72fc4ecf9251b35805374f60"},"manual_retry_allowed":false,"connector_transaction_id":"83997479617603144","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":"OSU_Spn7Zs7cmEcBXX7YL57bM-T9","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T11:54:35.676Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-22T11:39:38.567Z","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} ``` Psync ```json {"payment_id":"pay_gpuWWaVNgGjsFO9Qf2Ht","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"succeeded","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":100,"connector":"worldpayvantiv","client_secret":"pay_gpuWWaVNgGjsFO9Qf2Ht_secret_ZzlzHt4aO4Nd9aEtwLhF","created":"2025-08-22T11:39:35.676Z","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":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":{"avs_result":"02","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":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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"83997479617603144","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":"OSU_Spn7Zs7cmEcBXX7YL57bM-T9","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T11:54:35.676Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":"pm_pLGxYw7DY1nET3bjel8s","network_transaction_id":null,"payment_method_status":"inactive","updated":"2025-08-22T11:40:55.204Z","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} ``` MIT ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_N4Kk872pMhxmIKSazZbKqAzQfpHKxRtRKqB6JHDvd2Dy3yvBeIjvbRNfP7CMpNw0' \ --data '{ "amount": 15000, "currency": "USD", "off_session": true, "confirm": true, "capture_method": "automatic", "recurring_details": { "type": "payment_method_id", "data": "pm_50OIlMv7pxOew89alATb" }, "customer_id": "aaaa", "connector": [ "worldpayvantiv" ] }' ``` Response ``` {"payment_id":"pay_4Dw2f3P7ITvGcU7nSH75","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"processing","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":15000,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_4Dw2f3P7ITvGcU7nSH75_secret_TlgTo55JiDPHRASDLQrK","created":"2025-08-22T11:43:53.999Z","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":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"aaaa","created_at":1755863033,"expires":1755866633,"secret":"epk_5b1da7ef3d42490f8f019fa2b43798cb"},"manual_retry_allowed":false,"connector_transaction_id":"83997479689435292","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":"veeQfK1abJYO7RvVkIBhM5AjITJk","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T11:58:53.999Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_50OIlMv7pxOew89alATb","network_transaction_id":"239605450718890","payment_method_status":"active","updated":"2025-08-22T11:43:54.691Z","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":"270340788048431","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 ```json {"payment_id":"pay_4Dw2f3P7ITvGcU7nSH75","merchant_id":"postman_merchant_GHAction_ddbb3a5f-2662-42ea-8552-0e837234ea86","status":"succeeded","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":0,"amount_received":15000,"connector":"worldpayvantiv","client_secret":"pay_4Dw2f3P7ITvGcU7nSH75_secret_TlgTo55JiDPHRASDLQrK","created":"2025-08-22T11:43:53.999Z","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":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"8431","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"371449","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"83997479689435292","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":"veeQfK1abJYO7RvVkIBhM5AjITJk","payment_link":null,"profile_id":"pro_l1p84NUKtcjTefm3Cvx1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_hUK6008UqqyNo8IcS7Al","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-22T11:58:53.999Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_50OIlMv7pxOew89alATb","network_transaction_id":"239605450718890","payment_method_status":"active","updated":"2025-08-22T11:47:31.273Z","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} ``` </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/Cargo.toml` - `crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs` - `crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs` - ... and 1 more files **2. Other** - `Cargo.lock` **Code Patterns Applied:** - Implement new functions (8 changes) - Extend existing types with new fields (23 changes) - Add conditional logic for feature flags or filtering (5 changes) **Detailed Identifier Changes:** Commit b1486f8b: Files to modify: **crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs** Add: - function: private::generate_connector_request_reference_id - function: private::generate_connector_request_reference_id **crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs** Add: - function: private::extract_customer_id - function: private::get_valid_transaction_id **crates/hyperswitch_connectors/src/utils.rs** Add: - function: private::get_optional_customer_id
{"pr_number": 9031, "pr_title": "fix(connectors): [worldpayvantiv] map cnp_txn_id to connector_txn_id and enforce max length for customer_id and connector_request_reference_id", "merged_at": "2025-08-22T13:07:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/Cargo.toml", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs"], "other": ["Cargo.lock"]}, "change_types": {"functions_added": 8, "fields_added": 23, "conditionals_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [MULTISAFEPAY, CASHTOCODE, WORLDPAY, WELLSFARGO] Supported features for feature matrix ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Added Feature Matrix supported payment methods, countries and currencies for Multisafepay, Cashtocode, Worldpay and Wellsfargo. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ### MULTISAFEPAY **Card(Credit)** -Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_BRLi0eobwJCQvfjdD0MZbuGVAIaX16cvGPAM80Rpdn0j0ixXtlg3jtpzTDnMJUeH' \ --data-raw '{ "amount": 12345, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 12345, "customer_id": "abcdfe", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4212345678901237", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "card_cvc": "739" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" } }' ``` -Response ``` { "payment_id": "pay_bp8hf7Ocmqq7Ep9isDWQ", "merchant_id": "postman_merchant_GHAction_2c4ad87f-3e25-4085-8b54-825e8d863450", "status": "succeeded", "amount": 12345, "net_amount": 12345, "shipping_cost": null, "amount_capturable": 0, "amount_received": 12345, "connector": "cybersource", "client_secret": "pay_bp8hf7Ocmqq7Ep9isDWQ_secret_mHy67YGHq7j2ToBELWS6", "created": "2025-05-15T11:48:46.858Z", "currency": "USD", "customer_id": "abcdfe", "customer": { "id": "abcdfe", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1237", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "421234", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "payment_checks": { "avs_response": { "code": "Y", "codeRaw": "Y" }, "card_verification": { "resultCode": "M", "resultCodeRaw": "M" } }, "authentication_data": null }, "billing": null }, "payment_token": "token_TNV1WLBwxbIKZgsBtfmY", "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": "[email protected]", "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": "abcdfe", "created_at": 1747309726, "expires": 1747313326, "secret": "epk_58d552108b124ed7aaf601f064052c32" }, "manual_retry_allowed": false, "connector_transaction_id": "7473097280976362903813", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_bp8hf7Ocmqq7Ep9isDWQ_1", "payment_link": null, "profile_id": "pro_2Rna3YFTyOAA6HVlHE6P", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_yUDi3EIIDvjyE3xfxhVo", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-15T12:03:46.858Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-15T11:48:48.988Z", "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 } ``` **Card(Debit)** -Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_BRLi0eobwJCQvfjdD0MZbuGVAIaX16cvGPAM80Rpdn0j0ixXtlg3jtpzTDnMJUeH' \ --data-raw '{ "amount": 12345, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 12345, "customer_id": "abcdfe", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "debit", "payment_method_data": { "card": { "card_number": "4212345678901237", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "card_cvc": "739" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" } }' ``` -Response ``` { "payment_id": "pay_RGvWZ6NZWFdyEL1oYY9f", "merchant_id": "postman_merchant_GHAction_2c4ad87f-3e25-4085-8b54-825e8d863450", "status": "succeeded", "amount": 12345, "net_amount": 12345, "shipping_cost": null, "amount_capturable": 0, "amount_received": 12345, "connector": "cybersource", "client_secret": "pay_RGvWZ6NZWFdyEL1oYY9f_secret_9RR3g8s7Ez0Ue8TNYHqL", "created": "2025-05-15T11:50:43.927Z", "currency": "USD", "customer_id": "abcdfe", "customer": { "id": "abcdfe", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1237", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "421234", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "payment_checks": { "avs_response": { "code": "Y", "codeRaw": "Y" }, "card_verification": { "resultCode": "M", "resultCodeRaw": "M" } }, "authentication_data": null }, "billing": null }, "payment_token": "token_9O9B1lEaUrB6NDxdeKL8", "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": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "abcdfe", "created_at": 1747309843, "expires": 1747313443, "secret": "epk_e3cb053fcd8f4983965d69314c193199" }, "manual_retry_allowed": false, "connector_transaction_id": "7473098451916632303814", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_RGvWZ6NZWFdyEL1oYY9f_1", "payment_link": null, "profile_id": "pro_2Rna3YFTyOAA6HVlHE6P", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_yUDi3EIIDvjyE3xfxhVo", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-15T12:05:43.927Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-15T11:50:46.072Z", "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 } ``` ### WORLDPAY **Card(Credit)** -Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_ALZ6HXV1kpq1Ok1KCdI3B6qxZmg9FBPBnPrcxfafEsRItJZIfgE1LtRGrMwk0TYE' \ --data-raw '{ "amount": 12345, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 12345, "customer_id": "abcdfe", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4917610000000000", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "card_cvc": "739" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" } }' ``` -Response ``` { "payment_id": "pay_LfDj7yDZwdZKE3ne24KO", "merchant_id": "postman_merchant_GHAction_e8a47dab-c2e9-47ef-8a91-a48635f71ce5", "status": "succeeded", "amount": 12345, "net_amount": 12345, "shipping_cost": null, "amount_capturable": 0, "amount_received": 12345, "connector": "worldpay", "client_secret": "pay_LfDj7yDZwdZKE3ne24KO_secret_P8DHVjLDskQrknede60B", "created": "2025-05-15T12:36:29.727Z", "currency": "USD", "customer_id": "abcdfe", "customer": { "id": "abcdfe", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "0000", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "491761", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "order_details": null, "email": "[email protected]", "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": "abcdfe", "created_at": 1747312589, "expires": 1747316189, "secret": "epk_15edccce1ec84678a5b9153ccf6eeb35" }, "manual_retry_allowed": false, "connector_transaction_id": "eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT6h+lbqfJa+1BSoKFSY8HLfKkob4xtgyQHOUdu:YUsnot2jFsqX+NMruRZjQY5g0pBMj22Q8mqp+GdNtOOwjHFKehJNZz0urTs8IkF9iA18O1al9kEkFIu2H2OhX:2:zorW66yFNGsWi87tzkRENLR8ix3NBfHPU2KlzlyTrmR0mwasA4zRNlfY:bG7Aaa:GaUgn8jvCNhmdUlN6uDEfAu3+Gpx8cadeYO0VLI6Wl9Ij4FJlJc72BVERP7cifjqijx0JfAcqMmcRJg25WkhfAecgEOJO+Qo7r7FThP081jgS+WwXVvDoxGmrxlJztOw0ZGhpBnafkmtr87KRkF2Hgo", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "61acaebf-c0ca-4b58-b18b-be262abe305f", "payment_link": null, "profile_id": "pro_h8hgkqbVCGEK8MyOnVaL", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_wpyfUNuvetffMg1uwbMv", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-15T12:51:29.727Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-15T12:36:30.946Z", "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 } ``` **Card(Debit)** -Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_ALZ6HXV1kpq1Ok1KCdI3B6qxZmg9FBPBnPrcxfafEsRItJZIfgE1LtRGrMwk0TYE' \ --data-raw '{ "amount": 12345, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 12345, "customer_id": "abcdfe", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "debit", "payment_method_data": { "card": { "card_number": "4917610000000000", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "card_cvc": "739" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" } }' ``` -Response ``` { "payment_id": "pay_25AHqTxE1luViOJtmCu5", "merchant_id": "postman_merchant_GHAction_e8a47dab-c2e9-47ef-8a91-a48635f71ce5", "status": "succeeded", "amount": 12345, "net_amount": 12345, "shipping_cost": null, "amount_capturable": 0, "amount_received": 12345, "connector": "worldpay", "client_secret": "pay_25AHqTxE1luViOJtmCu5_secret_s32GKSm4PjQc4zpVPMiX", "created": "2025-05-15T12:37:58.132Z", "currency": "USD", "customer_id": "abcdfe", "customer": { "id": "abcdfe", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "0000", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "491761", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "abcdfe", "created_at": 1747312678, "expires": 1747316278, "secret": "epk_ec24ac5e66464278803a4c1dde2e9222" }, "manual_retry_allowed": false, "connector_transaction_id": "eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT6h+lbqfJa+1BSoKFSY8HL3:Tpogxng2CfR4suZ0BadXLKtk0Qq+VdxvEKmiG66C1BMj22Q8mqp+GdNtOOwjHFKehJNZz0urTs8IkF9iA18O1al9kEkFIu2H2OhX:2:zorW66yFNGsWi87tzkRENLR8ix3NBfHPU2KlzlyTrmR0mwasA4zRNlfY:bG7Aaa:GaUgn8jvCNhmdUlN6uDEfAu3+Gpx8cadeYO0VLI6Wl9ItPQQ4uEWtdK2eQhGhjXv4:b+hCjRbIf5TaaBZ7lNykV74q79FFmYaJUU5c653i+Zy+WwXVvDoxGmrxlJztOw0ZGhpBnafkmtr87KRkF2Hgo", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "980c0ecd-c852-4c1d-a9a6-360d62603074", "payment_link": null, "profile_id": "pro_h8hgkqbVCGEK8MyOnVaL", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_wpyfUNuvetffMg1uwbMv", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-15T12:52:58.132Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-15T12:37:59.805Z", "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 } ``` ### WELLSFARGO **Card(Credit)** -Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_0NOp4TLj6uRWn6OHHIlkjMgmPPPOlqAmaB6ZjeKLFangy25qjRWiWptl5n77kbmV' \ --data-raw '{ "amount": 12345, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 12345, "customer_id": "abcdfe", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4917610000000000", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "card_cvc": "739" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" } }' ``` -Response ``` { "payment_id": "pay_deDEDrQjPUQwzd3IdXzJ", "merchant_id": "postman_merchant_GHAction_fc8bb43f-52ec-4650-8eff-b9b265bac10e", "status": "succeeded", "amount": 12345, "net_amount": 12345, "shipping_cost": null, "amount_capturable": 0, "amount_received": 12345, "connector": "wellsfargo", "client_secret": "pay_deDEDrQjPUQwzd3IdXzJ_secret_d1oz1MWIXIGtGLESHzqX", "created": "2025-05-16T05:45:17.431Z", "currency": "USD", "customer_id": "abcdfe", "customer": { "id": "abcdfe", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "0000", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "491761", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "payment_checks": { "avs_response": { "code": "Y", "codeRaw": "Y" }, "card_verification": { "resultCode": "M", "resultCodeRaw": "M" } }, "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": "[email protected]", "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": "abcdfe", "created_at": 1747374317, "expires": 1747377917, "secret": "epk_d7f9ccabfdf54b9b8aa3dfe0ba44ce92" }, "manual_retry_allowed": false, "connector_transaction_id": "7473743176986359504806", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_deDEDrQjPUQwzd3IdXzJ_1", "payment_link": null, "profile_id": "pro_4kYBY5XPiQLdOCQMOoNA", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_PDi685cMHPyFvYTGVPEQ", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-16T06:00:17.431Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-16T05:45:18.676Z", "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 } ``` **Card(Debit)** -Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_0NOp4TLj6uRWn6OHHIlkjMgmPPPOlqAmaB6ZjeKLFangy25qjRWiWptl5n77kbmV' \ --data-raw '{ "amount": 12345, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 12345, "customer_id": "abcdfe", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "debit", "payment_method_data": { "card": { "card_number": "4917610000000000", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "card_cvc": "739" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" } }' ``` -Response ``` { "payment_id": "pay_usd7OiZOJa55V2ze0nYL", "merchant_id": "postman_merchant_GHAction_fc8bb43f-52ec-4650-8eff-b9b265bac10e", "status": "succeeded", "amount": 12345, "net_amount": 12345, "shipping_cost": null, "amount_capturable": 0, "amount_received": 12345, "connector": "wellsfargo", "client_secret": "pay_usd7OiZOJa55V2ze0nYL_secret_1miOHzueRY3p9Qd12fPm", "created": "2025-05-16T05:46:54.074Z", "currency": "USD", "customer_id": "abcdfe", "customer": { "id": "abcdfe", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "0000", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "491761", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "John Smith", "payment_checks": { "avs_response": { "code": "Y", "codeRaw": "Y" }, "card_verification": { "resultCode": "M", "resultCodeRaw": "M" } }, "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": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "abcdfe", "created_at": 1747374414, "expires": 1747378014, "secret": "epk_02d3e13eb4874dd88b59c4b5d8bd6712" }, "manual_retry_allowed": false, "connector_transaction_id": "7473744151326397904806", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_usd7OiZOJa55V2ze0nYL_1", "payment_link": null, "profile_id": "pro_4kYBY5XPiQLdOCQMOoNA", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_PDi685cMHPyFvYTGVPEQ", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-16T06:01:54.074Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-16T05:46:56.008Z", "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 } ``` ## 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/cashtocode.rs` - `crates/hyperswitch_connectors/src/connectors/deutschebank.rs` - `crates/hyperswitch_connectors/src/connectors/multisafepay.rs` - ... and 2 more files **2. Tests** - `config/deployments/integration_test.toml` **3. Configuration Files** - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - `config/development.toml` - ... and 1 more files **Code Patterns Applied:** - Implement new functions (12 changes) - Extend existing types with new fields (105 changes) **Detailed Identifier Changes:** Commit 8c77da7a: Files to modify: **crates/hyperswitch_connectors/src/connectors/cashtocode.rs** Remove: - function: private::validate_connector_against_payment_request - impl: impl ConnectorValidation for Cashtocode - impl: impl ConnectorSpecifications for Cashtocode Add: - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl ConnectorValidation for Cashtocode - impl: impl ConnectorSpecifications for Cashtocode **crates/hyperswitch_connectors/src/connectors/deutschebank.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/multisafepay.rs** Remove: - function: private::validate_connector_against_payment_request - impl: impl ConnectorSpecifications for Multisafepay Add: - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl ConnectorSpecifications for Multisafepay **crates/hyperswitch_connectors/src/connectors/wellsfargo.rs** Remove: - function: private::validate_connector_against_payment_request - impl: impl ConnectorSpecifications for Wellsfargo Add: - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl ConnectorSpecifications for Wellsfargo **crates/hyperswitch_connectors/src/connectors/worldpay.rs** Remove: - function: private::validate_connector_against_payment_request - impl: impl ConnectorSpecifications for Worldpay Add: - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl ConnectorSpecifications for Worldpay
{"pr_number": 7149, "pr_title": "feat(connector): [MULTISAFEPAY, CASHTOCODE, WORLDPAY, WELLSFARGO] Supported features for feature matrix", "merged_at": "2025-04-30T09:31:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/cashtocode.rs", "crates/hyperswitch_connectors/src/connectors/deutschebank.rs", "crates/hyperswitch_connectors/src/connectors/multisafepay.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo.rs", "crates/hyperswitch_connectors/src/connectors/worldpay.rs"], "tests": ["config/deployments/integration_test.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"functions_added": 12, "fields_added": 105, "imports_added": 9}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(router): [Cybersource] add flag to indicate final capture ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Added flag to the CyberSource capture call to indicate the final capture in cases of manual capture. This flag has been incorporated into the CyberSource capture request body to ensure the issuer bank is informed appropriately. ## How did you test 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 with cybersource ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key:*******' \ --data-raw '{ "amount": 1000, "currency": "USD", "confirm": true, "capture_method": "manual", "customer_id": "cust_no_pm", "authentication_type": "no_three_ds", "email": "[email protected]", "payment_method": "card", "payment_method_type": "debit", "payment_method_data": { "card": { "card_number": "4917 6100 0000 0000", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "joseph Doe", "card_cvc": "737" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } }' ``` Response ``` { "payment_id": "pay_lNsJx0F1KfljeOpelS9S", "merchant_id": "postman_merchant_GHAction_0960f2ad-f7eb-40b6-b26e-76f7b2c8a314", "status": "requires_capture", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 1000, "amount_received": null, "connector": "cybersource", "client_secret": "pay_lNsJx0F1KfljeOpelS9S_secret_smChi9KPNC8npC6RrMRM", "created": "2025-01-22T05:59:00.160Z", "currency": "USD", "customer_id": "cust_no_pm", "customer": { "id": "cust_no_pm", "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "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": "30", "card_holder_name": "joseph Doe", "payment_checks": { "avs_response": { "code": "Y", "codeRaw": "Y" }, "card_verification": null }, "authentication_data": null }, "billing": null }, "payment_token": "token_X2vJwiKJaVZGGBlHyCAl", "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": "[email protected]", "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cust_no_pm", "created_at": 1737525540, "expires": 1737529140, "secret": "epk_ee0b15d3ac32418c85bc7db03112c46c" }, "manual_retry_allowed": false, "connector_transaction_id": "7375255413326173904805", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_lNsJx0F1KfljeOpelS9S_1", "payment_link": null, "profile_id": "pro_fuk87m6LvjQtft86rwDM", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_iFThtaTcJgCADiOBnpnG", "incremental_authorization_allowed": true, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-01-22T06:14:00.160Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-01-22T05:59:02.003Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` Capture call ``` curl --location 'http://localhost:8080/payments/pay_lNsJx0F1KfljeOpelS9S/capture' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key:******8' \ --data '{ "amount_to_capture": 1000, "statement_descriptor_name": "Joseph", "statement_descriptor_suffix": "JS" }' ``` Response ``` { "payment_id": "pay_lNsJx0F1KfljeOpelS9S", "merchant_id": "postman_merchant_GHAction_0960f2ad-f7eb-40b6-b26e-76f7b2c8a314", "status": "processing", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 1000, "amount_received": null, "connector": "cybersource", "client_secret": "pay_lNsJx0F1KfljeOpelS9S_secret_smChi9KPNC8npC6RrMRM", "created": "2025-01-22T05:59:00.160Z", "currency": "USD", "customer_id": "cust_no_pm", "customer": { "id": "cust_no_pm", "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "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": "30", "card_holder_name": "joseph Doe", "payment_checks": { "avs_response": { "code": "Y", "codeRaw": "Y" }, "card_verification": null }, "authentication_data": null }, "billing": null }, "payment_token": "token_X2vJwiKJaVZGGBlHyCAl", "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": "[email protected]", "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "7377201269126748303954", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_lNsJx0F1KfljeOpelS9S_1", "payment_link": null, "profile_id": "pro_fuk87m6LvjQtft86rwDM", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_iFThtaTcJgCADiOBnpnG", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-01-22T06:14:00.160Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-01-22T05:59:08.242Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` ![Screenshot 2025-01-27 at 1 17 13 PM](https://github.com/user-attachments/assets/e9af38f6-0c92-43fc-a41e-f84aa33b77d9) Psync ``` curl --location 'http://localhost:8080/payments/pay_78YAFiVnkKgXA0j3xTjc?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_6kiThdH4P6mBBPHdwXYItx4btqxOFYkIMlOnnuhm2Mf3y3puFoZsi8pt3hIm4BJq' ``` Response ``` { "payment_id": "pay_78YAFiVnkKgXA0j3xTjc", "merchant_id": "postman_merchant_GHAction_dfe9803e-7fd8-473e-89d6-9fbf749f1f1f", "status": "succeeded", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 0, "amount_received": 1000, "connector": "cybersource", "client_secret": "pay_78YAFiVnkKgXA0j3xTjc_secret_q1IxnrvhYEjKVC7y0wM9", "created": "2025-01-24T12:01:59.112Z", "currency": "USD", "customer_id": "cust_no_pm", "customer": { "id": "cust_no_pm", "name": "박 성 준", "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "joseph Doe", "payment_checks": { "avs_response": { "code": "Y", "codeRaw": "Y" }, "card_verification": null }, "authentication_data": null }, "billing": null }, "payment_token": "token_lRVuuoX4WGATxCGmBEoQ", "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "박성준", "last_name": "박성준" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "[email protected]", "name": "박 성 준", "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "7377201269126748303954", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_78YAFiVnkKgXA0j3xTjc_1", "payment_link": null, "profile_id": "pro_oEimuIUyzLP64DhYs9uv", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_pijohfcR2jaEvPLtc1mQ", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-01-24T12:16:59.112Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-01-27T07:50:54.314Z", "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 **payment** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` **Code Patterns Applied:** - Extend existing types with new fields (1 changes) **Detailed Identifier Changes:** Commit 55bb284b: Files to modify: **crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs** Modify existing code
{"pr_number": 7085, "pr_title": "fix(router): [Cybersource] add flag to indicate final capture ", "merged_at": "2025-02-04T01:21:48Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connectors): [Tesouro] Integrate no-threeds cards ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Implemented payment method: Card no-3ds Implemented Flows 1. Authorization 2. Capture 3. Void 4. Refund 5. Psync 6. Rsync ## How did you test 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 </summary> ```sh curl --location 'http://localhost:8080/account/postman_merchant_GHAction_4cb4b491-da52-43a7-8fff-360261ebd79c/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_8XGtpjTSBeWNmsMy7KR8pdMkGBcvRI6OhCMmzxQcAVj8yjZ8Gp7MCjtNZyJWeFSx' \ --data '{ "connector_type": "payment_processor", "business_country": "US", "business_label": "default", "connector_name": "tesouro", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "nTEAZfcT**********", "api_secret": "4T4su51E2FbR**************/", "key1": "a82c239a-54a7-403f**************" }, "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 } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "skrill", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": false, "installment_payment_enabled": false } ] }, { "payment_method": "bank_redirect", "payment_method_types": [ { "payment_method_type": "interac", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "gift_card", "payment_method_types": [ { "payment_method_type": "pay_safe_card", "payment_experience": "invoke_sdk_client", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], }' ``` Response ```json { "connector_type": "payment_processor", "connector_name": "tesouro", "connector_label": "tesouro_US_default", "merchant_connector_id": "mca_M3Q1V50G2ytWac7zWmOF", "profile_id": "pro_eKnWPC646SRcs9KRGG0n", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "nT***********************ow", "key1": "a8********************************d3", "api_secret": "4T************************************f/" }, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "debit", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "apple_pay", "payment_experience": "invoke_sdk_client", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "google_pay", "payment_experience": "invoke_sdk_client", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "skrill", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": false, "installment_payment_enabled": false } ] }, { "payment_method": "bank_redirect", "payment_method_types": [ { "payment_method_type": "interac", "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": "gift_card", "payment_method_types": [ { "payment_method_type": "pay_safe_card", "payment_experience": "invoke_sdk_client", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "connector_webhook_details": null, "metadata": null, "test_mode": false, "disabled": false, "frm_configs": null, "business_country": "US", "business_label": "default", "business_sub_label": null, "applepay_verified_domains": null, "pm_auth_config": null, "status": "active", "additional_merchant_data": null, "connector_wallets_details": null } ``` </details> <details> <summary> Automatic no 3ds Card payment and Refund </summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_CK71LxQKH9Ca9ALpjDMLqTvPdsyUMWegZaSZl2GPErwxQffyESKr0PTWfRtBiHRL' \ --data-raw '{ "amount": 100, "currency": "USD", "confirm": true, "capture_method": "automatic", "email": "[email protected]", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "10", "card_exp_year": "25", "card_cvc": "1111" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" }, "billing": { "address": { "zip": "560095", "country": "CA", "state": "ab", "line2": "Fasdf", "city": "Fasdf" } } }' ``` Response ```json { "payment_id": "pay_SVsgv5wtaqOdSpb76MVI", "merchant_id": "postman_merchant_GHAction_9f0a82e1-b575-4a82-933e-2c7ac56d04a8", "status": "succeeded", "amount": 100, "net_amount": 100, "shipping_cost": null, "amount_capturable": 0, "amount_received": 100, "connector": "tesouro", "client_secret": "pay_SVsgv5wtaqOdSpb76MVI_secret_ukZI5V7J8cUQsghCx9Be", "created": "2025-10-01T05:33:30.915Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": null, "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "CA", "line1": null, "line2": "Fasdf", "line3": null, "zip": "560095", "state": "ab", "first_name": null, "last_name": null, "origin_zip": null }, "phone": null, "email": null }, "order_details": null, "email": null, "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "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": "2a65a3e0-9e88-11f0-9a42-dc24789d2db7", "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_Za2p72f3BBR1hq7Y1RSc", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_r0WktD3si60vWLU2A0fP", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-10-01T05:48:30.915Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-10-01T05:33:31.364Z", "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": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null, "enable_overcapture": null, "is_overcapture_enabled": null, "network_details": null } ``` Refund the transaction ``` curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_CK71LxQKH9Ca9ALpjDMLqTvPdsyUMWegZaSZl2GPErwxQffyESKr0PTWfRtBiHRL' \ --data '{ "payment_id": "pay_SVsgv5wtaqOdSpb76MVI", "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response ```json { "refund_id": "ref_BH1KVGCPkjKW6jKtLpWN", "payment_id": "pay_SVsgv5wtaqOdSpb76MVI", "amount": 100, "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-10-01T05:35:46.545Z", "updated_at": "2025-10-01T05:35:48.609Z", "connector": "tesouro", "profile_id": "pro_Za2p72f3BBR1hq7Y1RSc", "merchant_connector_id": "mca_r0WktD3si60vWLU2A0fP", "split_refunds": null, "issuer_error_code": null, "issuer_error_message": null } ``` Rsync ``` curl --location 'http://localhost:8080/refunds/ref_BH1KVGCPkjKW6jKtLpWN' \ --header 'Accept: application/json' \ --header 'api-key: dev_CK71LxQKH9Ca9ALpjDMLqTvPdsyUMWegZaSZl2GPErwxQffyESKr0PTWfRtBiHRL' ``` Response ```json { "refund_id": "ref_BH1KVGCPkjKW6jKtLpWN", "payment_id": "pay_SVsgv5wtaqOdSpb76MVI", "amount": 100, "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-10-01T05:35:46.545Z", "updated_at": "2025-10-01T05:36:42.990Z", "connector": "tesouro", "profile_id": "pro_Za2p72f3BBR1hq7Y1RSc", "merchant_connector_id": "mca_r0WktD3si60vWLU2A0fP", "split_refunds": null, "issuer_error_code": null, "issuer_error_message": null } ``` </details> <details> <summary>Manual Payment and Capture </summary> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_CK71LxQKH9Ca9ALpjDMLqTvPdsyUMWegZaSZl2GPErwxQffyESKr0PTWfRtBiHRL' \ --data-raw '{ "amount": 100, "currency": "USD", "confirm": true, "capture_method": "manual", "email": "[email protected]", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "10", "card_exp_year": "25", "card_cvc": "1111" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" }, "billing": { "address": { "zip": "560095", "country": "CA", "state": "ab", "line2": "Fasdf", "city": "Fasdf" } } }' ``` Response ```json { "payment_id": "pay_OZP40FmatEF5cs67oZiX", "merchant_id": "postman_merchant_GHAction_9f0a82e1-b575-4a82-933e-2c7ac56d04a8", "status": "requires_capture", "amount": 100, "net_amount": 100, "shipping_cost": null, "amount_capturable": 100, "amount_received": null, "connector": "tesouro", "client_secret": "pay_OZP40FmatEF5cs67oZiX_secret_8H4Yrw0NUSU8Cbzq2s9j", "created": "2025-10-01T06:07:43.490Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": null, "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "CA", "line1": null, "line2": "Fasdf", "line3": null, "zip": "560095", "state": "ab", "first_name": null, "last_name": null, "origin_zip": null }, "phone": null, "email": null }, "order_details": null, "email": null, "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "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": "f1bde650-9e8c-11f0-b70a-028553774ff4", "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_Za2p72f3BBR1hq7Y1RSc", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_r0WktD3si60vWLU2A0fP", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-10-01T06:22:43.490Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-10-01T06:07:43.817Z", "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": "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 } ``` Capture ```sh curl --location 'http://localhost:8080/payments/pay_OZP40FmatEF5cs67oZiX/capture' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_CK71LxQKH9Ca9ALpjDMLqTvPdsyUMWegZaSZl2GPErwxQffyESKr0PTWfRtBiHRL' \ --data '{ "amount_to_capture": 10 }' ``` Response ``` { "payment_id": "pay_OZP40FmatEF5cs67oZiX", "merchant_id": "postman_merchant_GHAction_9f0a82e1-b575-4a82-933e-2c7ac56d04a8", "status": "partially_captured", "amount": 100, "net_amount": 100, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10, "connector": "tesouro", "client_secret": "pay_OZP40FmatEF5cs67oZiX_secret_8H4Yrw0NUSU8Cbzq2s9j", "created": "2025-10-01T06:07:43.490Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": null, "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "CA", "line1": null, "line2": "Fasdf", "line3": null, "zip": "560095", "state": "ab", "first_name": null, "last_name": null, "origin_zip": null }, "phone": null, "email": null }, "order_details": null, "email": null, "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "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": "151c88db-9e8d-11f0-b47c-e0f5e6f853d2", "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_Za2p72f3BBR1hq7Y1RSc", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_r0WktD3si60vWLU2A0fP", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-10-01T06:22:43.490Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-10-01T06:08:43.141Z", "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": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null, "enable_overcapture": null, "is_overcapture_enabled": null, "network_details": null } ``` </details> <details> <summary>Manual Capture and Void </summary> ```sh curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_CK71LxQKH9Ca9ALpjDMLqTvPdsyUMWegZaSZl2GPErwxQffyESKr0PTWfRtBiHRL' \ --data-raw '{ "amount": 100, "currency": "USD", "confirm": true, "capture_method": "manual", "email": "[email protected]", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "10", "card_exp_year": "25", "card_cvc": "1111" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" }, "billing": { "address": { "zip": "560095", "country": "CA", "state": "ab", "line2": "Fasdf", "city": "Fasdf" } } }' ``` Response ```json { "payment_id": "pay_pSZnmh27wWa0DL3kj6A6", "merchant_id": "postman_merchant_GHAction_9f0a82e1-b575-4a82-933e-2c7ac56d04a8", "status": "requires_capture", "amount": 100, "net_amount": 100, "shipping_cost": null, "amount_capturable": 100, "amount_received": null, "connector": "tesouro", "client_secret": "pay_pSZnmh27wWa0DL3kj6A6_secret_lZpYQsWHUWSrZ9U6altL", "created": "2025-10-01T06:10:29.198Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": null, "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "CA", "line1": null, "line2": "Fasdf", "line3": null, "zip": "560095", "state": "ab", "first_name": null, "last_name": null, "origin_zip": null }, "phone": null, "email": null }, "order_details": null, "email": null, "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "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": "549579c0-9e8d-11f0-84dd-40baeaafcfb0", "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_Za2p72f3BBR1hq7Y1RSc", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_r0WktD3si60vWLU2A0fP", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-10-01T06:25:29.198Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-10-01T06:10:29.617Z", "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": "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 } ``` Void ```sh curl --location 'http://localhost:8080/payments/pay_pSZnmh27wWa0DL3kj6A6/cancel' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_CK71LxQKH9Ca9ALpjDMLqTvPdsyUMWegZaSZl2GPErwxQffyESKr0PTWfRtBiHRL' \ --data '{"cancellation_reason":"requested_by_customer"}' ``` Response ```json { "payment_id": "pay_pSZnmh27wWa0DL3kj6A6", "merchant_id": "postman_merchant_GHAction_9f0a82e1-b575-4a82-933e-2c7ac56d04a8", "status": "processing", "amount": 100, "net_amount": 100, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "tesouro", "client_secret": "pay_pSZnmh27wWa0DL3kj6A6_secret_lZpYQsWHUWSrZ9U6altL", "created": "2025-10-01T06:10:29.198Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": null, "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "CA", "line1": null, "line2": "Fasdf", "line3": null, "zip": "560095", "state": "ab", "first_name": null, "last_name": null, "origin_zip": null }, "phone": null, "email": null }, "order_details": null, "email": null, "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": "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": null, "connector_transaction_id": "78a30d77-9e8d-11f0-83af-ca1c1383be41", "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_Za2p72f3BBR1hq7Y1RSc", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_r0WktD3si60vWLU2A0fP", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-10-01T06:25:29.198Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-10-01T06:11:30.100Z", "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": "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 } ``` Psync ``` curl --location 'http://localhost:8080/payments/pay_pSZnmh27wWa0DL3kj6A6?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_CK71LxQKH9Ca9ALpjDMLqTvPdsyUMWegZaSZl2GPErwxQffyESKr0PTWfRtBiHRL' ``` Response ```json { "payment_id": "pay_pSZnmh27wWa0DL3kj6A6", "merchant_id": "postman_merchant_GHAction_9f0a82e1-b575-4a82-933e-2c7ac56d04a8", "status": "cancelled", "amount": 100, "net_amount": 100, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "tesouro", "client_secret": "pay_pSZnmh27wWa0DL3kj6A6_secret_lZpYQsWHUWSrZ9U6altL", "created": "2025-10-01T06:10:29.198Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": null, "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "CA", "line1": null, "line2": "Fasdf", "line3": null, "zip": "560095", "state": "ab", "first_name": null, "last_name": null, "origin_zip": null }, "phone": null, "email": null }, "order_details": null, "email": null, "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": "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": null, "connector_transaction_id": "78a30d77-9e8d-11f0-83af-ca1c1383be41", "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_Za2p72f3BBR1hq7Y1RSc", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_r0WktD3si60vWLU2A0fP", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-10-01T06:25:29.198Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-10-01T06:12:05.583Z", "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": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null, "enable_overcapture": null, "is_overcapture_enabled": null, "network_details": null } ``` </details> > Note: Due to fast execution of cypress testcases, connector randomly returns processing status - causing some Testcases to fail randomly. <img width="621" height="635" alt="Screenshot 2025-10-01 at 11 43 45 AM" src="https://github.com/user-attachments/assets/613be43b-d154-455a-8a95-b2bec65220ef" /> ## 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/connector_validation.rs` **2. External Connector Integration** - `crates/common_enums/src/connector_enums.rs` - `crates/connector_configs/src/connector.rs` - `crates/connector_configs/toml/development.toml` - ... and 7 more files **3. Type Definitions** - `crates/router/src/types/api/feature_matrix.rs` **4. Tests** - `config/deployments/integration_test.toml` - `cypress-tests/cypress/e2e/configs/Payment/Tesouro.js` - `cypress-tests/cypress/e2e/configs/Payment/Utils.js` **5. Configuration Files** - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - `config/development.toml` - ... and 1 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 (39 changes) - Implement new functions (38 changes) - Extend existing types with new fields (890 changes) - Add conditional logic for feature flags or filtering (12 changes) **Detailed Identifier Changes:** Commit fbd92fa1: 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/tesouro.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs** Remove: - function: private::try_from - struct: pub::TesouroPaymentsRequest Add: - function: private::get_acceptor_id - function: private::try_from - function: private::get_payment_attempt_status - function: private::try_from - function: private::try_from - function: private::try_from - struct: pub::GenericTesouroRequest - struct: pub::TesouroApiResponseData - struct: pub::TransactionResponseData - struct: pub::TesouroCaptureResponseData - struct: pub::CaptureCustomerInitiatedTransactionResponseData - struct: pub::TesouroVoidResponseData - struct: pub::ReverseTransactionResponseData - struct: pub::RefundTransactionResponseData - struct: pub::TesouroRefundPreviousPaymentResponseData - struct: pub::TesouroSyncResponseData - struct: pub::TesouroPaymentTransactionResponse - enum: pub::TesouroApiResponse - enum: pub::CaptureTransactionResponseType - enum: pub::ReverseTransactionResponseType - enum: pub::RefundTransactionResponseType - enum: pub::TesouroSyncStatus - impl: impl TesouroAuthType - impl: impl TryFrom<ResponseRouterData<F, TesouroVoidResponse, PaymentsCancelData, PaymentsResponseData>> for RouterData<F, PaymentsCancelData, PaymentsResponseData> - impl: impl TryFrom<ResponseRouterData<F, TesouroSyncResponse, PaymentsSyncData, PaymentsResponseData>> for RouterData<F, PaymentsSyncData, PaymentsResponseData> - impl: impl TryFrom<&RefundSyncRouterData> for TesouroSyncRequest - impl: impl TryFrom<RefundsResponseRouterData<RSync, TesouroSyncResponse>> for RefundsRouterData<RSync> - mod: pub::tesouro_queries - mod: pub::tesouro_constants **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": 9632, "pr_title": "feat(connectors): [Tesouro] Integrate no-threeds cards", "merged_at": "2025-10-01T13:05:07Z", "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/tesouro.rs", "crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/src/types/connector_transformers.rs"], "types": ["crates/router/src/types/api/feature_matrix.rs"], "tests": ["config/deployments/integration_test.toml", "cypress-tests/cypress/e2e/configs/Payment/Tesouro.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js"], "config": ["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": 39, "functions_added": 38, "enums_added": 12, "fields_added": 890, "imports_added": 5, "conditionals_added": 12}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connectors): [Redsys] add 3D secure card payment support, including transaction capture, cancellation, and refunds ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> In this PR 1. A new next action is added ```json "next_action": { "type": "invoke_hidden_iframe", "iframe_data": { "method_key": "threeDSMethodData", "three_ds_method_url": "https://sis-d.redsys.es/sis-simulador-web/threeDsMethod.jsp", "three_ds_method_data_submission": true, "three_ds_method_data": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6Imh0dHBzOi8vc2lzLWQucmVkc3lzLmVzL3Npcy1zaW11bGFkb3Itd2ViL3RocmVlRHNNZXRob2QuanNwIiwidGhyZWVEU01ldGhvZE5vdGlmaWNhdGlvblVSTCI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MC93ZWJob29rcy9wb3N0bWFuX21lcmNoYW50X0dIQWN0aW9uX2VkMzczYmQzLTM4MGYtNDAyNi1hZGY3LTNiN2I2MzAwOGFhNy9tY2FfYUI2Tk9BdXk4cEpLV2ZPd1NUaUcifQ==", "directory_server_id": "e8a57182-7192-474f-8808-e651855c0dd7", "message_version": "2.1.0" } } ``` 2. Threeds Methods completion flag is added to the payments request and is used in the complete authorize router data 3. Card 3DS Implemeneted for Redsys Redsys 3DS has 4 Scenarios -> Threeds Invoke + Challenge (Card number to trigger - 4918019199883839) -> Threeds Invoke + Frictionless (Card number to trigger - 4918019160034602) -> Challenge (Card number to trigger - 4548817212493017) -> Frictionless (Card number to trigger - 4548814479727229) Redsys Connector Create ``` "connector_account_details": { "auth_type": "SignatureKey", "api_key": "merchant_id", "key1": "terminal_id", "api_secret": "sha256_pwd" } ``` ## Additional Fixes Modifications have been made to ensure: 1. Preprocessing for Xendit payments will only be triggered during the PaymentsAuthorize call. 2. If a payment method is supported by the connector and the payment_method_type for the transaction is unspecified (None), the payment method will be regarded as supported by the connector. 3. Signals feature is removed from `hyperswitch_connector` crate ## How is this next action different form ThreedsInvoke In ThreedsInvoke, after invoking an iframe. The front end, has to call two other APIs to complete the payment. This next action only requires calling complete_authorize API ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables ## Points to Ponder -> All statuses from redsys is not completely handled. (Waiting on clarity) -> Psync and Rsync are not implemented. (Waiting on clarity) ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> <details> <summary>Redsys Connector Create</summary> ```json { "connector_type": "payment_processor", "connector_name": "redsys", "business_country": "US", "business_label": "default", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "**********************", "key1": "****", "api_secret": "***********" }, "test_mode": false, "disabled": false, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "debit", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "apple_pay", "payment_experience": "invoke_sdk_client", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "google_pay", "payment_experience": "invoke_sdk_client", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ] } ``` Response ```json {"connector_type":"payment_processor","connector_name":"redsys","connector_label":"redsys_US_default","merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","profile_id":"pro_eOH03lBB7VBEzDNVnhEg","connector_account_details":{"auth_type":"SignatureKey","api_key":"33*****31","key1":"***","api_secret":"sq****************************J7"},"payment_methods_enabled":[{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"affirm","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"afterpay_clearpay","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"klarna","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"klarna","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"bank_redirect","payment_method_types":[{"payment_method_type":"ideal","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"bancontact_card","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"przelewy24","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"giropay","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"sofort","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"eps","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"bank_debit","payment_method_types":[{"payment_method_type":"ach","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"becs","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"sepa","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"bacs","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"bank_transfer","payment_method_types":[{"payment_method_type":"ach","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"bacs","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"sepa","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"card","payment_method_types":[{"payment_method_type":"credit","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"card","payment_method_types":[{"payment_method_type":"debit","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"wallet","payment_method_types":[{"payment_method_type":"apple_pay","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"wallet","payment_method_types":[{"payment_method_type":"google_pay","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]}],"connector_webhook_details":null,"metadata":{"google_pay":{"merchant_info":{"merchant_name":"Narayan Bhat"},"allowed_payment_methods":[{"type":"CARD","parameters":{"allowed_auth_methods":["PAN_ONLY","CRYPTOGRAM_3DS"],"allowed_card_networks":["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]},"tokenization_specification":{"type":"PAYMENT_GATEWAY","parameters":{"gateway":"example","gateway_merchant_id":""}}}]}},"test_mode":false,"disabled":false,"frm_configs":null,"business_country":"US","business_label":"default","business_sub_label":null,"applepay_verified_domains":null,"pm_auth_config":null,"status":"active","additional_merchant_data":null,"connector_wallets_details":null} ``` </details> <details> <summary>Payment Create: Frictionless </summary> ```json curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' \ --data '{ "amount": 10, "currency": "EUR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4548814479727229", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }' ``` Response ```json {"payment_id":"pay_w32cQlkoQfrpYWCvFmcv","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"succeeded","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":10,"connector":"redsys","client_secret":"pay_w32cQlkoQfrpYWCvFmcv_secret_QUBMClABR8P1ckRBrp7u","created":"2025-03-13T08:26:27.905Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"7229","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"454881","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_tff9SQ5Wzs1f8OZe9wO6","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"First_Customer","created_at":1741854387,"expires":1741857987,"secret":"epk_b0de0f8520fe4c1eaa8b819df853bdac"},"manual_retry_allowed":false,"connector_transaction_id":"581314507799","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T08:41:27.905Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:26:33.172Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual"} ``` </details> <details> <summary>Payment Create: Challenge </summary> ```json curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' \ --data '{ "amount": 10, "currency": "EUR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4548817212493017", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }' ``` Response ```json {"payment_id":"pay_qw5tcYOYHGO7RBXKrKwR","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"requires_customer_action","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"redsys","client_secret":"pay_qw5tcYOYHGO7RBXKrKwR_secret_BuQ17aZIs3UZsCyHBu0K","created":"2025-03-13T08:30:36.990Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"3017","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"454881","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_5yr2SCPsa7G4GWbID1Fm","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":{"type":"redirect_to_url","redirect_to_url":"http://localhost:8080/payments/redirect/pay_qw5tcYOYHGO7RBXKrKwR/postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7/pay_qw5tcYOYHGO7RBXKrKwR_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":"First_Customer","created_at":1741854636,"expires":1741858236,"secret":"epk_9cc0878420ec48e5af4966a15e55d3d1"},"manual_retry_allowed":null,"connector_transaction_id":"457103313984","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T08:45:36.990Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:30:41.901Z","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"} ``` -> Payments Retrieve ```json curl --location 'http://localhost:8080/payments/pay_qw5tcYOYHGO7RBXKrKwR?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' ``` Response ```json {"payment_id":"pay_qw5tcYOYHGO7RBXKrKwR","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"succeeded","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":10,"connector":"redsys","client_secret":"pay_qw5tcYOYHGO7RBXKrKwR_secret_BuQ17aZIs3UZsCyHBu0K","created":"2025-03-13T08:30:36.990Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"3017","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"454881","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_5yr2SCPsa7G4GWbID1Fm","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"457103313984","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T08:45:36.990Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:32:09.374Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual"} ``` </details> <details> <summary>Payment Create: Threeds Method + Challenge </summary> ```json curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' \ --data '{ "amount": 10, "currency": "EUR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4918019199883839", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }' ``` ```json {"payment_id":"pay_VItcgnob8449Uq87QKZw","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"requires_customer_action","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"redsys","client_secret":"pay_VItcgnob8449Uq87QKZw_secret_Uatpvz6pE9paD5qG0GmJ","created":"2025-03-13T08:34:16.189Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"3839","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"491801","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_bTLziwNEXrBt6NvcBgOf","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":{"type":"invoke_hidden_iframe","iframe_data":{"method_key":"threeDSMethodData","three_ds_method_url":"https://sis-d.redsys.es/sis-simulador-web/threeDsMethod.jsp","three_ds_method_data_submission":true,"three_ds_method_data":"eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6Imh0dHBzOi8vc2lzLWQucmVkc3lzLmVzL3Npcy1zaW11bGFkb3Itd2ViL3RocmVlRHNNZXRob2QuanNwIiwidGhyZWVEU01ldGhvZE5vdGlmaWNhdGlvblVSTCI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MC93ZWJob29rcy9wb3N0bWFuX21lcmNoYW50X0dIQWN0aW9uX2VkMzczYmQzLTM4MGYtNDAyNi1hZGY3LTNiN2I2MzAwOGFhNy9tY2FfYUI2Tk9BdXk4cEpLV2ZPd1NUaUcifQ==","directory_server_id":"e8a57182-7192-474f-8808-e651855c0dd7","message_version":"2.1.0"}},"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"First_Customer","created_at":1741854856,"expires":1741858456,"secret":"epk_2097ff4011804a1c87c04565b3d33189"},"manual_retry_allowed":null,"connector_transaction_id":"506037405236","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T08:49:16.189Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:34:17.309Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual"} ``` Create an iframe from these details and then obtain the value for threeds_method_comp_ind then call -> Complete Auth ```json curl --location 'http://localhost:8080/payments/pay_VItcgnob8449Uq87QKZw/complete_authorize' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_ed8b0f1fb0b44c66a7fd1dc560995d04' \ --data '{ "threeds_method_comp_ind": "Y", "client_secret": "pay_VItcgnob8449Uq87QKZw_secret_Uatpvz6pE9paD5qG0GmJ" }' ``` Response ```json {"payment_id":"pay_VItcgnob8449Uq87QKZw","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"requires_customer_action","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"redsys","client_secret":"pay_VItcgnob8449Uq87QKZw_secret_Uatpvz6pE9paD5qG0GmJ","created":"2025-03-13T08:34:16.189Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"3839","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"491801","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_bTLziwNEXrBt6NvcBgOf","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":{"type":"redirect_to_url","redirect_to_url":"http://localhost:8080/payments/redirect/pay_VItcgnob8449Uq87QKZw/postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7/pay_VItcgnob8449Uq87QKZw_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":null,"manual_retry_allowed":null,"connector_transaction_id":"506037405236","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T08:49:16.189Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:37:43.149Z","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"} ``` -> Payments Retrieve ```json curl --location 'http://localhost:8080/payments/pay_VItcgnob8449Uq87QKZw?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' ``` Response ``` {"payment_id":"pay_VItcgnob8449Uq87QKZw","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"succeeded","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":10,"connector":"redsys","client_secret":"pay_VItcgnob8449Uq87QKZw_secret_Uatpvz6pE9paD5qG0GmJ","created":"2025-03-13T08:34:16.189Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"3839","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"491801","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_bTLziwNEXrBt6NvcBgOf","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"506037405236","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T08:49:16.189Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:37:57.180Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual"} ``` </details> <details> <summary>Threeds Method : Frictionless </summary> ```json curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' \ --data '{ "amount": 10, "currency": "EUR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4918019160034602", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }' ``` Response ```json {"payment_id":"pay_HVfveIgQwggMODsNmAkV","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"requires_customer_action","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"redsys","client_secret":"pay_HVfveIgQwggMODsNmAkV_secret_b4VuuSEVprws2M6G9eMz","created":"2025-03-13T08:40:59.019Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"4602","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"491801","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_XfL6fPhyIm8vh5KESUQI","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":{"type":"invoke_hidden_iframe","iframe_data":{"method_key":"threeDSMethodData","three_ds_method_url":"https://sis-d.redsys.es/sis-simulador-web/threeDsMethod.jsp","three_ds_method_data_submission":true,"three_ds_method_data":"eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6Imh0dHBzOi8vc2lzLWQucmVkc3lzLmVzL3Npcy1zaW11bGFkb3Itd2ViL3RocmVlRHNNZXRob2QuanNwIiwidGhyZWVEU01ldGhvZE5vdGlmaWNhdGlvblVSTCI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MC93ZWJob29rcy9wb3N0bWFuX21lcmNoYW50X0dIQWN0aW9uX2VkMzczYmQzLTM4MGYtNDAyNi1hZGY3LTNiN2I2MzAwOGFhNy9tY2FfYUI2Tk9BdXk4cEpLV2ZPd1NUaUcifQ==","directory_server_id":"a4ca6fb2-ddba-456b-a352-8a7550353974","message_version":"2.1.0"}},"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"First_Customer","created_at":1741855258,"expires":1741858858,"secret":"epk_bda97529ec5f4ce0a5e78ecf23e29479"},"manual_retry_allowed":null,"connector_transaction_id":"917303044435","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T08:55:59.019Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:41:00.075Z","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"} ``` -> Complete Authorize ```json curl --location 'http://localhost:8080/payments/pay_HVfveIgQwggMODsNmAkV/complete_authorize' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_87e0e03839214e2b991420b109984637' \ --data '{ "threeds_method_comp_ind": "Y", "client_secret": "pay_HVfveIgQwggMODsNmAkV_secret_b4VuuSEVprws2M6G9eMz" }' ``` Response ```json {"payment_id":"pay_HVfveIgQwggMODsNmAkV","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"succeeded","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":10,"connector":"redsys","client_secret":"pay_HVfveIgQwggMODsNmAkV_secret_b4VuuSEVprws2M6G9eMz","created":"2025-03-13T08:40:59.019Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"4602","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"491801","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_XfL6fPhyIm8vh5KESUQI","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"917303044435","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T08:55:59.019Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:42:17.894Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual"} ``` </details> <details> <summary>Manual Capture </summary> ```json curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' \ --data '{ "amount": 10, "currency": "EUR", "confirm": true, "capture_method": "manual", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4548814479727229", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }' ``` Response ```json {"payment_id":"pay_qcZiVdQQn7f6MGCZtZBf","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"requires_capture","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"redsys","client_secret":"pay_qcZiVdQQn7f6MGCZtZBf_secret_OcJOMyRHrIVtbngWXLYr","created":"2025-03-13T08:44:24.672Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"7229","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"454881","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_lEr4y3EaJ6Re7374wHU1","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"First_Customer","created_at":1741855464,"expires":1741859064,"secret":"epk_71e44d9e722e4f648bcd5feac33be76a"},"manual_retry_allowed":false,"connector_transaction_id":"422121527515","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T08:59:24.672Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:44:29.165Z","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"} ``` -> Capture ```json curl --location 'http://localhost:8080/payments/pay_qcZiVdQQn7f6MGCZtZBf/capture' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' \ --data '{ "amount_to_capture": 5, "statement_descriptor_name": "Joseph", "statement_descriptor_suffix": "JS" }' ``` Response ```json {"payment_id":"pay_qcZiVdQQn7f6MGCZtZBf","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"partially_captured","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":5,"connector":"redsys","client_secret":"pay_qcZiVdQQn7f6MGCZtZBf_secret_OcJOMyRHrIVtbngWXLYr","created":"2025-03-13T08:44:24.672Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"7229","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"454881","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_lEr4y3EaJ6Re7374wHU1","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"422121527515","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"422121527515","payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T08:59:24.672Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:45:44.002Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual"} ``` </details> <details> <summary>Refunds</summary> ```json curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' \ --data '{ "payment_id": "pay_qcZiVdQQn7f6MGCZtZBf", "amount": 5, "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response ```json {"refund_id":"ref_YERbzFCx14PLMpJW0P5j","payment_id":"pay_qcZiVdQQn7f6MGCZtZBf","amount":5,"currency":"EUR","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-03-13T08:46:24.506Z","updated_at":"2025-03-13T08:46:25.605Z","connector":"redsys","profile_id":"pro_eOH03lBB7VBEzDNVnhEg","merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","split_refunds":null} ``` </details> <details> <summary>Cancel</summary> ```json curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' \ --data '{ "amount": 10, "currency": "EUR", "confirm": true, "capture_method": "manual", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4548814479727229", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }' ``` Response ```json {"payment_id":"pay_byaJdEXTecxmaSl1DjY9","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"requires_capture","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"redsys","client_secret":"pay_byaJdEXTecxmaSl1DjY9_secret_LcVjyiksCPMr03SyGwWm","created":"2025-03-13T08:48:54.587Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"7229","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"454881","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_Hqkm1zmZPJtFwWz7dbPw","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"First_Customer","created_at":1741855734,"expires":1741859334,"secret":"epk_6e708e7a6220453b9bc20eef5ce38da5"},"manual_retry_allowed":false,"connector_transaction_id":"219029278965","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T09:03:54.587Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:48:59.602Z","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"} ``` -> Cancel ```json curl --location 'http://localhost:8080/payments/pay_byaJdEXTecxmaSl1DjY9/cancel' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_bvqj8tQaV1iaCA5W1LZrNeR96tyWQ6DBguyEpYYhfcxMi3cE5Xfrobb13uOZzDRu' \ --data '{"cancellation_reason":"requested_by_customer"}' ``` Response ```json {"payment_id":"pay_byaJdEXTecxmaSl1DjY9","merchant_id":"postman_merchant_GHAction_ed373bd3-380f-4026-adf7-3b7b63008aa7","status":"cancelled","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"redsys","client_secret":"pay_byaJdEXTecxmaSl1DjY9_secret_LcVjyiksCPMr03SyGwWm","created":"2025-03-13T08:48:54.587Z","currency":"EUR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"7229","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"454881","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"token_Hqkm1zmZPJtFwWz7dbPw","shipping":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"ES","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceuta","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":"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":"219029278965","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"219029278965","payment_link":null,"profile_id":"pro_eOH03lBB7VBEzDNVnhEg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_aB6NOAuy8pJKWfOwSTiG","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-13T09:03:54.587Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-13T08:56:19.532Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual"} ``` </details> <details> <summary>Xendit Split Payment </summary> Payment Create ```json curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_MnVMIySY3tKCQVap0PK5vy1XfO8zoWY9xc77rKmoHmJSyEUyEpf2qmcwFZ3gyRsN' \ --data-raw '{ "amount": 1500000, "currency": "IDR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4918019199883839", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "billing": { "phone": { "number": "8056594427", "country_code": "+91" }, "email": "[email protected]" }, "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" } ,"split_payments": { "xendit_split_payment": { "multiple_splits" : { "name": "20210908 Test", "description": "Platform fee and Delivery Fee for Marketplace", "routes": [ { "flat_amount": 100000, "currency": "IDR", "destination_account_id": "*********************", "reference_id": "1234" }, { "percent_amount": 5, "currency": "IDR", "destination_account_id": "**********************", "reference_id": "1235" } ] } } } }' ``` Response ```json {"payment_id":"pay_ytaRhxZOA1qetfZVyYOQ","merchant_id":"postman_merchant_GHAction_ca24bf53-c232-4a12-857d-a8a7a3959dc8","status":"requires_customer_action","amount":1500000,"net_amount":1500000,"shipping_cost":null,"amount_capturable":1500000,"amount_received":null,"connector":"xendit","client_secret":"pay_ytaRhxZOA1qetfZVyYOQ_secret_k4Dp1ZI88zO3k8EyNt0x","created":"2025-03-19T16:38:13.196Z","currency":"IDR","customer_id":"First_Customer","customer":{"id":"First_Customer","name":"John Doe","email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"3839","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"491801","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":null,"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":null,"email":null,"name":"John Doe","phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":{"type":"redirect_to_url","redirect_to_url":"http://localhost:8080/payments/redirect/pay_ytaRhxZOA1qetfZVyYOQ/postman_merchant_GHAction_ca24bf53-c232-4a12-857d-a8a7a3959dc8/pay_ytaRhxZOA1qetfZVyYOQ_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":"First_Customer","created_at":1742402293,"expires":1742405893,"secret":"epk_a3aa00f374ff4cc68e817623b2653872"},"manual_retry_allowed":null,"connector_transaction_id":"pr-4ca916d9-9f25-4326-8582-575a1f82e7d1","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"7b3fb80f-8928-473e-a66d-6501da014324","payment_link":null,"profile_id":"pro_81YEDWujEkUUJHajg3eb","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_KfvuDqkWkkL61kbZ0441","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-19T16:53:13.196Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-19T16:38:14.692Z","split_payments":{"xendit_split_payment":{"multiple_splits":{"split_rule_id":"splitru_5d653bd1-9189-484a-a7cb-7c1481c38114","for_user_id":null,"name":"20210908 Test","description":"Platform fee and Delivery Fee for Marketplace","routes":[{"flat_amount":100000,"percent_amount":null,"currency":"IDR","destination_account_id":"678a407d0951bdff0db5ba78","reference_id":"1234"},{"flat_amount":null,"percent_amount":5,"currency":"IDR","destination_account_id":"678a29180bffc2f28d8527c0","reference_id":"1235"}]}}},"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","issuer_error_code":null,"issuer_error_message":null} ``` </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **payment** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/payments.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/router_request_types.rs` **3. Core Business Logic** - `crates/router/src/core/admin.rs` - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/operations/payment_approve.rs` - ... and 14 more files **4. External Connector Integration** - `crates/common_enums/src/connector_enums.rs` - `crates/connector_configs/src/connector.rs` - `crates/connector_configs/toml/development.toml` - ... and 9 more files **5. Type Definitions** - `crates/router/src/compatibility/stripe/payment_intents/types.rs` - `crates/router/src/compatibility/stripe/setup_intents/types.rs` - `crates/router/src/types/api.rs` - ... and 1 more files **6. Utils** - `crates/common_utils/Cargo.toml` - `crates/common_utils/src/crypto.rs` - `crates/common_utils/src/errors.rs` **7. Tests** - `config/deployments/integration_test.toml` - `cypress-tests/cypress/e2e/configs/Payment/Redsys.js` - `cypress-tests/cypress/e2e/configs/Payment/Utils.js` - ... and 4 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 5 more files **Code Patterns Applied:** - Define new data structures (18 changes) - Implement new functions (72 changes) - Extend existing types with new fields (827 changes) - Add conditional logic for feature flags or filtering (15 changes) **Detailed Identifier Changes:** Commit a1ecce8f: Files to modify: **crates/api_models/src/payments.rs** Add: - enum: pub::IframeData **crates/common_enums/src/connector_enums.rs** Modify existing code **crates/common_enums/src/enums.rs** Add: - enum: pub::CryptoPadding **crates/common_utils/src/crypto.rs** Add: - function: pub::new - function: private::encode_message - struct: pub::TripleDesEde3CBC - impl: impl TripleDesEde3CBC - impl: impl EncodeMessage for TripleDesEde3CBC **crates/common_utils/src/errors.rs** Modify existing code **crates/connector_configs/src/connector.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs** Remove: - function: private::generate_12_digit_number **crates/hyperswitch_connectors/src/connectors/redsys.rs** Remove: - function: private::get_auth_header - function: private::get_headers - function: private::get_headers - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Redsys - impl: impl ConnectorCommonExt<Flow, Request, Response> for Redsys - impl: impl ConnectorValidation for Redsys - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Redsys - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Redsys - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Redsys - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Redsys - impl: impl ConnectorSpecifications for Redsys Add: - function: private::build_request - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_request_body - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl api::PaymentsPreProcessing for Redsys - impl: impl api::PaymentsCompleteAuthorize for Redsys - impl: impl ConnectorCommonExt<Flow, Request, Response> for Redsys - impl: impl ConnectorValidation for Redsys - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Redsys - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Redsys - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Redsys - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Redsys - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Redsys - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Redsys - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Redsys - impl: impl ConnectorSpecifications for Redsys **crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs** Remove: - struct: pub::RedsysPaymentsRequest Add: - function: pub::new - function: pub::add_browser_data - function: pub::set_three_d_s_server_trans_i_d - function: pub::set_protocol_version - function: pub::set_notification_u_r_l - function: pub::set_three_d_s_comp_ind - function: pub::set_three_d_s_cres - function: private::get_state_code - function: pub::set_billing_data - function: pub::set_shipping_data - struct: pub::PaymentsRequest - struct: pub::ShippingData - struct: pub::RedsysCardData - impl: impl EmvThreedsData **crates/hyperswitch_connectors/src/default_implementations.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Add: - function: private::get_card_expiry_month_2_digit - function: private::get_card_expiry_month_2_digit - function: private::get_optional_line3 - function: private::get_optional_zip - function: private::get_optional_state - function: private::get_browser_info - function: private::get_threeds_method_comp_ind - function: private::get_card_expiry_month_2_digit - function: pub::generate_12_digit_number - function: pub::normalize_string **crates/hyperswitch_domain_models/src/router_request_types.rs** Modify existing code **crates/hyperswitch_interfaces/src/api.rs** Modify existing code **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/router/src/compatibility/stripe/payment_intents/types.rs** Modify existing code **crates/router/src/compatibility/stripe/setup_intents/types.rs** Modify existing code **crates/router/src/configs/defaults/payment_connector_required_fields.rs** Modify existing code **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/operations/payment_approve.rs** Modify existing code **crates/router/src/core/payments/operations/payment_cancel.rs** Modify existing code **crates/router/src/core/payments/operations/payment_capture.rs** Modify existing code **crates/router/src/core/payments/operations/payment_complete_authorize.rs** Modify existing code **crates/router/src/core/payments/operations/payment_confirm.rs** Modify existing code **crates/router/src/core/payments/operations/payment_create.rs** Modify existing code **crates/router/src/core/payments/operations/payment_post_session_tokens.rs** Modify existing code **crates/router/src/core/payments/operations/payment_reject.rs** Modify existing code **crates/router/src/core/payments/operations/payment_session.rs** Modify existing code **crates/router/src/core/payments/operations/payment_start.rs** Modify existing code **crates/router/src/core/payments/operations/payment_status.rs** Modify existing code **crates/router/src/core/payments/operations/payment_update.rs** Modify existing code **crates/router/src/core/payments/operations/payments_incremental_authorization.rs** Modify existing code **crates/router/src/core/payments/operations/tax_calculation.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Add: - function: pub::next_action_invoke_hidden_frame - function: pub::construct_connector_invoke_hidden_frame **crates/router/src/routes/payments.rs** Modify existing code **crates/router/src/types/api.rs** Modify existing code **crates/router/src/types/transformers.rs** Modify existing code
{"pr_number": 7508, "pr_title": "feat(connectors): [Redsys] add 3D secure card payment support, including transaction capture, cancellation, and refunds", "merged_at": "2025-03-21T10:12:17Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_approve.rs", "crates/router/src/core/payments/operations/payment_cancel.rs", "crates/router/src/core/payments/operations/payment_capture.rs", "crates/router/src/core/payments/operations/payment_complete_authorize.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_post_session_tokens.rs", "crates/router/src/core/payments/operations/payment_reject.rs", "crates/router/src/core/payments/operations/payment_session.rs", "crates/router/src/core/payments/operations/payment_start.rs", "crates/router/src/core/payments/operations/payment_status.rs", "crates/router/src/core/payments/operations/payment_update.rs", "crates/router/src/core/payments/operations/payments_incremental_authorization.rs", "crates/router/src/core/payments/operations/tax_calculation.rs", "crates/router/src/core/payments/transformers.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/Cargo.toml", "crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/redsys.rs", "crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/configs/defaults/payment_connector_required_fields.rs"], "types": ["crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs", "crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "utils": ["crates/common_utils/Cargo.toml", "crates/common_utils/src/crypto.rs", "crates/common_utils/src/errors.rs"], "tests": ["config/deployments/integration_test.toml", "cypress-tests/cypress/e2e/configs/Payment/Redsys.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js", "cypress-tests/cypress/support/commands.js", "cypress-tests/cypress/support/redirectionHandler.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/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/routes/payments.rs"]}, "change_types": {"structs_added": 18, "functions_added": 72, "enums_added": 8, "fields_added": 827, "imports_added": 10, "conditionals_added": 15}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(routing): update configs on updation of mca ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description https://github.com/juspay/hyperswitch/pull/9659 This pull request introduces a new helper function to update the default fallback connector configuration whenever a merchant connector account (MCA) is updated. This ensures that changes to connector status (such as disabling or enabling) are accurately reflected in both merchant and profile configurations. The changes also include necessary imports and function calls to integrate this logic into the connector update flow. **Connector fallback configuration updates:** * Added the `update_default_fallback_on_mca_update` function in `routing/helpers.rs` to update merchant and profile default connector configurations based on the status of the updated MCA. The function ensures that disabled or inactive connectors are removed from the defaults, and enabled connectors are added if not already present. * Integrated the new helper into the `update_connector` flow in `admin.rs`, so it is triggered automatically after connector updates. **Imports and code organization:** * Added necessary imports for `update_default_fallback_on_mca_update` and related types in `admin.rs` and `helpers.rs` to support the new logic. [[1]](diffhunk://#diff-7e1b4a44fadc4de1af2a6abeb318b3ddf044177c44ba00731c33dbf4cdce92b7R25-R28) [[2]](diffhunk://#diff-ea48d33e52b2cb7edbbba1d236b55f946fdb2c178f8c76f4226818b3630c4658R6) ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> 1. Create two connectors namely adyen and wise 2. check configs table ``` SELECT key, config FROM configs WHERE key = 'routing_default_po_pro_RTMoW14AvhG5cjmcpcNb'; ``` ``` SELECT key, config FROM configs WHERE key = 'routing_default_po_merchant_id'; ``` 3. disable one of them 4. check configs table again for above query, this time the disabled shouldn't be present. 5. Re-enable the disabled connector, then query the table for the connector to be added back. ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/admin.rs` - `crates/router/src/core/routing.rs` - `crates/router/src/core/routing/helpers.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) **Detailed Identifier Changes:** Commit cd47f4bc: 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** Add: - function: pub::redact_routing_cache
{"pr_number": 9690, "pr_title": "refactor(routing): update configs on updation of mca", "merged_at": "2025-10-08T08:05:17Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/routing.rs", "crates/router/src/core/routing/helpers.rs"]}, "change_types": {"functions_added": 1, "fields_added": 9, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
ci(cypress): fix adyen sofort in cypress ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [x] CI/CD ## Description - Adyen sofort was failing in cypress automation as sofort payment method is deprecated from adyen, hence handled the error message - Fixed Variation case for iatapay ### 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 Adyen cypress tests were failing ## How did you test it? - Adyen <img width="731" alt="image" src="https://github.com/user-attachments/assets/96ab0176-e616-4ed6-a9bf-e244f737ac9a" /> - Iatapay <img width="731" alt="image" src="https://github.com/user-attachments/assets/6ae82421-1ef6-4a71-8af1-45ce3150b526" /> ## 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/PaymentUtils/Adyen.js` - `cypress-tests/cypress/e2e/PaymentUtils/Iatapay.js` **Code Patterns Applied:** - Extend existing types with new fields (17 changes)
{"pr_number": 6984, "pr_title": "ci(cypress): fix adyen sofort in cypress", "merged_at": "2025-01-03T19:57:49Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/PaymentUtils/Adyen.js", "cypress-tests/cypress/e2e/PaymentUtils/Iatapay.js"]}, "change_types": {"fields_added": 17}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
refactor(connector): [NMI,PAYONE,RISKIFIED] moved to hyperswitch_connectors ## 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 --> Moving connectors (NMI,Riskified,and payone) from `router` crate to `hyperswitch_connector` crate ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [x] I added unit tests for my changes where possible Closes #7715 # NMI test ## Create payment processor NOTE: used 3ds enabled key ```json { "connector_type": "payment_processor", "connector_name": "nmi", "connector_account_details": { "api_key":"********************", "auth_type": "BodyKey", "key1": "***********************" }, "test_mode": false, "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 } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "payment_method_type": "klarna", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "affirm", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "afterpay_clearpay", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "city": "NY", "unit": "245" }, "connector_webhook_details": { "merchant_secret": "MyWebhookSecret" }, "business_country": "US", "business_label": "default" } ``` ## Create payment processor Response ```json { "connector_type": "payment_processor", "connector_name": "nmi", "connector_label": "nmi_US_default", "merchant_connector_id": "mca_sZo4dKynSU90CRdytdQT", "profile_id": "pro_5wu4McY9AIOVmllRswYz", "connector_account_details": { "auth_type": "BodyKey", "api_key": "***************************", "key1": "********************************************" }, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "payment_method_type": "klarna", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "affirm", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "afterpay_clearpay", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "connector_webhook_details": { "merchant_secret": "MyWebhookSecret", "additional_secret": null }, "metadata": { "city": "NY", "unit": "245" }, "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 } ``` ## create payment ```json { "amount": 250, "currency": "USD", "confirm": true, "amount_to_capture": 250, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "nithin", "email": "[email protected]", "name": "John Doe", "phone": "9731918444", "phone_country_code": "+91", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://google.com", "setup_future_usage": "on_session", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "127.0.0.1" }, "shipping": { "address": { "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" } }, "routing": { "type": "single", "data": "nmi" }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4000000000002503", "card_exp_month": "08", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "999" } }, "billing": { "address": { "zip": "560095", "country": "IN", "first_name": "Sakil", "last_name": "Mostak" } } } ``` ## create payment response ```json { "payment_id": "pay_9hrmW9oFfnKedAy0P3Mn", "merchant_id": "merchant_1743143179", "status": "requires_customer_action", "amount": 250, "net_amount": 250, "shipping_cost": null, "amount_capturable": 250, "amount_received": null, "connector": "nmi", "client_secret": "pay_9hrmW9oFfnKedAy0P3Mn_secret_gJqo6Tw0eee5XPrufvo1", "created": "2025-03-28T10:29:46.830Z", "currency": "USD", "customer_id": "johndoe", "customer": { "id": "johndoe", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+91" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "2503", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "400000", "card_extended_bin": null, "card_exp_month": "08", "card_exp_year": "25", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_Qgf7HooZS0DBdeTuvyW2", "shipping": { "address": { "city": null, "country": "US", "line1": null, "line2": null, "line3": null, "zip": "94122", "state": null, "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": null, "country": "IN", "line1": null, "line2": null, "line3": null, "zip": "560095", "state": null, "first_name": "Sakil", "last_name": "Mostak" }, "phone": null, "email": null }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": { "type": "redirect_to_url", "redirect_to_url": "http://localhost:8080/payments/redirect/pay_9hrmW9oFfnKedAy0P3Mn/merchant_1743143179/pay_9hrmW9oFfnKedAy0P3Mn_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": "johndoe", "created_at": 1743157786, "expires": 1743161386, "secret": "epk_46f549a6894b47b5bb741de8aa1381b5" }, "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": "", "payment_link": null, "profile_id": "pro_5wu4McY9AIOVmllRswYz", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_sZo4dKynSU90CRdytdQT", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-03-28T10:44:46.830Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-03-28T10:29:48.266Z", "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", "issuer_error_code": null, "issuer_error_message": null } ``` Open redirect url "http://localhost:8080/payments/redirect/pay_9hrmW9oFfnKedAy0P3Mn/merchant_1743143179/pay_9hrmW9oFfnKedAy0P3Mn_1" <img width="1680" alt="Screenshot 2025-03-28 at 4 01 28 PM" src="https://github.com/user-attachments/assets/075f5bd4-c04c-4927-83dd-744d64f8a59b" /> ## payment retrieve NOTE use `/payments/:id?force_sync=true` Response ```json { "payment_id": "pay_9hrmW9oFfnKedAy0P3Mn", "merchant_id": "merchant_1743143179", "status": "succeeded", "amount": 250, "net_amount": 250, "shipping_cost": null, "amount_capturable": 0, "amount_received": 250, "connector": "nmi", "client_secret": "pay_9hrmW9oFfnKedAy0P3Mn_secret_gJqo6Tw0eee5XPrufvo1", "created": "2025-03-28T10:29:46.830Z", "currency": "USD", "customer_id": "johndoe", "customer": { "id": "johndoe", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+91" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "2503", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "400000", "card_extended_bin": null, "card_exp_month": "08", "card_exp_year": "25", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_Qgf7HooZS0DBdeTuvyW2", "shipping": { "address": { "city": null, "country": "US", "line1": null, "line2": null, "line3": null, "zip": "94122", "state": null, "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": null, "country": "IN", "line1": null, "line2": null, "line3": null, "zip": "560095", "state": null, "first_name": "Sakil", "last_name": "Mostak" }, "phone": null, "email": null }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "10550766500", "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_9hrmW9oFfnKedAy0P3Mn_1", "payment_link": null, "profile_id": "pro_5wu4McY9AIOVmllRswYz", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_sZo4dKynSU90CRdytdQT", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-03-28T10:44:46.830Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-03-28T10:34:49.994Z", "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", "issuer_error_code": null, "issuer_error_message": null } ``` ## refunds ```json "payment_id": "pay_9hrmW9oFfnKedAy0P3Mn", "amount": 250, "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } } ``` Response ```json { "refund_id": "ref_rOGRIeo7mSWazFxB6TpF", "payment_id": "pay_9hrmW9oFfnKedAy0P3Mn", "amount": 250, "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-03-28T10:36:26.792Z", "updated_at": "2025-03-28T10:36:29.898Z", "connector": "nmi", "profile_id": "pro_5wu4McY9AIOVmllRswYz", "merchant_connector_id": "mca_sZo4dKynSU90CRdytdQT", "split_refunds": null, "issuer_error_code": null, "issuer_error_message": null } ## refund retrieve response ```json { "refund_id": "ref_rOGRIeo7mSWazFxB6TpF", "payment_id": "pay_9hrmW9oFfnKedAy0P3Mn", "amount": 250, "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-03-28T10:36:26.792Z", "updated_at": "2025-03-28T10:36:54.546Z", "connector": "nmi", "profile_id": "pro_5wu4McY9AIOVmllRswYz", "merchant_connector_id": "mca_sZo4dKynSU90CRdytdQT", "split_refunds": null, "issuer_error_code": null, "issuer_error_message": null } ``` ********************************************** PAYONE ****************************** ## create connector ```json { "connector_type": "payout_processor", "connector_name": "payone", "connector_label": "adyen_payouts", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "*********************", "api_secret": "**********************", "key1": "Hyperswitch" }, "test_mode": true, "disabled": false, "metadata": { "city": "NY", "unit": "245", "endpoint_prefix": "" }, "payment_methods_enabled": [ { "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_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 } ] } ] } ``` ## create payouts ```json { "amount": 100, "currency": "EUR", "profile_id": {{profile_id}}, "customer": { "id": "new_id", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65" }, "connector": [ "payone" ], "description": "Its my first payout request", "payout_type": "card", "payout_method_data": { "card": { "card_number": "5137009801943438", "expiry_month": "03", "expiry_year": "2030", "card_holder_name": "John Doe" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "city": "San Fransico", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "entity_type": "Individual", "recurring": true, "metadata": { "ref": "123" }, "confirm": true, "auto_fulfill": true } ``` # RISKIFIED - Create a merchant with frm_routing_algorithm ```json "frm_routing_algorithm": { "type": "single", "data": "riskified" } ``` - create stripe MCA - create RISKIFIED MCA ```json { "connector_type": "payment_vas", "connector_name": "riskified", "connector_account_details": { "auth_type": "BodyKey", "api_key": "*************APIKEY", "key1": "www.juspay.com" }, "connector_webhook_details": { "merchant_secret": "**********************MERCHANT_SECRET", "additional_secret": null }, "test_mode": false, "disabled": false, "business_country": "US", "business_label": "default", "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "payment_method_type": "klarna", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "affirm", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "afterpay_clearpay", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "city": "NY", "unit": "245" }, "frm_configs": [ { "gateway": "stripe", "payment_methods": [ { "payment_method": "card", "flow" : "pre" } ] } ] } ``` - create a payment ```json { "amount": 1500000, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 1500000, "customer_id": "StripeCustomer2", "email": "[email protected]", "name": "Bob Smith", "phone": "999999999", "phone_country_code": "+91", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "debit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "123" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "31 Sherwood Gardens", "line3": "31 Sherwood Gardens", "city": "London", "state": "Manchester", "zip": "E14 9wn", "country": "GB", "first_name": "Bob", "last_name": "Smith" }, "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" }, "order_details" : [{ "product_name" : "gillete creme", "quantity" : 2, "amount" : 600 }, { "product_name" : "gillete razor", "quantity" : 1, "amount" : 300 }], "frm_metadata": { "vendor_name": "srujan", "shipping_lines": [ ] } } ``` - payment message should contain `frm_message` from riskified ```json "frm_message": { "frm_name": "riskified", "frm_transaction_id": "pay_v2TLKee8Wlw84rC7IHsj_1", "frm_transaction_type": "pre_frm", "frm_status": "legit", "frm_score": null, "frm_reason": "Reviewed and approved by Riskified", "frm_error": null } ```
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payments/flows.rs` **2. External Connector Integration** - `crates/hyperswitch_connectors/Cargo.toml` - `crates/hyperswitch_connectors/src/connectors.rs` - `crates/router/src/connector/nmi.rs` - ... and 13 more files **3. Configuration Files** - `crates/router/Cargo.toml` **4. Other** - `Cargo.lock` - `crates/router/src/macros.rs` **Code Patterns Applied:** - Define new data structures (1 changes) - Implement new functions (30 changes) - Extend existing types with new fields (242 changes) - Add conditional logic for feature flags or filtering (2 changes) - Modify database queries (1 changes) **Detailed Identifier Changes:** Commit b4610875: Files to modify: **crates/hyperswitch_connectors/src/connectors.rs** Add: - mod: pub::nmi - mod: pub::payone - mod: pub::riskified **crates/hyperswitch_connectors/src/connectors/riskified/transformers/auth.rs** Add: - function: private::try_from - struct: pub::RiskifiedAuthType - impl: impl TryFrom<&ConnectorAuthType> for RiskifiedAuthType **crates/hyperswitch_connectors/src/default_implementations.rs** Modify existing code **crates/hyperswitch_connectors/src/default_implementations_v2.rs** Modify existing code **crates/hyperswitch_connectors/src/types.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Add: - function: private::is_payment_successful - function: private::get_order_details - function: private::get_currency - trait: pub::FrmTransactionRouterDataRequest - trait: pub::FraudCheckCheckoutRequest - trait: pub::FraudCheckTransactionRequest - impl: impl FrmTransactionRouterDataRequest for FrmTransactionRouterData - impl: impl FraudCheckCheckoutRequest for FraudCheckCheckoutData - impl: impl FraudCheckTransactionRequest for FraudCheckTransactionData **crates/router/src/connector.rs** Remove: - mod: pub::nmi - mod: pub::payone - mod: pub::riskified **crates/router/src/connector/riskified/transformers/auth.rs** Remove: - function: private::try_from - struct: pub::RiskifiedAuthType - impl: impl TryFrom<&types::ConnectorAuthType> for RiskifiedAuthType **crates/router/src/core/payments/flows.rs** Modify existing code **crates/router/src/macros.rs** Modify existing code
{"pr_number": 7666, "pr_title": "refactor(connector): [NMI,PAYONE,RISKIFIED] moved to hyperswitch_connectors", "merged_at": "2025-04-24T10:35:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/flows.rs"], "connectors": ["crates/hyperswitch_connectors/Cargo.toml", "crates/hyperswitch_connectors/src/connectors.rs", "crates/router/src/connector/nmi.rs", "crates/router/src/connector/nmi/transformers.rs", "crates/router/src/connector/payone.rs", "crates/router/src/connector/payone/transformers.rs", "crates/router/src/connector/riskified.rs", "crates/router/src/connector/riskified/transformers.rs", "crates/router/src/connector/riskified/transformers/api.rs", "crates/hyperswitch_connectors/src/connectors/riskified/transformers/auth.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/router/src/connector.rs", "crates/router/src/connector/riskified/transformers/auth.rs"], "config": ["crates/router/Cargo.toml"], "other": ["Cargo.lock", "crates/router/src/macros.rs"]}, "change_types": {"structs_added": 1, "functions_added": 30, "fields_added": 242, "imports_added": 54, "conditionals_added": 2, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(users): handle email url for users in different tenancies ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description - Add support for user in tenants configs. - Handle email URLs for different tenancies ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context Closes [#6808](https://github.com/juspay/hyperswitch/issues/6808) ## How did you test it? Tested locally with email feature flag on, for different tenancies the emails we were getting, we were landing onto to the URL specified in the tenant's config. We specified the following in the local configs. ``` [multitenancy] enabled = true global_tenant = { schema = "public", redis_key_prefix = "", clickhouse_database = "default"} [multitenancy.tenants.public] base_url = "http://localhost:8080" schema = "public" redis_key_prefix = "" clickhouse_database = "default" [multitenancy.tenants.public.user] control_center_url = "http://localhost:9000" [multitenancy.tenants.test] base_url = "http://localhost:8080" schema = "public" redis_key_prefix = "" clickhouse_database = "default" [multitenancy.tenants.test.user] control_center_url = "http://localhost:9001" ``` We were getting the mails ![image](https://github.com/user-attachments/assets/af9b9b9e-0968-45c5-a1d1-f76494ca700f) For public Tenant: (**http://localhost:9000**/user/verify_email?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImFwb29ydmRpeGl0ODhAZ21haWwuY29tIiwiZmxvdyI6InZlcmlmeV9lbWFpbCIsImV4cCI6MTczNDAwNDg0MSwiZW50aXR5IjpudWxsfQ.j0RlE85yahAALsMccb2uQtt34JIrFV31t3eNYfO5Sdc) For test Tenant: (**http://locatlhost:9001**/user/verify_email?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImFwb29ydmRpeGl0ODgrMUBnbWFpbC5jb20iLCJmbG93IjoidmVyaWZ5X2VtYWlsIiwiZXhwIjoxNzM0MDA0OTY4LCJlbnRpdHkiOm51bGx9.KIiSssKT1J0awgOt9C64tx6lSNrc0CbfZPPXpyRXP_8) ## 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/recon.rs` - `crates/router/src/core/user.rs` - `crates/router/src/core/user/dashboard_metadata.rs` **2. Type Definitions** - `crates/router/src/services/email/types.rs` **3. Tests** - `loadtest/config/development.toml` **4. Configuration Files** - `config/config.example.toml` - `config/deployments/env_specific.toml` - `config/development.toml` - ... and 2 more files **5. Other** - `crates/external_services/src/email.rs` - `crates/router/src/workflows/api_key_expiry.rs` **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (11 changes) - Extend existing types with new fields (7 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 839e69df: Files to modify: **crates/external_services/src/email.rs** Modify existing code **crates/router/src/configs/settings.rs** Add: - struct: pub::TenantUserConfig **crates/router/src/core/recon.rs** Modify existing code **crates/router/src/core/user.rs** Modify existing code **crates/router/src/core/user/dashboard_metadata.rs** Modify existing code **crates/router/src/services/email/types.rs** Add: - function: pub::get_base_url **crates/router/src/workflows/api_key_expiry.rs** Modify existing code
{"pr_number": 6809, "pr_title": "feat(users): handle email url for users in different tenancies", "merged_at": "2024-12-19T08:50:07Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "token"]}, "hierarchy": {"core_business": ["crates/router/src/core/recon.rs", "crates/router/src/core/user.rs", "crates/router/src/core/user/dashboard_metadata.rs"], "types": ["crates/router/src/services/email/types.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"], "other": ["crates/external_services/src/email.rs", "crates/router/src/workflows/api_key_expiry.rs"]}, "change_types": {"structs_added": 2, "functions_added": 11, "fields_added": 7, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(gRPC): build gRPC client interface to initiate communication with recovery-decider service ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> I have implemented a gRPC client that facilitates communication with the recovery-decider gRPC service. The client should be capable of initializing and managing the connection to the service, sending requests, and handling responses in accordance with the defined service contract (protobuf definitions). ### 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)? --> Decider gRPC server:- <img width="1227" alt="Screenshot 2025-06-11 at 01 16 34" src="https://github.com/user-attachments/assets/b4887ed0-4315-406e-b393-cbd9bf480c95" /> Decider gRPC client(HS):- <img width="1159" alt="Screenshot 2025-06-05 at 02 05 20" src="https://github.com/user-attachments/assets/bbddd857-29e8-49bc-bb73-9797f8837b5b" /> Predictor gRPC server:- <img width="1201" alt="Screenshot 2025-06-05 at 02 03 06" src="https://github.com/user-attachments/assets/a3afdb68-33e7-4c4c-8117-8a3a501ecdb8" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced support for a gRPC client: Recovery Decider, enabling external retry decisioning. - Integrated dynamic scheduling for smart retry logic based on external gRPC service responses. - Added new protobuf definition for Recovery Decider. - **Improvements** - Enhanced revenue recovery payment flow with richer payment intent context and smarter retry scheduling. - Expanded logging and API flow tracking with new flow types. - **Configuration** - Added configuration options for new gRPC clients in the development environment. - **Bug Fixes** - Improved error handling and logging for gRPC client interactions.
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payments/operations/proxy_payments_intent.rs` - `crates/router/src/core/revenue_recovery/types.rs` **2. Type Definitions** - `crates/router/src/types/storage/revenue_recovery.rs` **3. Tests** - `config/deployments/integration_test.toml` **4. Configuration Files** - `config/config.example.toml` - `config/deployments/env_specific.toml` - `config/deployments/production.toml` - ... and 6 more files **5. Other** - `Cargo.lock` - `crates/external_services/build.rs` - `crates/external_services/src/grpc_client.rs` - ... and 6 more files **Code Patterns Applied:** - Define new data structures (4 changes) - Implement new functions (11 changes) - Extend existing types with new fields (97 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit 654c15ee: Files to modify: **crates/external_services/build.rs** Modify existing code **crates/external_services/src/grpc_client.rs** Add: - mod: pub::revenue_recovery **crates/external_services/src/grpc_client/revenue_recovery.rs** Add: - function: private::add_recovery_headers - function: pub::create_revenue_recovery_grpc_request - struct: pub::GrpcRecoveryHeaders - trait: pub::AddRecoveryHeaders - impl: impl AddRecoveryHeaders for tonic::Request<T> - mod: pub::recovery_decider_client **crates/external_services/src/grpc_client/revenue_recovery/recovery_decider_client.rs** Add: - function: pub::validate - function: pub::get_recovery_decider_connection - function: private::decide_on_retry - struct: pub::RecoveryDeciderClientConfig - enum: pub::RecoveryDeciderError - trait: pub::RecoveryDeciderClientInterface - impl: impl RecoveryDeciderClientConfig - impl: impl RecoveryDeciderClientInterface for DeciderClient<Client> - mod: pub::decider **crates/external_services/src/lib.rs** Add: - function: pub::convert_to_prost_timestamp - function: pub::convert_from_prost_timestamp - enum: pub::DateTimeConversionError - mod: pub::date_time **crates/router/src/configs/settings.rs** Modify existing code **crates/router/src/core/payments/operations/proxy_payments_intent.rs** Modify existing code **crates/router/src/core/revenue_recovery/types.rs** Modify existing code **crates/router/src/routes/app.rs** Add: - function: pub::get_recovery_grpc_headers **crates/router/src/types/storage/revenue_recovery.rs** Add: - function: private::default - struct: pub::RecoveryTimestamp - impl: impl Default for RecoveryTimestamp **crates/router/src/workflows/revenue_recovery.rs** Add: - function: pub::get_schedule_time_for_smart_retry - function: private::from - struct: private::InternalDeciderRequest - impl: impl From<InternalDeciderRequest> for external_grpc_client::DeciderRequest
{"pr_number": 8178, "pr_title": "feat(gRPC): build gRPC client interface to initiate communication with recovery-decider service", "merged_at": "2025-08-06T13:44:24Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/proxy_payments_intent.rs", "crates/router/src/core/revenue_recovery/types.rs"], "types": ["crates/router/src/types/storage/revenue_recovery.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", "config/docker_compose.toml", "crates/external_services/Cargo.toml", "crates/router/Cargo.toml", "crates/router/src/configs/settings.rs"], "other": ["Cargo.lock", "crates/external_services/build.rs", "crates/external_services/src/grpc_client.rs", "crates/external_services/src/grpc_client/revenue_recovery.rs", "crates/external_services/src/grpc_client/revenue_recovery/recovery_decider_client.rs", "crates/external_services/src/lib.rs", "crates/router/src/routes/app.rs", "crates/router/src/workflows/revenue_recovery.rs", "proto/recovery_decider.proto"]}, "change_types": {"structs_added": 4, "functions_added": 11, "enums_added": 2, "fields_added": 97, "imports_added": 21, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): [CASHTOCODE] Populate error 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 --> Error message from cashtocode is now populated in error reason along with error message as well. ### 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/7155 ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Cashtocode cannot be tested locally due to unavailability of credentials. ## 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/cashtocode.rs` - `crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs` **Code Patterns Applied:** - Extend existing types with new fields (4 changes) **Detailed Identifier Changes:** Commit f8cd2f25: Files to modify: **crates/hyperswitch_connectors/src/connectors/cashtocode.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs** Modify existing code
{"pr_number": 7154, "pr_title": "fix(connector): [CASHTOCODE] Populate error reason", "merged_at": "2025-03-03T16:30:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/cashtocode.rs", "crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs"]}, "change_types": {"fields_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(dynamic_routing): add open router integration for elimination routing ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR adds the elimination routing integration support with open router. ### 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 merchant_account, api_key, mca 1. Enable elimination routing for merchant ``` curl --location --request POST 'http://localhost:8080/account/merchant_1744368166/business_profile/pro_GrzjTHd5Pn5hAhwTZPRn/dynamic_routing/elimination/toggle?enable=dynamic_connector_selection' \ --header 'api-key: xyz' ``` 2. Enable Volume split ``` curl --location --request POST 'http://localhost:8080/account/merchant_1744368166/business_profile/pro_GrzjTHd5Pn5hAhwTZPRn/dynamic_routing/set_volume_split?split=100' \ --header 'api-key: xyz' ``` 3. Create a Payment Search for the log " penalizing the elimination score of the gateway with id" ![image](https://github.com/user-attachments/assets/16bd41b3-5dd9-4911-b64e-4f53ceb50689) ## 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/open_router.rs` - `crates/api_models/src/routing.rs` **2. Core Business Logic** - `crates/router/src/core/payments/routing.rs` - `crates/router/src/core/routing/helpers.rs` - `crates/router/src/core/routing/transformers.rs` **Code Patterns Applied:** - Implement new functions (2 changes) - Extend existing types with new fields (21 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit 4745ce97: Files to modify: **crates/api_models/src/open_router.rs** Remove: - function: private::from - impl: impl From<bool> for TxnStatus **crates/api_models/src/routing.rs** Add: - function: pub::is_elimination_enabled **crates/router/src/core/payments/routing.rs** Modify existing code **crates/router/src/core/routing/helpers.rs** Add: - function: private::foreign_from - impl: impl ForeignFrom<common_enums::AttemptStatus> for open_router::TxnStatus **crates/router/src/core/routing/transformers.rs** Modify existing code
{"pr_number": 7896, "pr_title": "feat(dynamic_routing): add open router integration for elimination routing", "merged_at": "2025-04-29T09:51:50Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/open_router.rs", "crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/payments/routing.rs", "crates/router/src/core/routing/helpers.rs", "crates/router/src/core/routing/transformers.rs"]}, "change_types": {"functions_added": 2, "fields_added": 21, "imports_added": 4, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [NOMUPAY] 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 <!-- Describe your changes in detail --> Template connector code for Nomupay payout ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/connector_enums.rs` **2. Core Business Logic** - `crates/router/src/core/payments/connector_integration_v2_impls.rs` - `crates/router/src/core/payments/flows.rs` **3. External Connector Integration** - `crates/common_enums/src/connector_enums.rs` - `crates/hyperswitch_connectors/src/connectors.rs` - `crates/hyperswitch_connectors/src/connectors/nomupay.rs` - ... and 9 more files **4. Type Definitions** - `crates/router/src/types/api.rs` - `crates/router/src/types/transformers.rs` **5. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **6. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 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 20a3a1c2: Files to modify: **crates/api_models/src/connector_enums.rs** Modify existing code **crates/common_enums/src/connector_enums.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors.rs** Add: - mod: pub::nomupay **crates/hyperswitch_connectors/src/connectors/nomupay.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::Nomupay - impl: impl Nomupay - impl: impl api::Payment for Nomupay - impl: impl api::PaymentSession for Nomupay - impl: impl api::ConnectorAccessToken for Nomupay - impl: impl api::MandateSetup for Nomupay - impl: impl api::PaymentAuthorize for Nomupay - impl: impl api::PaymentSync for Nomupay - impl: impl api::PaymentCapture for Nomupay - impl: impl api::PaymentVoid for Nomupay - impl: impl api::Refund for Nomupay - impl: impl api::RefundExecute for Nomupay - impl: impl api::RefundSync for Nomupay - impl: impl api::PaymentToken for Nomupay - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Nomupay - impl: impl ConnectorCommonExt<Flow, Request, Response> for Nomupay - impl: impl ConnectorCommon for Nomupay - impl: impl ConnectorValidation for Nomupay - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Nomupay - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Nomupay - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Nomupay - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Nomupay - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Nomupay - impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Nomupay - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Nomupay - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Nomupay - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Nomupay - impl: impl webhooks::IncomingWebhook for Nomupay - mod: pub::transformers **crates/hyperswitch_connectors/src/connectors/nomupay/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::NomupayRouterData - struct: pub::NomupayPaymentsRequest - struct: pub::NomupayCard - struct: pub::NomupayAuthType - struct: pub::NomupayPaymentsResponse - struct: pub::NomupayRefundRequest - struct: pub::RefundResponse - struct: pub::NomupayErrorResponse - enum: pub::NomupayPaymentStatus - enum: pub::RefundStatus - impl: impl From<(StringMinorUnit, T)> for NomupayRouterData<T> - impl: impl TryFrom<&NomupayRouterData<&PaymentsAuthorizeRouterData>> for NomupayPaymentsRequest - impl: impl TryFrom<&ConnectorAuthType> for NomupayAuthType - impl: impl From<NomupayPaymentStatus> for common_enums::AttemptStatus - impl: impl TryFrom<ResponseRouterData<F, NomupayPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData> - impl: impl TryFrom<&NomupayRouterData<&RefundsRouterData<F>>> for NomupayRefundRequest - impl: impl From<RefundStatus> for enums::RefundStatus - impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute> - impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync> **crates/hyperswitch_connectors/src/default_implementations.rs** Modify existing code **crates/hyperswitch_connectors/src/default_implementations_v2.rs** Modify existing code **crates/hyperswitch_interfaces/src/configs.rs** Modify existing code **crates/router/src/connector.rs** Modify existing code **crates/router/src/core/payments/connector_integration_v2_impls.rs** Modify existing code **crates/router/src/core/payments/flows.rs** Modify existing code **crates/router/src/types/api.rs** Modify existing code **crates/router/src/types/transformers.rs** Modify existing code **crates/router/tests/connectors/main.rs** Add: - mod: private::nomupay **crates/router/tests/connectors/nomupay.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::NomupayTest - impl: impl ConnectorActions for NomupayTest - impl: impl utils::Connector for NomupayTest **crates/test_utils/src/connector_auth.rs** Modify existing code
{"pr_number": 6382, "pr_title": "feat(connector): [NOMUPAY] Add template code", "merged_at": "2024-11-12T07:30:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/connector_enums.rs"], "core_business": ["crates/router/src/core/payments/connector_integration_v2_impls.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/nomupay.rs", "crates/hyperswitch_connectors/src/connectors/nomupay/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/nomupay.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"}
fix(connector): [CYBERSOURCE] fix CartesBancaires card_type for Cybersource ## Type of Change <!-- Put an `x` in the boxes that apply --> - [X] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Payment via CartesBancaires were failing via Cybersource, since the card_type passed was wrong. It was previously "006" ,but should be "036" - this PR introduces this fix. source https://developer.cybersource.com/library/documentation/dev_guides/Retail_SO_API/html/Topics/app_card_types.htm ### 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 CartesBancaires card_network for credit, debit pmt for Cybersource ### Request **/payments curl via Cybersource** `curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_5xoZZGCiGtFDREHNPd9l2i9CRJowAtZlrDRmuy0LTNBLBjtQlH661r0VTMNBXPgm' \ --data-raw '{ "amount": 700, "currency": "EUR", "confirm": true, "payment_link": false, "capture_on": "2029-09-10T10:11:12Z", "amount_to_capture": 700, "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method_data": { "card": { "card_number": "4035 5014 2814 6300", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "card_cvc": "737", "card_network": "CartesBancaires" }, "billing": { "address": { "line1": "1467", "line2": "CA", "city": "Thise", "state": "Alsace", "zip": "94122", "country": "FR", "first_name": "Henry", "last_name": "Henry" } } }, "payment_method": "card", "payment_method_type": "credit", "browser_info": { "color_depth": 24, "java_enabled": true, "java_script_enabled": true, "language": "en-GB", "screen_height": 720, "screen_width": 1280, "time_zone": -330, "ip_address": "208.127.127.193", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" }, "metadata": { "disable_avs": true, "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "order_details": [ { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" } ] }'` **After PR changes** <img width="1066" alt="Screenshot 2025-05-20 at 2 26 17 PM" src="https://github.com/user-attachments/assets/c0d7fbb6-cca7-479c-b0aa-3c1bccb55df8" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [X] I formatted the code `cargo +nightly fmt --all` - [X] I addressed lints thrown by `cargo clippy` - [X] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs` - `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` - `crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs` - ... and 3 more files **Detailed Identifier Changes:** Commit 4c9689d4: Files to modify: **crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/payone/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Modify existing code
{"pr_number": 8031, "pr_title": "fix(connector): [CYBERSOURCE] fix CartesBancaires card_type for Cybersource", "merged_at": "2025-05-15T12:54:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payone/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): [TRUSTPAY] Consuming Amount in PSync Response ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Hotfix for [PR](https://github.com/juspay/hyperswitch/pull/8455) ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/trustpay.rs` - `crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs` **Code Patterns Applied:** - Extend existing types with new fields (7 changes) **Detailed Identifier Changes:** Commit 4fe7cc28: 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": 8480, "pr_title": "fix(connector): [TRUSTPAY] Consuming Amount in PSync Response", "merged_at": "2025-06-27T11:19:06Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/trustpay.rs", "crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs"]}, "change_types": {"fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(core): remove hardcoded timeout limit of 5s for outgoing webhook requests ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Increased outgoing webhook timeout from 5 seconds to 30 seconds by replacing hardcoded `OUTGOING_WEBHOOK_TIMEOUT_SECS` with existing `REQUEST_TIME_OUT` constant for consistency. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue 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). --> 5-second hardcoded timeout causes webhook delivery failures for legacy systems that need more time to respond. Using 30-second timeout maintains consistency with other external API calls. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> <details> <summary>1. Create a simple server for delaying the response for 29seconds</summary> package.json { "name": "webhook-test-server", "version": "1.0.0", "description": "Test server for webhook timeout behavior - waits 30 seconds before responding", "main": "server.js", "scripts": { "start": "node server.js", "dev": "node server.js" }, "dependencies": { "express": "^4.18.2" }, "keywords": ["webhook", "test", "timeout"], "author": "", "license": "MIT" } server.js const express = require('express'); const app = express(); app.use(express.json()); app.post('/webhook', (req, res) => { console.log(`[${new Date().toISOString()}] Webhook received, waiting 29 seconds...`); setTimeout(() => { console.log(`[${new Date().toISOString()}] Responding after 29s delay`); res.json({ message: 'Success after 29s delay' }); }, 29000); }); app.listen(3000, () => { console.log('Webhook test server running on http://localhost:3000'); console.log('POST to /webhook - will wait 29 seconds before responding'); }); Run node server.js </details> <details> <summary>2. Set outgoing webhook endpoint during merchant account creation</summary> http://localhost:3000/webhook (use ngrok to expose this for testing in cloud env) </details> <details> <summary>3. Process a payment</summary> cURL curl --location --request POST 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_9QPrburqsfeS7j2qoybLlIYt5oFfcrFHNxQqUDnlTOYe9s9dkC5cPVOyZaINnWX8' \ --data-raw '{"amount":4500,"currency":"EUR","confirm":true,"profile_id":"pro_jY5jJD5THGIwfuIqH3Nx","capture_method":"automatic","authentication_type":"three_ds","setup_future_usage":"on_session","customer_id":"cus_HXi1vEcMXQ74qsaNq57p","email":"[email protected]","return_url":"https://google.com","payment_method":"card","payment_method_type":"debit","payment_method_data":{"card":{"card_number":"4000000000002503","card_exp_month":"12","card_exp_year":"49","card_cvc":"123"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","zip":"94122","country":"SG","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","language":"en-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"session_expiry":60}' Response {"payment_id":"pay_2Fqjbw3vYGAX1TTGJHWB","merchant_id":"merchant_1753252820","status":"failed","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"adyen","client_secret":"pay_2Fqjbw3vYGAX1TTGJHWB_secret_b50rZahoz0n6ee4Zm3nr","created":"2025-07-23T06:44:10.822Z","currency":"EUR","customer_id":"cus_HXi1vEcMXQ74qsaNq57p","customer":{"id":"cus_HXi1vEcMXQ74qsaNq57p","name":null,"email":"[email protected]","phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"2503","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":"49","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"SG","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":null,"phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":"2","error_message":"Refused","unified_code":"UE_9000","unified_message":"Something went wrong","payment_experience":null,"payment_method_type":"debit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_HXi1vEcMXQ74qsaNq57p","created_at":1753253050,"expires":1753256650,"secret":"epk_63945dac0445483b80731065804a2d75"},"manual_retry_allowed":true,"connector_transaction_id":"F59RPCDCMR9X2F75","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_jY5jJD5THGIwfuIqH3Nx","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_vZ79u4WZFBzDP1O0fSLc","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-23T06:45:10.822Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-23T06:44:13.414Z","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":"This is not a testCard","is_iframe_redirection_enabled":null,"whole_connector_response":null} Observations - Outgoing webhook triggered from application - A response is triggered after 29seconds and the connection from HS is not dropped (Status received: 200) <img width="865" height="811" alt="Screenshot 2025-07-23 at 12 21 36 PM" src="https://github.com/user-attachments/assets/8c053b7e-4e39-464a-bfe6-62c5c3b2504a" /> </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **payment** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/webhooks/outgoing.rs` - `crates/router/src/core/webhooks/outgoing_v2.rs` - `crates/router/src/core/webhooks/types.rs` **Detailed Identifier Changes:** Commit 8c7ddaa4: Files to modify: **crates/router/src/core/webhooks/outgoing.rs** Modify existing code **crates/router/src/core/webhooks/outgoing_v2.rs** Modify existing code **crates/router/src/core/webhooks/types.rs** Modify existing code
{"pr_number": 8725, "pr_title": "refactor(core): remove hardcoded timeout limit of 5s for outgoing webhook requests", "merged_at": "2025-07-24T15:36:25Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/webhooks/outgoing.rs", "crates/router/src/core/webhooks/outgoing_v2.rs", "crates/router/src/core/webhooks/types.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(dynamic_routing): integration of elimination routing for core flows ## 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 integrate elimination routing in our core flows for connectors to be filtered on basis of error codes received. ### 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)? --> Testing performed in same way as SR routing. 1. Enable ER for merchant ``` curl --location --request POST 'http://localhost:8080/account/merchant_1744368166/business_profile/pro_GrzjTHd5Pn5hAhwTZPRn/dynamic_routing/elimination/toggle?enable=dynamic_connector_selection' \ --header 'api-key: dev_a4XMpNXd3Yriz5DPsiwU6UbxEkiRkXdqHhwnJPolnVhssLaDEbOg6f5kE6B2hx1f' ``` 2. Enable Volume split ``` curl --location --request POST 'http://localhost:8080/account/merchant_1744368166/business_profile/pro_GrzjTHd5Pn5hAhwTZPRn/dynamic_routing/set_volume_split?split=100' \ --header 'api-key: dev_a4XMpNXd3Yriz5DPsiwU6UbxEkiRkXdqHhwnJPolnVhssLaDEbOg6f5kE6B2hx1f' ``` 3. Create a volte Payment ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_lnvARj6hcC6DXOC3XXByk5s2qv7EWGhG0v9vFo85RQvz3Ft9IrqMXeSMpvuotZfp' \ --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": "[email protected]", "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": "pro_KEc20awDxPq8pSIDsBV0" }' ``` cancel the payment after going to the payment url. 4. logs checkup: `DEBUG router::core::payments::routing: dynamic_eliminated_connectors: []` if the above log is present, it shows elimination is working fine. ## 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/routing.rs` **2. Core Business Logic** - `crates/router/src/core/errors.rs` - `crates/router/src/core/payments/operations/payment_response.rs` - `crates/router/src/core/payments/routing.rs` - ... and 1 more files **3. Configuration Files** - `config/development.toml` **4. Other** - `crates/common_enums/src/enums.rs` **Code Patterns Applied:** - Implement new functions (5 changes) - Extend existing types with new fields (55 changes) - Add conditional logic for feature flags or filtering (7 changes) **Detailed Identifier Changes:** Commit 82bc4616: Files to modify: **crates/api_models/src/routing.rs** Modify existing code **crates/common_enums/src/enums.rs** Add: - function: pub::should_perform_elimination_routing - impl: impl ErrorCategory **crates/router/src/core/errors.rs** Modify existing code **crates/router/src/core/payments/operations/payment_response.rs** Modify existing code **crates/router/src/core/payments/routing.rs** Modify existing code **crates/router/src/core/routing/helpers.rs** Add: - function: private::get_cached_dynamic_routing_config_for_profile - function: private::refresh_dynamic_routing_cache - function: pub::update_window_for_elimination_routing - impl: impl DynamicRoutingCache for routing_types::EliminationRoutingConfig
{"pr_number": 6816, "pr_title": "feat(dynamic_routing): integration of elimination routing for core flows", "merged_at": "2025-04-22T07:38:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/errors.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/routing/helpers.rs"], "config": ["config/development.toml"], "other": ["crates/common_enums/src/enums.rs"]}, "change_types": {"functions_added": 5, "fields_added": 55, "conditionals_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [AUTHORIZEDOTNET] customer_id length validated and server-too-busy error handled ## 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 --> customer_id length validated and server-too-busy error fixed ### 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. Setup Mandate with customer_id of length greater than max allowed length ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_NArOvTgCUUPP6V2rDoKmK763cqpUdUs7F2vSbwbQbGd0VzyRnOyXJEpxALlP6W9O' \ --data-raw ' { "amount": 0, "currency": "USD", "confirm": true, "customer": { "email": "[email protected]", "id": "customer_id_greater_than_length_20", "name": "Manisha Slack", "phone": "1234567890", "phone_country_code": "+1" }, "setup_future_usage": "off_session", "payment_type": "setup_mandate", "off_session": true, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "07", "card_exp_year": "26", "card_holder_name": "Joseph Does", "card_cvc": "123" } }, "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": 1000, "currency": "USD", "start_date": "2023-04-21T00:00:00Z", "end_date": "2023-05-21T00:00:00Z", "metadata": { "frequency": "13" } } } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" } } } ' ``` Response ``` {"payment_id":"pay_5uoErOavmqdqjrUbrZAH","merchant_id":"merchant_1752844609","status":"succeeded","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"authorizedotnet","client_secret":"pay_5uoErOavmqdqjrUbrZAH_secret_JZhgThPL50iHDzg6tIJ5","created":"2025-07-21T13:12:08.365Z","currency":"USD","customer_id":"customer_id_greater_than_length_20","customer":{"id":"customer_id_greater_than_length_20","name":"Manisha Slack","email":"[email protected]","phone":"1234567890","phone_country_code":"+1"},"description":null,"refunds":null,"disputes":null,"mandate_id":"man_3I7PRb2zvtTsHPCUIyGV","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":1000,"currency":"USD","start_date":"2023-04-21T00:00:00.000Z","end_date":"2023-05-21T00:00:00.000Z","metadata":{"frequency":"13"}}}},"setup_future_usage":"off_session","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":"07","card_exp_year":"26","card_holder_name":"Joseph Does","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":"John","last_name":"Doe"},"phone":null,"email":null},"billing":null,"order_details":null,"email":"[email protected]","name":"Manisha Slack","phone":"1234567890","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":"customer_id_greater_than_length_20","created_at":1753103528,"expires":1753107128,"secret":"epk_011d8416d97f44eb8ede16252a8f8999"},"manual_retry_allowed":false,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_gqhHNlHuk3bYhHxu7Or4","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3U25eUMykwv26k6svLyu","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-21T13:27:08.365Z","fingerprint":null,"browser_info":null,"payment_method_id":"pm_0Cd4rwPDE9mOzHqQs4FR","payment_method_status":"active","updated":"2025-07-21T13:12:09.064Z","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":"931978063-931256443","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. The "server too busy" error from Authorize.Net can only be tested when they actually return this specific error in a response. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` **Code Patterns Applied:** - Extend existing types with new fields (4 changes) - Add conditional logic for feature flags or filtering (3 changes) **Detailed Identifier Changes:** Commit 422724cf: Files to modify: **crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs** Modify existing code
{"pr_number": 8696, "pr_title": "feat(connector): [AUTHORIZEDOTNET] customer_id length validated and server-too-busy error handled", "merged_at": "2025-07-22T17:21:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs"]}, "change_types": {"fields_added": 4, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
docs(connector): [STRIPE] Added CIT & MIT Examples for API Reference in Stripe Split Payments ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [x] Documentation - [ ] CI/CD ## Description Added CIT and MIT flows examples for API Reference for Stripe Split Payments ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> `cargo run -p openapi --features v1` `mintlify dev` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Added two new example request bodies for the Payments - Create API demonstrating Stripe split payment requests for Customer Initiated Transactions (CIT) and Merchant Initiated Transactions (MIT). - Updated payment method schemas to clarify the "recurring_enabled" property, indicating its presence and optionality across different API responses and requests. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Other** - `api-reference/v1/openapi_spec_v1.json` - `crates/openapi/src/routes/payments.rs` **Detailed Identifier Changes:** Commit 0851c6ec: Files to modify: **crates/openapi/src/routes/payments.rs** Modify existing code
{"pr_number": 8311, "pr_title": "docs(connector): [STRIPE] Added CIT & MIT Examples for API Reference in Stripe Split Payments", "merged_at": "2025-06-20T14:01:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"other": ["api-reference/v1/openapi_spec_v1.json", "crates/openapi/src/routes/payments.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(customers_v2): address panics and some bugs in customers v2 endpoints ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR addresses panics and some bugs in customers v2 endpoints. This PR includes the following changes: - Fixes the customers v2 update and retrieve endpoints to use the correct HTTP methods (`PUT` and `GET` respectively). - Adds the `#[serde(deny_unknown_fields)]` to customer v2 request types. - Moves the `id` field to be at the beginning of the `CustomerResponse` and `CustomerDeleteResponse` structs, so that the JSON serialization also follows the same. - Introduces the `GlobalCustomerId` type and updates existing customer v2 (and other v2 modules like payment methods, payments, mandates) to use the `GlobalCustomerId` type instead of strings. - Removes some of the wrappers around the customer ID types (`CustomerId`, `GlobalId` and `UpdateCustomerId` defined in the `api_models` crate), and implements the methods / traits on the underlying ID types instead. - This was done since the underlying ID types and thus the field names differed, and it didn't make much difference as compared to implementing the methods / traits directly on the underlying ID type. - Removes the `customer_id` / `id` field from `CustomerUpdateRequest` type in both v1 and v2. This field was never expected to be passed in the request body, but only there for the purpose of API events. This PR introduces a `CustomerUpdateRequestInternal` type instead which wraps around the request and the ID type, and is used internally, not part of the public API interface. - Adds missing pieces of code to have the customers v2 create, retrieve, update, delete, list endpoints working. ### 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` --> - Moves the `id` field to be at the beginning of the `CustomerResponse` and `CustomerDeleteResponse` structs. - Updates the `customer_id` field in the payment methods and payments v2 API types to use `GlobalCustomerId` instead of `CustomerId`. - Removes the `customer_id` / `id` field from `CustomerUpdateRequest` type in both v1 and v2. - A few OpenAPI spec related fixes. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue 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 changes included in this PR help ensure that the customers v2 endpoints run without causing panics. This should also help unblock other tasks that depend on the customers v2 endpoints. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> - Create customer v2: ```shell curl --location 'http://localhost:8080/v2/customers' \ --header 'x-profile-id: pro_E6JIGLUJ0YUOCeyhbczu' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_fun38x9Yy3LoxGzdu0YK6KwO06xJT9aGfnm52FW6EL8hwNBKSXC3iilT8nDCEfOB' \ --data-raw '{ "merchant_reference_id": "customer_1734263771", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "default_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" }, "default_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" }, "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` - Retrieve customer v2: ```shell curl --location 'http://localhost:8080/v2/customers/12345_cus_0193ca2bc9e170e282ca121616ebec7a' \ --header 'x-profile-id: pro_E6JIGLUJ0YUOCeyhbczu' \ --header 'api-key: dev_fun38x9Yy3LoxGzdu0YK6KwO06xJT9aGfnm52FW6EL8hwNBKSXC3iilT8nDCEfOB' ``` - Update customer v2: ```shell curl --location --request PUT 'http://localhost:8080/v2/customers/12345_cus_0193ca2bc9e170e282ca121616ebec7a' \ --header 'x-profile-id: pro_E6JIGLUJ0YUOCeyhbczu' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_fun38x9Yy3LoxGzdu0YK6KwO06xJT9aGfnm52FW6EL8hwNBKSXC3iilT8nDCEfOB' \ --data-raw '{ "merchant_reference_id": "customer_1734263927", "name": "Jane Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65", "description": "Second customer", "default_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" }, "default_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" }, "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` - Delete customer v2: ```shell curl --location --request DELETE 'http://localhost:8080/v2/customers/12345_cus_0193ca2bc9e170e282ca121616ebec7a' \ --header 'x-profile-id: pro_E6JIGLUJ0YUOCeyhbczu' \ --header 'api-key: dev_fun38x9Yy3LoxGzdu0YK6KwO06xJT9aGfnm52FW6EL8hwNBKSXC3iilT8nDCEfOB' ``` - Customer list v2: ```shell curl --location 'http://localhost:8080/v2/customers/list' \ --header 'x-profile-id: pro_E6JIGLUJ0YUOCeyhbczu' \ --header 'api-key: dev_fun38x9Yy3LoxGzdu0YK6KwO06xJT9aGfnm52FW6EL8hwNBKSXC3iilT8nDCEfOB' ``` ### Known Bugs / Issues 1. The `default_billing_address` and `default_shipping_address` fields seem to be correctly encrypted and populated in the database, but not in the response (during customer create, update and retrieve). This is due to the way in which encryption is being handled in our code. 2. The `merchant_reference_id` is accepted in the customers update request, but it is not being accessed anywhere in the customers update flow. Moreover, the behavior once this is fixed should be such that it allows updating the reference ID from a null value to a non-null value, but does not allow updating the reference ID once set. 3. Customer delete v2 may not have redacted address completely, because of encryption issues (slightly related to 1). I'll be addressing these bugs in a separate PR, since 1 and 3 may need changes to the `ToEncryption` macro. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/customers.rs` - `crates/api_models/src/ephemeral_key.rs` - `crates/api_models/src/events/customer.rs` - ... and 2 more files **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/customers.rs` - `crates/diesel_models/src/kv.rs` - `crates/diesel_models/src/payment_intent.rs` - ... and 4 more files **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/customer.rs` - `crates/hyperswitch_domain_models/src/payment_methods.rs` - `crates/hyperswitch_domain_models/src/payments.rs` **4. Core Business Logic** - `crates/router/src/core/customers.rs` - `crates/router/src/core/mandate.rs` - `crates/router/src/core/payment_methods.rs` - ... and 10 more files **5. Type Definitions** - `crates/router/src/types/api/customers.rs` **6. Utils** - `crates/common_utils/src/events.rs` - `crates/common_utils/src/id_type.rs` - `crates/common_utils/src/id_type/customer.rs` - ... and 3 more files **7. Other** - `api-reference-v2/api-reference/customers/customers--create.mdx` - `api-reference-v2/api-reference/customers/customers--delete.mdx` - `api-reference-v2/api-reference/customers/customers--list.mdx` - ... and 18 more files **Code Patterns Applied:** - Define new data structures (4 changes) - Implement new functions (28 changes) - Extend existing types with new fields (134 changes) - Add conditional logic for feature flags or filtering (3 changes) - Modify database queries (3 changes) **Detailed Identifier Changes:** Commit dfbfce4e: Files to modify: **crates/api_models/src/customers.rs** Remove: - function: pub::get_merchant_reference_id - function: pub::new_customer_id_struct - function: pub::new - function: pub::get_merchant_reference_id - function: pub::new_customer_id_struct - function: pub::get_merchant_reference_id - function: pub::get_global_id - function: pub::new - struct: pub::CustomerId - struct: pub::GlobalId - struct: pub::CustomerId - struct: pub::UpdateCustomerId - impl: impl CustomerId - impl: impl GlobalId - impl: impl CustomerId - impl: impl UpdateCustomerId Add: - struct: pub::CustomerUpdateRequestInternal - struct: pub::CustomerUpdateRequestInternal **crates/api_models/src/ephemeral_key.rs** Add: - function: private::get_api_event_type - struct: pub::EphemeralKeyCreateRequest - impl: impl common_utils::events::ApiEventMetric for EphemeralKeyCreateRequest **crates/api_models/src/events/customer.rs** Remove: - function: private::get_api_event_type - function: private::get_api_event_type - impl: impl ApiEventMetric for CustomerId - impl: impl ApiEventMetric for CustomerUpdateRequest **crates/api_models/src/payment_methods.rs** Remove: - function: private::from - impl: impl From<PaymentMethodMigrationResponseType> for PaymentMethodMigrationResponse **crates/api_models/src/payments.rs** Modify existing code **crates/common_utils/src/events.rs** Modify existing code **crates/common_utils/src/id_type.rs** Remove: - mod: private::global_id Add: - mod: private::global_id **crates/common_utils/src/id_type/customer.rs** Add: - function: private::get_api_event_type - impl: impl crate::events::ApiEventMetric for CustomerId **crates/common_utils/src/id_type/global_id.rs** Remove: - mod: pub::payment - mod: pub::payment_methods - mod: pub::refunds Add: - mod: pub::customer - mod: pub::payment - mod: pub::payment_methods - mod: pub::refunds **crates/common_utils/src/id_type/global_id/customer.rs** Add: - function: pub::get_string_repr - function: pub::generate - function: private::try_from - function: private::get_api_event_type - impl: impl GlobalCustomerId - impl: impl TryFrom<GlobalCustomerId> for crate::id_type::CustomerId - impl: impl crate::events::ApiEventMetric for GlobalCustomerId **crates/common_utils/src/id_type/global_id/payment.rs** Modify existing code **crates/diesel_models/src/customers.rs** Modify existing code **crates/diesel_models/src/kv.rs** Modify existing code **crates/diesel_models/src/payment_intent.rs** Modify existing code **crates/diesel_models/src/payment_method.rs** Modify existing code **crates/diesel_models/src/query/customers.rs** Modify existing code **crates/diesel_models/src/query/mandate.rs** Modify existing code **crates/diesel_models/src/query/payment_method.rs** Remove: - function: pub::find_by_global_id **crates/hyperswitch_domain_models/src/customer.rs** Add: - function: pub::get_id - function: pub::get_id - impl: impl Customer **crates/hyperswitch_domain_models/src/payment_methods.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments.rs** Modify existing code **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/openapi/src/routes/customers.rs** Modify existing code **crates/router/src/compatibility/stripe/customers.rs** Modify existing code **crates/router/src/core/customers.rs** Remove: - impl: impl CustomerDeleteBridge for customers::CustomerId **crates/router/src/core/mandate.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/payment_methods/network_tokenization.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_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payment_create_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payment_get.rs** Modify existing code **crates/router/src/core/payments/operations/payment_session_intent.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/payouts.rs** Modify existing code **crates/router/src/db/customers.rs** Modify existing code **crates/router/src/db/kafka_store.rs** Add: - function: private::find_mandate_by_global_customer_id **crates/router/src/db/mandate.rs** Modify existing code **crates/router/src/db/payment_method.rs** Add: - function: private::find_payment_method_by_global_customer_id_merchant_id_status - function: private::find_payment_method_by_global_customer_id_merchant_id_status - function: private::find_payment_method_by_global_customer_id_merchant_id_status **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/customers.rs** Modify existing code **crates/router/src/routes/ephemeral_key.rs** Modify existing code **crates/router/src/routes/payment_methods.rs** Modify existing code **crates/router/src/routes/payments.rs** Modify existing code **crates/router/src/types/api/customers.rs** Modify existing code **crates/storage_impl/src/lib.rs** Modify existing code
{"pr_number": 6836, "pr_title": "refactor(customers_v2): address panics and some bugs in customers v2 endpoints", "merged_at": "2024-12-17T11:26:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/customers.rs", "crates/api_models/src/ephemeral_key.rs", "crates/api_models/src/events/customer.rs", "crates/api_models/src/payment_methods.rs", "crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/customers.rs", "crates/diesel_models/src/kv.rs", "crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/payment_method.rs", "crates/diesel_models/src/query/customers.rs", "crates/diesel_models/src/query/mandate.rs", "crates/diesel_models/src/query/payment_method.rs"], "domain": ["crates/hyperswitch_domain_models/src/customer.rs", "crates/hyperswitch_domain_models/src/payment_methods.rs", "crates/hyperswitch_domain_models/src/payments.rs"], "core_business": ["crates/router/src/core/customers.rs", "crates/router/src/core/mandate.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/network_tokenization.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_create_intent.rs", "crates/router/src/core/payments/operations/payment_get.rs", "crates/router/src/core/payments/operations/payment_session_intent.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/payouts.rs"], "types": ["crates/router/src/types/api/customers.rs"], "utils": ["crates/common_utils/src/events.rs", "crates/common_utils/src/id_type.rs", "crates/common_utils/src/id_type/customer.rs", "crates/common_utils/src/id_type/global_id.rs", "crates/common_utils/src/id_type/global_id/customer.rs", "crates/common_utils/src/id_type/global_id/payment.rs"], "other": ["api-reference-v2/api-reference/customers/customers--create.mdx", "api-reference-v2/api-reference/customers/customers--delete.mdx", "api-reference-v2/api-reference/customers/customers--list.mdx", "api-reference-v2/api-reference/customers/customers--retrieve.mdx", "api-reference-v2/api-reference/customers/customers--update.mdx", "api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes/customers.rs", "crates/router/src/compatibility/stripe/customers.rs", "crates/router/src/db/customers.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/mandate.rs", "crates/router/src/db/payment_method.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/customers.rs", "crates/router/src/routes/ephemeral_key.rs", "crates/router/src/routes/payment_methods.rs", "crates/router/src/routes/payments.rs", "crates/storage_impl/src/lib.rs"]}, "change_types": {"structs_added": 4, "functions_added": 28, "fields_added": 134, "imports_added": 8, "conditionals_added": 3, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(users): Add V2 User APIs to Support Modularity for Merchant Accounts ## 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 --> As part of the modularity effort, we are introducing user support to enable dashboard interactions with v2 merchant accounts. This allows users to create, list, and switch between merchant accounts within their organization. This also allows users to list profiles and switch profiles when using v2 merchant accounts. ## Key Changes ### 1. User Support for v2 Merchant Accounts Introduced APIs to facilitate user interactions with v2 merchant accounts: - **Create Merchant Account API (v1 & v2)**: Allows users to create a merchant account. - **List Merchant Accounts API**: Retrieves all v2 merchant accounts associated with a user in an organization. - **Switch Merchant Account API**: Enables users to switch to a different v2 merchant account. ### 2. Modified Response Structure - The response for **Create Merchant Account (v1 & v2)** now returns an object instead of just `StatusOk (200)`. The response object includes: - `merchant_id` - `merchant_name` - `product_type` - `version` - The **List Merchant Accounts API** now returns a vector of these objects instead of a raw list. ### 3. Request Structure Update - The **Create Merchant Account API** request now includes an optional `product_type` field. - This field is currently optional but will be made mandatory once both the frontend and backend are stabilized. ### 4. Recon - Added **Merchant Account** permission for Recon related activities. ### 5. User Support for v2 Profiles Introduced APIs to facilitate user interactions with v2 profiles: - **List Profiles API**: Retrieves all v2 profiles associated with a user in a merchant. - **Switch Profile API**: Enables users to switch to a different v2 profile in the merchant. ### 6. Modified get_user_details API: - Modified **get_user_details API** response type to return the version as well, enabling FE to have more context while trying to fetch the merchant account details. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> With the modularization of the payments solution, managing multiple merchant accounts becomes essential. This update ensures a seamless user experience for handling v1 and v2 merchant accounts and profiles within an organization. ## How did you test 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 flow looks like this: - Sign Up / Sign In through V1 merchant account --> Create Merchant Account (V1 or V2) --> List Merchant Accounts (V1 and V2)--> Switch Merchant Account (V1 and V2) ### Testing V2 Flow: Sign In to a V1 merchant account #### Create v2 Merchant Account: ```bash curl --location 'http://localhost:8000/v2/user/create_merchant' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWI5ZGZjNWUtZjA2My00YWY3LThkNzUtYmFmOTgzZmU0ODE4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF92S09zQU9odGc2S3hpSldlR3Y2YiIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDE3NTk2MjUsIm9yZ19pZCI6Im9yZ19kUENaYU51bmNaRDY5aVZXb0hKcyIsInByb2ZpbGVfaWQiOiJwcm9fQjV4UWZxUWE4dkNCaXpoc2FnTmkiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.MMJ68FinbhA4dShNvbrOsofU_nTaw1MjGnUrEkmkeOk' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWI5ZGZjNWUtZjA2My00YWY3LThkNzUtYmFmOTgzZmU0ODE4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF92S09zQU9odGc2S3hpSldlR3Y2YiIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDE3NTk2MjUsIm9yZ19pZCI6Im9yZ19kUENaYU51bmNaRDY5aVZXb0hKcyIsInByb2ZpbGVfaWQiOiJwcm9fQjV4UWZxUWE4dkNCaXpoc2FnTmkiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.MMJ68FinbhA4dShNvbrOsofU_nTaw1MjGnUrEkmkeOk' \ --data '{ "company_name": "TestingMerchantAccountCreateV2", "product_type": "vault" } ' ``` Sample Output: ```json { "merchant_id": "testingmerchantaccountcreatev2_Ku5OxNIapqaot1P8rlQr", "merchant_name": "TestingMerchantAccountCreateV2", "product_type": "vault", "version": "v2" } ``` #### List V2 Merchant Accounts for User in Org: ```bash curl --location 'http://localhost:8000/v2/user/list/merchant' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWI5ZGZjNWUtZjA2My00YWY3LThkNzUtYmFmOTgzZmU0ODE4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF92S09zQU9odGc2S3hpSldlR3Y2YiIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDE3NTk2MjUsIm9yZ19pZCI6Im9yZ19kUENaYU51bmNaRDY5aVZXb0hKcyIsInByb2ZpbGVfaWQiOiJwcm9fQjV4UWZxUWE4dkNCaXpoc2FnTmkiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.MMJ68FinbhA4dShNvbrOsofU_nTaw1MjGnUrEkmkeOk' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWI5ZGZjNWUtZjA2My00YWY3LThkNzUtYmFmOTgzZmU0ODE4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF92S09zQU9odGc2S3hpSldlR3Y2YiIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDE3NTk2MjUsIm9yZ19pZCI6Im9yZ19kUENaYU51bmNaRDY5aVZXb0hKcyIsInByb2ZpbGVfaWQiOiJwcm9fQjV4UWZxUWE4dkNCaXpoc2FnTmkiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.MMJ68FinbhA4dShNvbrOsofU_nTaw1MjGnUrEkmkeOk' ``` Sample Output: ```json [ { "merchant_id": "merchant_vKOsAOhtg6KxiJWeGv6b", "merchant_name": "merchant", "product_type": "orchestration", "version": "v2" }, { "merchant_id": "testingmerchantaccountcreatev2_Ku5OxNIapqaot1P8rlQr", "merchant_name": "TestingMerchantAccountCreateV2", "product_type": "vault", "version": "v2" } ] ``` #### Switch to V2 merchant Account: ```bash curl --location 'http://localhost:8000/v2/user/switch/merchant' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWI5ZGZjNWUtZjA2My00YWY3LThkNzUtYmFmOTgzZmU0ODE4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF92S09zQU9odGc2S3hpSldlR3Y2YiIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDE3NTk2MjUsIm9yZ19pZCI6Im9yZ19kUENaYU51bmNaRDY5aVZXb0hKcyIsInByb2ZpbGVfaWQiOiJwcm9fQjV4UWZxUWE4dkNCaXpoc2FnTmkiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.MMJ68FinbhA4dShNvbrOsofU_nTaw1MjGnUrEkmkeOk' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWI5ZGZjNWUtZjA2My00YWY3LThkNzUtYmFmOTgzZmU0ODE4IiwibWVyY2hhbnRfaWQiOiJ0ZXN0aW5nbWVyY2hhbnRhY2NvdW50Y3JlYXRldjJfS3U1T3hOSWFwcWFvdDFQOHJsUXIiLCJyb2xlX2lkIjoib3JnX2FkbWluIiwiZXhwIjoxNzQxNzU5NzYyLCJvcmdfaWQiOiJvcmdfZFBDWmFOdW5jWkQ2OWlWV29ISnMiLCJwcm9maWxlX2lkIjoicHJvX2huN2RqaVpKckJTMnYxS1hjdWIxIiwidGVuYW50X2lkIjoicHVibGljIn0.kxj8dXx4KBXRl-Ayfy6qVJxZF5hLvwqxouJ2ENubm8Q' \ --data '{ "merchant_id": "testingmerchantaccountcreatev2_Ku5OxNIapqaot1P8rlQr" }' ``` Sample Output: ```json { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWI5ZGZjNWUtZjA2My00YWY3LThkNzUtYmFmOTgzZmU0ODE4IiwibWVyY2hhbnRfaWQiOiJ0ZXN0aW5nbWVyY2hhbnRhY2NvdW50Y3JlYXRldjJfS3U1T3hOSWFwcWFvdDFQOHJsUXIiLCJyb2xlX2lkIjoib3JnX2FkbWluIiwiZXhwIjoxNzQxNzU5NzYyLCJvcmdfaWQiOiJvcmdfZFBDWmFOdW5jWkQ2OWlWV29ISnMiLCJwcm9maWxlX2lkIjoicHJvX2huN2RqaVpKckJTMnYxS1hjdWIxIiwidGVuYW50X2lkIjoicHVibGljIn0.kxj8dXx4KBXRl-Ayfy6qVJxZF5hLvwqxouJ2ENubm8Q", "token_type": "user_info" } ``` #### Switch to V2 Profile: ```bash curl --location 'http://localhost:8000/v2/user/switch/profile' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNzhjMjBkNzQtN2FkYy00NmE5LWEzN2UtNGFhOWMzOWE0ZDY4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF9DaGxVcVNSakNyc1pQMTI3VmVUeCIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDE4NjIxOTQsIm9yZ19pZCI6Im9yZ19VSWlNWFBvVFRsZVBXOElRU2V3MyIsInByb2ZpbGVfaWQiOiJwcm9fZnhHdTBKZm1mbUVmQVEwUGpiY1ciLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.8QVJGDmL-ybeQ8Rx8On_ACt7_GsFQVkE8-jZtT9fNXg' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNzhjMjBkNzQtN2FkYy00NmE5LWEzN2UtNGFhOWMzOWE0ZDY4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF9DaGxVcVNSakNyc1pQMTI3VmVUeCIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDE4NjIzODYsIm9yZ19pZCI6Im9yZ19VSWlNWFBvVFRsZVBXOElRU2V3MyIsInByb2ZpbGVfaWQiOiJwcm9fVWpKWUpGektSaGtvUmlZVHU4ckMiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.Yo6_JeAN1fv6GTqFZJWpvsNfm3BhxqPOjP2KRYNMH-A' \ --data '{ "profile_id": "pro_UjJYJFzKRhkoRiYTu8rC" }' ``` Sample Output: ```json { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNzhjMjBkNzQtN2FkYy00NmE5LWEzN2UtNGFhOWMzOWE0ZDY4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF9DaGxVcVNSakNyc1pQMTI3VmVUeCIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDE4NjIzODYsIm9yZ19pZCI6Im9yZ19VSWlNWFBvVFRsZVBXOElRU2V3MyIsInByb2ZpbGVfaWQiOiJwcm9fVWpKWUpGektSaGtvUmlZVHU4ckMiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.Yo6_JeAN1fv6GTqFZJWpvsNfm3BhxqPOjP2KRYNMH-A", "token_type": "user_info" } ``` #### List V2 Profile for a v2 merchant account: ```bash curl --location 'http://localhost:8000/v2/user/list/profile' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNzhjMjBkNzQtN2FkYy00NmE5LWEzN2UtNGFhOWMzOWE0ZDY4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF9DaGxVcVNSakNyc1pQMTI3VmVUeCIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDE4NjIxOTQsIm9yZ19pZCI6Im9yZ19VSWlNWFBvVFRsZVBXOElRU2V3MyIsInByb2ZpbGVfaWQiOiJwcm9fZnhHdTBKZm1mbUVmQVEwUGpiY1ciLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.8QVJGDmL-ybeQ8Rx8On_ACt7_GsFQVkE8-jZtT9fNXg' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNzhjMjBkNzQtN2FkYy00NmE5LWEzN2UtNGFhOWMzOWE0ZDY4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF9DaGxVcVNSakNyc1pQMTI3VmVUeCIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDE4NjIxOTQsIm9yZ19pZCI6Im9yZ19VSWlNWFBvVFRsZVBXOElRU2V3MyIsInByb2ZpbGVfaWQiOiJwcm9fZnhHdTBKZm1mbUVmQVEwUGpiY1ciLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.8QVJGDmL-ybeQ8Rx8On_ACt7_GsFQVkE8-jZtT9fNXg' ``` Sample Output: ```json [ { "profile_id": "pro_UjJYJFzKRhkoRiYTu8rC", "profile_name": "TestingV4-Profile" }, { "profile_id": "pro_fxGu0JfmfmEfAQ0PjbcW", "profile_name": "default" } ] ``` ### Testing V1 flow: Sign in to V1 merchant account #### Create V1 merchant Account: ```bash curl --location 'http://localhost:8080/user/create_merchant' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTk0OTE4YzUtOTM0OS00YjEzLWIzZDItZDc0Mzg0OTk3MWNkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxNTg4NTI2Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTc2MTM0OCwib3JnX2lkIjoib3JnX3NYdWNFTGFKSURtVFU2YVlsbmJZIiwicHJvZmlsZV9pZCI6InByb184QnNld0tIRUlaa3ppdUhKa282YiIsInRlbmFudF9pZCI6InB1YmxpYyJ9.lyeIOXMCXVdDaE7ACHxzoFgAZeCY0rjDRFq1rSxu1NE' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTk0OTE4YzUtOTM0OS00YjEzLWIzZDItZDc0Mzg0OTk3MWNkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxNTg4NTI2Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTc2MTM0OCwib3JnX2lkIjoib3JnX3NYdWNFTGFKSURtVFU2YVlsbmJZIiwicHJvZmlsZV9pZCI6InByb184QnNld0tIRUlaa3ppdUhKa282YiIsInRlbmFudF9pZCI6InB1YmxpYyJ9.lyeIOXMCXVdDaE7ACHxzoFgAZeCY0rjDRFq1rSxu1NE' \ --data '{ "company_name": "TestingV1", "product_type": "recovery" }' ``` Sample Output: ```json { "merchant_id": "merchant_1741588579", "merchant_name": "TestingV1", "product_type": "recovery", "version": "v1" } ``` #### List V1 Merchant Accounts for User in Org: ```bash curl --location 'http://localhost:8080/user/list/merchant' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTk0OTE4YzUtOTM0OS00YjEzLWIzZDItZDc0Mzg0OTk3MWNkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxNTg4NTI2Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTc2MTM0OCwib3JnX2lkIjoib3JnX3NYdWNFTGFKSURtVFU2YVlsbmJZIiwicHJvZmlsZV9pZCI6InByb184QnNld0tIRUlaa3ppdUhKa282YiIsInRlbmFudF9pZCI6InB1YmxpYyJ9.lyeIOXMCXVdDaE7ACHxzoFgAZeCY0rjDRFq1rSxu1NE' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTk0OTE4YzUtOTM0OS00YjEzLWIzZDItZDc0Mzg0OTk3MWNkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxNTg4NTI2Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTc2MTM0OCwib3JnX2lkIjoib3JnX3NYdWNFTGFKSURtVFU2YVlsbmJZIiwicHJvZmlsZV9pZCI6InByb184QnNld0tIRUlaa3ppdUhKa282YiIsInRlbmFudF9pZCI6InB1YmxpYyJ9.lyeIOXMCXVdDaE7ACHxzoFgAZeCY0rjDRFq1rSxu1NE' ``` Sample Output: ```json [ { "merchant_id": "merchant_1741588526", "merchant_name": null, "product_type": "orchestration", "version": "v1" }, { "merchant_id": "merchant_1741588579", "merchant_name": "TestingV1", "product_type": "recovery", "version": "v1" } ] ``` #### Switch to V1 Merchant Account: ```bash curl --location 'http://localhost:8080/user/switch/merchant' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTk0OTE4YzUtOTM0OS00YjEzLWIzZDItZDc0Mzg0OTk3MWNkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxNTg4NTI2Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTc2MTM0OCwib3JnX2lkIjoib3JnX3NYdWNFTGFKSURtVFU2YVlsbmJZIiwicHJvZmlsZV9pZCI6InByb184QnNld0tIRUlaa3ppdUhKa282YiIsInRlbmFudF9pZCI6InB1YmxpYyJ9.lyeIOXMCXVdDaE7ACHxzoFgAZeCY0rjDRFq1rSxu1NE' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTk0OTE4YzUtOTM0OS00YjEzLWIzZDItZDc0Mzg0OTk3MWNkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxNTg4NTc5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTc2MTUwNSwib3JnX2lkIjoib3JnX3NYdWNFTGFKSURtVFU2YVlsbmJZIiwicHJvZmlsZV9pZCI6InByb19PVnQ0OTIzYmdoS0dVRU13Y1JiOSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.5yi6unFpacer1FO_wcxxQIHRls_mjDjPraIHD6BO0ME' \ --data '{ "merchant_id": "merchant_1741588579" }' ``` Sample Output: ```json { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTk0OTE4YzUtOTM0OS00YjEzLWIzZDItZDc0Mzg0OTk3MWNkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxNTg4NTc5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTc2MTUwNSwib3JnX2lkIjoib3JnX3NYdWNFTGFKSURtVFU2YVlsbmJZIiwicHJvZmlsZV9pZCI6InByb19PVnQ0OTIzYmdoS0dVRU13Y1JiOSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.5yi6unFpacer1FO_wcxxQIHRls_mjDjPraIHD6BO0ME", "token_type": "user_info" } ``` #### get_user_details ```bash curl --location 'https://integ-api.hyperswitch.io/user' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMTlmN2IzZjctMmEwOS00NTllLTllNGItZTRlODcwZDMwMjEwIiwibWVyY2hhbnRfaWQiOiJ0ZXN0Zmxvd3YyX1pMNmV3aFBiZUhIMWU5dmlVc2JoIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTk0MzQ0Miwib3JnX2lkIjoib3JnX3MzUGVzYTQxRk1aNng3VVJOT0RPIiwicHJvZmlsZV9pZCI6InByb19zbjVFTFV0eGpFSnphN0dnYzhmRCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.EbmlEihGnAM_DW08BAyyeDHFZlBWmCm8Q0bRlAPnEfM' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMTlmN2IzZjctMmEwOS00NTllLTllNGItZTRlODcwZDMwMjEwIiwibWVyY2hhbnRfaWQiOiJ0ZXN0Zmxvd3YyX1pMNmV3aFBiZUhIMWU5dmlVc2JoIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTk0MzQ0Miwib3JnX2lkIjoib3JnX3MzUGVzYTQxRk1aNng3VVJOT0RPIiwicHJvZmlsZV9pZCI6InByb19zbjVFTFV0eGpFSnphN0dnYzhmRCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.EbmlEihGnAM_DW08BAyyeDHFZlBWmCm8Q0bRlAPnEfM' ``` Sample Output: ```json { "merchant_id": "testflowv2_ZL6ewhPbeHH1e9viUsbh", "name": "sandeep.kumar", "email": "[email protected]", "verification_days_left": null, "role_id": "org_admin", "org_id": "org_s3Pesa41FMZ6x7URNODO", "is_two_factor_auth_setup": false, "recovery_codes_left": null, "profile_id": "pro_sn5ELUtxjEJza7Ggc8fD", "entity_type": "organization", "theme_id": null, "version": "v2" } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/events/user.rs` - `crates/api_models/src/user.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/merchant_account.rs` **3. Core Business Logic** - `crates/router/src/core/admin.rs` - `crates/router/src/core/user.rs` **4. Type Definitions** - `crates/router/src/types/domain/user.rs` **5. Utils** - `crates/router/src/utils/user.rs` **6. Other** - `crates/common_enums/src/enums/accounts.rs` - `crates/router/src/consts/user.rs` - `crates/router/src/lib.rs` - ... and 2 more files **Code Patterns Applied:** - Define new data structures (1 changes) - Implement new functions (4 changes) - Extend existing types with new fields (27 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit d1f53036: Files to modify: **crates/api_models/src/events/user.rs** Modify existing code **crates/api_models/src/user.rs** Remove: - struct: pub::ListMerchantsForUserInOrgResponse Add: - struct: pub::UserMerchantAccountResponse **crates/common_enums/src/enums/accounts.rs** Modify existing code **crates/hyperswitch_domain_models/src/merchant_account.rs** Modify existing code **crates/router/src/consts/user.rs** Modify existing code **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/core/user.rs** Modify existing code **crates/router/src/lib.rs** Modify existing code **crates/router/src/routes/app.rs** Add: - function: pub::server - impl: impl User **crates/router/src/services/authorization/permission_groups.rs** Modify existing code **crates/router/src/types/domain/user.rs** Add: - function: pub::get_product_type **crates/router/src/utils/user.rs** Modify existing code
{"pr_number": 7386, "pr_title": "feat(users): Add V2 User APIs to Support Modularity for Merchant Accounts", "merged_at": "2025-03-12T14:36:50Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/user.rs", "crates/api_models/src/user.rs"], "domain": ["crates/hyperswitch_domain_models/src/merchant_account.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/user.rs"], "types": ["crates/router/src/types/domain/user.rs"], "utils": ["crates/router/src/utils/user.rs"], "other": ["crates/common_enums/src/enums/accounts.rs", "crates/router/src/consts/user.rs", "crates/router/src/lib.rs", "crates/router/src/routes/app.rs", "crates/router/src/services/authorization/permission_groups.rs"]}, "change_types": {"structs_added": 1, "functions_added": 4, "fields_added": 27, "imports_added": 2, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(connector): [BRAINTREE] Pass email in payment requests ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> ORIGINAL PR: https://github.com/juspay/hyperswitch/pull/7591 Pass email in payment request body of Braintree as it is mandatory field for sending receipts in braintree ### 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/7590 ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Payment Request: ``` { "amount": 1233, "currency": "EUR", "confirm": true, "customer_id": "abcdef", "billing": { "email": "[email protected]" } "name": "John Doe", "authentication_type": "no_three_ds", "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" } } } ``` Payment Response: ``` { "payment_id": "pay_o6SLsqlZ6J049AiPkHwW", "merchant_id": "postman_merchant_GHAction_ec4bf644-13b4-420a-9747-5a91dc33c1b5", "status": "requires_customer_action", "amount": 100, "net_amount": 100, "shipping_cost": null, "amount_capturable": 100, "amount_received": null, "connector": "braintree", "client_secret": "pay_o6SLsqlZ6J049AiPkHwW_secret_Bv6iGp8QmWWfywJd7jOO", "created": "2025-03-21T11:15:04.414Z", "currency": "EUR", "customer_id": "deepanshu", "customer": { "id": "deepanshu", "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "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": "10", "card_exp_year": "25", "card_holder_name": "Deepanshu Bansal", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": null, "phone": null, "email": "[email protected]" }, "order_details": null, "email": "[email protected]", "name": null, "phone": null, "return_url": "https://duck.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_o6SLsqlZ6J049AiPkHwW/postman_merchant_GHAction_ec4bf644-13b4-420a-9747-5a91dc33c1b5/pay_o6SLsqlZ6J049AiPkHwW_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": "deepanshu", "created_at": 1742555704, "expires": 1742559304, "secret": "epk_cc70c871e62f4f0a9a0fb797bb433941" }, "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_pzlYtlAD7YgNLdXLPSlq", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_CSJaSjj2gRnDoaSDRndr", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-03-21T11:30:04.414Z", "fingerprint": null, "browser_info": null, "payment_method_id": "pm_xp0BCgE81c2YO7G4Zan5", "payment_method_status": "inactive", "updated": "2025-03-21T11:15:06.916Z", "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", "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/braintree/transformers.rs` **Code Patterns Applied:** - Define new data structures (1 changes) - Extend existing types with new fields (8 changes) **Detailed Identifier Changes:** Commit b76ef128: Files to modify: **crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs** Add: - struct: pub::CustomerBody
{"pr_number": 7597, "pr_title": "refactor(connector): [BRAINTREE] Pass email in payment requests", "merged_at": "2025-03-21T16:28:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs"]}, "change_types": {"structs_added": 1, "fields_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(nuvei): Map NTID for nuvei payment responses ## 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 --> Return Network transaction if from connector Response - NOTE: we need to ask nuvei to return `external_scheme_transaction_id` during integration. <details> <summary> See returned NTID in the connector payment response</summary> ### Request ```json { "amount": 4324, "currency": "EUR", "confirm": true, "capture_method":"automatic", "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": "on_session", "payment_type":"setup_mandate", "connector":["nuvei"], "customer_id": "nidthhxxinn", "return_url": "https://www.google.com", "payment_method": "card", "payment_method_type": "credit", "authentication_type": "no_three_ds", "description": "hellow world", "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" } }, "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": "[email protected]", "payment_method_data": { "card": { "card_number": "4000000000009995", "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": "John Smith", "card_cvc": "100" } } } ``` ### Response ```json { "payment_id": "pay_132ox19xtSuuI0v9ys8n", "merchant_id": "merchant_1756789409", "status": "succeeded", "amount": 4324, "net_amount": 4324, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "nuvei", "client_secret": "pay_132ox19xtSuuI0v9ys8n_secret_zh69zcTMS8m8Gu3Qbxqj", "created": "2025-09-03T11:35:15.849Z", "currency": "EUR", "customer_id": "nidthhxxinn", "customer": { "id": "nidthhxxinn", "name": null, "email": "[email protected]", "phone": null, "phone_country_code": null }, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "9995", "card_type": "CREDIT", "card_network": "Visa", "card_issuer": "INTL HDQTRS-CENTER OWNED", "card_issuing_country": "UNITEDSTATES", "card_isin": "400000", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": "John Smith", "payment_checks": { "avs_description": null, "avs_result_code": "", "cvv_2_reply_code": "", "cvv_2_description": null, "merchant_advice_code": "", "merchant_advice_code_description": null }, "authentication_data": { "challengePreferenceReason": "12" } }, "billing": null }, "payment_token": "token_G1CCSamx2eABoRZkUVdu", "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe", "origin_zip": null }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "[email protected]", "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": "nidthhxxinn", "created_at": 1756899315, "expires": 1756902915, "secret": "epk_47477b29a38249f98abba6493c539f4b" }, "manual_retry_allowed": false, "connector_transaction_id": "7110000000016989638", "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": "8460393111", "payment_link": null, "profile_id": "pro_EzO6xGQZdE5pd9I5Rdzs", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_i5QVCDvXmBLbZg7n97n2", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-09-03T11:50:15.849Z", "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_bdgYAugJg43wY2L78Vkb", "network_transaction_id": "483299310332879", // NETWORK TRANSACTION ID "payment_method_status": "active", "updated": "2025-09-03T11:35:18.030Z", "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": "2313100111", "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 } ``` </details> <details> <summary> make a payment using NTID and card details</summary> ### request ```json { "amount": 10023, "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", "authentication_type": "no_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": "[email protected]", "payment_method": "card", "payment_method_type": "credit", "off_session": true, "recurring_details": { "type": "network_transaction_id_and_card_details", "data": { "card_number": "4000000000009995", "card_exp_month": "01", "card_exp_year": "2026", "card_network":"VISA", "network_transaction_id": "483299310332879" } } } ``` ### Response ```json { "payment_id": "pay_PP3muTBqIZL7tmrcOUgt", "merchant_id": "merchant_1756789409", "status": "succeeded", "amount": 10023, "net_amount": 10023, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10023, "connector": "nuvei", "client_secret": "pay_PP3muTBqIZL7tmrcOUgt_secret_nv6ljhZsvECDd4g7p3V2", "created": "2025-09-03T11:48:42.127Z", "currency": "EUR", "customer_id": null, "customer": null, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": true, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "9995", "card_type": "CREDIT", "card_network": "Visa", "card_issuer": "INTL HDQTRS-CENTER OWNED", "card_issuing_country": "UNITEDSTATES", "card_isin": "400000", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": null, "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": "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": "nithxxinn", "created_at": 1756900122, "expires": 1756903722, "secret": "epk_803cf15eb02a4cd29894d6eb117b464e" }, "manual_retry_allowed": false, "connector_transaction_id": "7110000000016990565", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "8460887111", "payment_link": null, "profile_id": "pro_EzO6xGQZdE5pd9I5Rdzs", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_i5QVCDvXmBLbZg7n97n2", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-09-03T12:03:42.127Z", "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": "483299310332879", "payment_method_status": null, "updated": "2025-09-03T11:48:43.810Z", "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 } ``` </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` --> ## 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/nuvei/transformers.rs` **Code Patterns Applied:** - Extend existing types with new fields (1 changes) **Detailed Identifier Changes:** Commit 00622647: Files to modify: **crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs** Modify existing code
{"pr_number": 9261, "pr_title": "feat(nuvei): Map NTID for nuvei payment responses", "merged_at": "2025-09-07T14:40:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(connector): stripe migration from router to hyperswitch_connectors ## 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 --> Move stripe connector code form `router` crate to `hyperswitch_connectors` crate - issue : https://github.com/juspay/hyperswitch/issues/8008 ### 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 a stripe Connector account ```sh curl --location 'http://localhost:8080/account/merchant_1747113313/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-feature: integ-custom' \ --header 'api-key: ******* ' \ --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": "card", "payment_method_types": [ { "payment_method_type": "credit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "payment_method_type": "klarna", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "affirm", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "afterpay_clearpay", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "city": "NY", "unit": "245" }, "connector_webhook_details": { "merchant_secret": "MyWebhookSecret" }, "business_country": "US", "business_label": "default" }' ``` Response : ```json { "connector_type": "payment_processor", "connector_name": "stripe", "connector_label": "stripe_US_default", "merchant_connector_id": "mca_8qleoiztV9FBwkaNf0Rm", "profile_id": "pro_t33gfLUkrUO76eylTYK4", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "****************************************************************************************" }, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "payment_method_type": "klarna", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "affirm", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "afterpay_clearpay", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "connector_webhook_details": { "merchant_secret": "MyWebhookSecret", "additional_secret": null }, "metadata": { "city": "NY", "unit": "245" }, "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 } ``` ### make successful payment ```sh curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_Li4eaVL1tG5lV2lVmj3vP6BBwvxQ19KIWwp7V2zbw1rhithkA5HxCr02paARBlCz' \ --data-raw '{ "amount": 10000000, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "CustomerX", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "HK", "first_name": "John", "last_name": "Doe" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "HK", "first_name": "John", "last_name": "Doe" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "payment_method": "card", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "123" } }, "connector_metadata": { "noon": { "order_category": "pay" } }, "setup_future_usage": "off_session", "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "13.232.74.226", "user_agent": "amet irure esse" } } }' ``` response ```json { "payment_id": "pay_q6e0Q412V5XBmVTfFvoe", "merchant_id": "merchant_1747113313", "status": "succeeded", "amount": 10000000, "net_amount": 10000000, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10000000, "connector": "stripe", "client_secret": "pay_q6e0Q412V5XBmVTfFvoe_secret_EbWpc8loQOn0naXMfEgZ", "created": "2025-05-13T05:15:28.338Z", "currency": "USD", "customer_id": "CustomerX", "customer": { "id": "CustomerX", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "10", "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": { "address": { "city": "San Fransico", "country": "HK", "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": "HK", "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": "[email protected]", "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": "CustomerX", "created_at": 1747113328, "expires": 1747116928, "secret": "epk_2f16f9167ee34c60a28130b51275b9d3" }, "manual_retry_allowed": false, "connector_transaction_id": "pi_3ROBBdD5R7gDAGff02wZ2nM2", "frm_message": null, "metadata": null, "connector_metadata": { "apple_pay": null, "airwallex": null, "noon": { "order_category": "pay" }, "braintree": null, "adyen": null }, "feature_metadata": null, "reference_id": "pi_3ROBBdD5R7gDAGff02wZ2nM2", "payment_link": null, "profile_id": "pro_t33gfLUkrUO76eylTYK4", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_8qleoiztV9FBwkaNf0Rm", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-13T05:30:28.338Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-13T05:15:30.957Z", "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 } ``` ## 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/payments.rs` - `crates/router/src/core/payments/flows.rs` **2. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors.rs` - `crates/router/src/connector/stripe.rs` - `crates/router/src/connector/stripe/transformers.rs` - ... and 8 more files **3. Type Definitions** - `crates/router/src/types.rs` **4. Other** - `crates/router/src/macros.rs` **Code Patterns Applied:** - Implement new functions (40 changes) - Extend existing types with new fields (343 changes) - Add conditional logic for feature flags or filtering (5 changes) **Detailed Identifier Changes:** Commit e5cf6698: Files to modify: **crates/hyperswitch_connectors/src/connectors.rs** Add: - mod: pub::stripe **crates/hyperswitch_connectors/src/constants.rs** Modify existing code **crates/hyperswitch_connectors/src/default_implementations.rs** Modify existing code **crates/hyperswitch_connectors/src/default_implementations_v2.rs** Modify existing code **crates/hyperswitch_connectors/src/types.rs** Add: - function: private::get_external_account_account_holder_type - trait: pub::PayoutIndividualDetailsExt - impl: impl PayoutIndividualDetailsExt for api_models::payouts::PayoutIndividualDetails **crates/hyperswitch_connectors/src/utils.rs** Modify existing code **crates/router/src/connector.rs** Remove: - mod: pub::stripe **crates/router/src/connector/utils.rs** Remove: - function: pub::get_authorise_integrity_object - function: pub::get_sync_integrity_object - function: pub::get_capture_integrity_object - function: pub::get_refund_integrity_object **crates/router/src/core/payments.rs** Remove: - function: private::get_name - function: private::get_email - trait: pub::CustomerDetailsExt - impl: impl CustomerDetailsExt for CustomerDetails **crates/router/src/core/payments/flows.rs** Modify existing code **crates/router/src/macros.rs** Modify existing code **crates/router/src/types.rs** Remove: - function: private::get_external_account_account_holder_type - impl: impl PayoutIndividualDetailsExt for api_models::payouts::PayoutIndividualDetails
{"pr_number": 8007, "pr_title": "refactor(connector): stripe migration from router to hyperswitch_connectors", "merged_at": "2025-05-16T14:21:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors.rs", "crates/router/src/connector/stripe.rs", "crates/router/src/connector/stripe/transformers.rs", "crates/router/src/connector/stripe/transformers/connect.rs", "crates/hyperswitch_connectors/src/constants.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/hyperswitch_connectors/src/types.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector.rs", "crates/router/src/connector/utils.rs"], "types": ["crates/router/src/types.rs"], "other": ["crates/router/src/macros.rs"]}, "change_types": {"functions_added": 40, "fields_added": 343, "imports_added": 22, "conditionals_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [TRUSTPAY] Added Integrity Checks for PSync & RSync flows & Added New Variants in AttemptStatus & IntentStatus ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Added Integrity Checks for PSync and RSync flows in Trustpay. Why not for other flows as well? The reason being, Trustpay doesnt send `amount` field in their response. Without getting to know the `amount`, we cannot perform integrity check. But they do send an `amount` field in Webhooks, so it will be checked upon receiving the webhooks payload. Also added a function which converts f64 to StringMajorUnit directly because there wasn't any function already which does it. We needed this function to convert the amount being received in f64 from Webhooks into StringMajorUnit which is required for the integrity check function. Also added new enum variants in AttemptStatus and IntentStatus. In AttemptStatus added an enum variant "IntegrityFailure" and in IntentStatus added an enum variant "Conflicted". ### 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? Note: Since we donot have the Trustpay Dashboard access for SEPA Bank Transfer payment method hence we are sending the webhook payload by ourselves and thereby adding a function inside impl IncomingWebhooks so that the source verification becomes true. ``` async fn verify_webhook_source( &self, _request: &webhooks::IncomingWebhookRequestDetails<'_>, _merchant_id: &common_utils::id_type::MerchantId, _connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>, _connector_account_details: crypto::Encryptable<masking::Secret<serde_json::Value>>, _connector_name: &str, ) -> CustomResult<bool, errors::ConnectorError> { Ok(true) } ``` Step 1: Do a Payments - Create (3DS) cURL : ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_SHOvApfNQsc4Jinsu2maY97fKEA8fmphKoXvhPRM5io9C6KhCVdfNQbLJhm3pkx2' \ --header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \ --data-raw '{ "amount": 6540, "currency": "EUR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "StripeCustomer", "email": "[email protected]", "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": "bank_transfer", "payment_method_type" :"sepa_bank_transfer", "payment_method_data": { "bank_transfer": { "sepa_bank_transfer": { } } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "ES", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "ES", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" } }' ``` We will get a status of `requires_customer_action` and upon getting redirected we will complete the payment and get a status of `processing` upon doing a PSync. PSync cURL : ``` curl --location 'http://localhost:8080/payments/pay_hfikYPO1IQG1QNjmTA7f?force_sync=true&expand_captures=true&expand_attempts=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_SHOvApfNQsc4Jinsu2maY97fKEA8fmphKoXvhPRM5io9C6KhCVdfNQbLJhm3pkx2' \ --header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' ``` Response: ``` { "payment_id": "pay_hfikYPO1IQG1QNjmTA7f", "merchant_id": "merchant_1747840487", "status": "processing", "amount": 6540, "net_amount": 6540, "shipping_cost": null, "amount_capturable": 6540, "amount_received": null, "connector": "trustpay", "client_secret": "pay_hfikYPO1IQG1QNjmTA7f_secret_fokQJrYy4upXurha5WqK", "created": "2025-05-21T15:15:05.524Z", "currency": "EUR", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "attempts": [ { "attempt_id": "pay_hfikYPO1IQG1QNjmTA7f_1", "status": "authorizing", "amount": 6540, "order_tax_amount": null, "currency": "EUR", "connector": "trustpay", "error_message": null, "payment_method": "bank_transfer", "connector_transaction_id": "1668403613", "capture_method": "automatic", "authentication_type": "three_ds", "created_at": "2025-05-21T15:15:05.524Z", "modified_at": "2025-05-21T15:15:49.679Z", "cancellation_reason": null, "mandate_id": null, "error_code": null, "payment_token": null, "connector_metadata": null, "payment_experience": null, "payment_method_type": "sepa_bank_transfer", "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": "bank_transfer", "payment_method_data": { "bank_transfer": { "sepa": {} }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "ES", "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": "[email protected]", "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": "sepa_bank_transfer", "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": "1668403613", "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_4l7F4ABCL71EMcjo792M", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_iiEi4DvepGnrCFNuMeam", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-21T15:30:05.524Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-21T15:16:21.400Z", "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 } ``` Once the status gets to 'suceedeed` and we receive webhooks and if there's a discrepency between the amount sent and amount sent to the connector, we receive this Webhook Payload : ``` curl --location 'https://af82-110-227-219-118.ngrok-free.app/webhooks/merchant_1747815234/mca_CK494Qer53vC6Qfi0tHI' \ --header 'Content-Type: application/json' \ --data '{ "PaymentInformation": { "CreditDebitIndicator": "CRDT", "References": { "MerchantReference": "pay_Q5hHIJ1qTvUf9l7gq8Xp_1", "PaymentId": "6964857984" }, "Status": "Paid", "Amount": { "Amount": 65.41, "Currency": "EUR" }, "StatusReasonInformation": null }, "Signature": "abcd" }' ``` Response: ``` { "error": { "type": "api", "message": "Integrity Check Failed! as data mismatched for amount expected 6540 but found 6541", "code": "IE_00", "connector_transaction_id": "6964857984" } } ``` <img width="1195" alt="Screenshot 2025-05-22 at 1 26 50 AM" src="https://github.com/user-attachments/assets/1d406a9f-5830-4287-b9dc-563ba9d5e87b" /> <img width="1195" alt="Screenshot 2025-05-22 at 1 27 11 AM" src="https://github.com/user-attachments/assets/61877d06-0e6a-4d38-ba30-b1f766eba4f9" /> ## 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.rs` **2. Core Business Logic** - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/helpers.rs` - `crates/router/src/core/payments/operations/payment_attempt_record.rs` - ... and 11 more files **3. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs` - `crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs` - `crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs` - ... and 4 more files **4. Type Definitions** - `crates/router/src/compatibility/stripe/payment_intents/types.rs` - `crates/router/src/compatibility/stripe/setup_intents/types.rs` - `crates/router/src/types.rs` - ... and 1 more files **5. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` - `crates/common_enums/src/enums.rs` - ... and 3 more files **Code Patterns Applied:** - Extend existing types with new fields (10 changes) - Add conditional logic for feature flags or filtering (2 changes) - Modify database queries (1 changes) **Detailed Identifier Changes:** Commit a76a9c15: Files to modify: **crates/common_enums/src/enums.rs** Modify existing code **crates/common_enums/src/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/trustpay.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_data.rs** Modify existing code **crates/router/src/compatibility/stripe/payment_intents/types.rs** Modify existing code **crates/router/src/compatibility/stripe/setup_intents/types.rs** Modify existing code **crates/router/src/connector/utils.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/payments/operations/payment_attempt_record.rs** Modify existing code **crates/router/src/core/payments/operations/payment_capture_v2.rs** Modify existing code **crates/router/src/core/payments/operations/payment_confirm_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payment_get.rs** Modify existing code **crates/router/src/core/payments/operations/payment_response.rs** Modify existing code **crates/router/src/core/payments/operations/payment_session_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payment_update_intent.rs** Modify existing code **crates/router/src/core/payments/operations/proxy_payments_intent.rs** Modify existing code **crates/router/src/core/payments/payment_methods.rs** Modify existing code **crates/router/src/core/payments/retry.rs** Modify existing code **crates/router/src/core/revenue_recovery/transformers.rs** Modify existing code **crates/router/src/core/routing/helpers.rs** Modify existing code **crates/router/src/types.rs** Modify existing code **crates/router/src/types/transformers.rs** Modify existing code
{"pr_number": 8096, "pr_title": "feat(connector): [TRUSTPAY] Added Integrity Checks for PSync & RSync flows & Added New Variants in AttemptStatus & IntentStatus", "merged_at": "2025-06-10T17:03:40Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_attempt_record.rs", "crates/router/src/core/payments/operations/payment_capture_v2.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_get.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/payment_session_intent.rs", "crates/router/src/core/payments/operations/payment_update_intent.rs", "crates/router/src/core/payments/operations/proxy_payments_intent.rs", "crates/router/src/core/payments/payment_methods.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/revenue_recovery/transformers.rs", "crates/router/src/core/routing/helpers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/connectors/trustpay.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/utils.rs"], "types": ["crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs", "crates/router/src/types.rs", "crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/common_enums/src/transformers.rs", "migrations/2025-05-21-194538_modify_attemptstatus_and_intentstatus/down.sql", "migrations/2025-05-21-194538_modify_attemptstatus_and_intentstatus/up.sql"]}, "change_types": {"fields_added": 10, "conditionals_added": 2, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): [Authorizedotnet] fix deserialization error for Paypal while canceling payment ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description fix deserialization error for Paypal while canceling payment for Authorizedotnet ### 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. connector create for authorizedot net ``` curl --location 'http://localhost:8080/account/postman_merchant_GHAction_39c48f8b-cc20-4438-aeb0-c55318bdaf57/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "payment_processor", "connector_name": "authorizedotnet", "connector_account_details": { "auth_type": "BodyKey", "api_key": "___", "key1": "_____" }, "test_mode": false, "disabled": false, "business_country": "US", "business_label": "default", "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "payment_method_type": "klarna", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "affirm", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "afterpay_clearpay", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "paypal", "payment_experience": "redirect_to_url", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": false, "installment_payment_enabled": false }, { "payment_method_type": "paypal", "payment_experience": "invoke_sdk_client", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": false, "installment_payment_enabled": false } ] } ], "metadata": { "city": "NY", "unit": "245" }, "connector_webhook_details": { "merchant_secret": "3F35B486E1C02696996449B9E028A12AD63244960A47F951535AF0150CD83C51C40C742790887A39742892A9FC2E3E7805C20B4FD985C07975CEB9CEAF3A867C" } }' ``` 2. Create a payment request for Paypal Payment method ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_sKAySZvwwbC2pO7VDEw2SjTRIZihrOStcCdzaxvzS6pDWRWVHoV9WY0q1HnvTziD' \ --data-raw '{ "amount": 58164, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 58164, "customer_id": "StripeCustomer", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "wallet", "payment_method_type": "paypal", "payment_method_data": { "wallet": { "paypal_redirect": {} } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response ``` { "payment_id": "pay_WTVANaVp0FGteE2Bx85r", "merchant_id": "postman_merchant_GHAction_39c48f8b-cc20-4438-aeb0-c55318bdaf57", "status": "requires_customer_action", "amount": 58164, "net_amount": 58164, "shipping_cost": null, "amount_capturable": 58164, "amount_received": null, "connector": "authorizedotnet", "client_secret": "pay_WTVANaVp0FGteE2Bx85r_secret_YyznIjfsXsw3OAiSjFJ2", "created": "2025-01-29T19:45:21.437Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "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": {}, "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": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": { "type": "redirect_to_url", "redirect_to_url": "http://localhost:8080/payments/redirect/pay_WTVANaVp0FGteE2Bx85r/postman_merchant_GHAction_39c48f8b-cc20-4438-aeb0-c55318bdaf57/pay_WTVANaVp0FGteE2Bx85r_1" }, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "paypal", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "StripeCustomer", "created_at": 1738179921, "expires": 1738183521, "secret": "epk_e364574f91ee4ad89486ff1625617897" }, "manual_retry_allowed": null, "connector_transaction_id": "80037212738", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "80037212738", "payment_link": null, "profile_id": "pro_SDmjfWOHaZl12nR19QZt", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_mODZDR1M4oeDuMJBXWaa", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-01-29T20:00:21.437Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-01-29T19:45:24.028Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` Click on redirection link and cancel the payment by clicking on "Cancel and return to Test Store" <img width="568" alt="image" src="https://github.com/user-attachments/assets/def50daa-3740-4751-9889-53f276af59a5" /> Payment should get failed 3. Retrive Payment ``` curl --location 'http://localhost:8080/payments/pay_WTVANaVp0FGteE2Bx85r' \ --header 'Accept: application/json' \ --header 'api-key: dev_sKAySZvwwbC2pO7VDEw2SjTRIZihrOStcCdzaxvzS6pDWRWVHoV9WY0q1HnvTziD' ``` Response ``` { "payment_id": "pay_WTVANaVp0FGteE2Bx85r", "merchant_id": "postman_merchant_GHAction_39c48f8b-cc20-4438-aeb0-c55318bdaf57", "status": "failed", "amount": 58164, "net_amount": 58164, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "authorizedotnet", "client_secret": "pay_WTVANaVp0FGteE2Bx85r_secret_YyznIjfsXsw3OAiSjFJ2", "created": "2025-01-29T19:45:21.437Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "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": {}, "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": "[email protected]", "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": "2006", "error_message": "Payer ID is required", "unified_code": "UE_9000", "unified_message": "Something went wrong", "payment_experience": null, "payment_method_type": "paypal", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": true, "connector_transaction_id": "80037212738", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "80037212738", "payment_link": null, "profile_id": "pro_SDmjfWOHaZl12nR19QZt", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_mODZDR1M4oeDuMJBXWaa", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-01-29T20:00:21.437Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-01-29T19:45:36.853Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/router/src/connector/authorizedotnet/transformers.rs` **Code Patterns Applied:** - Extend existing types with new fields (2 changes) **Detailed Identifier Changes:** Commit 698a0aa7: Files to modify: **crates/router/src/connector/authorizedotnet/transformers.rs** Modify existing code Commit dab87488: Files to modify: **crates/router/src/connector/authorizedotnet/transformers.rs** Modify existing code
{"pr_number": 7141, "pr_title": "fix(connector): [Authorizedotnet] fix deserialization error for Paypal while canceling payment ", "merged_at": "2025-02-05T15:03:54Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/connector/authorizedotnet/transformers.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
feat(router): Add Payments - List endpoint for v2 ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Added `Payments - List` endpoint for v2 ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test 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/list?profile_id=pro_4jOKADI7FmJF09Sp30bM' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: pro_syRDLhwbDPVbVgrDQDN5' \ --header 'api-key: dev_S529hQ8b0xLFAC4WvYFOgM9VFvUkxB8btBfmxVh83pejCCBmB33wK7ujJYoVcKAe' ``` - Response: ```json { "count": 3, "total_count": 3, "data": [ { "id": "12345_pay_0195129a6d6b79c0b0fc459fc0fc4ba8", "merchant_id": "cloth_seller_VbtyEBrzigIhWiWgxQWr", "profile_id": "pro_4jOKADI7FmJF09Sp30bM", "customer_id": "12345_cus_01951299cc277621a6c26053d1f98145", "payment_method_id": null, "status": "requires_payment_method", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": null }, "created": "2025-02-17T06:31:05.333Z", "payment_method_type": null, "payment_method_subtype": null, "connector": null, "merchant_connector_id": null, "customer": null, "merchant_reference_id": null, "connector_payment_id": null, "connector_response_reference_id": null, "metadata": null, "description": null, "authentication_type": "no_three_ds", "capture_method": "manual", "setup_future_usage": "on_session", "attempt_count": 0, "error": null, "cancellation_reason": null, "order_details": null, "return_url": null, "statement_descriptor": null, "allowed_payment_method_types": null, "authorization_count": 0, "modified_at": null }, { "id": "12345_pay_0195129973837d138240f54b307544f6", "merchant_id": "cloth_seller_VbtyEBrzigIhWiWgxQWr", "profile_id": "pro_4jOKADI7FmJF09Sp30bM", "customer_id": null, "payment_method_id": null, "status": "requires_payment_method", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": null }, "created": "2025-02-17T06:30:01.356Z", "payment_method_type": null, "payment_method_subtype": null, "connector": null, "merchant_connector_id": null, "customer": null, "merchant_reference_id": null, "connector_payment_id": null, "connector_response_reference_id": null, "metadata": null, "description": null, "authentication_type": "no_three_ds", "capture_method": "manual", "setup_future_usage": "on_session", "attempt_count": 0, "error": null, "cancellation_reason": null, "order_details": null, "return_url": null, "statement_descriptor": null, "allowed_payment_method_types": null, "authorization_count": 0, "modified_at": null }, { "id": "12345_pay_019512991b037d12b1a6c6be6e9ec825", "merchant_id": "cloth_seller_VbtyEBrzigIhWiWgxQWr", "profile_id": "pro_4jOKADI7FmJF09Sp30bM", "customer_id": null, "payment_method_id": null, "status": "requires_capture", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 100, "amount_captured": 0 }, "created": "2025-02-17T06:29:38.704Z", "payment_method_type": "card", "payment_method_subtype": "credit", "connector": "stripe", "merchant_connector_id": "mca_ONJ7YPf8ct3Mnvxir8d3", "customer": null, "merchant_reference_id": null, "connector_payment_id": "pi_3QtNq2EKQ8UQWeo41P082tvk", "connector_response_reference_id": null, "metadata": null, "description": null, "authentication_type": "no_three_ds", "capture_method": "manual", "setup_future_usage": "on_session", "attempt_count": 0, "error": null, "cancellation_reason": null, "order_details": null, "return_url": null, "statement_descriptor": null, "allowed_payment_method_types": null, "authorization_count": 0, "modified_at": "2025-02-17T06:29:55.623Z" } ] } ``` ## 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/payment.rs` - `crates/api_models/src/payments.rs` **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/query/payment_attempt.rs` **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs` - `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` **4. Core Business Logic** - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/transformers.rs` **5. Type Definitions** - `crates/router/src/types/api/payments.rs` **6. Other** - `api-reference-v2/api-reference/payments/payments--list.mdx` - `api-reference-v2/mint.json` - `api-reference-v2/openapi_spec.json` - ... and 9 more files **Code Patterns Applied:** - Define new data structures (5 changes) - Implement new functions (23 changes) - Extend existing types with new fields (245 changes) - Add conditional logic for feature flags or filtering (16 changes) - Modify database queries (68 changes) **Detailed Identifier Changes:** Commit d1f537e2: Files to modify: **crates/api_models/src/events/payment.rs** Modify existing code **crates/api_models/src/payments.rs** Add: - function: pub::has_no_attempt_filters - struct: pub::CustomerDetailsResponse - struct: pub::PaymentsListResponseItem - struct: pub::PaymentListConstraints - struct: pub::PaymentListResponse - impl: impl PaymentListConstraints **crates/diesel_models/src/query/payment_attempt.rs** Add: - function: pub::get_total_count_of_attempts **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_intent.rs** Add: - function: pub::get_profile_id - function: private::from - struct: pub::PaymentIntentListParams - enum: pub::PaymentIntentFetchConstraints - impl: impl PaymentIntentFetchConstraints - impl: impl From<api_models::payments::PaymentListConstraints> for PaymentIntentFetchConstraints **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/openapi/src/routes/payments.rs** Add: - function: pub::payments_list **crates/router/src/core/payments.rs** Add: - function: pub::list_payments **crates/router/src/core/payments/transformers.rs** Add: - function: private::foreign_from - impl: impl ForeignFrom<(storage::PaymentIntent, Option<storage::PaymentAttempt>)> for api_models::payments::PaymentsListResponseItem **crates/router/src/db/kafka_store.rs** Add: - function: private::get_total_count_of_filtered_payment_attempts - function: private::get_filtered_payment_intents_attempt - function: private::get_filtered_active_attempt_ids_for_total_count **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/payments.rs** Add: - function: pub::payments_list **crates/router/src/types/api/payments.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_attempt.rs** Add: - function: private::get_total_count_of_filtered_payment_attempts **crates/storage_impl/src/mock_db/payment_intent.rs** Add: - function: private::get_filtered_payment_intents_attempt - function: private::get_filtered_active_attempt_ids_for_total_count **crates/storage_impl/src/payments/payment_attempt.rs** Add: - function: private::get_total_count_of_filtered_payment_attempts - function: private::get_total_count_of_filtered_payment_attempts **crates/storage_impl/src/payments/payment_intent.rs** Add: - function: private::get_filtered_payment_intents_attempt - function: private::get_filtered_active_attempt_ids_for_total_count - function: private::get_filtered_payment_intents_attempt - function: private::get_filtered_active_attempt_ids_for_total_count
{"pr_number": 7191, "pr_title": "feat(router): Add Payments - List endpoint for v2", "merged_at": "2025-02-20T12:28:49Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/payment.rs", "crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/query/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router/src/types/api/payments.rs"], "other": ["api-reference-v2/api-reference/payments/payments--list.mdx", "api-reference-v2/mint.json", "api-reference-v2/openapi_spec.json", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes/payments.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/mock_db/payment_intent.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "crates/storage_impl/src/payments/payment_intent.rs"]}, "change_types": {"structs_added": 5, "functions_added": 23, "enums_added": 1, "fields_added": 245, "imports_added": 4, "conditionals_added": 16, "database_queries": 68}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): Add support for get plan prices 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 --> This PR integrates the get plan prices endpoint for chargebee, required to be called in the respective API handler for the same (not yet implemented) ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> Closes #9054 ## How did you test 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="1091" height="931" alt="image" src="https://github.com/user-attachments/assets/d9e6a1b7-461a-45ab-b10b-c5f307a79391" /> <img width="1282" height="358" alt="image" src="https://github.com/user-attachments/assets/c4ec8bc8-33b2-49be-9a46-42b455227d50" /> ## 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.rs` - `crates/hyperswitch_interfaces/src/api/subscriptions.rs` - `crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs` - ... and 2 more files **Code Patterns Applied:** - Define new data structures (8 changes) - Implement new functions (9 changes) - Extend existing types with new fields (63 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit e2f1a456: Files to modify: **crates/hyperswitch_connectors/src/connectors/chargebee.rs** Add: - function: private::get_chargebee_plan_prices_query_params - function: private::get_headers - function: private::get_url - function: private::build_request - function: private::handle_response - function: private::get_error_response - impl: impl api::subscriptions::GetSubscriptionPlanPricesFlow for Chargebee - impl: impl ConnectorIntegration< GetSubscriptionPlanPrices, GetSubscriptionPlanPricesRequest, GetSubscriptionPlanPricesResponse, > for Chargebee - impl: impl GetSubscriptionPlanPricesV2 for Chargebee - impl: impl ConnectorIntegrationV2< GetSubscriptionPlanPrices, hyperswitch_domain_models::router_data_v2::flow_common_types::GetSubscriptionPlanPricesData, GetSubscriptionPlanPricesRequest, GetSubscriptionPlanPricesResponse, > for Chargebee **crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs** Add: - function: private::try_from **crates/hyperswitch_connectors/src/connectors/recurly.rs** Add: - impl: impl api::subscriptions_v2::GetSubscriptionPlanPricesV2 for Recurly - impl: impl ConnectorIntegrationV2< GetSubscriptionPlanPrices, GetSubscriptionPlanPricesData, GetSubscriptionPlanPricesRequest, GetSubscriptionPlanPricesResponse, > for Recurly **crates/hyperswitch_connectors/src/default_implementations.rs** Remove: - impl: impl Subscriptions for connectors::DummyConnector<T> Add: - impl: impl GetSubscriptionPlanPricesFlow for $connector - impl: impl ConnectorIntegration< GetSubscriptionPlanPrices, GetSubscriptionPlanPricesRequest, GetSubscriptionPlanPricesResponse > for $connector - impl: impl Subscriptions for connectors::DummyConnector<T> - impl: impl GetSubscriptionPlanPricesFlow for connectors::DummyConnector<T> - impl: impl ConnectorIntegration< GetSubscriptionPlanPrices, GetSubscriptionPlanPricesRequest, GetSubscriptionPlanPricesResponse, > for connectors::DummyConnector<T> **crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs** Add: - struct: pub::GetSubscriptionPlanPricesData **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::GetSubscriptionPlanPrices **crates/hyperswitch_domain_models/src/router_request_types/subscriptions.rs** Add: - struct: pub::GetSubscriptionPlanPricesRequest **crates/hyperswitch_domain_models/src/router_response_types/subscriptions.rs** Add: - struct: pub::GetSubscriptionPlanPricesResponse - struct: pub::SubscriptionPlanPrices - enum: pub::PeriodUnit **crates/hyperswitch_domain_models/src/types.rs** Modify existing code **crates/hyperswitch_interfaces/src/api.rs** Modify existing code **crates/hyperswitch_interfaces/src/api/subscriptions.rs** Add: - trait: pub::GetSubscriptionPlanPricesFlow - trait: private::GetSubscriptionPlanPricesFlow **crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs** Remove: - trait: pub::SubscriptionsV2 Add: - trait: pub::SubscriptionsV2 - trait: pub::GetSubscriptionPlanPricesV2 **crates/hyperswitch_interfaces/src/conversion_impls.rs** Remove: - function: private::from_old_router_data - function: private::to_old_router_data - impl: impl RouterDataConversion<T, Req, Resp> for GetSubscriptionPlansData **crates/hyperswitch_interfaces/src/types.rs** Modify existing code **crates/router/src/services/api.rs** Modify existing code
{"pr_number": 9300, "pr_title": "feat(connector): Add support for get plan prices for Chargebee", "merged_at": "2025-09-19T08:20:28Z", "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.rs", "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": 9, "enums_added": 4, "fields_added": 63, "imports_added": 1, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(router): adding connector_customer_id for external vault proxy ## 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 --> Adding `connector_customer_id` for proxy 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 <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> 1. Create a profile ```bash curl --location 'http://localhost:8080/v2/profiles' \ --header 'x-merchant-id: MERCHANT_ID' \ --header 'Authorization: admin-api-key=ADMIN_API_KEY' \ --header 'Content-Type: application/json' \ --header 'api-key: ADMIN_API_KEY' \ --data-raw '{ "profile_name": "business_test_5", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "redirect_to_merchant_with_http_post": false, "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "webhook_url": "https://webhook.site", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true }, "metadata": null, "order_fulfillment_time": 900, "order_fulfillment_time_origin": "create", "applepay_verified_domains": null, "session_expiry": 900, "payment_link_config": null, "authentication_connector_details": null, "use_billing_as_payment_method_billing": true, "collect_shipping_details_from_wallet_connector_if_required": false, "collect_billing_details_from_wallet_connector_if_required": false, "always_collect_shipping_details_from_wallet_connector": false, "always_collect_billing_details_from_wallet_connector": false, "is_connector_agnostic_mit_enabled": false, "payout_link_config": null, "outgoing_webhook_custom_http_headers": null }' ``` Response ```json { "merchant_id": "cloth_seller_TEP9F7yYvhHwegRK39Nf", "id": "PROFILE_ID", "profile_name": "business_test_7", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "payment_response_hash_key": "NFgBM5rvXEI0wLgqQvT3oEgFPqj5w3Ncupj3bEA5MYanoJwq1oIycDh0jWEHGuUx", "redirect_to_merchant_with_http_post": false, "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "webhook_url": "https://webhook.site", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true, "payment_statuses_enabled": null, "refund_statuses_enabled": null, "payout_statuses_enabled": null }, "metadata": null, "applepay_verified_domains": null, "session_expiry": 900, "payment_link_config": null, "authentication_connector_details": null, "use_billing_as_payment_method_billing": true, "extended_card_info_config": null, "collect_shipping_details_from_wallet_connector_if_required": false, "collect_billing_details_from_wallet_connector_if_required": false, "always_collect_shipping_details_from_wallet_connector": false, "always_collect_billing_details_from_wallet_connector": false, "is_connector_agnostic_mit_enabled": false, "payout_link_config": null, "outgoing_webhook_custom_http_headers": null, "order_fulfillment_time": 900, "order_fulfillment_time_origin": "create", "tax_connector_id": null, "is_tax_connector_enabled": false, "is_network_tokenization_enabled": false, "should_collect_cvv_during_payment": null, "is_click_to_pay_enabled": false, "authentication_product_ids": null, "card_testing_guard_config": { "card_ip_blocking_status": "disabled", "card_ip_blocking_threshold": 3, "guest_user_card_blocking_status": "disabled", "guest_user_card_blocking_threshold": 10, "customer_id_blocking_status": "disabled", "customer_id_blocking_threshold": 5, "card_testing_guard_expiry": 3600 }, "is_clear_pan_retries_enabled": false, "is_debit_routing_enabled": false, "merchant_business_country": null, "is_iframe_redirection_enabled": null, "is_external_vault_enabled": null, "external_vault_connector_details": null, "merchant_category_code": null, "merchant_country_code": null, "split_txns_enabled": "skip" } ``` 2. Create a connector account for vault processor (VGS) ```bash curl --location 'http://localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: MERCHANT_ID' \ --header 'x-profile-id: PROFILE_ID' \ --header 'x-feature: hyperswitch-custom-v2' \ --header 'Authorization: admin-api-key=ADMIN_API_KEY' \ --header 'api-key: ADMIN_API_KEY' \ --data-raw '{ "connector_type": "vault_processor", "connector_name": "vgs", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "{CONNECTOR_API_KEY}", "key1": "{CONNECTOR_KEY1}", "api_secret": "{CONNECTOR_API_SECRET}" }, "frm_configs": null, "connector_webhook_details": { "merchant_secret": "" }, "profile_id": "PROFILE_ID", "metadata": { "proxy_url": "{VAULT_URL}", "certificate": "{BASE64_ENCODED_CERTIFICATE}" } }' ``` Response ```json { "connector_type": "vault_processor", "connector_name": "vgs", "connector_label": "vgs_business_test_7", "id": "MERCHANT_CONNECTOR_ACCOUNT_ID", "profile_id": "PROFILE_ID", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "US********************mi", "key1": "86********************************26", "api_secret": "tn*******lr" }, "payment_methods_enabled": null, "connector_webhook_details": { "merchant_secret": "", "additional_secret": null }, "metadata": { "proxy_url": "https://vault.verygoodproxy.com", "certificate": "CERTIFICATE_BASE64_ENCODED" }, "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 } ``` 3. Create a connector account for payment processor (Adyen) ```bash curl --location 'http://localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: MERCHANT_ID' \ --header 'x-profile-id: PROFILE_ID' \ --header 'Authorization: admin-api-key=ADMIN_API_KEY' \ --header 'api-key: ADMIN_API_KEY' \ --data '{ "connector_type": "payment_processor", "connector_name": "adyen", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "{CONNECTOR_API_KEY}", "key1": "{CONNECTOR_KEY1}", "api_secret":"{CONNECTOR_API_SECRET}" }, "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 } ] }, { "payment_method_type": "wallet", "payment_method_subtypes": [ { "payment_method_subtype": "google_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "apple_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "we_chat_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "ali_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "paypal", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "mb_way", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "pay_later", "payment_method_subtypes": [ { "payment_method_subtype": "klarna", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "affirm", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "afterpay_clearpay", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "walley", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "status_url": "https://example.com/status", "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": "PROFILE_ID" }' ``` Response ```json { "connector_type": "payment_processor", "connector_name": "adyen", "connector_label": "adyen_business_test_7", "id": "MERCHANT_CONNECTOR_ACCOUNT_ID", "profile_id": "PROFILE_ID", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "US********************mi", "key1": "Ju*******************************OM", "api_secret": "tn*******" }, "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 } ] }, { "payment_method_type": "wallet", "payment_method_subtypes": [ { "payment_method_subtype": "google_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "apple_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "we_chat_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "ali_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "paypal", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "mb_way", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method_type": "pay_later", "payment_method_subtypes": [ { "payment_method_subtype": "klarna", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "affirm", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "afterpay_clearpay", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "walley", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "connector_webhook_details": { "merchant_secret": "", "additional_secret": null }, "metadata": { "status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay", "account_name": "transaction_processing", "acquirer_bin": "438309", "pricing_type": "fixed_price", "acquirer_merchant_id": "00002000000" }, "disabled": false, "frm_configs": null, "applepay_verified_domains": null, "pm_auth_config": null, "status": "active", "additional_merchant_data": null, "connector_wallets_details": null, "feature_metadata": null } ``` 4. Create an API key for the profile ```bash curl --location 'http://localhost:8080/v2/api-keys' \ --header 'x-merchant-id: MERCHANT_ID' \ --header 'Authorization: admin-api-key=ADMIN_API_KEY' \ --header 'Content-Type: application/json' \ --header 'api-key: ADMIN_API_KEY' \ --data '{ "name": "My Api Key", "expiration": "never" }' ``` Response ```json { "key_id": "KEY_ID", "merchant_id": "MERCHANT_ID", "name": "My Api Key", "description": null, "api_key": "API_KEY", "created": "2025-09-11T10:14:53.929Z", "expiration": "never" } ``` 5. Create a customer ```bash curl --location 'http://localhost:8080/v2/customers' \ --header 'x-profile-id: PROFILE_ID' \ --header 'Authorization: api-key=API_KEY' \ --header 'Content-Type: application/json' \ --header 'api-key: API_KEY' \ --data-raw '{ "merchant_reference_id": "customer_1757584966", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "default_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" }, "default_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" }, "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response ```json { "id": "12345_cus_01993844c6c47dc39f528073a92ad278", "merchant_reference_id": "customer_1757585655", "connector_customer_ids": null, "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "default_billing_address": null, "default_shipping_address": null, "created_at": "2025-09-11T10:14:15.493Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null } ``` 6. Update the profile to add external vault details ```bash curl -v --location --request PUT 'http://localhost:8080/v2/profiles/PROFILE_ID' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: PROFILE_ID' \ --header 'Authorization: admin-api-key=ADMIN_API_KEY' \ --header 'x-merchant-id: MERCHANT_ID' \ --header 'x-tenant: public' \ --data-raw '{ "profile_name": "Update", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "redirect_to_merchant_with_http_post": false, "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "webhook_url": "https://webhook.site", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true }, "metadata": null, "order_fulfillment_time": 900, "order_fulfillment_time_origin": "create", "applepay_verified_domains": null, "session_expiry": 900, "payment_link_config": null, "authentication_connector_details": null, "use_billing_as_payment_method_billing": true, "collect_shipping_details_from_wallet_connector_if_required": false, "collect_billing_details_from_wallet_connector_if_required": false, "always_collect_shipping_details_from_wallet_connector": false, "always_collect_billing_details_from_wallet_connector": false, "is_connector_agnostic_mit_enabled": false, "payout_link_config": null, "outgoing_webhook_custom_http_headers": null, "is_external_vault_enabled": true, "external_vault_connector_details": { "vault_connector_id": "MERCHANT_CONNECTOR_ACCOUNT", "vault_sdk": "vgs_sdk" } }' ``` Response ```json { "merchant_id": "{MERCHANT_ID}", "id": "PROFILE_ID", "profile_name": "Update", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "payment_response_hash_key": "doVXhW8TEtgpZNZgrytLAnIuegoyApXlKwnXMM7nIe3tWKbRwlZ14CiNWRaThnQX", "redirect_to_merchant_with_http_post": false, "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "webhook_url": "https://webhook.site", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true, "payment_statuses_enabled": null, "refund_statuses_enabled": null, "payout_statuses_enabled": null }, "metadata": null, "applepay_verified_domains": null, "session_expiry": 900, "payment_link_config": null, "authentication_connector_details": null, "use_billing_as_payment_method_billing": true, "extended_card_info_config": null, "collect_shipping_details_from_wallet_connector_if_required": false, "collect_billing_details_from_wallet_connector_if_required": false, "always_collect_shipping_details_from_wallet_connector": false, "always_collect_billing_details_from_wallet_connector": false, "is_connector_agnostic_mit_enabled": false, "payout_link_config": null, "outgoing_webhook_custom_http_headers": null, "order_fulfillment_time": 900, "order_fulfillment_time_origin": "create", "tax_connector_id": null, "is_tax_connector_enabled": false, "is_network_tokenization_enabled": false, "should_collect_cvv_during_payment": null, "is_click_to_pay_enabled": false, "authentication_product_ids": null, "card_testing_guard_config": { "card_ip_blocking_status": "disabled", "card_ip_blocking_threshold": 3, "guest_user_card_blocking_status": "disabled", "guest_user_card_blocking_threshold": 10, "customer_id_blocking_status": "disabled", "customer_id_blocking_threshold": 5, "card_testing_guard_expiry": 3600 }, "is_clear_pan_retries_enabled": false, "is_debit_routing_enabled": false, "merchant_business_country": null, "is_iframe_redirection_enabled": null, "is_external_vault_enabled": true, "external_vault_connector_details": { "vault_connector_id": "MERCHANT_CONNECTOR_ACCOUNT", "vault_sdk": "vgs_sdk" }, "merchant_category_code": null, "merchant_country_code": null, "split_txns_enabled": "skip" } ``` 7. Create a payment intent with card details using external vault ```bash curl --location 'http://localhost:8080/v2/payments/create-intent' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: PROFILE_ID' \ --header 'Authorization: api-key=API_KEY' \ --header 'x-tenant: public' \ --header 'api-key: API_KEY' \ --data-raw '{ "amount_details": { "order_amount": 100, "currency": "USD" }, "customer_id": "CUSTOMER_ID", "capture_method":"manual", "authentication_type": "no_three_ds", "shipping": { "address": { "first_name": "John", "last_name": "Dough", "city": "Karwar", "zip": "581301", "state": "Karnataka", "country": "NL" }, "email": "[email protected]" }, "metadata":{ "udf":"test" }, "merchant_reference_id":"NOPA", "billing": { "address": { "city": "test", "country": "NL", "line1": "here is some \n there is some \n none is some? \n ", "line2": "there", "line3": "anywhere", "zip": "560095", "state": "SE", "first_name": "Sakil", "last_name": "Mostak" }, "phone": { "number": "1234567890", "country_code": "+1" }, "email": "[email protected]" } }' ``` Response ```json { "id": "12345_pay_019914bad4b97b51a5784378d30b65e2", "status": "requires_payment_method", "amount_details": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null }, "client_secret": "cs_019914bad58a7d419202971c85f52e78", "profile_id": "pro_zxVxleDz6pBK70pPhvHw", "merchant_reference_id": "NOPA", "routing_algorithm_id": null, "capture_method": "manual", "authentication_type": "no_three_ds", "billing": { "address": { "city": "test", "country": "NL", "line1": "here is some \n there is some \n none is some? \n ", "line2": "there", "line3": "anywhere", "zip": "560095", "state": "SE", "first_name": "Sakil", "last_name": "Mostak", "origin_zip": null }, "phone": { "number": "1234567890", "country_code": "+1" }, "email": "[email protected]" }, "shipping": { "address": { "city": "Karwar", "country": "NL", "line1": null, "line2": null, "line3": null, "zip": "581301", "state": "Karnataka", "first_name": "John", "last_name": "Dough", "origin_zip": null }, "phone": null, "email": "[email protected]" }, "customer_id": "CUSTOMER_ID", "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": { "udf": "test" }, "connector_metadata": null, "feature_metadata": null, "payment_link_enabled": "Skip", "payment_link_config": null, "request_incremental_authorization": "false", "split_txns_enabled": "skip", "expires_on": "2025-09-04T12:51:52.734Z", "frm_metadata": null, "request_external_three_ds_authentication": "Skip", "payment_type": "normal" } ``` 8. Confirm the payment intent using card details and vault data ```bash curl --location 'http://localhost:8080/v2/payments/12345_pay_019914bad4b97b51a5784378d30b65e2/confirm-intent/external-vault-proxy' \ --header 'x-client-secret: CLIENT_SECRET' \ --header 'x-profile-id: PROFILE_ID' \ --header 'Authorization: api-key=API_KEY' \ --header 'Content-Type: application/json' \ --header 'api-key: API_KEY' \ --data '{ "payment_method_type": "card", "payment_method_subtype": "debit", "payment_method_data": { "vault_data_card": { "card_number": "4166679492386746", "card_exp_month": "03", "card_exp_year": "2030", "card_cvc": "tok_sandbox_hmUN1L4M6ds1GQG62QmT8T", "bin_number": "42424", "last_four": "4242" } } }' ``` Response ```json { "id": "12345_pay_019914bad4b97b51a5784378d30b65e2", "status": "succeeded", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": 100 }, "customer_id": "CUSTOMER_ID", "connector": "adyen", "created": "2025-09-04T12:36:52.734Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": "Z2FDRSJ53HKV5CV5", "connector_reference_id": "NOPA", "merchant_connector_id": "mca_DJWBJR6rTI5PdoJBWhov", "browser_info": null, "error": { "code": "CONNECTOR_ERROR", "message": "Failed to deserialize connector response", "unified_code": null, "unified_message": null, "network_advice_code": null, "network_decline_code": null, "network_error_message": null }, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": "no_three_ds", "authentication_type_applied": "no_three_ds", "is_iframe_redirection_enabled": null, "merchant_reference_id": "NOPA", "raw_connector_response": null, "feature_metadata": 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/operations/external_vault_proxy_payment_intent.rs` **Code Patterns Applied:** - Extend existing types with new fields (4 changes) **Detailed Identifier Changes:** Commit 87ff43f2: Files to modify: **crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs** Modify existing code
{"pr_number": 9263, "pr_title": "fix(router): adding connector_customer_id for external vault proxy", "merged_at": "2025-09-11T12:38:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs"]}, "change_types": {"fields_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
Feat(connector): [AMAZON PAY] Added Template code ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Template code added for new connector Amazon Pay https://developer.amazon.com/docs/amazon-pay-api-v2/introduction.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 <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue 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? 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` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible Fixes https://github.com/juspay/hyperswitch-cloud/issues/7282
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/connector_enums.rs` **2. Core Business Logic** - `crates/router/src/core/payments/connector_integration_v2_impls.rs` - `crates/router/src/core/payments/flows.rs` **3. External Connector Integration** - `crates/common_enums/src/connector_enums.rs` - `crates/hyperswitch_connectors/src/connectors.rs` - `crates/hyperswitch_connectors/src/connectors/amazonpay.rs` - ... and 9 more files **4. Type Definitions** - `crates/router/src/types/api.rs` - `crates/router/src/types/transformers.rs` **5. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **6. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 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 fe4931a3: Files to modify: **crates/api_models/src/connector_enums.rs** Modify existing code **crates/common_enums/src/connector_enums.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors.rs** Add: - mod: pub::amazonpay **crates/hyperswitch_connectors/src/connectors/amazonpay.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::Amazonpay - impl: impl Amazonpay - impl: impl api::Payment for Amazonpay - impl: impl api::PaymentSession for Amazonpay - impl: impl api::ConnectorAccessToken for Amazonpay - impl: impl api::MandateSetup for Amazonpay - impl: impl api::PaymentAuthorize for Amazonpay - impl: impl api::PaymentSync for Amazonpay - impl: impl api::PaymentCapture for Amazonpay - impl: impl api::PaymentVoid for Amazonpay - impl: impl api::Refund for Amazonpay - impl: impl api::RefundExecute for Amazonpay - impl: impl api::RefundSync for Amazonpay - impl: impl api::PaymentToken for Amazonpay - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Amazonpay - impl: impl ConnectorCommonExt<Flow, Request, Response> for Amazonpay - impl: impl ConnectorCommon for Amazonpay - impl: impl ConnectorValidation for Amazonpay - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Amazonpay - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Amazonpay - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Amazonpay - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Amazonpay - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Amazonpay - impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Amazonpay - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Amazonpay - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Amazonpay - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Amazonpay - impl: impl webhooks::IncomingWebhook for Amazonpay - mod: pub::transformers **crates/hyperswitch_connectors/src/connectors/amazonpay/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::AmazonpayRouterData - struct: pub::AmazonpayPaymentsRequest - struct: pub::AmazonpayCard - struct: pub::AmazonpayAuthType - struct: pub::AmazonpayPaymentsResponse - struct: pub::AmazonpayRefundRequest - struct: pub::RefundResponse - struct: pub::AmazonpayErrorResponse - enum: pub::AmazonpayPaymentStatus - enum: pub::RefundStatus - impl: impl From<(StringMinorUnit, T)> for AmazonpayRouterData<T> - impl: impl TryFrom<&AmazonpayRouterData<&PaymentsAuthorizeRouterData>> for AmazonpayPaymentsRequest - impl: impl TryFrom<&ConnectorAuthType> for AmazonpayAuthType - impl: impl From<AmazonpayPaymentStatus> for common_enums::AttemptStatus - impl: impl TryFrom<ResponseRouterData<F, AmazonpayPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData> - impl: impl TryFrom<&AmazonpayRouterData<&RefundsRouterData<F>>> for AmazonpayRefundRequest - 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/amazonpay.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::AmazonpayTest - impl: impl ConnectorActions for AmazonpayTest - impl: impl utils::Connector for AmazonpayTest **crates/router/tests/connectors/main.rs** Add: - mod: private::amazonpay **crates/test_utils/src/connector_auth.rs** Modify existing code
{"pr_number": 6486, "pr_title": "Feat(connector): [AMAZON PAY] Added Template code", "merged_at": "2024-11-08T10:52:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/connector_enums.rs"], "core_business": ["crates/router/src/core/payments/connector_integration_v2_impls.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/amazonpay.rs", "crates/hyperswitch_connectors/src/connectors/amazonpay/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/amazonpay.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(analytics): add `sessionized_metrics` for disputes analytics ## 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 --> - Add sessionized metrics module and implement backwards compatibility. - Add the `sessionizer_dispute` table support for Sessionized metrics. ### Fixes #6572 ### 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). --> - Dispute metrics didn't have a `sessionized_metrics` module and implementation as were there in payments and payment_intents metrics ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ```bash curl --location 'http://localhost:8080/analytics/v1/org/metrics/disputes' \ --header 'Accept: */*' \ --header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \ --header 'Connection: keep-alive' \ --header 'Content-Type: application/json' \ --header 'Origin: http://localhost:9000' \ --header 'QueryType: SingleStat' \ --header 'Referer: http://localhost:9000/' \ --header 'Sec-Fetch-Dest: empty' \ --header 'Sec-Fetch-Mode: cors' \ --header 'Sec-Fetch-Site: same-site' \ --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36' \ --header 'api-key: dev_r3kVZ4URj3fMiHhJJuhHOVqteaXwKyEMGCaFo6PiCS6S9vZsb0ErV4kCVqogM60H' \ --header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDZlOGRmZWYtMzI0Zi00Yjc0LTg2MTItYzdkZjNhOGZmZTcyIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI3NDM0NTkzIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMTY1MTcyMCwib3JnX2lkIjoib3JnXzl3Y0kxQ2hTOGVEdnRRQmRXak9IIiwicHJvZmlsZV9pZCI6InByb19FNW5lek43YjZUbVB1WlUzbEU1VSJ9.gtctUL339INfdj6CVmZLW2NDMNcseMTCPX0uxSsOD1c' \ --header 'sec-ch-ua: "Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"' \ --header 'sec-ch-ua-mobile: ?0' \ --header 'sec-ch-ua-platform: "macOS"' \ --data '[ { "timeRange": { "startTime": "2024-11-06T18:30:00Z", "endTime": "2024-11-14T10:51:00Z" }, "mode": "ORDER", "source": "BATCH", "metrics": [ "dispute_status_metric", "total_amount_disputed", "total_dispute_lost_amount" ], "delta": true } ]' ``` ```bash curl --location 'http://localhost:8080/analytics/v1/org/metrics/disputes' \ --header 'Accept: */*' \ --header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \ --header 'Connection: keep-alive' \ --header 'Content-Type: application/json' \ --header 'Origin: http://localhost:9000' \ --header 'QueryType: SingleStat' \ --header 'Referer: http://localhost:9000/' \ --header 'Sec-Fetch-Dest: empty' \ --header 'Sec-Fetch-Mode: cors' \ --header 'Sec-Fetch-Site: same-site' \ --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36' \ --header 'api-key: dev_r3kVZ4URj3fMiHhJJuhHOVqteaXwKyEMGCaFo6PiCS6S9vZsb0ErV4kCVqogM60H' \ --header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDZlOGRmZWYtMzI0Zi00Yjc0LTg2MTItYzdkZjNhOGZmZTcyIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI3NDM0NTkzIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMTY1MTcyMCwib3JnX2lkIjoib3JnXzl3Y0kxQ2hTOGVEdnRRQmRXak9IIiwicHJvZmlsZV9pZCI6InByb19FNW5lek43YjZUbVB1WlUzbEU1VSJ9.gtctUL339INfdj6CVmZLW2NDMNcseMTCPX0uxSsOD1c' \ --header 'sec-ch-ua: "Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"' \ --header 'sec-ch-ua-mobile: ?0' \ --header 'sec-ch-ua-platform: "macOS"' \ --data '[ { "timeRange": { "startTime": "2024-11-06T18:30:00Z", "endTime": "2024-11-14T10:51:00Z" }, "mode": "ORDER", "source": "BATCH", "metrics": [ "sessionized_dispute_status_metric", "sessionized_total_amount_disputed", "sessionized_total_dispute_lost_amount" ], "delta": true } ]' ``` <img width="1289" alt="Screenshot 2024-11-14 at 6 14 32 PM" src="https://github.com/user-attachments/assets/ce8b0aeb-6f4f-4242-a329-4183a97ea8b3"> <img width="1289" alt="Screenshot 2024-11-14 at 6 14 32 PM" src="https://github.com/user-attachments/assets/ce8b0aeb-6f4f-4242-a329-4183a97ea8b3"> ### Result: Earlier it used to throw `5xx` for sessionized metrics but here it's giving us `200` for both metrics. ## 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. API Request/Response Models** - `crates/api_models/src/analytics.rs` - `crates/api_models/src/analytics/disputes.rs` - `crates/api_models/src/events.rs` **2. Core Business Logic** - `crates/analytics/src/disputes/core.rs` **3. Type Definitions** - `crates/analytics/src/types.rs` **4. Other** - `crates/analytics/src/clickhouse.rs` - `crates/analytics/src/disputes/accumulators.rs` - `crates/analytics/src/disputes/metrics.rs` - ... and 5 more files **Code Patterns Applied:** - Define new data structures (3 changes) - Implement new functions (4 changes) - Extend existing types with new fields (72 changes) - Add conditional logic for feature flags or filtering (5 changes) **Detailed Identifier Changes:** Commit 8fbb7663: Files to modify: **crates/analytics/src/clickhouse.rs** Modify existing code **crates/analytics/src/disputes/accumulators.rs** Modify existing code **crates/analytics/src/disputes/core.rs** Modify existing code **crates/analytics/src/disputes/metrics.rs** Add: - mod: private::sessionized_metrics **crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs** Add: - function: private::load_metrics - struct: pub::DisputeStatusMetric - impl: impl super::DisputeMetric<T> for DisputeStatusMetric **crates/analytics/src/disputes/metrics/sessionized_metrics/mod.rs** Add: - mod: private::dispute_status_metric - mod: private::total_amount_disputed - mod: private::total_dispute_lost_amount **crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs** Add: - function: private::load_metrics - struct: pub::TotalAmountDisputed - impl: impl super::DisputeMetric<T> for TotalAmountDisputed **crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs** Add: - function: private::load_metrics - struct: pub::TotalDisputeLostAmount - impl: impl super::DisputeMetric<T> for TotalDisputeLostAmount **crates/analytics/src/sqlx.rs** Modify existing code **crates/analytics/src/types.rs** Modify existing code **crates/api_models/src/analytics.rs** Add: - struct: pub::DisputesAnalyticsMetadata - struct: pub::DisputesMetricsResponse **crates/api_models/src/analytics/disputes.rs** Modify existing code **crates/api_models/src/events.rs** Add: - function: private::get_api_event_type - impl: impl ApiEventMetric for DisputesMetricsResponse<T>
{"pr_number": 6573, "pr_title": "feat(analytics): add `sessionized_metrics` for disputes analytics", "merged_at": "2024-11-26T13:58:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "order"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics.rs", "crates/api_models/src/analytics/disputes.rs", "crates/api_models/src/events.rs"], "core_business": ["crates/analytics/src/disputes/core.rs"], "types": ["crates/analytics/src/types.rs"], "other": ["crates/analytics/src/clickhouse.rs", "crates/analytics/src/disputes/accumulators.rs", "crates/analytics/src/disputes/metrics.rs", "crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs", "crates/analytics/src/disputes/metrics/sessionized_metrics/mod.rs", "crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs", "crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs", "crates/analytics/src/sqlx.rs"]}, "change_types": {"structs_added": 3, "functions_added": 4, "fields_added": 72, "imports_added": 21, "conditionals_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [Moneris] Add payments flow ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Add payments flows for connector Moneris - Payments (Cards) - Payment Sync - Capture - Void - Refund - Refund Sync - Add cypress test - Add wasm 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? 1. Create Merchant Account 2. Create API Key 3. Create MCA ``` curl --location 'http://localhost:8080/account/merchant_1739363796/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "payment_processor", "connector_name": "moneris", "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", "card_networks": [ "AmericanExpress", "Discover", "Interac", "JCB", "Mastercard", "Visa", "DinersClub", "UnionPay", "RuPay" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "card_networks": [ "AmericanExpress", "Discover", "Interac", "JCB", "Mastercard", "Visa", "DinersClub", "UnionPay", "RuPay" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "city": "NY", "unit": "245" }, "connector_webhook_details": { "merchant_secret": "dce1d767-7c28-429c-b0fe-9e0b9e91f962" }, "business_country": "US", "business_label": "food" }' ``` _____________________________________________________________________________________ 1. Create a Cards Payment ("capture_method": "manual") ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_MbH6f5FwMiYA3RQVXpNoxpawB6AtZ9xLeJoiVoyY5WA0DdAfb5o7DFJWPDBcZmjI' \ --data-raw '{ "amount": 800, "currency": "CAD", "confirm": true, "capture_method": "manual", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 800, "customer_id": "StripeCustomer", "email": "[email protected]", "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": "4242424242424242", "card_exp_month": "01", "card_exp_year": "27", "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": "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" }, "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_E2T2HdT5eE9DAQbuIZg6", "merchant_id": "merchant_1739444085", "status": "requires_capture", "amount": 800, "net_amount": 800, "shipping_cost": null, "amount_capturable": 800, "amount_received": null, "connector": "moneris", "client_secret": "pay_E2T2HdT5eE9DAQbuIZg6_secret_whpsvmOwj2jT6ozbNOBi", "created": "2025-02-13T10:56:49.709Z", "currency": "CAD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "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": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "27", "card_holder_name": "Joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "DE", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "DE", "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": "[email protected]", "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": { "customer_id": "StripeCustomer", "created_at": 1739444209, "expires": 1739447809, "secret": "epk_c118cb7eab8742c0869807cd72d1d8b5" }, "manual_retry_allowed": false, "connector_transaction_id": "pi0001JKZF8PHZW1YG054V5E9D6NX1", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi0001JKZF8PHZW1YG054V5E9D6NX1", "payment_link": null, "profile_id": "pro_Z4ijU0sS7k84EBvvBi88", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_5yPXakyIDD9btFqNqTOh", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-02-13T11:11:49.709Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-02-13T10:56:55.186Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` 2. Capture the payment ``` curl --location 'http://localhost:8080/payments/pay_E2T2HdT5eE9DAQbuIZg6/capture' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: _' \ --data '{ "amount_to_capture": 800, "statement_descriptor_name": "Joseph", "statement_descriptor_suffix": "JS" }' ``` Response ``` { "payment_id": "pay_E2T2HdT5eE9DAQbuIZg6", "merchant_id": "merchant_1739444085", "status": "succeeded", "amount": 800, "net_amount": 800, "shipping_cost": null, "amount_capturable": 0, "amount_received": 800, "connector": "moneris", "client_secret": "pay_E2T2HdT5eE9DAQbuIZg6_secret_whpsvmOwj2jT6ozbNOBi", "created": "2025-02-13T10:56:49.709Z", "currency": "CAD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "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": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "27", "card_holder_name": "Joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "DE", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "DE", "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": "[email protected]", "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": "pi0001JKZF8PHZW1YG054V5E9D6NX1", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi0001JKZF8PHZW1YG054V5E9D6NX1", "payment_link": null, "profile_id": "pro_Z4ijU0sS7k84EBvvBi88", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_5yPXakyIDD9btFqNqTOh", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-02-13T11:11:49.709Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-02-13T10:59:31.509Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` ____________________________________________________________________ 1. Create a Card Payment ("capture_method": "manual" ) ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: _' \ --data-raw '{ "amount": 800, "currency": "CAD", "confirm": true, "capture_method": "manual", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 800, "customer_id": "StripeCustomer", "email": "[email protected]", "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": "4242424242424242", "card_exp_month": "01", "card_exp_year": "27", "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": "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" }, "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" } } ' ``` Void the payment ``` curl --location 'http://localhost:8080/payments/pay_ieDuJ94ZeAVKN5cFDosT/cancel' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: _' \ --data '{ "cancellation_reason": "requested_by_customer" }' ``` Response ``` { "payment_id": "pay_ieDuJ94ZeAVKN5cFDosT", "merchant_id": "merchant_1739444085", "status": "cancelled", "amount": 800, "net_amount": 800, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "moneris", "client_secret": "pay_ieDuJ94ZeAVKN5cFDosT_secret_wRtvigMQJSiTdm27wrOk", "created": "2025-02-13T11:03:33.529Z", "currency": "CAD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "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": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "27", "card_holder_name": "Joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "DE", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "DE", "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": "[email protected]", "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": "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": "pi0001JKZFMY2V5X3V045NA6P1Z4TF", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi0001JKZFMY2V5X3V045NA6P1Z4TF", "payment_link": null, "profile_id": "pro_Z4ijU0sS7k84EBvvBi88", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_5yPXakyIDD9btFqNqTOh", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-02-13T11:18:33.529Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-02-13T11:03:59.957Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` _____________________________________________________________________________ 1. Create a Card Payment ("capture_method": "automatic") ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: _' \ --data-raw '{ "amount": 800, "currency": "CAD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 800, "customer_id": "StripeCustomer", "email": "[email protected]", "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": "4242424242424242", "card_exp_month": "01", "card_exp_year": "27", "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": "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" }, "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_DybD6hYEqf7GppsxtTpP", "merchant_id": "merchant_1739444085", "status": "succeeded", "amount": 800, "net_amount": 800, "shipping_cost": null, "amount_capturable": 0, "amount_received": 800, "connector": "moneris", "client_secret": "pay_DybD6hYEqf7GppsxtTpP_secret_EDStzF4Q0bbvadKldhhI", "created": "2025-02-13T11:05:05.442Z", "currency": "CAD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "27", "card_holder_name": "Joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "DE", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "DE", "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": "[email protected]", "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": { "customer_id": "StripeCustomer", "created_at": 1739444705, "expires": 1739448305, "secret": "epk_e790af00683447c79ce9942c701d58d1" }, "manual_retry_allowed": false, "connector_transaction_id": "pi0001JKZFQPZ61QEXVZMME4Y08AWV", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi0001JKZFQPZ61QEXVZMME4Y08AWV", "payment_link": null, "profile_id": "pro_Z4ijU0sS7k84EBvvBi88", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_5yPXakyIDD9btFqNqTOh", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-02-13T11:20:05.442Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-02-13T11:05:07.104Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` 2. create a Psync ``` curl --location 'http://localhost:8080/payments/pay_DybD6hYEqf7GppsxtTpP?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: _' ``` Response ``` { "payment_id": "pay_DybD6hYEqf7GppsxtTpP", "merchant_id": "merchant_1739444085", "status": "succeeded", "amount": 800, "net_amount": 800, "shipping_cost": null, "amount_capturable": 0, "amount_received": 800, "connector": "moneris", "client_secret": "pay_DybD6hYEqf7GppsxtTpP_secret_EDStzF4Q0bbvadKldhhI", "created": "2025-02-13T11:05:05.442Z", "currency": "CAD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "01", "card_exp_year": "27", "card_holder_name": "Joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "DE", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "DE", "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": "[email protected]", "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": "pi0001JKZFQPZ61QEXVZMME4Y08AWV", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi0001JKZFQPZ61QEXVZMME4Y08AWV", "payment_link": null, "profile_id": "pro_Z4ijU0sS7k84EBvvBi88", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_5yPXakyIDD9btFqNqTOh", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-02-13T11:20:05.442Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-02-13T11:05:07.104Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` 3. Create a Refund ``` curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: _' \ --data '{ "payment_id": "pay_DybD6hYEqf7GppsxtTpP", "amount": 600, "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response ``` { "refund_id": "ref_XqphS7TWLb7BMBQ15hUq", "payment_id": "pay_DybD6hYEqf7GppsxtTpP", "amount": 600, "currency": "CAD", "status": "succeeded", "reason": "Customer returned product", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "error_message": null, "error_code": null, "unified_code": null, "unified_message": null, "created_at": "2025-02-13T11:06:45.507Z", "updated_at": "2025-02-13T11:06:48.720Z", "connector": "moneris", "profile_id": "pro_Z4ijU0sS7k84EBvvBi88", "merchant_connector_id": "mca_5yPXakyIDD9btFqNqTOh", "split_refunds": null } ``` 4. Create Rsync ``` curl --location 'http://localhost:8080/refunds/ref_XqphS7TWLb7BMBQ15hUq?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: _' ``` Response ``` { "refund_id": "ref_XqphS7TWLb7BMBQ15hUq", "payment_id": "pay_DybD6hYEqf7GppsxtTpP", "amount": 600, "currency": "CAD", "status": "succeeded", "reason": "Customer returned product", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "error_message": null, "error_code": null, "unified_code": null, "unified_message": null, "created_at": "2025-02-13T11:06:45.507Z", "updated_at": "2025-02-13T11:07:55.108Z", "connector": "moneris", "profile_id": "pro_Z4ijU0sS7k84EBvvBi88", "merchant_connector_id": "mca_5yPXakyIDD9btFqNqTOh", "split_refunds": null } ``` Cypress Test Case <img width="823" alt="image" src="https://github.com/user-attachments/assets/bac07350-cb4a-488c-89af-e7bcc152c2e9" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/admin.rs` **2. External Connector Integration** - `crates/common_enums/src/connector_enums.rs` - `crates/connector_configs/src/connector.rs` - `crates/connector_configs/toml/development.toml` - ... and 7 more files **3. Type Definitions** - `crates/router/src/types/api.rs` - `crates/router/src/types/transformers.rs` **4. Tests** - `cypress-tests/cypress/e2e/configs/Payment/Moneris.js` - `cypress-tests/cypress/e2e/configs/Payment/Utils.js` **5. Configuration Files** - `config/deployments/production.toml` **6. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` **Code Patterns Applied:** - Define new data structures (9 changes) - Implement new functions (20 changes) - Extend existing types with new fields (380 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit d18d98a1: 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/moneris.rs** Remove: - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Moneris - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Moneris - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Moneris Add: - function: private::validate_connector_against_payment_request - function: private::get_url - function: private::get_content_type - function: private::get_headers - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - 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 - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Moneris - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Moneris - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Moneris **crates/hyperswitch_connectors/src/connectors/moneris/transformers.rs** Add: - function: private::from - struct: pub::Amount - struct: pub::PaymentMethod - impl: impl From<(MinorUnit, T)> for MonerisRouterData<T> - mod: pub::auth_headers **crates/router/src/configs/defaults/payment_connector_required_fields.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/moneris.rs** Modify existing code **crates/test_utils/src/connector_auth.rs** Modify existing code
{"pr_number": 7249, "pr_title": "feat(connector): [Moneris] Add payments flow", "merged_at": "2025-02-18T18:00:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/moneris.rs", "crates/hyperswitch_connectors/src/connectors/moneris/transformers.rs", "crates/router/src/configs/defaults/payment_connector_required_fields.rs", "crates/router/tests/connectors/moneris.rs", "crates/test_utils/src/connector_auth.rs"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Moneris.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js"], "config": ["config/deployments/production.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"structs_added": 9, "functions_added": 20, "enums_added": 1, "fields_added": 380, "imports_added": 6, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(webhooks): mask custom outgoing webhook headers in profile response ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Mask custom outgoing webhook headers in profile response. This changes is required to mask the custom outgoing webhook headers in the profile dashboard. This also requires control center changes, BE changes will only be merged and deployed after dashboard 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)? --> Test Case 1 : Profile create ``` curl --location 'http://localhost:8080/account/merchant_1733900220/business_profile' \ --header 'Content-Type: application/json' \ --header 'api-key: ••••••' \ --data-raw '{ "profile_name" : "test_profile1", "webhook_details": { "webhook_url": "https://webhook.site/672f0697-9e14-4a49-abef-b15769c19962", "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true }, "outgoing_webhook_custom_http_headers": { "authentication": "this is test key header", "test_key": "asd", "client_key": "asdkfjhakdjh" } }' ``` Response ``` { "merchant_id": "merchant_1733900220", "profile_id": "pro_nvV4ljCmGfPnUiRbjjMW", "profile_name": "test_profile1", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "payment_response_hash_key": "IurVIL6k065SRjO2TWHcx6cf2mQCWO1SKf1tep6AZ79XBFBcLJFvsfpZ3JWRkxHy", "redirect_to_merchant_with_http_post": false, "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "webhook_url": "https://webhook.site/672f0697-9e14-4a49-abef-b15769c19962", "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": { "authentication": "th*******************er", "test_key": "***", "client_key": "as********jh" }, "tax_connector_id": null, "is_tax_connector_enabled": false, "is_network_tokenization_enabled": false, "is_auto_retries_enabled": false, "max_auto_retries_enabled": null, "is_click_to_pay_enabled": false } ``` Profile update request ``` curl --location 'http://localhost:8080/account/merchant_1733900220/business_profile/pro_nvV4ljCmGfPnUiRbjjMW' \ --header 'Content-Type: application/json' \ --header 'api-key: ••••••' \ --data '{ "profile_name" : "test_profile1", "outgoing_webhook_custom_http_headers": { "changed_key" : "changed_value" } }' ``` response should have masked webhook headers ``` { "merchant_id": "merchant_1733900220", "profile_id": "pro_nvV4ljCmGfPnUiRbjjMW", "profile_name": "test_profile1", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "payment_response_hash_key": "IurVIL6k065SRjO2TWHcx6cf2mQCWO1SKf1tep6AZ79XBFBcLJFvsfpZ3JWRkxHy", "redirect_to_merchant_with_http_post": false, "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "webhook_url": "https://webhook.site/672f0697-9e14-4a49-abef-b15769c19962", "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": { "changed_key": "ch*********ue" }, "tax_connector_id": null, "is_tax_connector_enabled": false, "is_network_tokenization_enabled": false, "is_auto_retries_enabled": false, "max_auto_retries_enabled": null, "is_click_to_pay_enabled": false } ``` Payment webhooks : ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept-Language: zh' \ --header 'api-key: dev_e3cBS20M6B2YB0ec2fDQTbGMUQjfRpNSP6PSko2AC9plc57huvPLb70dLndryRMG' \ --data-raw '{ "amount": 700, "currency": "USD", "confirm": true, "payment_link": false, "capture_on": "2029-09-10T10:11:12Z", "amount_to_capture": 700, "name": "John Doe", "phone": "999999999", "email" :"[email protected]", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method_data": { "card": { "card_number": "4917610000000000", "card_exp_month": "03", "card_exp_year": "30", "card_cvc": "737" }, "billing": { "address": { "line1": "1467", "line2": "CA", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } } }, "payment_method": "card", "payment_method_type": "credit", "profile_id": "pro_Os8bvIiwq7rz0XESi190", "browser_info": { "color_depth": 24, "java_enabled": true, "java_script_enabled": true, "language": "en-GB", "screen_height": 720, "screen_width": 1280, "time_zone": -330, "ip_address": "208.127.127.193", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" }, "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "payment_link_config_id":"key2", "order_details": [ { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 110, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" } ] } ' ``` custom headerss of out going webhook will have non masked headers . <img width="1698" alt="Screenshot 2024-12-11 at 12 38 16 PM" src="https://github.com/user-attachments/assets/949cd502-1d24-47c6-a051-e9102267e4ca"> ## 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. Type Definitions** - `crates/router/src/types/api/admin.rs` **Code Patterns Applied:** - Define new data structures (1 changes) - Implement new functions (2 changes) - Extend existing types with new fields (6 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit bc8a9902: Files to modify: **crates/api_models/src/admin.rs** Add: - function: private::mask_value - function: pub::from_headers - struct: pub::MaskedHeaders - impl: impl MaskedHeaders **crates/router/src/types/api/admin.rs** Modify existing code
{"pr_number": 6822, "pr_title": "fix(webhooks): mask custom outgoing webhook headers in profile response", "merged_at": "2024-12-12T08:42:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs"], "types": ["crates/router/src/types/api/admin.rs"]}, "change_types": {"structs_added": 1, "functions_added": 2, "fields_added": 6, "imports_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(router): add `challenge_request_key` in authentication response and add support for cardinal authentication processor ## 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 `challenge_request_key` in authentication response and add support for cardinal authentication processor ### Additional Changes - [x] This PR modifies the API contract - [x] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Tested Manually 1. Perform external 3DS authentication and check for presence of `challenge_request_key` in authentication response CURL ``` curl --location '{{BASE_URL}}/payments/{{PAYMENT_ID}}/3ds/authentication' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: {{API_KEY}}' \ --data '{ "client_secret": "pay_7stGc8AODvtHlYiWFnEf_secret_zcj8sevT3uUHs31lnBVp", "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": "eyJtZXNzYWdlVHlwZSI6IkNSZXEiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjE5NzI5MzI5LTFjYjMtNDA5NC04MzIzLTk3MWZmOGExYzBlOCIsImFjc1RyYW5zSUQiOiIxZTc0N2MzZC02ZGNkLTRhZjAtOGVjYi0zOWE1MjMyMzQ2MmMiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMy4xIn0", "challenge_request_key": "creq", "acs_reference_number": "3DS_LOA_ACS_201_13579", "acs_trans_id": "1e747c3d-6dcd-4af0-8ecb-39a52323462c", "three_dsserver_trans_id": "19729329-1cb3-4094-8323-971ff8a1c0e8", "acs_signed_content": null, "three_ds_requestor_url": "https://my.flowbirdapp.com/", "three_ds_requestor_app_url": null } ``` 2. Sanity external 3DS flow ## 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/authentication.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/connector_endpoints.rs` - `crates/hyperswitch_domain_models/src/router_request_types/authentication.rs` **4. Core Business Logic** - `crates/router/src/core/authentication/utils.rs` - `crates/router/src/core/connector_validation.rs` - `crates/router/src/core/payments.rs` - ... and 2 more files **5. External Connector Integration** - `crates/common_enums/src/connector_enums.rs` - `crates/connector_configs/src/connector.rs` - `crates/connector_configs/toml/development.toml` - ... and 9 more files **6. Type Definitions** - `crates/router/src/types/api/authentication.rs` - `crates/router/src/types/api/feature_matrix.rs` **7. Other** - `api-reference/v1/openapi_spec_v1.json` - `api-reference/v2/openapi_spec_v2.json` - `crates/common_enums/src/enums.rs` - ... and 4 more files **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (34 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit b23c28b0: Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/common_enums/src/connector_enums.rs** Modify existing code **crates/common_enums/src/enums.rs** Modify existing code **crates/connector_configs/src/connector.rs** Modify existing code **crates/diesel_models/src/authentication.rs** Modify existing code **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs** Modify existing code **crates/hyperswitch_domain_models/src/connector_endpoints.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_request_types/authentication.rs** Add: - function: pub::get_challenge_request_key **crates/router/src/consts.rs** Modify existing code **crates/router/src/core/authentication/utils.rs** Modify existing code **crates/router/src/core/connector_validation.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/unified_authentication_service.rs** Modify existing code **crates/router/src/core/unified_authentication_service/utils.rs** Modify existing code **crates/router/src/db/authentication.rs** Modify existing code **crates/router/src/types/api/authentication.rs** Modify existing code **crates/router/src/types/api/connector_mapping.rs** Modify existing code **crates/router/src/types/api/feature_matrix.rs** Modify existing code **crates/router/src/types/connector_transformers.rs** Modify existing code **crates/test_utils/src/connector_auth.rs** Modify existing code
{"pr_number": 9429, "pr_title": "feat(router): add `challenge_request_key` in authentication response and add support for cardinal authentication processor", "merged_at": "2025-09-18T15:40:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "card"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/authentication.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/connector_endpoints.rs", "crates/hyperswitch_domain_models/src/router_request_types/authentication.rs"], "core_business": ["crates/router/src/core/authentication/utils.rs", "crates/router/src/core/connector_validation.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/unified_authentication_service.rs", "crates/router/src/core/unified_authentication_service/utils.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs", "crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs", "crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs", "crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/src/types/connector_transformers.rs", "crates/test_utils/src/connector_auth.rs"], "types": ["crates/router/src/types/api/authentication.rs", "crates/router/src/types/api/feature_matrix.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/common_enums/src/enums.rs", "crates/router/src/consts.rs", "crates/router/src/db/authentication.rs", "migrations/2025-09-15-065211_add-challenge-request-key-in-authentication/down.sql", "migrations/2025-09-15-065211_add-challenge-request-key-in-authentication/up.sql"]}, "change_types": {"functions_added": 1, "fields_added": 34, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(revenue_recovery): Populate payment method data in record attempt flow for V2 ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> In revenue recovery flow, when process tracker picks task , it records internal attempt first and then triggers proxy payments. Previously only customer id and psp token is required to make payment. Since recovery ml model needs all othe parameter, This PR adds support for populating payment method data in internal and external attempts . Attempts are created in 3 scenarios 1) when external attempt is triggered by billing connectors(like chargebee,recurly) via webhooks 2) when external attempt is created by custom billing api 3) process trackers executes execute_workflow. These 3 scenarios are covered in this PR . ### 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). --> Create payment via custom billing api, use this pr testcases https://github.com/juspay/hyperswitch/pull/8838 1) payment method data in both external and internal attempts in DB. 2) Internal payment attempts via worldpay should be succe succeeded dded ``` { "amount_details": { "order_amount": 100, "currency": "USD" }, "merchant_reference_id": "4444", "billing_merchant_connector_id" : "{{mca_id}}", "payment_merchant_connector_id": "mca_mOBlRqcT7KPPUlEBugqv", "error": { "code": "card_declined", "message": "Your card was declined.", "network_advice_code": null, "network_decline_code": "01", "network_error_message": "generic_decline" }, "billing": { "address": { "first_name": "John", "last_name": "Dough" }, "email": "[email protected]" }, "attempt_status": "failure", "payment_method_type": "card", "payment_method_sub_type": "credit", "transaction_created_at": "2025-06-20T10:11:12Z", "connector_customer_id": "cus_0001", "connector_transaction_id": "id35987asdaaddfse", "primary_processor_payment_method_token": "5454540204265454", "action": "schedule_failed_payment", "billing_started_at": "2025-07-31T10:11:12Z", "payment_method_units": { "2871855923280002": { "card": { "expiry_month": "12", "expiry_year": "25", "last_four_digits": "0008", "card_issuer": "Chase", "card_network" :"visa" } } } } ``` ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/payments.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments.rs` - `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs` **3. Core Business Logic** - `crates/router/src/core/payments/transformers.rs` - `crates/router/src/core/revenue_recovery.rs` - `crates/router/src/core/revenue_recovery/api.rs` - ... and 4 more files **4. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs` - `crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs` **5. Type Definitions** - `crates/router/src/types/storage/revenue_recovery.rs` - `crates/router/src/types/storage/revenue_recovery_redis_operation.rs` - `crates/router/src/types/transformers.rs` **6. Other** - `crates/router/src/workflows/revenue_recovery.rs` **Code Patterns Applied:** - Define new data structures (1 changes) - Implement new functions (8 changes) - Extend existing types with new fields (68 changes) - Add conditional logic for feature flags or filtering (1 changes) - Modify database queries (1 changes) **Detailed Identifier Changes:** Commit 594fae14: Files to modify: **crates/api_models/src/payments.rs** Add: - function: pub::get_connector_customer_id - struct: pub::RecordAttemptPaymentMethodDataRequest **crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/revenue_recovery.rs** Modify existing code **crates/router/src/core/revenue_recovery/api.rs** Modify existing code **crates/router/src/core/revenue_recovery/transformers.rs** Modify existing code **crates/router/src/core/revenue_recovery/types.rs** Add: - function: pub::get_payment_processor_token_id_from_payment_attempt **crates/router/src/core/utils.rs** Modify existing code **crates/router/src/core/webhooks/recovery_incoming.rs** Remove: - function: private::insert_execute_pcr_task **crates/router/src/types/storage/revenue_recovery.rs** Modify existing code **crates/router/src/types/storage/revenue_recovery_redis_operation.rs** Add: - function: pub::get_token_based_on_retry_type **crates/router/src/types/transformers.rs** Add: - function: private::foreign_from - impl: impl ForeignFrom<&revenue_recovery_redis_operation::PaymentProcessorTokenStatus> for payments::AdditionalCardInfo **crates/router/src/workflows/revenue_recovery.rs** Add: - function: private::error_handler - function: pub::get_token_with_schedule_time_based_on_retry_algorithm_type
{"pr_number": 9061, "pr_title": "fix(revenue_recovery): Populate payment method data in record attempt flow for V2", "merged_at": "2025-08-28T17:25:22Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs"], "core_business": ["crates/router/src/core/payments/transformers.rs", "crates/router/src/core/revenue_recovery.rs", "crates/router/src/core/revenue_recovery/api.rs", "crates/router/src/core/revenue_recovery/transformers.rs", "crates/router/src/core/revenue_recovery/types.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/recovery_incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs"], "types": ["crates/router/src/types/storage/revenue_recovery.rs", "crates/router/src/types/storage/revenue_recovery_redis_operation.rs", "crates/router/src/types/transformers.rs"], "other": ["crates/router/src/workflows/revenue_recovery.rs"]}, "change_types": {"structs_added": 1, "functions_added": 8, "fields_added": 68, "imports_added": 7, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): [GlobalPay] Address `5xx` when cancelling a paypal transaction ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR addresses 5xx that currently is being thrown when a user tries to cancel the PayPal transactions from the redirected page: <img width="372" alt="image" src="https://github.com/user-attachments/assets/4f920b8b-6ab4-4bcb-9705-dc4d15635c2d" /> This is addressed by introducing a new field `cancel_url` that is required for PayPal. This PR also removes unused structs and enums. In addition to that, `ActionType` has been replaced the previous `String` and now that it only accepts limited number of values. ### 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). --> We're getting a 5xx when trying to cancel the payment. Closes [#7607](https://github.com/juspay/hyperswitch/issues/7607) ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ▶ Expose the `localhost` to the internet via `tailscale funnel` <details> <summary>Make a Paypal transaction</summary> Create Payment: ```curl curl --location 'https://pix-mbp.orthrus-monster.ts.net/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_DYcmLTXXQ6gF1HulHKL1WMBpoP8Uw2v1M4eO9mqp9za9AHCpJfhloE568dArpo5Y' \ --data-raw '{ "amount": 1000, "currency": "USD", "confirm": false, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 1000, "customer_id": "StripeCustomer", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://duck.com", "billing": { "address": { "first_name": "John", "last_name": "Doe", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "127.0.0.1" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` ```json { "payment_id": "pay_nL4QMyfyB3Q6T0Cs2OEf", "merchant_id": "postman_merchant_GHAction_164c761e-166f-4a82-859f-609d96a725b0", "status": "requires_payment_method", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": null, "client_secret": "pay_nL4QMyfyB3Q6T0Cs2OEf_secret_No5MIK8z5xGpdgyfb5gH", "created": "2025-03-24T11:25:08.436Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": null, "payment_method_data": null, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "StripeCustomer", "created_at": 1742815508, "expires": 1742819108, "secret": "epk_bc69bc123b7446839d02b177bc3273f7" }, "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_bf5d6NP8wcNd1vnsH0eE", "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-24T11:40:08.436Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-03-24T11:25:08.461Z", "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 } ``` Confirm payment: ```curl curl --location 'https://pix-mbp.orthrus-monster.ts.net/payments/pay_5Vm2zTuuBxSsYrddguto/confirm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_DYcmLTXXQ6gF1HulHKL1WMBpoP8Uw2v1M4eO9mqp9za9AHCpJfhloE568dArpo5Y' \ --data '{ "payment_method": "wallet", "payment_method_type": "paypal", "return_url": "https://nohello.com", "payment_method_data": { "wallet": { "paypal_redirect": { } } } } ' ``` ```json { "payment_id": "pay_nL4QMyfyB3Q6T0Cs2OEf", "merchant_id": "postman_merchant_GHAction_164c761e-166f-4a82-859f-609d96a725b0", "status": "requires_customer_action", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 1000, "amount_received": null, "connector": "globalpay", "client_secret": "pay_nL4QMyfyB3Q6T0Cs2OEf_secret_No5MIK8z5xGpdgyfb5gH", "created": "2025-03-24T11:25:08.436Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": {}, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://nohello.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_nL4QMyfyB3Q6T0Cs2OEf/postman_merchant_GHAction_164c761e-166f-4a82-859f-609d96a725b0/pay_nL4QMyfyB3Q6T0Cs2OEf_1" }, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "paypal", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": null, "connector_transaction_id": "TRN_PRy15uCj0zyEXanseeWWt78nr53Zh4_Q6T0Cs2OEf_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_nL4QMyfyB3Q6T0Cs2OEf_1", "payment_link": null, "profile_id": "pro_bf5d6NP8wcNd1vnsH0eE", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_vURZVfOwYJUGEdIvkfny", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-03-24T11:40:08.436Z", "fingerprint": null, "browser_info": { "os_type": null, "language": null, "time_zone": null, "ip_address": "103.159.11.202", "os_version": null, "user_agent": null, "color_depth": null, "device_model": null, "java_enabled": null, "screen_width": null, "accept_header": null, "screen_height": null, "accept_language": "en", "java_script_enabled": null }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-03-24T11:25:12.890Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": null, "issuer_error_code": null, "issuer_error_message": null } ``` </details> <details> <summary>Click on `Cancel and return to Global Pay Merchant's Test Store` in PayPal **Express Checkout** page</summary> <img width="561" alt="image" src="https://github.com/user-attachments/assets/b13b7e05-31c1-4037-a9b7-a7fd8c2d017f" /> </details> <details> <summary>You should be redirected to the `return_url` with payment status as `failed`</summary> <img width="652" alt="image" src="https://github.com/user-attachments/assets/18aab179-ccce-4ce4-ab83-3a13e970999f" /> </details> <details> <summary>Retrieve the Payment to see the updated status</summary> ```curl curl --location 'https://pix-mbp.orthrus-monster.ts.net/payments/pay_5Vm2zTuuBxSsYrddguto?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_DYcmLTXXQ6gF1HulHKL1WMBpoP8Uw2v1M4eO9mqp9za9AHCpJfhloE568dArpo5Y' ``` ```json { "payment_id": "pay_nL4QMyfyB3Q6T0Cs2OEf", "merchant_id": "postman_merchant_GHAction_164c761e-166f-4a82-859f-609d96a725b0", "status": "failed", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "globalpay", "client_secret": "pay_nL4QMyfyB3Q6T0Cs2OEf_secret_No5MIK8z5xGpdgyfb5gH", "created": "2025-03-24T11:25:08.436Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": {}, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "https://nohello.com/", "authentication_type": "three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": "INVALID_REQUEST_DATA", "error_message": "The supplied Payer Id doesn't match the value saved in the database", "unified_code": "UE_9000", "unified_message": "Something went wrong", "payment_experience": null, "payment_method_type": "paypal", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": true, "connector_transaction_id": "TRN_PRy15uCj0zyEXanseeWWt78nr53Zh4_Q6T0Cs2OEf_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_nL4QMyfyB3Q6T0Cs2OEf_1", "payment_link": null, "profile_id": "pro_bf5d6NP8wcNd1vnsH0eE", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_vURZVfOwYJUGEdIvkfny", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-03-24T11:40:08.436Z", "fingerprint": null, "browser_info": { "os_type": null, "language": null, "time_zone": null, "ip_address": "103.159.11.202", "os_version": null, "user_agent": null, "color_depth": null, "device_model": null, "java_enabled": null, "screen_width": null, "accept_header": null, "screen_height": null, "accept_language": "en", "java_script_enabled": null }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-03-24T11:25:23.530Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": null, "issuer_error_code": null, "issuer_error_message": null } ``` </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs` - `crates/hyperswitch_connectors/src/connectors/globalpay/response.rs` - `crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs` - ... and 1 more files **Code Patterns Applied:** - Extend existing types with new fields (3 changes) **Detailed Identifier Changes:** Commit 8b0c1333: Files to modify: **crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/globalpay/response.rs** Remove: - struct: pub::GlobalpayPaymentsWebhookResponse - struct: pub::GlobalpayRedirectResponse - enum: pub::FingerprintPresenceIndicator Add: - enum: pub::ActionType **crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs** Modify existing code
{"pr_number": 7605, "pr_title": "fix(connector): [GlobalPay] Address `5xx` when cancelling a paypal transaction", "merged_at": "2025-03-26T10:26:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs", "crates/hyperswitch_connectors/src/connectors/globalpay/response.rs", "crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs"]}, "change_types": {"enums_added": 1, "fields_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
chore(masking): add peek_mut to PeekInterface ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Enhancement ## Description <!-- Describe your changes in detail --> Add `peek_mut` function to PeekInterface to get mutable reference for the inner data. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> To get the mutable reference for inner data in StrongSecret. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ** THIS CANNOT BE TESTED IN ENVIRONMENTS ** ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code
To implement this **connector_integration** feature, you'll need to modify these architectural layers: **1. Other** - `crates/masking/src/abs.rs` - `crates/masking/src/bytes.rs` - `crates/masking/src/secret.rs` - ... and 1 more files **Code Patterns Applied:** - Implement new functions (4 changes) **Detailed Identifier Changes:** Commit 890a265e: Files to modify: **crates/masking/src/abs.rs** Modify existing code **crates/masking/src/bytes.rs** Add: - function: private::peek_mut **crates/masking/src/secret.rs** Add: - function: private::peek_mut **crates/masking/src/strong_secret.rs** Add: - function: private::peek_mut
{"pr_number": 7281, "pr_title": "chore(masking): add peek_mut to PeekInterface", "merged_at": "2025-02-22T08:40:07Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["crates/masking/src/abs.rs", "crates/masking/src/bytes.rs", "crates/masking/src/secret.rs", "crates/masking/src/strong_secret.rs"]}, "change_types": {"functions_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(debit_routing): Handle missing merchant_business_country by defaulting to US ## 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 --> If the business profile does not have a country set, we cannot perform debit routing, because the merchant_business_country will be treated as the acquirer_country, which is used to determine whether a transaction is local or global in the open router. For now, since debit routing is only implemented for USD, we can safely assume the acquirer_country is US if not provided by the merchant. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> -> Update the business profile to set is_debit_routing_enabled to true whereas the merchant_business_country will still be null. ``` curl --location 'http://localhost:8080/account/merchant_1748264799/business_profile/pro_15JiSFiM9m6TM3yuxgMI' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: ' \ --data '{ "is_debit_routing_enabled": true }' ``` ``` { "merchant_id": "merchant_1748264799", "profile_id": "pro_15JiSFiM9m6TM3yuxgMI", "profile_name": "US_default", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "payment_response_hash_key": "5l7IJEsRsndG8yfoTGMsbnnxXAfRwjIMYBo2wbA1MMcGekcbTNn9tH3KueaXAjQJ", "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": true, "merchant_business_country": null, "is_pre_network_tokenization_enabled": false } ``` -> Make a payment and it should go through debit routing flow ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-tenant-id: hyperswitch' \ --header 'api-key: ' \ --data-raw '{ "amount": 100, "amount_to_capture": 100, "currency": "USD", "confirm": true, "capture_method": "automatic", "setup_future_usage": "on_session", "capture_on": "2022-09-10T10:11:12Z", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "customer_id": "cu_1747729092", "return_url": "http://127.0.0.1:4040", "payment_method": "card", "payment_method_type": "debit", "payment_method_data": { "card": { "card_number": "4400002000000004", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "card_cvc": "737" } }, "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "in sit", "user_agent": "amet irure esse" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX", "last_name": "ss" }, "email": "[email protected]" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX" } }, "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_bUuuAvxcM8GZyiXUK01M", "merchant_id": "merchant_1748264799", "status": "succeeded", "amount": 100, "net_amount": 100, "shipping_cost": null, "amount_capturable": 0, "amount_received": 100, "connector": "adyen", "client_secret": "pay_bUuuAvxcM8GZyiXUK01M_secret_kpTGYz66ll5bYgWZdfzK", "created": "2025-05-26T13:09:15.219Z", "currency": "USD", "customer_id": "cu_1747729092", "customer": { "id": "cu_1747729092", "name": "John Doe", "email": "[email protected]", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "0004", "card_type": "DEBIT", "card_network": "Accel", "card_issuer": "Wells Fargo Bank", "card_issuing_country": "UNITEDSTATES", "card_isin": "440000", "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": "[email protected]" }, "order_details": null, "email": "[email protected]", "name": "John Doe", "phone": "999999999", "return_url": "http://127.0.0.1:4040/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1747729092", "created_at": 1748264955, "expires": 1748268555, "secret": "epk_4f3cb7ba24a7432e9524c958ba3e167c" }, "manual_retry_allowed": false, "connector_transaction_id": "K7ZPG2FFPZBK6R65", "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_bUuuAvxcM8GZyiXUK01M_1", "payment_link": null, "profile_id": "pro_15JiSFiM9m6TM3yuxgMI", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_2VuIwuvgf5y58mK3873Q", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-26T13:24:15.219Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-26T13:09:16.661Z", "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 } ``` -> decision engine logs showing `acquirer_country` being considered US by default <img width="1175" alt="image" src="https://github.com/user-attachments/assets/44e4174a-18d5-4c32-9230-67cc8319861f" /> ## 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/debit_routing.rs` **Code Patterns Applied:** - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit 1acf525a: Files to modify: **crates/router/src/core/debit_routing.rs** Modify existing code
{"pr_number": 8141, "pr_title": "refactor(debit_routing): Handle missing merchant_business_country by defaulting to US", "merged_at": "2025-05-28T06:51:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/debit_routing.rs"]}, "change_types": {"conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(core): Add authorized_amount in payment_attempt to support partial authorization for manual_multiple capture ## 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 authorized_amount in payment_attempt to support partial authorization for manual_multiple capture. Add partial authorization support for Checkout connector ### 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)? --> Multiple Manual Capture Request: ``` { "amount": 1000, "currency": "USD", "confirm": true, "customer_id": "cus_2", "return_url": "https://www.google.com", "capture_method": "manual_multiple", "payment_method": "card", "payment_method_type": "credit", "all_keys_required": true, "enable_partial_authorization": true, "authentication_type": "no_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": "[email protected]", "payment_method_data": { "card": { "card_number": "5518207720770101", "card_exp_month": "12", "card_exp_year": "2027", "card_holder_name": "CL-BRW2", "card_cvc": "152" } } } ``` Response: ``` { "payment_id": "pay_Hhh7UHWmdNbT9qIeRkxE", "merchant_id": "merchant_1759077441", "status": "partially_authorized_and_requires_capture", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 700, "amount_received": null, "connector": "checkout", "client_secret": "pay_Hhh7UHWmdNbT9qIeRkxE_secret_9OZuO6sZLM9JixNE16OP", "created": "2025-09-29T08:37:29.516Z", "currency": "USD", "customer_id": "cus_2", "customer": { "id": "cus_2", "name": null, "email": "[email protected]", "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": "manual_multiple", "payment_method": "card", "payment_method_data": { "card": { "last4": "0101", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "551820", "card_extended_bin": null, "card_exp_month": "12", "card_exp_year": "2027", "card_holder_name": "CL-BRW2", "payment_checks": { "avs_result": "U", "card_validation_result": "U" }, "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": "[email protected]", "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": "cus_2", "created_at": 1759135049, "expires": 1759138649, "secret": "epk_ffcff39d5a014ee792d41c39d77bb184" }, "manual_retry_allowed": null, "connector_transaction_id": "pay_42mvzlkpwdkuxlgie4rjvvdu74", "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_Hhh7UHWmdNbT9qIeRkxE_1", "payment_link": null, "profile_id": "pro_SGzZFdB0h0AlyRiXXfF7", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_RCGUpdytFAbrHDZdX5iu", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-09-29T08:52:29.516Z", "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": "MCC4583410930", "payment_method_status": null, "updated": "2025-09-29T08:37:31.609Z", "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": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "enable_partial_authorization": true, "enable_overcapture": null, "is_overcapture_enabled": null, "network_details": null } ``` Capture: Request ``` curl --location 'http://localhost:8080/payments/pay_Hhh7UHWmdNbT9qIeRkxE/capture' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_JUXbhyY' \ --data '{ "amount_to_capture": 300 }' ``` Response: ``` { "payment_id": "pay_Hhh7UHWmdNbT9qIeRkxE", "merchant_id": "merchant_1759077441", "status": "partially_captured_and_capturable", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 400, "amount_received": 300, "connector": "checkout", "client_secret": "pay_Hhh7UHWmdNbT9qIeRkxE_secret_9OZuO6sZLM9JixNE16OP", "created": "2025-09-29T08:37:29.516Z", "currency": "USD", "customer_id": "cus_2", "customer": { "id": "cus_2", "name": null, "email": "[email protected]", "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": "manual_multiple", "payment_method": "card", "payment_method_data": { "card": { "last4": "0101", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "551820", "card_extended_bin": null, "card_exp_month": "12", "card_exp_year": "2027", "card_holder_name": "CL-BRW2", "payment_checks": { "avs_result": "U", "card_validation_result": "U" }, "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": "[email protected]", "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": null, "connector_transaction_id": "pay_42mvzlkpwdkuxlgie4rjvvdu74", "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_Hhh7UHWmdNbT9qIeRkxE_1", "payment_link": null, "profile_id": "pro_SGzZFdB0h0AlyRiXXfF7", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_RCGUpdytFAbrHDZdX5iu", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-09-29T08:52:29.516Z", "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": "MCC4583410930", "payment_method_status": null, "updated": "2025-09-29T08:40:11.018Z", "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": "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": true, "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` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Database Layer (Queries & Schema)** - `crates/diesel_models/src/payment_attempt.rs` - `crates/diesel_models/src/schema.rs` - `crates/diesel_models/src/schema_v2.rs` - ... and 1 more files **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs` - `crates/hyperswitch_domain_models/src/router_data.rs` **3. Core Business Logic** - `crates/router/src/core/authentication/transformers.rs` - `crates/router/src/core/fraud_check/flows/checkout_flow.rs` - `crates/router/src/core/fraud_check/flows/fulfillment_flow.rs` - ... and 14 more files **4. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs` - `crates/hyperswitch_connectors/src/utils.rs` - `crates/router/src/types/api/verify_connector.rs` - ... and 1 more files **5. Type Definitions** - `crates/router/src/types.rs` - `crates/router/src/types/storage/payment_attempt.rs` **6. Utils** - `crates/router/src/utils/user/sample_data.rs` **7. Other** - `crates/hyperswitch_interfaces/src/conversion_impls.rs` - `crates/router/src/services/kafka/payment_attempt.rs` - `crates/router/src/services/kafka/payment_attempt_event.rs` - ... and 4 more files **Code Patterns Applied:** - Define new data structures (1 changes) - Extend existing types with new fields (101 changes) - Modify database queries (1 changes) **Detailed Identifier Changes:** Commit 8e62824b: Files to modify: **crates/diesel_models/src/payment_attempt.rs** Modify existing code **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/diesel_models/src/user/sample_data.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs** Add: - struct: pub::CheckoutPartialAuthorization **crates/hyperswitch_connectors/src/utils.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_interfaces/src/conversion_impls.rs** Modify existing code **crates/router/src/core/authentication/transformers.rs** Modify existing code **crates/router/src/core/fraud_check/flows/checkout_flow.rs** Modify existing code **crates/router/src/core/fraud_check/flows/fulfillment_flow.rs** Modify existing code **crates/router/src/core/fraud_check/flows/record_return.rs** Modify existing code **crates/router/src/core/fraud_check/flows/sale_flow.rs** Modify existing code **crates/router/src/core/fraud_check/flows/transaction_flow.rs** Modify existing code **crates/router/src/core/mandate/utils.rs** Modify existing code **crates/router/src/core/payment_methods.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/payments/operations/payment_create.rs** Modify existing code **crates/router/src/core/payments/operations/payment_response.rs** Modify existing code **crates/router/src/core/payments/retry.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/relay/utils.rs** Modify existing code **crates/router/src/core/unified_authentication_service/utils.rs** Modify existing code **crates/router/src/core/utils.rs** Modify existing code **crates/router/src/core/webhooks/utils.rs** Modify existing code **crates/router/src/services/kafka/payment_attempt.rs** Modify existing code **crates/router/src/services/kafka/payment_attempt_event.rs** Modify existing code **crates/router/src/types.rs** Modify existing code **crates/router/src/types/api/verify_connector.rs** Modify existing code **crates/router/src/types/storage/payment_attempt.rs** Modify existing code **crates/router/src/utils/user/sample_data.rs** Modify existing code **crates/router/tests/connectors/utils.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_attempt.rs** Modify existing code **crates/storage_impl/src/payments/payment_attempt.rs** Modify existing code
{"pr_number": 9594, "pr_title": "feat(core): Add authorized_amount in payment_attempt to support partial authorization for manual_multiple capture", "merged_at": "2025-10-01T10:16:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs", "crates/diesel_models/src/user/sample_data.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/fraud_check/flows/checkout_flow.rs", "crates/router/src/core/fraud_check/flows/fulfillment_flow.rs", "crates/router/src/core/fraud_check/flows/record_return.rs", "crates/router/src/core/fraud_check/flows/sale_flow.rs", "crates/router/src/core/fraud_check/flows/transaction_flow.rs", "crates/router/src/core/mandate/utils.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/relay/utils.rs", "crates/router/src/core/unified_authentication_service/utils.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/router/src/types.rs", "crates/router/src/types/storage/payment_attempt.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "other": ["crates/hyperswitch_interfaces/src/conversion_impls.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", "migrations/2025-09-29-074746_add_authorized_amount_to_payment_attempt/down.sql", "migrations/2025-09-29-074746_add_authorized_amount_to_payment_attempt/up.sql"]}, "change_types": {"structs_added": 1, "fields_added": 101, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(dynamic_routing): change the response type of update gateway score api in open router ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description A new struct, UpdateScoreResponse, was introduced in the API models to represent responses from the Open Router. The payment routing logic was updated to parse responses directly into this struct, replacing the previous manual string conversion and error handling with structured deserialization. ### 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 until open_router is enabled in runtime. Tested locally - Response is getting deserialized ![image](https://github.com/user-attachments/assets/51117d21-74b2-4a34-811f-99d9c95e226f) ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Introduced a new response format for score updates, providing clear messaging after updating gateway scores. - Updated payment method responses to clarify recurring payment eligibility and support. - **Refactor** - Improved the way score update responses are processed for greater reliability and clarity. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/open_router.rs` **2. Core Business Logic** - `crates/router/src/core/payments/routing.rs` **3. Other** - `api-reference-v2/openapi_spec.json` **Code Patterns Applied:** - Define new data structures (1 changes) - Extend existing types with new fields (1 changes) **Detailed Identifier Changes:** Commit ff5b2e8e: Files to modify: **crates/api_models/src/open_router.rs** Add: - struct: pub::UpdateScoreResponse **crates/router/src/core/payments/routing.rs** Modify existing code
{"pr_number": 8308, "pr_title": "refactor(dynamic_routing): change the response type of update gateway score api in open router", "merged_at": "2025-06-11T10:07:49Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/open_router.rs"], "core_business": ["crates/router/src/core/payments/routing.rs"], "other": ["api-reference-v2/openapi_spec.json"]}, "change_types": {"structs_added": 1, "fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
docs(api-reference): fix the content of the tip Corrected the tip content. ## 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 --> Corrected the content of the tip. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the 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 #7391 ## How did you test 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/api-reference/payments/Introduction--to--payments.mdx`
{"pr_number": 7387, "pr_title": "docs(api-reference): fix the content of the tip", "merged_at": "2025-02-27T13:47:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["api-reference/api-reference/payments/Introduction--to--payments.mdx"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
feat(utils): add iso representation for each state for european countries ## 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 --> For each countries present in Europe, their states are converted to ISO Standard [Source for standard](https://github.com/juspay/hyperswitch-web/blob/main/src/States.json) Note: A bugfix is present as well for address_id used to fetch billing_address for external authentication Note: hotfix against https://github.com/juspay/hyperswitch/pull/7273 ### 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)? --> Sanity External 3DS payment, by sending billing_address in payment_method_data for Poland country address CURL ``` curl --location 'localhost:8080/payments/pay_MRVy1jlxGGGZafdE7xsJ/3ds/authentication' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_d3a60dc7950549aa954219ca29746442' \ --data '{ "client_secret": "pay_MRVy1jlxGGGZafdE7xsJ_secret_at05FqOzGfMCtJ3bRw4Y", "device_channel": "BRW", "threeds_method_comp_ind": "Y" }' ``` ## 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/mandates.rs` **3. Core Business Logic** - `crates/router/src/core/payments.rs` **4. External Connector Integration** - `crates/hyperswitch_connectors/src/utils.rs` **5. Configuration Files** - `.typos.toml` **6. Other** - `crates/common_enums/src/enums.rs` **Code Patterns Applied:** - Implement new functions (33 changes) - Extend existing types with new fields (33 changes) **Detailed Identifier Changes:** Commit 170217a8: Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/common_enums/src/enums.rs** Add: - enum: pub::AlbaniaStatesAbbreviation - enum: pub::AndorraStatesAbbreviation - enum: pub::AustriaStatesAbbreviation - enum: pub::BelarusStatesAbbreviation - enum: pub::BosniaAndHerzegovinaStatesAbbreviation - enum: pub::BulgariaStatesAbbreviation - enum: pub::CroatiaStatesAbbreviation - enum: pub::CzechRepublicStatesAbbreviation - enum: pub::DenmarkStatesAbbreviation - enum: pub::FinlandStatesAbbreviation - enum: pub::FranceStatesAbbreviation - enum: pub::GermanyStatesAbbreviation - enum: pub::GreeceStatesAbbreviation - enum: pub::HungaryStatesAbbreviation - enum: pub::IcelandStatesAbbreviation - enum: pub::IrelandStatesAbbreviation - enum: pub::LatviaStatesAbbreviation - enum: pub::ItalyStatesAbbreviation - enum: pub::LiechtensteinStatesAbbreviation - enum: pub::LithuaniaStatesAbbreviation - enum: pub::MaltaStatesAbbreviation - enum: pub::MoldovaStatesAbbreviation - enum: pub::MonacoStatesAbbreviation - enum: pub::MontenegroStatesAbbreviation - enum: pub::NetherlandsStatesAbbreviation - enum: pub::NorthMacedoniaStatesAbbreviation - enum: pub::NorwayStatesAbbreviation - enum: pub::PolandStatesAbbreviation - enum: pub::PortugalStatesAbbreviation - enum: pub::SpainStatesAbbreviation - enum: pub::SwitzerlandStatesAbbreviation - enum: pub::UnitedKingdomStatesAbbreviation - enum: pub::RomaniaStatesAbbreviation **crates/hyperswitch_connectors/src/utils.rs** Add: - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - function: private::foreign_try_from - impl: impl ForeignTryFrom<String> for GermanyStatesAbbreviation - impl: impl ForeignTryFrom<String> for SpainStatesAbbreviation - impl: impl ForeignTryFrom<String> for ItalyStatesAbbreviation - impl: impl ForeignTryFrom<String> for NorwayStatesAbbreviation - impl: impl ForeignTryFrom<String> for AlbaniaStatesAbbreviation - impl: impl ForeignTryFrom<String> for AndorraStatesAbbreviation - impl: impl ForeignTryFrom<String> for AustriaStatesAbbreviation - impl: impl ForeignTryFrom<String> for RomaniaStatesAbbreviation - impl: impl ForeignTryFrom<String> for PortugalStatesAbbreviation - impl: impl ForeignTryFrom<String> for SwitzerlandStatesAbbreviation - impl: impl ForeignTryFrom<String> for NorthMacedoniaStatesAbbreviation - impl: impl ForeignTryFrom<String> for MontenegroStatesAbbreviation - impl: impl ForeignTryFrom<String> for MonacoStatesAbbreviation - impl: impl ForeignTryFrom<String> for NetherlandsStatesAbbreviation - impl: impl ForeignTryFrom<String> for MoldovaStatesAbbreviation - impl: impl ForeignTryFrom<String> for LithuaniaStatesAbbreviation - impl: impl ForeignTryFrom<String> for LiechtensteinStatesAbbreviation - impl: impl ForeignTryFrom<String> for LatviaStatesAbbreviation - impl: impl ForeignTryFrom<String> for MaltaStatesAbbreviation - impl: impl ForeignTryFrom<String> for BelarusStatesAbbreviation - impl: impl ForeignTryFrom<String> for IrelandStatesAbbreviation - impl: impl ForeignTryFrom<String> for IcelandStatesAbbreviation - impl: impl ForeignTryFrom<String> for HungaryStatesAbbreviation - impl: impl ForeignTryFrom<String> for GreeceStatesAbbreviation - impl: impl ForeignTryFrom<String> for FinlandStatesAbbreviation - impl: impl ForeignTryFrom<String> for DenmarkStatesAbbreviation - impl: impl ForeignTryFrom<String> for CzechRepublicStatesAbbreviation - impl: impl ForeignTryFrom<String> for CroatiaStatesAbbreviation - impl: impl ForeignTryFrom<String> for BulgariaStatesAbbreviation - impl: impl ForeignTryFrom<String> for BosniaAndHerzegovinaStatesAbbreviation - impl: impl ForeignTryFrom<String> for UnitedKingdomStatesAbbreviation **crates/hyperswitch_domain_models/src/mandates.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code
{"pr_number": 7302, "pr_title": "feat(utils): add iso representation for each state for european countries", "merged_at": "2025-02-18T17:45:24Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/mandates.rs"], "core_business": ["crates/router/src/core/payments.rs"], "connectors": ["crates/hyperswitch_connectors/src/utils.rs"], "config": [".typos.toml"], "other": ["crates/common_enums/src/enums.rs"]}, "change_types": {"functions_added": 33, "enums_added": 33, "fields_added": 33}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(authz): Make info APIs support `ParentGroup` ## 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 --> Make new APIs to replace - `/user/role/{{role_id}}` -> `/user/role/{{role_id}}/v2` - `/user/role` -> `/user/role/v2` - `/user/module/list` -> `/user/parent/list` The new APIs will have proper description and parent info which has entity level context unlike the previous APIs. ### 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 #6439. ## How did you test 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. Parent List ``` curl --location 'http://localhost:8080/user/parent/list' \ --header 'Authorization: JWT' \ ``` ```json [ { "name": "Operations", "description": "View and Manage Payments, Refunds, Mandates, Disputes, Customers, Payouts, Operation Reports, Organization Account", "scopes": [ "write", "read" ] }, { "name": "Recon", "description": "View and Manage Reconciliation Reports", "scopes": [ "write" ] }, { "name": "Analytics", "description": "View Analytics, Operation Reports, Organization Account", "scopes": [ "read" ] }, { "name": "Workflows", "description": "View and Manage Routing, 3DS Decision Manager, Surcharge Decision Manager, Organization Account", "scopes": [ "write", "read" ] }, { "name": "Users", "description": "View and Manage Users, Organization Account", "scopes": [ "read", "write" ] }, { "name": "Account", "description": "View and Manage Organization Account, Api Keys, Webhook Events", "scopes": [ "read", "write" ] }, { "name": "Connectors", "description": "View and Manage Payment Processors, Payout Processors, Fraud & Risk Managers, Organization Account", "scopes": [ "write", "read" ] } ] ``` The descriptions and scopes in the above response will change with respect the role. 2. Get Role V2 ``` curl --location 'http://localhost:8080/user/role/merchant_admin/v2' \ --header 'Authorization: JWT' \ ``` ```json { "role_id": "merchant_admin", "parent_groups": [ { "name": "Users", "description": "View and Manage Users, Merchant Account", "scopes": [ "read", "write" ] }, { "name": "Connectors", "description": "View and Manage Payment Processors, Payout Processors, Fraud & Risk Managers, Merchant Account", "scopes": [ "read", "write" ] }, { "name": "Recon", "description": "View and Manage Reconciliation Reports", "scopes": [ "write" ] }, { "name": "Account", "description": "View and Manage Merchant Account, Api Keys, Webhook Events", "scopes": [ "read", "write" ] }, { "name": "Workflows", "description": "View and Manage Routing, 3DS Decision Manager, Surcharge Decision Manager, Merchant Account", "scopes": [ "write", "read" ] }, { "name": "Analytics", "description": "View Analytics, Operation Reports, Merchant Account", "scopes": [ "read" ] }, { "name": "Operations", "description": "View and Manage Payments, Refunds, Mandates, Disputes, Customers, Payouts, Operation Reports, Merchant Account", "scopes": [ "read", "write" ] } ], "role_name": "merchant_admin", "role_scope": "organization" } ``` 3. Get Role from Token V2 ``` curl --location 'http://localhost:8080/user/role/v2' \ --header 'Authorization: JWT' \ ``` ``` { "groups": [ "connectors_manage", "account_manage", "users_manage", "merchant_details_manage", "merchant_details_view", "workflows_manage", "analytics_view", "operations_view", "organization_manage", "connectors_view", "recon_ops", "users_view", "workflows_view", "account_view", "operations_manage" ], "resources": [ "routing", "customer", "payout", "api_key", "refund", "connector", "user", "mandate", "analytics", "account", "surcharge_decision_manager", "payment", "webhook_event", "recon", "three_ds_decision_manager", "dispute", "report" ] } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/events/user_role.rs` - `crates/api_models/src/user_role/role.rs` **2. Core Business Logic** - `crates/router/src/core/user_role.rs` - `crates/router/src/core/user_role/role.rs` **3. Type Definitions** - `crates/router_env/src/logger/types.rs` **4. Utils** - `crates/router/src/routes/lock_utils.rs` **5. Other** - `crates/common_enums/src/enums.rs` - `crates/router/src/routes/app.rs` - `crates/router/src/routes/user_role.rs` - ... and 4 more files **Code Patterns Applied:** - Define new data structures (3 changes) - Implement new functions (16 changes) - Extend existing types with new fields (37 changes) - Add conditional logic for feature flags or filtering (1 changes) - Modify database queries (5 changes) **Detailed Identifier Changes:** Commit 7dcffccf: Files to modify: **crates/api_models/src/events/user_role.rs** Modify existing code **crates/api_models/src/user_role/role.rs** Add: - struct: pub::RoleInfoWithParents - struct: pub::ParentGroupInfo - struct: pub::GroupsAndResources **crates/common_enums/src/enums.rs** Modify existing code **crates/router/src/core/user_role.rs** Add: - function: pub::get_parent_group_info **crates/router/src/core/user_role/role.rs** Add: - function: pub::get_groups_and_resources_for_role_from_token - function: pub::get_parent_info_for_role **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/routes/user_role.rs** Add: - function: pub::get_groups_and_resources_for_role_from_token - function: pub::get_parent_info_for_role - function: pub::get_parent_group_info **crates/router/src/services/authorization/info.rs** Remove: - function: pub::get_parent_name **crates/router/src/services/authorization/permission_groups.rs** Add: - function: private::get_descriptions_for_groups **crates/router/src/services/authorization/permissions.rs** Add: - function: pub::get_resource_name - function: pub::get_scope_name **crates/router/src/services/authorization/roles/predefined_roles.rs** Modify existing code **crates/router_env/src/logger/types.rs** Modify existing code
{"pr_number": 6440, "pr_title": "feat(authz): Make info APIs support `ParentGroup`", "merged_at": "2024-10-30T10:42:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/user_role.rs", "crates/api_models/src/user_role/role.rs"], "core_business": ["crates/router/src/core/user_role.rs", "crates/router/src/core/user_role/role.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/user_role.rs", "crates/router/src/services/authorization/info.rs", "crates/router/src/services/authorization/permission_groups.rs", "crates/router/src/services/authorization/permissions.rs", "crates/router/src/services/authorization/roles/predefined_roles.rs"]}, "change_types": {"structs_added": 3, "functions_added": 16, "fields_added": 37, "imports_added": 9, "conditionals_added": 1, "database_queries": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): Add record back connector integration flow ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> After passive churn recovery retries the payment, we will have to record back and update the invoice in billing process. This PR adds support for this by adding connector integration 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 <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue 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 not required since this just add flow to the connector integration and doesn't implemented for any 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 `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/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` **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. Other** - `crates/hyperswitch_interfaces/src/api/revenue_recovery.rs` - `crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs` - `crates/router/src/services/api.rs` **Code Patterns Applied:** - Define new data structures (4 changes) - Extend existing types with new fields (7 changes) **Detailed Identifier Changes:** Commit 13a27490: 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::RevenueRecoveryRecordBackData **crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs** Add: - struct: pub::RecoveryRecordBack **crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs** Add: - struct: pub::RevenueRecoveryRecordBackRequest **crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs** Add: - struct: pub::RevenueRecoveryRecordBackResponse **crates/hyperswitch_domain_models/src/types.rs** Modify existing code **crates/hyperswitch_interfaces/src/api/revenue_recovery.rs** Remove: - trait: pub::RevenueRecovery Add: - trait: pub::RevenueRecovery - trait: pub::RevenueRecoveryRecordBack **crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs** Remove: - trait: pub::RevenueRecoveryV2 Add: - trait: pub::RevenueRecoveryV2 - trait: pub::RevenueRecoveryRecordBackV2 **crates/hyperswitch_interfaces/src/types.rs** Modify existing code **crates/router/src/core/payments/flows.rs** Add: - impl: impl api::RevenueRecoveryRecordBack for connector::DummyConnector<T> - impl: impl services::ConnectorIntegration< RecoveryRecordBack, types::RevenueRecoveryRecordBackRequest, types::RevenueRecoveryRecordBackResponse, > 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": 7416, "pr_title": "feat(connector): Add record back connector integration flow ", "merged_at": "2025-03-12T12:38:36Z", "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"], "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"], "other": ["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": 4, "fields_added": 7, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [CELERO] Integrate Card Payments (Alpha) ## 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 --> Integrate celero commerce connector Doc : https://sandbox.gotnpgateway.com/docs/api/transactions [x] Cards [x] Avs ### 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` --> MOCK SERVER results <img width="803" height="920" alt="Screenshot 2025-08-05 at 11 37 29 AM" src="https://github.com/user-attachments/assets/19bee0c6-f0e4-4123-b423-b959c229899b" /> <img width="560" height="926" alt="Screenshot 2025-08-05 at 11 37 38 AM" src="https://github.com/user-attachments/assets/2e9c08e7-aba4-4799-b3b5-4a0f3df9360e" /> <img width="930" height="1001" alt="Screenshot 2025-08-05 at 11 37 54 AM" src="https://github.com/user-attachments/assets/e8b202e1-a5a0-4afe-8574-93944b61d816" /> ![Uploading Screenshot 2025-08-06 at 3.00.16 PM.png…]() ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue 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/8575 ## How did you test 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 creds for testing ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [x] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/connector_configs/toml/development.toml` - `crates/connector_configs/toml/production.toml` - `crates/connector_configs/toml/sandbox.toml` - ... and 3 more files **2. Tests** - `.github/workflows/cypress-tests-runner.yml` - `cypress-tests/README.md` - `cypress-tests/cypress/e2e/configs/Payment/Celero.js` - ... and 11 more files **Code Patterns Applied:** - Define new data structures (11 changes) - Implement new functions (30 changes) - Extend existing types with new fields (1267 changes) - Add conditional logic for feature flags or filtering (45 changes) **Detailed Identifier Changes:** Commit e1fc1413: Files to modify: **crates/hyperswitch_connectors/src/connectors/celero.rs** Remove: - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Celero - impl: impl ConnectorSpecifications for Celero Add: - function: private::validate_connector_against_payment_request - function: private::get_request_body - 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_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Celero - impl: impl ConnectorSpecifications for Celero **crates/hyperswitch_connectors/src/connectors/celero/transformers.rs** Add: - function: private::try_from - function: private::try_from - function: private::try_from - function: private::try_from - struct: pub::CeleroSearchRequest - struct: pub::CeleroAddress - struct: pub::CeleroCaptureRequest - enum: pub::CeleroPaymentMethod - enum: pub::CeleroEntryType - impl: impl TryFrom<(MinorUnit, T)> for CeleroRouterData<T> - impl: impl TryFrom<&PaymentsSyncRouterData> for CeleroSearchRequest - impl: impl TryFrom<&RefundSyncRouterData> for CeleroSearchRequest **crates/payment_methods/src/configs/payment_connector_required_fields.rs** Modify existing code
{"pr_number": 8574, "pr_title": "feat(connector): [CELERO] Integrate Card Payments (Alpha)", "merged_at": "2025-08-20T12:33:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector", "card"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/celero.rs", "crates/hyperswitch_connectors/src/connectors/celero/transformers.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs"], "tests": [".github/workflows/cypress-tests-runner.yml", "cypress-tests/README.md", "cypress-tests/cypress/e2e/configs/Payment/Celero.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/configs/mock-server/Connectors/Celero.ts", "cypress-tests/cypress/e2e/configs/mock-server/Connectors/Silverflow.ts", "cypress-tests/cypress/e2e/configs/mock-server/Creds.json", "cypress-tests/cypress/e2e/configs/mock-server/Silverflow.js", "cypress-tests/cypress/e2e/configs/mock-server/mockserver.ts", "cypress-tests/cypress/e2e/configs/mock-server/router.ts", "cypress-tests/eslint.config.js", "cypress-tests/package-lock.json", "cypress-tests/package.json", "cypress-tests/tsconfig.json"]}, "change_types": {"structs_added": 11, "functions_added": 30, "enums_added": 6, "fields_added": 1267, "imports_added": 6, "conditionals_added": 45}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}