prompt
stringlengths
83
247k
response
stringlengths
121
36.1k
metadata
stringlengths
314
42.3k
feat(core): Add support for v2 payments get intent using merchant reference id ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR adds support for payments get intent in v2 using merchant reference id. Note : In a distributed setup we will be having many partition, to access data efficiently we need `partition_key`. For payments partition_key is `payment_intent global-id` . So to get the partition_key, we need to create a `reverse_lookup` table which map `merchant_reference_id+profile` to `payment_intent global-id`. A constraint based mechanism will be implemented on those tables. ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Test case 1: request : ``` curl --location 'http://localhost:8080/v2/payments/ref/example' \ --header 'x-profile-id: pro_xVG6fBFDok3HxeI2vklo' \ --header 'api-key: dev_pICbNgHQUSohctLw03CxJUszzttJpYWcuaeqyTS1SjBoaSHulQsdq9y1uqnc1jNq' \ --data '' ``` response ``` { "id": "12345_pay_0194a76014af73b19c5d487667c0e00e", "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": "12345_pay_0194a76014af73b19c5d487667c0e00e_secret_0194a76014ba74439ec0fc14e9808ea2", "profile_id": "pro_xVG6fBFDok3HxeI2vklo", "merchant_reference_id": "example", "routing_algorithm_id": null, "capture_method": "manual", "authentication_type": "no_three_ds", "billing": { "address": { "city": null, "country": null, "line1": null, "line2": null, "line3": null, "zip": null, "state": null, "first_name": "John", "last_name": "Dough" }, "phone": null, "email": "example@example.com" }, "shipping": { "address": { "city": "Karwar", "country": null, "line1": null, "line2": null, "line3": null, "zip": "581301", "state": "Karnataka", "first_name": "John", "last_name": "Dough" }, "phone": null, "email": "example@example.com" }, "customer_id": null, "customer_present": "present", "description": null, "return_url": null, "setup_future_usage": "on_session", "apply_mit_exemption": "Skip", "statement_descriptor": null, "order_details": null, "allowed_payment_method_types": null, "metadata": null, "connector_metadata": null, "feature_metadata": { "redirect_response": null, "search_tags": null, "apple_pay_recurring_details": null }, "payment_link_enabled": "Skip", "payment_link_config": null, "request_incremental_authorization": "default", "expires_on": "2025-01-27T11:02:59.418Z", "frm_metadata": null, "request_external_three_ds_authentication": "Skip" } ``` Test case 2 : Invalid merchant reference id ``` curl --location 'http://localhost:8080/v2/payments/ref/example1' \ --header 'x-profile-id: pro_xVG6fBFDok3HxeI2vklo' \ --header 'api-key: ••••••' \ --data '' ``` response ``` { "error": { "type": "invalid_request", "message": "Payment does not exist in our records", "code": "HE_02" } } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Database Layer (Queries & Schema)** - `crates/diesel_models/src/query/payment_intent.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` **3. Core Business Logic** - `crates/router/src/core/payments.rs` **4. Type Definitions** - `crates/router_env/src/logger/types.rs` **5. Utils** - `crates/router/src/routes/lock_utils.rs` **6. Other** - `crates/router/src/db/kafka_store.rs` - `crates/router/src/routes/app.rs` - `crates/router/src/routes/payments.rs` - ... and 2 more files **Code Patterns Applied:** - Implement new functions (8 changes) - Extend existing types with new fields (40 changes) - Modify database queries (3 changes) **Detailed Identifier Changes:** Commit e17ffd12: Files to modify: **crates/diesel_models/src/query/payment_intent.rs** Add: - function: pub::find_by_merchant_reference_id_profile_id **crates/hyperswitch_domain_models/src/payments/payment_intent.rs** Modify existing code **crates/router/src/core/payments.rs** Add: - function: pub::payments_get_intent_using_merchant_reference **crates/router/src/db/kafka_store.rs** Add: - function: private::find_payment_intent_by_merchant_reference_id_profile_id **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::payment_get_intent_using_merchant_reference_id **crates/router_env/src/logger/types.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_intent.rs** Add: - function: private::find_payment_intent_by_merchant_reference_id_profile_id **crates/storage_impl/src/payments/payment_intent.rs** Add: - function: private::find_payment_intent_by_merchant_reference_id_profile_id - function: private::find_payment_intent_by_merchant_reference_id_profile_id
{"pr_number": 7123, "pr_title": "feat(core): Add support for v2 payments get intent using merchant reference id", "merged_at": "2025-02-06T15:07:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/query/payment_intent.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_intent.rs"], "core_business": ["crates/router/src/core/payments.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "other": ["crates/router/src/db/kafka_store.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs", "crates/storage_impl/src/mock_db/payment_intent.rs", "crates/storage_impl/src/payments/payment_intent.rs"]}, "change_types": {"functions_added": 8, "fields_added": 40, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(router): add three_ds_decision_rule_algorithm to the domain and diesel models of business_profile ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> add three_ds_decision_rule_algorithm to the domain and diesel models of business_profile This is a Micro PR towards three_ds decision rule exemption engine, would be adding support to three_ds decision rules in routing apis in future PRs ### 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)? --> Compiler guided, no flow changes as of now ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Database Layer (Queries & Schema)** - `crates/diesel_models/src/business_profile.rs` - `crates/diesel_models/src/schema.rs` - `crates/diesel_models/src/schema_v2.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/business_profile.rs` **3. Core Business Logic** - `crates/router/src/core/routing/helpers.rs` **4. Other** - `migrations/2025-05-21-134155_add_three_ds_decision_rule_algorithm_to_business_profile/down.sql` - `migrations/2025-05-21-134155_add_three_ds_decision_rule_algorithm_to_business_profile/up.sql` **Code Patterns Applied:** - Extend existing types with new fields (18 changes) **Detailed Identifier Changes:** Commit c0cda41b: Files to modify: **crates/diesel_models/src/business_profile.rs** Modify existing code **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/hyperswitch_domain_models/src/business_profile.rs** Modify existing code **crates/router/src/core/routing/helpers.rs** Modify existing code
{"pr_number": 8106, "pr_title": "feat(router): add three_ds_decision_rule_algorithm to the domain and diesel models of business_profile", "merged_at": "2025-05-23T07:46:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/routing/helpers.rs"], "other": ["migrations/2025-05-21-134155_add_three_ds_decision_rule_algorithm_to_business_profile/down.sql", "migrations/2025-05-21-134155_add_three_ds_decision_rule_algorithm_to_business_profile/up.sql"]}, "change_types": {"fields_added": 18}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): WASM fixed in Getnet ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> WASM fixed in Getnet ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Only WASM fix, hence no testing needed ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/connector_configs/toml/development.toml` - `crates/connector_configs/toml/production.toml` - `crates/connector_configs/toml/sandbox.toml`
{"pr_number": 7564, "pr_title": "fix(connector): WASM fixed in Getnet", "merged_at": "2025-03-19T11:18:51Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "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"}
feat(core): Make installment_payment_enabled,recurring_enabled Optional ## 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 --> 1)Make installment_payment_enabled,recurring_enabled Optional 2) is_frame_redirection_enabled Field Missing in Create Business Profile API Response 3)Move CaptureMethodNotSupported error to 4xx instead of 5xx. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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)? --> **MCA- Create: Without passing installment_payment_enabled,recurring_enabled** ``` curl --location 'http://localhost:8080/account/postman_merchant_GHAction_43ec75d3-248f-449f-8c0a-39ffda03a400/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key:' \ --data '{ "connector_type": "payment_processor", "connector_name": "stripe", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "" }, "metadata": { "lasdh": "123" }, "test_mode": true, "disabled": false, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "accepted_countries": { "type": "enable_only", "list": [ "US" ] } }, { "payment_method_type": "debit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "accepted_countries": { "type": "enable_only", "list": [ "US" ] } } ] } ], "connector_webhook_details": { "merchant_secret": "MyWebhookSecret" }, "business_country": "US", "business_label": "default" }' ``` **MCA- Response** ``` { "connector_type": "payment_processor", "connector_name": "stripe", "connector_label": "stripe_US_default", "merchant_connector_id": "mca_Ta8rIMy0lcKaMGn0QXg6", "profile_id": "pro_oTruCQEjuV2SSHdtxWiQ", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "sk*******************************************************************************************************hm" }, "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": { "type": "enable_only", "list": [ "US" ] }, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": null, "installment_payment_enabled": null }, { "payment_method_type": "debit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": { "type": "enable_only", "list": [ "US" ] }, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": null, "installment_payment_enabled": null } ] } ], "connector_webhook_details": { "merchant_secret": "MyWebhookSecret", "additional_secret": null }, "metadata": { "lasdh": "123" }, "test_mode": true, "disabled": false, "frm_configs": null, "business_country": "US", "business_label": "default", "business_sub_label": null, "applepay_verified_domains": null, "pm_auth_config": null, "status": "active", "additional_merchant_data": null, "connector_wallets_details": null } ``` <img width="1495" alt="Screenshot 2025-06-02 at 11 43 26 AM" src="https://github.com/user-attachments/assets/05ec5e86-5168-417f-87b5-b505443c38e8" /> ________________________________________________________________________________________________ **is_iframe_redirection_enabled in Create Business Profile Response** ``` curl --location 'http://localhost:8080/account/merchant_1748845815/business_profile' \ --header 'Content-Type: application/json' \ --header 'api-key:' \ --data-raw '{ "profile_name": "business", "return_url": "https://google.com/success", "is_iframe_redirection_enabled":true, "enable_payment_response_hash": true, "redirect_to_merchant_with_http_post": false, "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "webhook_url": "https://webhook.site", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true }, "metadata": null, "intent_fulfillment_time": 900, "frm_routing_algorithm": null, "payout_routing_algorithm": null, "applepay_verified_domains": null, "session_expiry": 900, "payment_link_config": null, "authentication_connector_details": null, "use_billing_as_payment_method_billing": true, "collect_shipping_details_from_wallet_connector": false, "collect_billing_details_from_wallet_connector": false, "is_connector_agnostic_mit_enabled": false, "payout_link_config": null, "outgoing_webhook_custom_http_headers": null }' ``` **Response** ``` { "merchant_id": "merchant_1748845815", "profile_id": "pro_SPzt1cVdj0Q2LpPGVU1d", "profile_name": "business", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "payment_response_hash_key": "6oCM673UUObMkQsu8vpdFspjUnZYNjXJd0y6fh8aBGsvSvQHljAEiOFjnqLkMIpC", "redirect_to_merchant_with_http_post": false, "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "webhook_url": "https://webhook.site", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true }, "metadata": null, "routing_algorithm": null, "intent_fulfillment_time": 900, "frm_routing_algorithm": null, "payout_routing_algorithm": null, "applepay_verified_domains": null, "session_expiry": 900, "payment_link_config": null, "authentication_connector_details": null, "use_billing_as_payment_method_billing": true, "extended_card_info_config": null, "collect_shipping_details_from_wallet_connector": false, "collect_billing_details_from_wallet_connector": false, "always_collect_shipping_details_from_wallet_connector": false, "always_collect_billing_details_from_wallet_connector": false, "is_connector_agnostic_mit_enabled": false, "payout_link_config": null, "outgoing_webhook_custom_http_headers": null, "tax_connector_id": null, "is_tax_connector_enabled": false, "is_network_tokenization_enabled": false, "is_auto_retries_enabled": false, "max_auto_retries_enabled": null, "always_request_extended_authorization": null, "is_click_to_pay_enabled": false, "authentication_product_ids": null, "card_testing_guard_config": { "card_ip_blocking_status": "disabled", "card_ip_blocking_threshold": 3, "guest_user_card_blocking_status": "disabled", "guest_user_card_blocking_threshold": 10, "customer_id_blocking_status": "disabled", "customer_id_blocking_threshold": 5, "card_testing_guard_expiry": 3600 }, "is_clear_pan_retries_enabled": false, "force_3ds_challenge": false, "is_debit_routing_enabled": false, "merchant_business_country": null, "is_pre_network_tokenization_enabled": false, "is_iframe_redirection_enabled": true } ``` **Capture Method Not Supported** Before ![image](https://github.com/user-attachments/assets/8335a865-09aa-4bc5-beeb-0af9700da7be) After: <img width="1087" alt="Screenshot 2025-06-09 at 3 40 52 PM" src="https://github.com/user-attachments/assets/96f9c06f-7f0e-4bd4-8de0-027082488eb4" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/admin.rs` - `crates/api_models/src/payment_methods.rs` **2. Core Business Logic** - `crates/router/src/core/errors/utils.rs` - `crates/router/src/core/payment_methods/cards.rs` - `crates/router/src/core/payment_methods/tokenize/card_executor.rs` - ... and 3 more files **3. External Connector Integration** - `crates/connector_configs/src/transformer.rs` **4. Type Definitions** - `crates/common_types/src/payment_methods.rs` - `crates/router/src/types/api/admin.rs` - `crates/router/src/types/transformers.rs` **5. Utils** - `crates/kgraph_utils/benches/evaluation.rs` - `crates/kgraph_utils/src/mca.rs` - `crates/payment_methods/src/helpers.rs` **6. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` **Code Patterns Applied:** - Extend existing types with new fields (57 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 171ca3b5: Files to modify: **crates/api_models/src/admin.rs** Modify existing code **crates/api_models/src/payment_methods.rs** Modify existing code **crates/common_types/src/payment_methods.rs** Modify existing code **crates/connector_configs/src/transformer.rs** Modify existing code **crates/kgraph_utils/benches/evaluation.rs** Modify existing code **crates/kgraph_utils/src/mca.rs** Modify existing code **crates/payment_methods/src/helpers.rs** Modify existing code **crates/router/src/core/errors/utils.rs** Modify existing code **crates/router/src/core/payment_methods/cards.rs** Modify existing code **crates/router/src/core/payment_methods/tokenize/card_executor.rs** Modify existing code **crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs** Modify existing code **crates/router/src/core/payment_methods/transformers.rs** Modify existing code **crates/router/src/core/payments/tokenization.rs** Modify existing code **crates/router/src/types/api/admin.rs** Modify existing code **crates/router/src/types/transformers.rs** Modify existing code
{"pr_number": 8201, "pr_title": "feat(core): Make installment_payment_enabled,recurring_enabled Optional", "merged_at": "2025-06-10T11:04:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs", "crates/api_models/src/payment_methods.rs"], "core_business": ["crates/router/src/core/errors/utils.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/tokenize/card_executor.rs", "crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs", "crates/router/src/core/payment_methods/transformers.rs", "crates/router/src/core/payments/tokenization.rs"], "connectors": ["crates/connector_configs/src/transformer.rs"], "types": ["crates/common_types/src/payment_methods.rs", "crates/router/src/types/api/admin.rs", "crates/router/src/types/transformers.rs"], "utils": ["crates/kgraph_utils/benches/evaluation.rs", "crates/kgraph_utils/src/mca.rs", "crates/payment_methods/src/helpers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"fields_added": 57, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): [Worldpay] handle multiple ddc submission for CompleteAuthorize ## Type of Change - [x] Bugfix ## Description Fixes race condition in Worldpay 3DS Device Data Collection (DDC) flow causing `bodyDoesNotMatchSchema` errors. **Changes made:** - Extended DDC timeout from 8s to 10s in client-side JavaScript - Added `ddcProcessed` flag to prevent duplicate submissions on client-side - Reject `collectionReference` submissions when payment is in `AuthenticationPending` state - Fixed CSS media query syntax (`@media (max-width: 600px)`) - Added Cypress test case for both client and server-side race conditions for DDC submissions ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables ## Motivation and Context Race condition caused intermittent 3DS payment failures when DDC took > 8 seconds. ## How did you test it? <details> <summary>1. DDC race case in isolation </summary> <img width="797" height="156" alt="Screenshot 2025-07-24 at 12 02 50 PM" src="https://github.com/user-attachments/assets/70d14add-9742-4ad3-b72f-da97dae5b197" /> </details> <details> <summary>2. All test cases for Worldpay</summary> <img width="461" height="873" alt="Screenshot 2025-07-25 at 12 52 56 AM" src="https://github.com/user-attachments/assets/7458a378-c413-4c8a-9b0d-4c09b2705a41" /> Note - PSync for WP fails due to 404 and WP sending back a HTML rather than a JSON response (https://github.com/juspay/hyperswitch/pull/8753) </details> ## Checklist - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/worldpay.rs` - `crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs` **2. Tests** - `cypress-tests/cypress/e2e/configs/Payment/Commons.js` - `cypress-tests/cypress/e2e/configs/Payment/Utils.js` - `cypress-tests/cypress/e2e/configs/Payment/WorldPay.js` - ... and 2 more files **3. Other** - `crates/router/src/services/api.rs` **Code Patterns Applied:** - Extend existing types with new fields (126 changes) - Add conditional logic for feature flags or filtering (22 changes) - Modify database queries (2 changes) **Detailed Identifier Changes:** Commit f6cdddcb: Files to modify: **crates/hyperswitch_connectors/src/connectors/worldpay.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs** Modify existing code **crates/router/src/services/api.rs** Modify existing code
{"pr_number": 8741, "pr_title": "fix(connector): [Worldpay] handle multiple ddc submission for CompleteAuthorize", "merged_at": "2025-07-29T08:47:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/worldpay.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Commons.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/configs/Payment/WorldPay.js", "cypress-tests/cypress/e2e/spec/Payment/00030-DDCRaceCondition.cy.js", "cypress-tests/cypress/support/commands.js"], "other": ["crates/router/src/services/api.rs"]}, "change_types": {"fields_added": 126, "conditionals_added": 22, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [Gigadat] Implement interac payouts ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Implement Interac payouts ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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? Not tested as we don't have creds ## Checklis <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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/payments.rs` - `crates/api_models/src/payouts.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/router_request_types.rs` **3. Core Business Logic** - `crates/router/src/core/payouts.rs` - `crates/router/src/core/utils.rs` **4. External Connector Integration** - `crates/connector_configs/src/connector.rs` - `crates/connector_configs/toml/development.toml` - `crates/connector_configs/toml/production.toml` - ... and 6 more files **5. Other** - `api-reference/v1/openapi_spec_v1.json` - `api-reference/v2/openapi_spec_v2.json` **Code Patterns Applied:** - Define new data structures (3 changes) - Implement new functions (21 changes) - Extend existing types with new fields (102 changes) **Detailed Identifier Changes:** Commit cf30da2d: Files to modify: **crates/api_models/src/enums.rs** Modify existing code **crates/api_models/src/payments.rs** Modify existing code **crates/api_models/src/payouts.rs** Modify existing code **crates/connector_configs/src/connector.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/gigadat.rs** Add: - function: private::get_headers - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_headers - function: private::get_url - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_headers - function: private::get_url - function: private::build_request - function: private::handle_response - function: private::get_error_response - impl: impl api::PayoutQuote for Gigadat - impl: impl api::PayoutCreate for Gigadat - impl: impl api::PayoutFulfill for Gigadat - impl: impl ConnectorIntegration<PoQuote, PayoutsData, PayoutsResponseData> for Gigadat - impl: impl ConnectorIntegration<PoCreate, PayoutsData, PayoutsResponseData> for Gigadat - impl: impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Gigadat **crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs** Add: - function: private::try_from - function: private::try_from - struct: pub::GigadatPayoutQuoteRequest - struct: pub::GigadatPayoutResponse - struct: pub::GigadatPayoutData - impl: impl TryFrom<&GigadatRouterData<&PayoutsRouterData<PoQuote>>> for GigadatPayoutQuoteRequest - impl: impl TryFrom<PayoutsResponseRouterData<F, GigadatPayoutResponse>> for PayoutsRouterData<F> **crates/hyperswitch_connectors/src/default_implementations.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Add: - function: private::get_browser_info **crates/hyperswitch_domain_models/src/router_request_types.rs** Add: - function: private::from - impl: impl From<api_models::payments::BrowserInformation> for BrowserInformation **crates/router/src/core/payouts.rs** Modify existing code **crates/router/src/core/utils.rs** Modify existing code **crates/router/tests/connectors/utils.rs** Modify existing code
{"pr_number": 9566, "pr_title": "feat(connector): [Gigadat] Implement interac payouts", "merged_at": "2025-10-01T09:32:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"api_models": ["crates/api_models/src/enums.rs", "crates/api_models/src/payments.rs", "crates/api_models/src/payouts.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payouts.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/gigadat.rs", "crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/tests/connectors/utils.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json"]}, "change_types": {"structs_added": 3, "functions_added": 21, "fields_added": 102, "imports_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
Refactor: Customer email and browser Information ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Refactored customer email and browser information in router 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). --> This refactoring provides data to the connector integrations, so that it can be used in connector 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)? --> - Confirm Intent API Call for trustpay connector. ``` curl --location 'http://localhost:8080/v2/payments/12345_pay_01945e865f697553bbf0eb847611cfcd/confirm-intent' \ --header 'x-client-secret: 1secret-client-secret' \ --header 'x-profile-id: pro_id' \ --header 'Content-Type: application/json' \ --header 'api-key: api-key' \ --data '{ "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "01", "card_exp_year": "25", "card_holder_name": "John Doe", "card_cvc": "100" } }, "payment_method_type": "card", "payment_method_subtype": "credit", "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 from above call ``` { "id": "12345_pay_01945f254dc27802a54be556c0acab7a", "status": "failed", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": null }, "customer_id": "12345_cus_01945f252cb37e20a6fb6105be0c976f", "connector": "trustpay", "client_secret": "12345_pay_01945f254dc27802a54be556c0acab7a_secret_01945f254ddd7cb385275b8d620bbb24", "created": "2025-01-13T10:11:07.869Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "next_action": null, "connector_transaction_id": null, "connector_reference_id": null, "merchant_connector_id": "mca_lZ6moeYo6Ce2vdD01f7s", "browser_info": null, "error": { "code": "4", "message": "The field Reference must be a string with a maximum length of 35.", "unified_code": null, "unified_message": null } } ``` - This refactoring fixes availability of email and browser information fields for trustpay. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **payment** feature, you'll need to modify these architectural layers: **1. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/router_request_types.rs` **2. Core Business Logic** - `crates/router/src/core/payments/transformers.rs` **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (13 changes) **Detailed Identifier Changes:** Commit d35a9222: Files to modify: **crates/hyperswitch_domain_models/src/router_request_types.rs** Add: - function: private::from - impl: impl From<common_utils::types::BrowserInformation> for BrowserInformation **crates/router/src/core/payments/transformers.rs** Modify existing code
{"pr_number": 7034, "pr_title": "Refactor: Customer email and browser Information", "merged_at": "2025-01-21T08:49:43Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payments/transformers.rs"]}, "change_types": {"functions_added": 1, "fields_added": 13}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(vsaas): modify api key auth to support vsaas cases ## 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 Modified api key auth to support control over VSAAS operations. The PR provides fine grained control over routes authentication - allowing Platform to perform payments in V1 (MVP case) - disallowing all the operations in v2 - disallowing all other operations other than payments, for platform - context of connected merchant, doing any operation (Checks from the auth, to be added in the next PR, with introduction of new header) ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding 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 [#2540](https://github.com/juspay/hyperswitch-control-center/issues/2540) ## How did you test it? A platform making payment for connected Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-connected-merchant-id: merchant_1743501899' \ --header 'api-key: dev_a1mj1XmnK3cyHy3QzrhGzVaYAHikwQzPAB51LmABIobtmch0cjw9fWDLdXlGA9gb' \ --data-raw '{ "amount": 6540, "currency": "USD", "amount_to_capture": 6540, "confirm": true, "profile_id": "pro_5SR2H2RsXa1ZgZM3FXQ9", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "authentication_type": "no_three_ds", "setup_future_usage": "on_session", "customer": { "id": "customer123", "name": "John Doe", "email": "customer@gmail.com", "phone": "9999999999", "phone_country_code": "+1" }, "customer_id": "customer123", "phone_country_code": "+1", "routing": { "type": "single", "data": "stripe" }, "description": "Its my first payment request", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "123" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": "guest@example.com" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": "guest@example.com" }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "order_details": [ { "product_name": "Apple iphone 15", "quantity": 1, "amount": 6540, "account_name": "transaction_processing" } ], "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "128.0.0.1" }, "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "125.0.0.1", "user_agent": "amet irure esse" } }, "connector_metadata": { "noon": { "order_category": "pay" } }, "payment_link": false, "payment_link_config": { "theme": "", "logo": "", "seller_name": "", "sdk_layout": "", "display_sdk_only": false, "enabled_saved_payment_method": false }, "payment_type": "normal", "request_incremental_authorization": false, "merchant_order_reference_id": "test_ord", "session_expiry": 900 }' ``` Response: ``` {"payment_id":"pay_1SBoOIGttbr0hIkWv6Z6","merchant_id":"merchant_1743501899","status":"succeeded","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":0,"amount_received":6540,"connector":"stripe","client_secret":"pay_1SBoOIGttbr0hIkWv6Z6_secret_mRXK0x17sFQUjd8wShnk","created":"2025-04-02T09:53:18.310Z","currency":"USD","customer_id":"customer123","customer":{"id":"customer123","name":"John Doe","email":"customer@gmail.com","phone":"9999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"4242","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"424242","card_extended_bin":null,"card_exp_month":"10","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":{"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":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"order_details":[{"brand":null,"amount":6540,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"product_name":"Apple iphone 15","product_type":null,"sub_category":null,"product_img_link":null,"product_tax_code":null,"total_tax_amount":null,"requires_shipping":null}],"email":"customer@gmail.com","name":"John Doe","phone":"9999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"customer123","created_at":1743587598,"expires":1743591198,"secret":"epk_c7b49aaf7b90475aadba449c1fdc2886"},"manual_retry_allowed":false,"connector_transaction_id":"pi_3R9Nz0D5R7gDAGff1ZJG1T7C","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":{"apple_pay":null,"airwallex":null,"noon":{"order_category":"pay"},"braintree":null},"feature_metadata":null,"reference_id":"pi_3R9Nz0D5R7gDAGff1ZJG1T7C","payment_link":null,"profile_id":"pro_5SR2H2RsXa1ZgZM3FXQ9","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_rqSP2RrlUsf1ur5nbW9p","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-04-02T10:08:18.310Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"128.0.0.1","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-04-02T09:53:19.877Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":"test_ord","order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","issuer_error_code":null,"issuer_error_message":null} ``` Platform making operation for module where it doesn't have access: ``` curl --location 'http://localhost:8080/customers' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-connected-merchant-id: merchant_1743501899' \ --header 'api-key: dev_a1mj1XmnK3cyHy3QzrhGzVaYAHikwQzPAB51LmABIobtmch0cjw9fWDLdXlGA9gb' \ --data-raw '{ "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "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 Currently we are not allowing platform to access customers modules ``` { "error": { "type": "invalid_request", "message": "API does not support platform operation", "code": "IR_43" } } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Other** - `crates/router/src/compatibility/stripe/customers.rs` - `crates/router/src/compatibility/stripe/payment_intents.rs` - `crates/router/src/compatibility/stripe/refunds.rs` - ... and 21 more files **Code Patterns Applied:** - Define new data structures (2 changes) - Extend existing types with new fields (338 changes) - Add conditional logic for feature flags or filtering (3 changes) **Detailed Identifier Changes:** Commit 2a467053: Files to modify: **crates/router/src/compatibility/stripe/customers.rs** Modify existing code **crates/router/src/compatibility/stripe/payment_intents.rs** Modify existing code **crates/router/src/compatibility/stripe/refunds.rs** Modify existing code **crates/router/src/compatibility/stripe/setup_intents.rs** Modify existing code **crates/router/src/routes/blocklist.rs** Modify existing code **crates/router/src/routes/cards_info.rs** Modify existing code **crates/router/src/routes/currency.rs** Modify existing code **crates/router/src/routes/customers.rs** Modify existing code **crates/router/src/routes/disputes.rs** Modify existing code **crates/router/src/routes/ephemeral_key.rs** Modify existing code **crates/router/src/routes/files.rs** Modify existing code **crates/router/src/routes/fraud_check.rs** Modify existing code **crates/router/src/routes/mandates.rs** Modify existing code **crates/router/src/routes/payment_link.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/routes/payouts.rs** Modify existing code **crates/router/src/routes/pm_auth.rs** Modify existing code **crates/router/src/routes/profiles.rs** Modify existing code **crates/router/src/routes/refunds.rs** Modify existing code **crates/router/src/routes/relay.rs** Modify existing code **crates/router/src/routes/routing.rs** Modify existing code **crates/router/src/routes/verification.rs** Modify existing code **crates/router/src/services/authentication.rs** Remove: - struct: pub::ApiKeyAuth - struct: pub::V2ApiKeyAuth Add: - struct: pub::ApiKeyAuth - struct: pub::V2ApiKeyAuth
{"pr_number": 7593, "pr_title": "feat(vsaas): modify api key auth to support vsaas cases", "merged_at": "2025-04-16T10:50:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"other": ["crates/router/src/compatibility/stripe/customers.rs", "crates/router/src/compatibility/stripe/payment_intents.rs", "crates/router/src/compatibility/stripe/refunds.rs", "crates/router/src/compatibility/stripe/setup_intents.rs", "crates/router/src/routes/blocklist.rs", "crates/router/src/routes/cards_info.rs", "crates/router/src/routes/currency.rs", "crates/router/src/routes/customers.rs", "crates/router/src/routes/disputes.rs", "crates/router/src/routes/ephemeral_key.rs", "crates/router/src/routes/files.rs", "crates/router/src/routes/fraud_check.rs", "crates/router/src/routes/mandates.rs", "crates/router/src/routes/payment_link.rs", "crates/router/src/routes/payment_methods.rs", "crates/router/src/routes/payments.rs", "crates/router/src/routes/payouts.rs", "crates/router/src/routes/pm_auth.rs", "crates/router/src/routes/profiles.rs", "crates/router/src/routes/refunds.rs", "crates/router/src/routes/relay.rs", "crates/router/src/routes/routing.rs", "crates/router/src/routes/verification.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"structs_added": 2, "fields_added": 338, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(nuvei): Googlepay , applepay and partial authorization integration for nuvei ## 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 --> Add the following features in nuvie 1. Google pay decrypt flow S2S 2. Apple pay decrypt flow S2S 3. Google pay encrypt flow 4. Partial Authorization 5. Send shipping address for nuvei (previously not sent) ## Test attachment <details> <summary> <b>APPLE PAY DECRYPT FLOW </b> </summary> # Request ```json { "amount": 1, "currency": "EUR", "confirm": true, // "order_tax_amount": 100, "setup_future_usage": "off_session", // "payment_type":"setup_mandate", "customer_id": "nithxxinn", "return_url": "https://www.google.com", "capture_method": "automatic", "payment_method": "wallet", "payment_method_type": "apple_pay", "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" }, "email":"nithingowdan77@gmail.com" }, "browser_info": { "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "ip_address": "192.168.1.1", "java_enabled": false, "java_script_enabled": true, "language": "en-US", "color_depth": 24, "screen_height": 1080, "screen_width": 1920, "time_zone": 330, "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" }, "email": "hello@gmail.com", "payment_method_data": { "wallet": { "apple_pay": { "payment_data": { "application_primary_account_number": "4242424242424242", "application_expiration_month": "09", "application_expiration_year": "30", "application_brand":"VISA", "payment_data": { "online_payment_cryptogram": "ArSx8**************************", "eci_indicator": "7" } }, "payment_method": { "display_name": "Discover 9319", "network": "VISA", "type": "debit" }, "transaction_identifier": "c635c5b3af900d7bd81fecd7028f1262f9d030754ee65ec7afd988a678194751" } } } } ``` # Response ```json { "payment_id": "pay_MgXkheRylOHLMUllc1Mw", "merchant_id": "merchant_1755589543", "status": "succeeded", "amount": 1, "net_amount": 1, "shipping_cost": null, "amount_capturable": 0, "amount_received": 1, "connector": "nuvei", "client_secret": "pay_MgXkheRylOHLMUllc1Mw_secret_swUebKaDNEsP4Qo5BMxe", "created": "2025-08-19T08:05:14.847Z", "currency": "EUR", "customer_id": "nithxxinn", "customer": { "id": "nithxxinn", "name": null, "email": "hello@gmail.com", "phone": null, "phone_country_code": null }, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "apple_pay": { "last4": "9319", "card_network": "VISA", "type": "debit" } }, "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": "nithin*****@gmail.com" }, "order_details": null, "email": "hello@gmail.com", "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": "apple_pay", "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": 1755590714, "expires": 1755594314, "secret": "epk_ad5c941cff3a4404ab38dee084e575d0" }, "manual_retry_allowed": false, "connector_transaction_id": "8110000000012650848", "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": "8027431111", "payment_link": null, "profile_id": "pro_o6xLMNfkFwAWH1U1zimF", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_8DFDwR4GryN3qQQOh8bq", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-19T08:20:14.847Z", "fingerprint": null, "browser_info": { "language": "en-US", "time_zone": 330, "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", "color_depth": 24, "java_enabled": false, "screen_width": 1920, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "screen_height": 1080, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-08-19T08:05:17.249Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": null, "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null } ``` </details> <details> <summary> Google pay Decrypt </summary> ## Request ```json { "amount": 1, "currency": "EUR", "confirm": true, "customer_id": "nithxxinn", "return_url": "https://www.google.com", "capture_method": "automatic", "payment_method": "wallet", "payment_method_type": "google_pay", "authentication_type": "no_three_ds", "description": "hellow world", "billing": { "address": { "zip": "560095", "country": "UA", "first_name": "Sakil", "last_name": "Mostak", "line1": "Fasdf", "line2": "Fasdf", "city": "Fasdf" }, "email":"test@gmail.com" }, "browser_info": { "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "ip_address": "192.168.1.1", "java_enabled": false, "java_script_enabled": true, "language": "en-US", "color_depth": 24, "screen_height": 1080, "screen_width": 1920, "time_zone": 330, "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" }, "email": "hello@gmail.com", "payment_method_data": { "wallet": { "google_pay": { "type": "CARD", "tokenization_data": { "application_primary_account_number": "4761344136141390", "card_exp_month": "12", "card_exp_year": "25", "cryptogram": "ejJR********************U=", "eci_indicator": "5" }, "info": { "card_details": "Discover 9319", "card_network": "VISA" }, "description": "something" } } } } ``` Response ```json { "payment_id": "pay_0i5TBkizYCY8JIwAPB1H", "merchant_id": "merchant_1755589543", "status": "succeeded", "amount": 1, "net_amount": 1, "shipping_cost": null, "amount_capturable": 0, "amount_received": 1, "connector": "nuvei", "client_secret": "pay_0i5TBkizYCY8JIwAPB1H_secret_7O5zdgMiNJxFdZolSjIJ", "created": "2025-08-19T08:07:18.648Z", "currency": "EUR", "customer_id": "nithxxinn", "customer": { "id": "nithxxinn", "name": null, "email": "hello@gmail.com", "phone": null, "phone_country_code": null }, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "google_pay": { "last4": "Discover 9319", "card_network": "VISA", "type": "CARD" } }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "UA", "line1": "Fasdf", "line2": "Fasdf", "line3": null, "zip": "560095", "state": null, "first_name": "Sakil", "last_name": "Mostak", "origin_zip": null }, "phone": null, "email": "test@gmail.com" }, "order_details": null, "email": "hello@gmail.com", "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": "google_pay", "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": 1755590838, "expires": 1755594438, "secret": "epk_8d9994d7f5594c2a8fb10ebf6c3fdc27" }, "manual_retry_allowed": false, "connector_transaction_id": "8110000000012650994", "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": "8027476111", "payment_link": null, "profile_id": "pro_o6xLMNfkFwAWH1U1zimF", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_8DFDwR4GryN3qQQOh8bq", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-19T08:22:18.648Z", "fingerprint": null, "browser_info": { "language": "en-US", "time_zone": 330, "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", "color_depth": 24, "java_enabled": false, "screen_width": 1920, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "screen_height": 1080, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-08-19T08:07:21.259Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": null, "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null } ``` </details> <details> <summary> GOOGLE PAY DIRECT </summary> ```js const tokenizationSpecification = { type: "PAYMENT_GATEWAY", parameters: { "gateway": "nuveidigital", "gatewayMerchantId": "googletest" } }; ``` ## Request ```json { "amount": 1, "currency": "EUR", "confirm": true, "customer_id": "nithxxinn", "return_url": "https://www.google.com", "capture_method": "automatic", "payment_method": "wallet", "payment_method_type": "google_pay", "authentication_type": "no_three_ds", "description": "hellow world", "billing": { "address": { "zip": "560095", "country": "UA", "first_name": "Sakil", "last_name": "Mostak", "line1": "Fasdf", "line2": "Fasdf", "city": "Fasdf" }, "email":"nithin@test.com" }, "browser_info": { "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "ip_address": "192.168.1.1", "java_enabled": false, "java_script_enabled": true, "language": "en-US", "color_depth": 24, "screen_height": 1080, "screen_width": 1920, "time_zone": 330, "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" }, "email": "hello@gmail.com", "payment_method_data": { "wallet": { "google_pay": { "description": "SG Visa Success: Visa •••• 1390", "info": { "assuranceDetails": { "account_verified": true, "card_holder_authenticated": false }, "card_details": "1390", "card_network": "VISA" }, "tokenization_data": { "token": "{\"signature\":\"MEUCIG7saL2k07Szf8ezokemD5jAJTwpcWwpy+ajTJot7u+nAiEAzvcuwAoj47r8oMh3a6eUKeZB2lFyDLEzZt2R2lpezo0\\u003d\",\"intermediateSigningKey\":{\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9ByUUgcs6d9rtJA3svCKaGZQjfsbMQAAwWZ6YNIpJkg/NR9HAkMT1sdhkKMRxtcFp1k5y01dr/JpEU2Pj3XyYw\\\\u003d\\\\u003d\\\",\\\"keyExpiration\\\":\\\"1756245691797\\\"}\",\"signatures\":[\"MEQCIFAS8NBh7J4rz00iRDjScYizAfRV+pVnCfsmsFgrehMVAiBpxHFUu6wG3UVNhDMmudb6sZeZHXDJonLkkKOWgzN4TA\\u003d\\u003d\"]},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"hJxayhOT/y4ekX9Ub14X6nl7Xm0h3b1nu8FKv7WDulloondBA+kk9sYnNomQx+ZPANrGES4CBGbmptqW5gR6TjdvENXbSUrTjzU8k++Klw/AwAJBcID+dL+EgyIvgmqIYesLyKzITkZr9zSxtd0zuB9ewcta8gHgBzlZmJSWmdvanv4xiBQgjriKolnw4IiOXXAzN+X0GGXkPqcQnlLIrUzjn/9oCgwhFDltl1EJjkUH8Ji2Rzx62FUexxY6RHHrkoq3pCoirc+KNRXPu3+gC06iloRTR48gmmayFKH5s3Kyw0j9Oypu7fx/AgSqrFKkFzVUmCV0yLwGQSI2vyVdKOFLgLay8dDbEHKvF5X+ZP7diunVh0QwZUTT7yRmgyQUaZAbQhd+uRHrev6SYXcmWdSu8E+8H6A7jtITaZN2eHI7u9ciW82/AcIx3gPkTocKGyXdYRB07+GaFIqyWwxT+9TwLW49oq7hbj978APK1vy4f8x6v2h1tCj6StH6md7xJpn+U47n8rKmJhQiXqRyzfKFcCekndvs0YpgEVbcoZEKKl0E\\\",\\\"ephemeralPublicKey\\\":\\\"BKvkUFUZmpa0BgifTbr2ZTNBK7D74Fg8RMsk2Txta+Vf+vX1/BZLUaITfjpgJ5Xqt3rz+AmrkFe+XRvT5E4R7nc\\\\u003d\\\",\\\"tag\\\":\\\"cGNVu61W/PvTC89JXVMUcsKaZIOpt92oexc+aztsKqw\\\\u003d\\\"}\"}", "type": "PAYMENT_GATEWAY" }, "type": "CARD" } }} } ``` ## response ```json { "payment_id": "pay_UGldGh1QW8CTJJJ22CMJ", "merchant_id": "merchant_1755589543", "status": "succeeded", "amount": 1, "net_amount": 1, "shipping_cost": null, "amount_capturable": 0, "amount_received": 1, "connector": "nuvei", "client_secret": "pay_UGldGh1QW8CTJJJ22CMJ_secret_nKqyqNJ02RgcaMsBBz51", "created": "2025-08-19T09:08:25.037Z", "currency": "EUR", "customer_id": "nithxxinn", "customer": { "id": "nithxxinn", "name": null, "email": "hello@gmail.com", "phone": null, "phone_country_code": null }, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "google_pay": { "last4": "1390", "card_network": "VISA", "type": "CARD" } }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "UA", "line1": "Fasdf", "line2": "Fasdf", "line3": null, "zip": "560095", "state": null, "first_name": "Sakil", "last_name": "Mostak", "origin_zip": null }, "phone": null, "email": "nithin@test.com" }, "order_details": null, "email": "hello@gmail.com", "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": "google_pay", "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": 1755594505, "expires": 1755598105, "secret": "epk_d3dbd5a8b4c04958b6fb4c959cbc67a1" }, "manual_retry_allowed": false, "connector_transaction_id": "8110000000012655452", "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": "8029357111", "payment_link": null, "profile_id": "pro_o6xLMNfkFwAWH1U1zimF", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_8DFDwR4GryN3qQQOh8bq", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-19T09:23:25.037Z", "fingerprint": null, "browser_info": { "language": "en-US", "time_zone": 330, "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", "color_depth": 24, "java_enabled": false, "screen_width": 1920, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "screen_height": 1080, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-08-19T09:08:29.510Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": null, "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null } ``` </details> <details> <summary>Partial auth </summary> ## Request ```json { "amount": 300, "currency": "EUR", "confirm": true, "customer_id": "nithxxinn", "return_url": "https://www.google.com", "capture_method": "automatic", "enable_partial_authorization":true, "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" }, "email":"nithin@gmail.com" }, "browser_info": { "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "ip_address": "192.168.1.1", "java_enabled": false, "java_script_enabled": true, "language": "en-US", "color_depth": 24, "screen_height": 1080, "screen_width": 1920, "time_zone": 330, "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" }, "email": "hello@gmail.com", "payment_method_data": { "card": { "card_number": "4531739335817394", "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": "John Smith", "card_cvc": "100" } } } ``` ## Response ```json { "payment_id": "pay_hieZ9MkK4v1qbqiXKEor", "merchant_id": "merchant_1755589543", "status": "partially_captured", "amount": 300, "net_amount": 300, "shipping_cost": null, "amount_capturable": 300, "amount_received": 150, "connector": "nuvei", "client_secret": "pay_hieZ9MkK4v1qbqiXKEor_secret_KN9DE1LjGlbxEIDGpzFT", "created": "2025-08-19T09:21:17.091Z", "currency": "EUR", "customer_id": "nithxxinn", "customer": { "id": "nithxxinn", "name": null, "email": "hello@gmail.com", "phone": null, "phone_country_code": null }, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "7394", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "453173", "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_7PrpuuSVcta1g2qFHYtC", "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": "nithin@gmail.com" }, "order_details": null, "email": "hello@gmail.com", "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": 1755595277, "expires": 1755598877, "secret": "epk_8003507abbdb427788e1fa089e75c59c" }, "manual_retry_allowed": false, "connector_transaction_id": "8110000000012656330", "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": "8029726111", "payment_link": null, "profile_id": "pro_o6xLMNfkFwAWH1U1zimF", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_8DFDwR4GryN3qQQOh8bq", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-19T09:36:17.091Z", "fingerprint": null, "browser_info": { "language": "en-US", "time_zone": 330, "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", "color_depth": 24, "java_enabled": false, "screen_width": 1920, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "screen_height": 1080, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-08-19T09:21:19.648Z", "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": true } ``` ## partial-auth manual payment response ```json { "payment_id": "pay_t82V58k4cohYq87gBvGL", "merchant_id": "merchant_1755675958", "status": "partially_authorized_and_requires_capture", "amount": 300, "net_amount": 300, "shipping_cost": null, "amount_capturable": 150, "amount_received": null, "connector": "nuvei", "client_secret": "pay_t82V58k4cohYq87gBvGL_secret_CHN75ZbLuZWVBKYTITqg", "created": "2025-08-21T08:37:13.180Z", "currency": "EUR", "customer_id": "nithxxinn", "customer": { "id": "nithxxinn", "name": null, "email": "hello@gmail.com", "phone": null, "phone_country_code": null }, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "7394", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "453173", "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_yUVtqVsfxyKqmAM4fl1H", "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "US", "line1": "Fasdf", "line2": "Fasdf", "line3": null, "zip": "560095", "state": null, "first_name": "Sakil", "last_name": "Mostak", "origin_zip": null }, "phone": null, "email": null }, "order_details": null, "email": "hello@gmail.com", "name": null, "phone": null, "return_url": "https://www.google.com/", "authentication_type": "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": 1755765433, "expires": 1755769033, "secret": "epk_c7ea65af285e4db69a3bd6fbcb553bf4" }, "manual_retry_allowed": false, "connector_transaction_id": "8110000000012833076", "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": "8101170111", "payment_link": null, "profile_id": "pro_8OqPL5PekR8mRXU8WZZs", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_48b4pLXImpTC9wJALk91", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-21T08:52:13.180Z", "fingerprint": null, "browser_info": { "language": "en-US", "time_zone": 330, "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", "color_depth": 24, "java_enabled": false, "screen_width": 1920, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "screen_height": 1080, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-08-21T08:37:15.983Z", "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": true } ``` ### capture partial ```json { "payment_id": "pay_t82V58k4cohYq87gBvGL", "merchant_id": "merchant_1755675958", "status": "partially_captured", "amount": 300, "net_amount": 300, "shipping_cost": null, "amount_capturable": 0, "amount_received": 150, "connector": "nuvei", "client_secret": "pay_t82V58k4cohYq87gBvGL_secret_CHN75ZbLuZWVBKYTITqg", "created": "2025-08-21T08:37:13.180Z", "currency": "EUR", "customer_id": "nithxxinn", "customer": { "id": "nithxxinn", "name": null, "email": "hello@gmail.com", "phone": null, "phone_country_code": null }, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "7394", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "453173", "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_yUVtqVsfxyKqmAM4fl1H", "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "US", "line1": "Fasdf", "line2": "Fasdf", "line3": null, "zip": "560095", "state": null, "first_name": "Sakil", "last_name": "Mostak", "origin_zip": null }, "phone": null, "email": null }, "order_details": null, "email": "hello@gmail.com", "name": null, "phone": null, "return_url": "https://www.google.com/", "authentication_type": "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": "8110000000012833218", "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": "8101170111", "payment_link": null, "profile_id": "pro_8OqPL5PekR8mRXU8WZZs", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_48b4pLXImpTC9wJALk91", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-08-21T08:52:13.180Z", "fingerprint": null, "browser_info": { "language": "en-US", "time_zone": 330, "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36", "color_depth": 24, "java_enabled": false, "screen_width": 1920, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "screen_height": 1080, "java_script_enabled": true }, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-08-21T08:37:57.428Z", "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": true } ``` </details> ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/nuvei.rs` - `crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs` - `crates/router/src/types/api/connector_mapping.rs` - ... and 1 more files **2. Type Definitions** - `crates/router/src/types/api/feature_matrix.rs` **Code Patterns Applied:** - Define new data structures (9 changes) - Implement new functions (14 changes) - Extend existing types with new fields (164 changes) - Add conditional logic for feature flags or filtering (3 changes) **Detailed Identifier Changes:** Commit 049e6b57: Files to modify: **crates/hyperswitch_connectors/src/connectors/nuvei.rs** Remove: - struct: pub::Nuvei Add: - function: pub::new - struct: pub::Nuvei - impl: impl Nuvei **crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs** Add: - function: private::get_is_partial_approval - function: private::get_minor_amount_required - function: private::get_is_partial_approval - function: private::from - function: private::from - struct: pub::ShippingAddress - struct: private::GooglePayCamelCase - struct: private::GooglePayInfoCamelCase - struct: private::GooglePayAssuranceDetailsCamelCase - struct: private::GooglePayTokenizationDataCamelCase - struct: private::ApplePayCamelCase - struct: private::ApplePayPaymentMethodCamelCase - enum: pub::PartialApprovalFlag - impl: impl From<bool> for PartialApprovalFlag - impl: impl From<&Address> for ShippingAddress **crates/router/src/types/api/connector_mapping.rs** Modify existing code **crates/router/src/types/api/feature_matrix.rs** Modify existing code **crates/router/tests/connectors/nuvei.rs** Modify existing code
{"pr_number": 8985, "pr_title": "feat(nuvei): Googlepay , applepay and partial authorization integration for nuvei", "merged_at": "2025-08-22T12:06:10Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nuvei.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/tests/connectors/nuvei.rs"], "types": ["crates/router/src/types/api/feature_matrix.rs"]}, "change_types": {"structs_added": 9, "functions_added": 14, "enums_added": 1, "fields_added": 164, "imports_added": 2, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(subscriptions): Add Subscription confirm handler This pull request introduces a new subscription feature to the codebase, adding comprehensive support for subscription management via new API models, endpoints, and supporting logic. The changes include new data models, API routes, core business logic for creating and confirming subscriptions, and integration with customer management. The implementation is gated behind the `v1` and `olap` feature flags. **New Subscription Feature** * Added `subscription` module to `api_models`, including request and response types, core data structures (`Subscription`, `Invoice`), and helper functions for mapping customer data. * Introduced a new `Subscription` resource to the global `Resource` enum for system-wide referencing. **Core Logic and Utilities** * Implemented core business logic in `core/subscription.rs` for creating and confirming subscriptions, including customer handling, client secret generation, and placeholder billing processor integration. * Added utility functions in `core/subscription/utils.rs` for customer retrieval/creation and extracting customer details from subscription requests. * Updated customer helper function signature in payouts to allow broader usage in subscription flows. **Database and Model Changes** * Added client secret generation to the `SubscriptionNew` model in `diesel_models`, supporting secure subscription creation. [[1]](diffhunk://#diff-18a18c6db4052184eddf2b35c376f2eff90d566c06c6d2fbc4aea751852b0f3aR85-R94) [[2]](diffhunk://#diff-18a18c6db4052184eddf2b35c376f2eff90d566c06c6d2fbc4aea751852b0f3aL1-R1) **API Routing and Integration** * Registered new subscription endpoints in the API routes and application server, enabling `/subscription` and `/subscription/{subscription_id}/confirm` endpoints for managing subscriptions. [[1]](diffhunk://#diff-a6e49b399ffdee83dd322b3cb8bee170c65fb9c6e2e52c14222ec310f6927c54R1164-R1186) [[2]](diffhunk://#diff-911527e4effff636e27a7c44689ecc4a5c37963f0e9198193eacb52e1488cab5R212) [[3]](diffhunk://#diff-7e1080d750a904d5d9ea4a8041a6b210d2b0c1fa9e45207500824f0dad7fbc51R53-R54) [[4]](diffhunk://#diff-7e1080d750a904d5d9ea4a8041a6b210d2b0c1fa9e45207500824f0dad7fbc51L99-R101) [[5]](diffhunk://#diff-a6e49b399ffdee83dd322b3cb8bee170c65fb9c6e2e52c14222ec310f6927c54L68-R70) * Added subscription module references to core and feature-gated module lists for proper compilation and integration. [[1]](diffhunk://#diff-77a35e04ebe8b59efecf0b6a986e706e15170eb486b847e8c8c55514c5e55486R45-R46) [[2]](diffhunk://#diff-3f92a5ed20c7decce0129ef9eb838b87bae76de2197e8efa267657c26f590f4bR52-R53) * Updated API identifier enums to include `Subscription` for locking and routing utilities.] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> 1. create a customer ``` curl --location 'http://localhost:8080/customers' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_Ske75Nx2J7qtHsP8cc7pFx5k4dccYBedM6UAExaLOdHCkji3uVWSqfmZ0Qz0Tnyj' \ --data-raw '{ "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` 2. create a subscription ``` curl --location 'http://localhost:8080/subscription/create' \ --header 'Content-Type: application/json' \ --header 'X-Profile-Id: pro_X16mQSHipgRuWbTEMkMp' \ --header 'api-key: dev_Ske75Nx2J7qtHsP8cc7pFx5k4dccYBedM6UAExaLOdHCkji3uVWSqfmZ0Qz0Tnyj' \ --data '{ "customer_id": "cus_NdHhw4wwWyYXSldO9oYE" }' ``` response - ``` {"id":"subscription_wBV1G9dhh6EBhTOTXRBA","merchant_reference_id":null,"status":"Created","plan_id":null,"profile_id":"pro_X16mQSHipgRuWbTEMkMp","client_secret":"subscription_wBV1G9dhh6EBhTOTXRBA_secret_6W89VL1bl5C3esgbxpJp","merchant_id":"merchant_1758626894","coupon_code":null,"customer_id":"cus_NdHhw4wwWyYXSldO9oYE"} ``` 3. Confirm subscription ``` curl --location 'http://localhost:8080/subscription/subscription_wBV1G9dhh6EBhTOTXRBA/confirm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'X-Profile-Id: pro_2WzEeiNyj8fSCObXqo36' \ --header 'api-key: dev_Ske75Nx2J7qtHsP8cc7pFx5k4dccYBedM6UAExaLOdHCkji3uVWSqfmZ0Qz0Tnyj' \ --data '{ "amount": 14100, "currency": "INR", "item_price_id": "cbdemo_enterprise-suite-INR-Daily", "customer_id": "cus_NdHhw4wwWyYXSldO9oYE", "billing_address": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "payment_details": { "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "123" } }, "setup_future_usage": "off_session", "customer_acceptance": { "acceptance_type": "online", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "127.0.0.1", "user_agent": "amet irure esse" } } } }' ``` Response - ``` {"id":"subscription_wBV1G9dhh6EBhTOTXRBA","merchant_reference_id":null,"status":"Active","plan_id":null,"price_id":null,"coupon":null,"profile_id":"pro_X16mQSHipgRuWbTEMkMp","payment":null,"customer_id":"cus_NdHhw4wwWyYXSldO9oYE","invoice":{"id":"invoice_0XANlbhMp2V7wUvWRhhJ","subscription_id":"subscription_wBV1G9dhh6EBhTOTXRBA","merchant_id":"merchant_1758626894","profile_id":"pro_X16mQSHipgRuWbTEMkMp","merchant_connector_id":"mca_eN6JxSK2NkuT0wSYAH5s","payment_intent_id":null,"payment_method_id":null,"customer_id":"cus_NdHhw4wwWyYXSldO9oYE","amount":14100,"currency":"INR","status":"InvoiceCreated"}} ``` ## 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. Database Layer (Queries & Schema)** - `crates/diesel_models/src/invoice.rs` **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/business_profile.rs` - `crates/hyperswitch_domain_models/src/errors/api_error_response.rs` - `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs` - ... and 1 more files **4. Core Business Logic** - `crates/router/src/core/subscription.rs` **5. 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 3 more files **6. Type Definitions** - `crates/router_env/src/logger/types.rs` **7. Utils** - `crates/router/src/routes/lock_utils.rs` **8. Other** - `crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs` - `crates/hyperswitch_interfaces/src/conversion_impls.rs` - `crates/router/src/compatibility/stripe/errors.rs` - ... and 2 more files **Code Patterns Applied:** - Define new data structures (13 changes) - Implement new functions (19 changes) - Extend existing types with new fields (213 changes) - Add conditional logic for feature flags or filtering (2 changes) - Modify database queries (1 changes) **Detailed Identifier Changes:** Commit f02d1803: Files to modify: **crates/api_models/src/subscription.rs** Add: - function: pub::get_item_price_id - function: pub::get_billing_address - struct: pub::PaymentDetails - struct: pub::PaymentResponseData - struct: pub::ConfirmSubscriptionRequest - struct: pub::ConfirmSubscriptionResponse - struct: pub::Invoice - impl: impl ConfirmSubscriptionRequest - impl: impl ApiEventMetric for ConfirmSubscriptionRequest - impl: impl ApiEventMetric for ConfirmSubscriptionResponse **crates/diesel_models/src/invoice.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/chargebee.rs** Add: - impl: impl ConnectorIntegrationV2< CreateConnectorCustomer, SubscriptionCustomerData, ConnectorCustomerData, PaymentsResponseData, > for Chargebee **crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/recurly.rs** Add: - impl: impl api::subscriptions_v2::SubscriptionConnectorCustomerV2 for Recurly - impl: impl ConnectorIntegrationV2< CreateConnectorCustomer, SubscriptionCustomerData, ConnectorCustomerData, PaymentsResponseData, > for Recurly **crates/hyperswitch_domain_models/src/business_profile.rs** Add: - function: pub::get_billing_processor_id **crates/hyperswitch_domain_models/src/errors/api_error_response.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs** Remove: - struct: pub::SubscriptionCreateData - struct: pub::GetSubscriptionPlansData - struct: pub::GetSubscriptionPlanPricesData Add: - struct: pub::SubscriptionCustomerData - struct: pub::SubscriptionCreateData - struct: pub::GetSubscriptionPlansData - struct: pub::GetSubscriptionPlanPricesData **crates/hyperswitch_domain_models/src/router_response_types/subscriptions.rs** Add: - function: private::from - impl: impl From<SubscriptionStatus> for api_models::subscription::SubscriptionStatus **crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs** Add: - trait: private::SubscriptionConnectorCustomerV2 **crates/hyperswitch_interfaces/src/conversion_impls.rs** Modify existing code **crates/router/src/compatibility/stripe/errors.rs** Modify existing code **crates/router/src/core/subscription.rs** Add: - function: pub::confirm_subscription - function: pub::new - function: pub::find_subscription - function: private::generate_response - function: private::update_subscription_status - function: pub::get_billing_handler - function: pub::get_invoice_handler - function: pub::create_invoice_entry - function: pub::create_cit_payment - function: pub::create_invoice_record_back_job - function: pub::create_customer_on_connector - function: pub::create_subscription_on_connector - function: private::call_connector - function: private::build_router_data - struct: pub::SubscriptionHandler - struct: pub::SubscriptionWithHandler - struct: pub::BillingHandler - struct: pub::InvoiceHandler - impl: impl SubscriptionHandler - impl: impl SubscriptionWithHandler<'a> - impl: impl InvoiceHandler - impl: impl BillingHandler **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/routes/subscription.rs** Add: - function: pub::confirm_subscription **crates/router/tests/connectors/utils.rs** Modify existing code **crates/router_env/src/logger/types.rs** Modify existing code
{"pr_number": 9353, "pr_title": "feat(subscriptions): Add Subscription confirm handler", "merged_at": "2025-09-25T16:22:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/subscription.rs"], "database": ["crates/diesel_models/src/invoice.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/errors/api_error_response.rs", "crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs", "crates/hyperswitch_domain_models/src/router_response_types/subscriptions.rs"], "core_business": ["crates/router/src/core/subscription.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/router/tests/connectors/utils.rs", "migrations/2025-09-23-112547_add_billing_processor_in_connector_type/down.sql", "migrations/2025-09-23-112547_add_billing_processor_in_connector_type/up.sql"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "other": ["crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs", "crates/hyperswitch_interfaces/src/conversion_impls.rs", "crates/router/src/compatibility/stripe/errors.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/subscription.rs"]}, "change_types": {"structs_added": 13, "functions_added": 19, "fields_added": 213, "imports_added": 8, "conditionals_added": 2, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(payment_methods): fix merchant payment method list to retain a mca based on connector_name and mca_id ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Earlier a connector was occurring twice while doing a session token call for wallets. This PR fixes merchant payment method list to retain a mca based on connector_name and mca_id. So that with every distinct mca_id the connector is listed just once for wallets. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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? - Create a MA and an MCA(with wallets enabled) - Create an payment_intent ``` Intent Response { "payment_id": "pay_NHWegNguTfDH9hxuVj1m", "merchant_id": "merchant_1729514766", "status": "requires_payment_method", "amount": 8500, "net_amount": 8500, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": null, "client_secret": "pay_NHWegNguTfDH9hxuVj1m_secret_YgCdjC1ZMbdqGBmOOoTP", "created": "2024-10-21T13:11:49.384Z", "currency": "USD", "customer_id": "CustomerX777", "customer": { "id": "CustomerX777", "name": "Joseph Doe", "email": "something@gmail.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": null, "payment_method_data": null, "payment_token": null, "shipping": { "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": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "CustomerX777", "created_at": 1729516309, "expires": 1729519909, "secret": "epk_f7a7e71ac7b246b490d5cc31cb55e5d4" }, "manual_retry_allowed": null, "connector_transaction_id": null, "frm_message": null, "metadata": null, "connector_metadata": { "apple_pay": null, "airwallex": null, "noon": { "order_category": "pay" } }, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_M3DqjrGVffJASyys4npr", "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-10-21T13:26:49.384Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-10-21T13:11:49.418Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` - Do a PML call, for the wallets the mca should be listed once for the wallets that support session token flow ``` Merchant PML response { "redirect_url": "https://google.com/success", "currency": "USD", "payment_methods": [ { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "paypal", "payment_experience": [ { "payment_experience_type": "redirect_to_url", "eligible_connectors": [ "stripe" ] } ], "card_networks": null, "bank_names": null, "bank_debits": null, "bank_transfers": null, "required_fields": null, "surcharge_details": null, "pm_auth_connector": null }, { "payment_method_type": "google_pay", "payment_experience": [ { "payment_experience_type": "invoke_sdk_client", "eligible_connectors": [ "stripe" ] } ], "card_networks": null, "bank_names": null, "bank_debits": null, "bank_transfers": null, "required_fields": {}, "surcharge_details": null, "pm_auth_connector": null }, { "payment_method_type": "samsung_pay", "payment_experience": [ { "payment_experience_type": "invoke_sdk_client", "eligible_connectors": [ "stripe", "stripe" ] } ], "card_networks": null, "bank_names": null, "bank_debits": null, "bank_transfers": null, "required_fields": null, "surcharge_details": null, "pm_auth_connector": null }, { "payment_method_type": "apple_pay", "payment_experience": [ { "payment_experience_type": "invoke_sdk_client", "eligible_connectors": [ "stripe" ] } ], "card_networks": null, "bank_names": null, "bank_debits": null, "bank_transfers": null, "required_fields": {}, "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 } ``` - Create a MA and 2 same MCA - Create a payment_intent - Create a session token, only one google_pay will appear ``` curl --location 'http://localhost:8080/payments/session_tokens' \ --header 'Content-Type: application/json' \ --header 'x-client-platform: ios' \ --header 'api-key: pk_dev_385274838f7c4d66b6571c32756827d6' \ --data '{ "payment_id": "pay_NUmAgcew9X7W8yyBBsIK", "wallets":[], "client_secret": "pay_NUmAgcew9X7W8yyBBsIK_secret_DdDRx8PnhQznkCnVfY99" }' ``` ``` { "payment_id": "pay_NUmAgcew9X7W8yyBBsIK", "client_secret": "pay_NUmAgcew9X7W8yyBBsIK_secret_DdDRx8PnhQznkCnVfY99", "session_token": [ { "wallet_name": "google_pay", "merchant_info": { "merchant_name": "S7" }, "shipping_address_required": false, "email_required": false, "shipping_address_parameters": { "phone_number_required": false }, "allowed_payment_methods": [ { "type": "CARD", "parameters": { "allowed_auth_methods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowed_card_networks": [ "AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA" ], "billing_address_required": false }, "tokenization_specification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "stripe", "stripe:version": "2018-10-31", "stripe:publishableKey": "pk_test_51Msk2GAGHc77EJXX78h549SX2uaOnEkUYqBfjcoD05PIpAnDkYxMn8nQ4d19im85NQuX4Z6WDyHaUw2fFTPBWsIY00Wa7oNerO" } } } ], "transaction_info": { "country_code": "US", "currency_code": "USD", "total_price_status": "Final", "total_price": "85.00" }, "delayed_session_token": false, "connector": "stripe", "sdk_next_action": { "next_action": "confirm" }, "secrets": 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. API Request/Response Models** - `crates/api_models/src/payment_methods.rs` **2. Core Business Logic** - `crates/router/src/core/payment_methods/cards.rs` - `crates/router/src/core/payments.rs` **Code Patterns Applied:** - Extend existing types with new fields (2 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 842c4a2f: Files to modify: **crates/api_models/src/payment_methods.rs** Modify existing code **crates/router/src/core/payment_methods/cards.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code
{"pr_number": 6408, "pr_title": "fix(payment_methods): fix merchant payment method list to retain a mca based on connector_name and mca_id", "merged_at": "2024-10-24T15:05:19Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "core_business": ["crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payments.rs"]}, "change_types": {"fields_added": 2, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
chore: reorder v2 migrations folders ## 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 --> reordered v2 migrations folders. * All misplaced v2 migrations are moved to `v2_compatible_migrations` directory. * Removed `Add not null` constraints to newly added v2 columns. * `v2_migrations` directory will only contain queries for dropping deprecated v1 columns and tables. And queries to update primary_key constraints on v2 columns. This set of migration will only be run after v1 is deprecated. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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)? --> Ran` just migrate` and `just migrate_v2` and checked if schema.rs and schema_v2.rs has changed. # 1. Create and retrieve MCA. 1. Create curl. ``` curl --location 'localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: test_merchant_Y0ZfWfDN9sUUbMjs8anw' \ --header 'x-profile-id: pro_wm40wdiluSez3GvEhgUh' \ --header 'x-tenant-id: public' \ --header 'authorization: admin-api-key=test_admin' \ --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", "payment_method_subtypes": [ { "payment_method_subtype": "credit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "debit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay", "account_name": "transaction_processing", "pricing_type": "fixed_price", "acquirer_bin": "438309", "acquirer_merchant_id": "00002000000" }, "frm_configs": null, "connector_webhook_details": { "merchant_secret": "" }, "profile_id": "pro_wm40wdiluSez3GvEhgUh" }' ``` 2. Retrive MCA. ``` curl --location 'localhost:8080/v2/connector-accounts/mca_OpUAPwOPYsXZUUKNMhAg' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: test_merchant_Y0ZfWfDN9sUUbMjs8anw' \ --header 'x-profile-id: pro_wm40wdiluSez3GvEhgUh' \ --header 'x-tenant-id: public' \ --header 'authorization: admin-api-key=test_admin' ``` Response: 2xx response # 2. Create and retrieve Customer. 1. Create customer. ``` curl --location 'localhost:8080/v2/customers' \ --header 'x-profile-id: pro_wm40wdiluSez3GvEhgUh' \ --header 'x-tenant-id: public' \ --header 'Content-Type: application/json' \ --header 'authorization: api-key=dev_shfYv8ac2GIlqBl8Qd0WaBqeiNkGuF53bTv0clK1CGR4p28agg0VIuO4j4r4vATm' \ --data-raw '{ "merchant_reference_id": "customer_1753776365", "name": "John Doe", "email": "guest@example.com", "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" } }' ``` 2. Retrive Customer. ``` curl --location 'localhost:8080/v2/customers/12345_cus_0198551f679f7091a036beaf2c013020' \ --header 'x-profile-id: pro_wm40wdiluSez3GvEhgUh' \ --header 'authorization: api-key=dev_shfYv8ac2GIlqBl8Qd0WaBqeiNkGuF53bTv0clK1CGR4p28agg0VIuO4j4r4vATm' ``` Response: 2xx 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. Database Layer (Queries & Schema)** - `crates/diesel_models/src/business_profile.rs` - `crates/diesel_models/src/customers.rs` - `crates/diesel_models/src/lib.rs` - ... and 5 more files **2. External Connector Integration** - `v2_migrations/2025-02-24-053820_add_billing_processor_value_to_connector_type_enum/down.sql` - `v2_migrations/2025-02-24-053820_add_billing_processor_value_to_connector_type_enum/up.sql` - `v2_migrations/2025-05-30-103514_add_connector_request_reference_id_in_payment_attempt/down.sql` - ... and 1 more files **3. Other** - `crates/common_enums/src/enums.rs` - `v2_migrations/2025-01-17-042122_add_feature_metadata_in_payment_attempt/down.sql` - `v2_migrations/2025-01-17-042122_add_feature_metadata_in_payment_attempt/up.sql` - ... and 21 more files **Code Patterns Applied:** - Define new data structures (3 changes) - Implement new functions (6 changes) - Extend existing types with new fields (41 changes) - Modify database queries (2 changes) **Detailed Identifier Changes:** Commit c573f611: Files to modify: **crates/common_enums/src/enums.rs** Modify existing code **crates/diesel_models/src/business_profile.rs** Modify existing code **crates/diesel_models/src/customers.rs** Modify existing code **crates/diesel_models/src/lib.rs** Add: - function: pub::into_inner - function: private::build - function: pub::into_inner - function: private::build - struct: pub::RequiredFromNullable - struct: pub::RequiredFromNullableWithDefault - impl: impl RequiredFromNullable<T> - impl: impl Queryable<Nullable<ST>, DB> for RequiredFromNullable<T> - impl: impl RequiredFromNullableWithDefault<T> - impl: impl Queryable<Nullable<ST>, DB> for RequiredFromNullableWithDefault<T> **crates/diesel_models/src/merchant_connector_account.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/refund.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code
{"pr_number": 8671, "pr_title": "chore: reorder v2 migrations folders", "merged_at": "2025-08-05T08:25:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/customers.rs", "crates/diesel_models/src/lib.rs", "crates/diesel_models/src/merchant_connector_account.rs", "crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/refund.rs", "crates/diesel_models/src/schema_v2.rs"], "connectors": ["v2_migrations/2025-02-24-053820_add_billing_processor_value_to_connector_type_enum/down.sql", "v2_migrations/2025-02-24-053820_add_billing_processor_value_to_connector_type_enum/up.sql", "v2_migrations/2025-05-30-103514_add_connector_request_reference_id_in_payment_attempt/down.sql", "v2_migrations/2025-05-30-103514_add_connector_request_reference_id_in_payment_attempt/up.sql"], "other": ["crates/common_enums/src/enums.rs", "v2_migrations/2025-01-17-042122_add_feature_metadata_in_payment_attempt/down.sql", "v2_migrations/2025-01-17-042122_add_feature_metadata_in_payment_attempt/up.sql", "v2_compatible_migrations/2025-02-10-101458_create_index_payment_attempt_payment_id/down.sql", "v2_migrations/2025-02-10-101458_create_index_payment_attempt_payment_id/up.sql", "v2_migrations/2025-03-19-080705_payment-method-subtype-optional/down.sql", "v2_migrations/2025-03-19-080705_payment-method-subtype-optional/up.sql", "v2_migrations/2025-03-25-074512_payment-method-subtype-mandatory/down.sql", "v2_migrations/2025-03-25-074512_payment-method-subtype-mandatory/up.sql", "v2_migrations/2025-04-02-051959_add_network_error_info_in_payment_attempt/down.sql", "v2_migrations/2025-04-02-051959_add_network_error_info_in_payment_attempt/up.sql", "v2_migrations/2025-04-08-101702_add_recovery_algorithm_column_in_business_profile/down.sql", "v2_migrations/2025-04-08-101702_add_recovery_algorithm_column_in_business_profile/up.sql", "v2_migrations/2025-04-25-105138_tokenization_service_creation/down.sql", "v2_migrations/2025-04-25-105138_tokenization_service_creation/up.sql", "v2_compatible_migrations/2025-07-16-035805_add_index_on_mca_for_profile_id/down.sql", "v2_compatible_migrations/2025-07-16-035805_add_index_on_mca_for_profile_id/up.sql", "v2_migrations/2024-08-28-081837_add_not_null_constraints_to_v2_columns/down.sql", "v2_migrations/2024-08-28-081837_add_not_null_constraints_to_v2_columns/up.sql", "v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/down.sql", "v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/up.sql", "v2_migrations/2025-01-13-081847_drop_v1_columns/down.sql", "v2_migrations/2025-01-13-081847_drop_v1_columns/up.sql", "v2_migrations/2025-02-10-101458_create_index_payment_attempt_payment_id/down.sql"]}, "change_types": {"structs_added": 3, "functions_added": 6, "fields_added": 41, "imports_added": 8, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(customer): return redacted customer instead of error ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Return redacted customer response instead of error when querying deleted customers. ## Motivation and Context Upon merging this PR, the API will return deleted Customer with redacted values instead of error. https://github.com/juspay/hyperswitch/issues/7126 ## How did you test it? - Create Customer API Call ``` curl --location 'http://localhost:8080/customers' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data-raw '{ "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "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 API Call for same customer ``` curl --location --request DELETE 'http://localhost:8080/customers/cus_vl2xIM4vJGaOVanI9rLl' \ --header 'Accept: application/json' \ --header 'api-key: *****' ``` - Retrieve Customer API call for the same customer ``` curl --location 'http://localhost:8080/customers/cus_PEkI9z16lQRq2xAXOol5' \ --header 'Accept: application/json' \ --header 'api-key: dev_CN6BIH4qBtQTtH3smdKKJEwcyuaxiQgu9Yv6houFWmaOmgjhLtSNOGFLEDagthEZ' ``` - Response from the above API Call ``` {"customer_id":"cus_PEkI9z16lQRq2xAXOol5","name":"Redacted","email":"Redacted","phone":"Redacted","phone_country_code":"Redacted","description":"Redacted","address":{"city":"Redacted","country":"US","line1":"Redacted","line2":"Redacted","line3":"Redacted","zip":"Redacted","state":"Redacted","first_name":"Redacted","last_name":"Redacted"},"created_at":"2025-01-28T07:15:35.740Z","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"default_payment_method_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/customers.rs` **Detailed Identifier Changes:** Commit 97e9270e: Files to modify: **crates/router/src/core/customers.rs** Modify existing code
{"pr_number": 7122, "pr_title": "refactor(customer): return redacted customer instead of error", "merged_at": "2025-02-06T15:04:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment"]}, "hierarchy": {"core_business": ["crates/router/src/core/customers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix: consider status of payment method before filtering wallets in list pm ## 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 --> Main pr - https://github.com/juspay/hyperswitch/pull/7004 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payment_methods/cards.rs` **Detailed Identifier Changes:** Commit df67b9d7: Files to modify: **crates/router/src/core/payment_methods/cards.rs** Modify existing code
{"pr_number": 7012, "pr_title": "fix: consider status of payment method before filtering wallets in list pm", "merged_at": "2025-01-09T07:49:41Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/payment_methods/cards.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(analytics): Add RoutingApproach filter in payment analytics ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> - Added RoutingApproach column in Payment attempt - Added RoutingApproach as a filter and dimension in payment analytics - Added routing metric endpoints DB queries - ```sql CREATE TYPE "RoutingApproach" AS ENUM ( 'success_rate_exploitation', 'success_rate_exploration', 'contract_based_routing', 'debit_routing', 'rule_based_routing', 'volume_based_routing', 'default_fallback' ); ALTER TABLE payment_attempt ADD COLUMN IF NOT EXISTS routing_approach "RoutingApproach"; ``` ### 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)? --> ```bash curl -X GET 'http://localhost:8080/analytics/v1/org/routing/info' \ -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/136.0.0.0 Safari/537.36' \ -H 'X-Merchant-Id: merchant_1750414514' \ -H 'X-Profile-Id: pro_8QBK8uJG8ZHGwiZfWcAr' \ -H 'api-key: hyperswitch' \ -H 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiOGMzNzEwZmMtNDU3NS00NDlmLWFhNzItNWFjOWUyYmJlODViIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzUwNDE0NTE0Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc1MDg1MDY3MCwib3JnX2lkIjoib3JnX2EycGVlblVCaVNqY2dmVzNMQ2xXIiwicHJvZmlsZV9pZCI6InByb184UUJLOHVKRzhaSEd3aVpmV2NBciIsInRlbmFudF9pZCI6InB1YmxpYyJ9.wutHNAmKapYOM4kcOF0t-Lrrx-ZVFKelyFCXk_Xk8JA' \ -H 'sec-ch-ua: "Chromium";v="136", "Google Chrome";v="136", "Not.A/Brand";v="99"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "macOS"' ``` response - ```json { "metrics": [ { "name": "payment_success_rate", "desc": "" }, { "name": "payment_count", "desc": "" }, { "name": "payment_success_count", "desc": "" }, { "name": "payment_processed_amount", "desc": "" }, { "name": "avg_ticket_size", "desc": "" }, { "name": "retries_count", "desc": "" }, { "name": "connector_success_rate", "desc": "" }, { "name": "sessionized_payment_success_rate", "desc": "" }, { "name": "sessionized_payment_count", "desc": "" }, { "name": "sessionized_payment_success_count", "desc": "" }, { "name": "sessionized_payment_processed_amount", "desc": "" }, { "name": "sessionized_avg_ticket_size", "desc": "" }, { "name": "sessionized_retries_count", "desc": "" }, { "name": "sessionized_connector_success_rate", "desc": "" }, { "name": "payments_distribution", "desc": "" }, { "name": "failure_reasons", "desc": "" } ], "downloadDimensions": null, "dimensions": [ { "name": "connector", "desc": "" }, { "name": "payment_method", "desc": "" }, { "name": "payment_method_type", "desc": "" }, { "name": "currency", "desc": "" }, { "name": "authentication_type", "desc": "" }, { "name": "status", "desc": "" }, { "name": "client_source", "desc": "" }, { "name": "client_version", "desc": "" }, { "name": "profile_id", "desc": "" }, { "name": "card_network", "desc": "" }, { "name": "merchant_id", "desc": "" }, { "name": "routing_approach", "desc": "" } ] } ``` ```bash curl -X POST http://localhost:8080/analytics/v1/org/filters/routing \ -H "Content-Type: application/json" \ -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiOGMzNzEwZmMtNDU3NS00NDlmLWFhNzItNWFjOWUyYmJlODViIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzUwNDE0NTE0Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc1MDU4NzUzMCwib3JnX2lkIjoib3JnX2EycGVlblVCaVNqY2dmVzNMQ2xXIiwicHJvZmlsZV9pZCI6InByb184UUJLOHVKRzhaSEd3aVpmV2NBciIsInRlbmFudF9pZCI6InB1YmxpYyJ9.4PuaaBWunN6wnLnm6Pxj08r9rXuuMrZ6GfYewQX9IFE" \ -d '{ "timeRange": { "startTime": "2025-06-11T18:30:00.000Z", "endTime": "2025-06-20T11:10:32.000Z" }, "groupByNames": [ "connector", "payment_method", "payment_method_type", "currency", "authentication_type", "status", "client_source", "client_version", "profile_id", "card_network", "merchant_id", "routing_approach" ], "source": "BATCH", "delta": true }' ``` ```bash curl 'http://localhost:8080/analytics/v1/org/metrics/routing' \ -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/136.0.0.0 Safari/537.36' \ -H 'X-Merchant-Id: merchant_1750414514' \ -H 'X-Profile-Id: pro_8QBK8uJG8ZHGwiZfWcAr' \ -H 'api-key: hyperswitch' \ -H 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiOGMzNzEwZmMtNDU3NS00NDlmLWFhNzItNWFjOWUyYmJlODViIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzUwNDE0NTE0Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc1MDg1MDY3MCwib3JnX2lkIjoib3JnX2EycGVlblVCaVNqY2dmVzNMQ2xXIiwicHJvZmlsZV9pZCI6InByb184UUJLOHVKRzhaSEd3aVpmV2NBciIsInRlbmFudF9pZCI6InB1YmxpYyJ9.wutHNAmKapYOM4kcOF0t-Lrrx-ZVFKelyFCXk_Xk8JA' \ -H 'sec-ch-ua: "Chromium";v="136", "Google Chrome";v="136", "Not.A/Brand";v="99"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "macOS"' \ --data-raw '[{"timeRange":{"startTime":"2025-06-12T18:30:00Z","endTime":"2025-06-23T18:23:53Z"},"groupByNames":["routing_approach","connector"],"source":"BATCH","metrics":[ "payment_count","payment_success_rate", "payment_processed_amount"],"delta":true}]' ``` Response ```json { "queryData": [ { "payment_success_rate": null, "payment_count": null, "payment_success_count": null, "payment_processed_amount": 20400, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": "USD", "status": null, "connector": "stripe", "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": "rule_based_routing", "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": null, "payment_count": null, "payment_success_count": null, "payment_processed_amount": 20300, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": "USD", "status": null, "connector": "pretendpay", "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": null, "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": 100.0, "payment_count": 2, "payment_success_count": null, "payment_processed_amount": 0, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": null, "status": null, "connector": "stripe", "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": "volume_based_routing", "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": 100.0, "payment_count": 2, "payment_success_count": null, "payment_processed_amount": 0, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": null, "status": null, "connector": "stripe", "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": "rule_based_routing", "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": null, "payment_count": null, "payment_success_count": null, "payment_processed_amount": 10200, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": "USD", "status": null, "connector": "stripe", "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": "default_fallback", "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": 100.0, "payment_count": 4, "payment_success_count": null, "payment_processed_amount": 0, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": null, "status": null, "connector": "stripe", "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": null, "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": 0.0, "payment_count": 12, "payment_success_count": null, "payment_processed_amount": 0, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": null, "status": null, "connector": null, "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": null, "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": 0.0, "payment_count": 6, "payment_success_count": null, "payment_processed_amount": 0, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": null, "status": null, "connector": null, "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": "rule_based_routing", "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": null, "payment_count": null, "payment_success_count": null, "payment_processed_amount": 20000, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": "USD", "status": null, "connector": "stripe", "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": "volume_based_routing", "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": null, "payment_count": null, "payment_success_count": null, "payment_processed_amount": 40000, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": "USD", "status": null, "connector": "stripe", "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": null, "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": 100.0, "payment_count": 2, "payment_success_count": null, "payment_processed_amount": 0, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": null, "status": null, "connector": "pretendpay", "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": null, "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" }, { "payment_success_rate": 100.0, "payment_count": 1, "payment_success_count": null, "payment_processed_amount": 0, "payment_processed_amount_in_usd": null, "payment_processed_count": null, "payment_processed_amount_without_smart_retries": 0, "payment_processed_amount_without_smart_retries_usd": null, "payment_processed_count_without_smart_retries": null, "avg_ticket_size": null, "payment_error_message": null, "retries_count": null, "retries_amount_processed": 0, "connector_success_rate": null, "payments_success_rate_distribution": null, "payments_success_rate_distribution_without_smart_retries": null, "payments_success_rate_distribution_with_only_retries": null, "payments_failure_rate_distribution": null, "payments_failure_rate_distribution_without_smart_retries": null, "payments_failure_rate_distribution_with_only_retries": null, "failure_reason_count": 0, "failure_reason_count_without_smart_retries": 0, "currency": null, "status": null, "connector": "stripe", "authentication_type": null, "payment_method": null, "payment_method_type": null, "client_source": null, "client_version": null, "profile_id": null, "card_network": null, "merchant_id": null, "card_last_4": null, "card_issuer": null, "error_reason": null, "routing_approach": "default_fallback", "time_range": { "start_time": "2025-06-12T18:30:00.000Z", "end_time": "2025-06-23T18:23:53.000Z" }, "time_bucket": "2025-06-12 18:30:00" } ], "metaData": [ { "total_payment_processed_amount": 110900, "total_payment_processed_amount_in_usd": null, "total_payment_processed_amount_without_smart_retries": 0, "total_payment_processed_amount_without_smart_retries_usd": null, "total_payment_processed_count": 0, "total_payment_processed_count_without_smart_retries": 0, "total_failure_reasons_count": 0, "total_failure_reasons_count_without_smart_retries": 0 } ] } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] 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/analytics/payments.rs` **2. Database Layer (Queries & Schema)** - `crates/analytics/src/query.rs` - `crates/diesel_models/src/enums.rs` - `crates/diesel_models/src/payment_attempt.rs` - ... and 2 more files **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs` **4. Core Business Logic** - `crates/analytics/src/core.rs` - `crates/analytics/src/payments/core.rs` - `crates/router/src/core/debit_routing.rs` - ... and 8 more files **5. External Connector Integration** - `crates/analytics/src/payments/metrics/connector_success_rate.rs` - `crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs` **6. Type Definitions** - `crates/analytics/src/payments/types.rs` - `crates/analytics/src/types.rs` - `crates/router/src/types/storage/payment_attempt.rs` **7. Utils** - `crates/analytics/src/utils.rs` - `crates/router/src/utils/user/sample_data.rs` **8. Other** - `crates/analytics/docs/clickhouse/scripts/payment_attempts.sql` - `crates/analytics/src/payments/distribution.rs` - `crates/analytics/src/payments/distribution/payment_error_message.rs` - ... and 26 more files **Code Patterns Applied:** - Implement new functions (14 changes) - Extend existing types with new fields (87 changes) - Add conditional logic for feature flags or filtering (2 changes) - Modify database queries (3 changes) **Detailed Identifier Changes:** Commit a3cc44c6: Files to modify: **crates/analytics/src/core.rs** Modify existing code **crates/analytics/src/payments/core.rs** Modify existing code **crates/analytics/src/payments/distribution.rs** Modify existing code **crates/analytics/src/payments/distribution/payment_error_message.rs** Modify existing code **crates/analytics/src/payments/filters.rs** Modify existing code **crates/analytics/src/payments/metrics.rs** Modify existing code **crates/analytics/src/payments/metrics/avg_ticket_size.rs** Modify existing code **crates/analytics/src/payments/metrics/connector_success_rate.rs** Modify existing code **crates/analytics/src/payments/metrics/payment_count.rs** Modify existing code **crates/analytics/src/payments/metrics/payment_processed_amount.rs** Modify existing code **crates/analytics/src/payments/metrics/payment_success_count.rs** Modify existing code **crates/analytics/src/payments/metrics/retries_count.rs** Modify existing code **crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs** Modify existing code **crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs** Modify existing code **crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs** Modify existing code **crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs** Modify existing code **crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs** Modify existing code **crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs** Modify existing code **crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs** Modify existing code **crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs** Modify existing code **crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs** Modify existing code **crates/analytics/src/payments/metrics/success_rate.rs** Modify existing code **crates/analytics/src/payments/types.rs** Modify existing code **crates/analytics/src/query.rs** Modify existing code **crates/analytics/src/sqlx.rs** Modify existing code **crates/analytics/src/types.rs** Modify existing code **crates/analytics/src/utils.rs** Modify existing code **crates/api_models/src/analytics/payments.rs** Modify existing code **crates/common_enums/src/enums.rs** Add: - function: pub::from_decision_engine_approach - enum: pub::RoutingApproach - impl: impl RoutingApproach **crates/diesel_models/src/enums.rs** Modify existing code **crates/diesel_models/src/payment_attempt.rs** Modify existing code **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/user/sample_data.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code **crates/router/src/analytics.rs** Modify existing code **crates/router/src/core/debit_routing.rs** Modify existing code **crates/router/src/core/payments.rs** Add: - function: private::set_routing_approach_in_attempt - function: private::set_routing_approach_in_attempt - function: private::set_routing_approach_in_attempt - function: private::set_routing_approach_in_attempt **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/payments/operations/payment_confirm.rs** Modify existing code **crates/router/src/core/payments/operations/payment_create.rs** Modify existing code **crates/router/src/core/payments/retry.rs** Modify existing code **crates/router/src/core/payments/routing.rs** Modify existing code **crates/router/src/core/payments/routing/utils.rs** Add: - function: private::from - impl: impl From<RoutingApproach> for common_enums::RoutingApproach **crates/router/src/core/routing/helpers.rs** Modify existing code **crates/router/src/services/kafka/payment_attempt.rs** Modify existing code **crates/router/src/services/kafka/payment_attempt_event.rs** Modify existing code **crates/router/src/types/storage/payment_attempt.rs** Modify existing code **crates/router/src/utils/user/sample_data.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_attempt.rs** Modify existing code **crates/storage_impl/src/payments/payment_attempt.rs** Modify existing code
{"pr_number": 8408, "pr_title": "feat(analytics): Add RoutingApproach filter in payment analytics", "merged_at": "2025-06-23T17:55:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics/payments.rs"], "database": ["crates/analytics/src/query.rs", "crates/diesel_models/src/enums.rs", "crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/user/sample_data.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs"], "core_business": ["crates/analytics/src/core.rs", "crates/analytics/src/payments/core.rs", "crates/router/src/core/debit_routing.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/payments/routing/utils.rs", "crates/router/src/core/routing/helpers.rs"], "connectors": ["crates/analytics/src/payments/metrics/connector_success_rate.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs"], "types": ["crates/analytics/src/payments/types.rs", "crates/analytics/src/types.rs", "crates/router/src/types/storage/payment_attempt.rs"], "utils": ["crates/analytics/src/utils.rs", "crates/router/src/utils/user/sample_data.rs"], "other": ["crates/analytics/docs/clickhouse/scripts/payment_attempts.sql", "crates/analytics/src/payments/distribution.rs", "crates/analytics/src/payments/distribution/payment_error_message.rs", "crates/analytics/src/payments/filters.rs", "crates/analytics/src/payments/metrics.rs", "crates/analytics/src/payments/metrics/avg_ticket_size.rs", "crates/analytics/src/payments/metrics/payment_count.rs", "crates/analytics/src/payments/metrics/payment_processed_amount.rs", "crates/analytics/src/payments/metrics/payment_success_count.rs", "crates/analytics/src/payments/metrics/retries_count.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs", "crates/analytics/src/payments/metrics/success_rate.rs", "crates/analytics/src/sqlx.rs", "crates/common_enums/src/enums.rs", "crates/router/src/analytics.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-06-19-124558_add_routing_approach_to_attempt/down.sql", "migrations/2025-06-19-124558_add_routing_approach_to_attempt/up.sql", "v2_migrations/2025-01-13-081847_drop_v1_columns/up.sql"]}, "change_types": {"functions_added": 14, "enums_added": 1, "fields_added": 87, "imports_added": 1, "conditionals_added": 2, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
ci(cypress): Add billwerk connector test in cypress ## Type of Change - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Enhanced Billwerk Connector in cypress for Comprehensive Testing. ## How did you test it? <img width="515" alt="Billwerk" src="https://github.com/user-attachments/assets/feb4d3ec-b263-4143-ba0b-2d5b4db61ea9" /> 1.Savecard flow is not working (on_session & off_session) both throwing no eligible connector error 2.zero auth mandates not throwing an validation error 3.Payment method list is always empty ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **payment** feature, you'll need to modify these architectural layers: **1. Tests** - `cypress-tests/cypress/e2e/configs/Payment/Billwerk.js` - `cypress-tests/cypress/e2e/configs/Payment/Utils.js` **Code Patterns Applied:** - Extend existing types with new fields (653 changes)
{"pr_number": 8397, "pr_title": "ci(cypress): Add billwerk connector test in cypress", "merged_at": "2025-06-20T11:28:25Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Billwerk.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js"]}, "change_types": {"fields_added": 653}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
feat(payment_link): expose configurations for payment links ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description This PR exposes three configurations for payment links 1. `payment_form_header_text` - for rendering a header text for payment links 2. `payment_form_label_type` - for specifying the type of payment form labels (floating / above / never) 3. `show_card_terms` - for controlling visibility of the terms for cards (auto / always / never) ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 4. `crates/router/src/configs` 5. `loadtest/config` --> ## Motivation and Context Helps in exposing UI functionalities through some configs for SDK. ## How did you test it? Tested locally <details> <summary>Create payment link with new configs</summary> cURL curl --location --request POST 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_ML2p8kRGcMvi4oQ3cPnIfz5R2rO31efjWKXzgMnbRCnj5pUpjiki8K2HONlmMAb4' \ --data-raw '{"authentication_type":"three_ds","customer_id":"cus_9SCrW9x19m2WbGYHprJS","profile_id":"pro_jZ4ix0hYxn8qi2NSSYih","amount":100,"currency":"EUR","payment_link":true,"setup_future_usage":"off_session","capture_method":"automatic","billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"NL","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"random@juspay.in"},"return_url":"https://example.com","payment_link_config":{"theme":"#2167AE","enable_button_only_on_form_ready":true,"display_sdk_only":true,"show_card_terms":"never","payment_form_label_type":"floating","payment_form_header_text":"Detalles de tu tarjeta","payment_link_ui_rules":{"#submit":{"height":"max-content","borderRadius":"50px","padding":"14px 20px","marginTop":"48px","fontSize":"20px"},"#submit.not-ready":{"backgroundColor":"#A6ADAF !important"},"#submit.processing":{"paddingLeft":"50px !important","paddingRight":"50px !important"}},"sdk_ui_rules":{".Input, .Input:focus, .Input--invalid, .Input--empty":{"border":"none","boxShadow":"none","borderRadius":"28px","paddingLeft":"22px !important","paddingBottom":"2px !important","backgroundColor":"rgb(231, 234, 235) !important","height":"56px","fontSize":"20px"},".Input, .Input:focus, .Input--empty":{"color":"#23366F"},".Input--invalid":{"border":"2px solid #CB4B40 !important"},".Label":{"marginLeft":"22px","color":"#2167AE","opacity":"1 !important","bottom":"5px"},".Label--invalid, .Input--invalid, .Error":{"color":"#CB4B40 !important","opacity":"1 !important"},".Label--floating":{"opacity":"1 !important"},".InputLogo--empty":{"color":"#979797"},".InputLogo":{"color":"#23366F"},".InputLogo--invalid":{"color":"#CB4B40"},".PaymentLabel":{"color":"#23366F !important","fontSize":"24px"}}}}' Response {"payment_id":"pay_McmUUZfc21SHM7Hpc9Sr","merchant_id":"merchant_1743758708","status":"requires_payment_method","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":null,"client_secret":"pay_McmUUZfc21SHM7Hpc9Sr_secret_ohEWaukkfjWDkoB2U7pc","created":"2025-04-07T11:49:19.273Z","currency":"EUR","customer_id":"cus_9SCrW9x19m2WbGYHprJS","customer":{"id":"cus_9SCrW9x19m2WbGYHprJS","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":null,"payment_method_data":null,"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"NL","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"random@juspay.in"},"order_details":null,"email":null,"name":null,"phone":null,"return_url":"https://example.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_9SCrW9x19m2WbGYHprJS","created_at":1744026559,"expires":1744030159,"secret":"epk_74f58545483841e7a27ef0bddca9b8b5"},"manual_retry_allowed":null,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":{"link":"http://localhost:8080/payment_link/merchant_1743758708/pay_McmUUZfc21SHM7Hpc9Sr?locale=en","secure_link":"http://localhost:8080/payment_link/s/merchant_1743758708/pay_McmUUZfc21SHM7Hpc9Sr?locale=en","payment_link_id":"plink_1VJHoVm7E71veuUAJhI8"},"profile_id":"pro_jZ4ix0hYxn8qi2NSSYih","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-04-07T12:04:19.254Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-04-07T11:49:19.358Z","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} Verify below things 1. Label is floating when 2. Payment form has a header text 3. Card terms are missing for off_session payment type <img width="627" alt="Screenshot 2025-04-07 at 5 21 04 PM" src="https://github.com/user-attachments/assets/5e395ab6-44e7-44ab-9660-57603f79c4c2" /> </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/admin.rs` - `crates/api_models/src/payments.rs` **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/business_profile.rs` - `crates/diesel_models/src/payment_intent.rs` **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/lib.rs` **4. Core Business Logic** - `crates/router/src/core/payment_link.rs` - `crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js` - `crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js` - ... and 1 more files **5. Type Definitions** - `crates/router/src/types/transformers.rs` **6. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` - `crates/common_enums/src/enums/ui.rs` - ... and 3 more files **Code Patterns Applied:** - Extend existing types with new fields (47 changes) - Add conditional logic for feature flags or filtering (8 changes) **Detailed Identifier Changes:** Commit b475171d: Files to modify: **crates/api_models/src/admin.rs** Modify existing code **crates/api_models/src/payments.rs** Modify existing code **crates/common_enums/src/enums/ui.rs** Add: - enum: pub::PaymentLinkSdkLabelType - enum: pub::PaymentLinkShowSdkTerms **crates/diesel_models/src/business_profile.rs** Modify existing code **crates/diesel_models/src/payment_intent.rs** Modify existing code **crates/hyperswitch_domain_models/src/lib.rs** Modify existing code **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/router/src/core/payment_link.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/routes/customers.rs** Modify existing code **crates/router/src/types/transformers.rs** Modify existing code
{"pr_number": 7742, "pr_title": "feat(payment_link): expose configurations for payment links", "merged_at": "2025-04-09T07:47:51Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs", "crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/payment_intent.rs"], "domain": ["crates/hyperswitch_domain_models/src/lib.rs"], "core_business": ["crates/router/src/core/payment_link.rs", "crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js", "crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums/ui.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/routes/customers.rs"]}, "change_types": {"enums_added": 2, "fields_added": 47, "conditionals_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(customers_v2): Remove merchant reference id from v2 customer update ## 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 --> We are removing `merchant_reference_id` from all API updates, due to possible bugs on merchant side db and HS db as there might be mismatch in their's and our's db records. This exists only in customers and refunds v2 apis, a separate PR has been implemented for refunds update, and this PR is for customers v2 update api. It was noticed that in the current implementation of customers v2 update flow, the `merchant_reference_id` field is being accepted by the API but it was never updated in the db. In this PR we are removing `merchant_reference_id` from being accepted in the customers v2 update request. ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> Upon merging this PR, we will be removing `merchant_reference_id` from being updated in customer v2 update api. ## How did you test 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 API Call ``` curl --location 'http://localhost:8080/v2/customers' \ --header 'x-profile-id: pro_saOFnM13wT1ngOuItKJl' \ --header 'Content-Type: application/json' \ --header 'Authorization: api-key=dev_VAtwaBd0cVItaaxIS8bUTFuPcxa9DkqlmBPvH5fq6IASKSlBxc9cBUygLoCaebFj' \ --data-raw '{ "merchant_reference_id": "customer_1748929359", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "default_billing_address": null, "default_shipping_address": null, "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` - Response from above call ``` { "id": "12345_cus_0197344f74677930a77bfc4c926c3b3e", "merchant_reference_id": "customer_1748929312", "connector_customer_ids": null, "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "default_billing_address": null, "default_shipping_address": null, "created_at": "2025-06-03T05:41:51.849Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null } ``` - Customer Update API call ``` curl --location --request PUT 'http://localhost:8080/v2/customers/12345_cus_0197344f74677930a77bfc4c926c3b3e' \ --header 'x-profile-id: pro_saOFnM13wT1ngOuItKJl' \ --header 'Content-Type: application/json' \ --header 'Authorization: api-key=dev_VAtwaBd0cVItaaxIS8bUTFuPcxa9DkqlmBPvH5fq6IASKSlBxc9cBUygLoCaebFj' \ --data-raw '{ "name": "Jane Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "Second customer", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` - Response from the above call ``` { "id": "12345_cus_0197344f74677930a77bfc4c926c3b3e", "merchant_reference_id": "customer_1748929312", "connector_customer_ids": null, "name": "Jane Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "Second customer", "default_billing_address": null, "default_shipping_address": null, "created_at": "2025-06-03T05:41:51.849Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null } ``` - Trying to update `merchant_reference_id` API call ``` curl --location --request PUT 'http://localhost:8080/v2/customers/12345_cus_0197344f74677930a77bfc4c926c3b3e' \ --header 'x-profile-id: pro_saOFnM13wT1ngOuItKJl' \ --header 'Content-Type: application/json' \ --header 'Authorization: api-key=dev_VAtwaBd0cVItaaxIS8bUTFuPcxa9DkqlmBPvH5fq6IASKSlBxc9cBUygLoCaebFj' \ --data-raw '{ "merchant_reference_id": "customer_1748929499", "name": "Jane Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "Second customer", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` - Response from the above call ``` { "error": { "error_type": "invalid_request", "message": "Json deserialize error: unknown field `merchant_reference_id`, expected one of `name`, `email`, `phone`, `description`, `phone_country_code`, `default_billing_address`, `default_shipping_address`, `metadata`, `default_payment_method_id` at line 2 column 27", "code": "IR_06" } } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/customers.rs` **2. Other** - `api-reference-v2/openapi_spec.json` **Detailed Identifier Changes:** Commit d6ad8522: Files to modify: **crates/api_models/src/customers.rs** Remove: - function: pub::get_merchant_reference_id
{"pr_number": 7879, "pr_title": "refactor(customers_v2): Remove merchant reference id from v2 customer update", "merged_at": "2025-06-09T07:54:14Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/customers.rs"], "other": ["api-reference-v2/openapi_spec.json"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(connector): Added amount conversion framework to Wise. ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This pull request introduces significant changes to the Wise connector in the `crates/router` module, focusing on the integration of a new amount conversion utility and refactoring to utilize a new `WiseRouterData` struct. The changes enhance how amounts are handled and improve the overall structure and clarity of the code. ### Refactoring and Enhancements: * **Amount Conversion Utility Integration:** - Added `amount_converter` to the `Wise` struct and integrated it into the `new` method. - Updated `convert_amount` usage in `WisePayoutQuoteRequest` and `WiseRecipientCreateRequest` implementations to use the new `amount_converter`. [[1]](diffhunk://#diff-a149ab1c35f89dd3b0eed2fca15df170708e81962550226b958ae6c367515043L365-R382) [[2]](diffhunk://#diff-a149ab1c35f89dd3b0eed2fca15df170708e81962550226b958ae6c367515043L444-R467) * **Introduction of `WiseRouterData` Struct:** - Added `WiseRouterData` struct to encapsulate amount and router data, and implemented conversion from a tuple. - Modified `WisePayoutQuoteRequest` and `WiseRecipientCreateRequest` to use `WiseRouterData` for transformations. [[1]](diffhunk://#diff-1e46db110c015ea743fbbe850bf756011b4311a1ef56fe5ee75c911bb4960b15L351-R371) [[2]](diffhunk://#diff-1e46db110c015ea743fbbe850bf756011b4311a1ef56fe5ee75c911bb4960b15L423-R451) ### Codebase Simplification: * **Removal of Unnecessary Debug Trait:** - Removed the `Debug` trait from the `Wise` struct. * **Update in Connector Initialization:** - Updated the initialization of the `Wise` connector to use the `new` method in `api.rs` and test files. [[1]](diffhunk://#diff-71935350b305eb696195bc45f26e6f2a16097fb17bd5ac55192eb1d03558bf9aL483-R483) [[2]](diffhunk://#diff-0177b5efcc163c3f657a8c60b0162bf272a68a5e22beb13f6eb309bd34d54166L31-R31) ### Minor Enhancements: * **Type Adjustments:** - Changed various fields in `WiseRecipientCreateRequest` and `WisePayoutQuoteRequest` to use `StringMajorUnit` instead of `String` or `i64`. [[1]](diffhunk://#diff-1e46db110c015ea743fbbe850bf756011b4311a1ef56fe5ee75c911bb4960b15L64-R79) [[2]](diffhunk://#diff-1e46db110c015ea743fbbe850bf756011b4311a1ef56fe5ee75c911bb4960b15L159-R175) These changes collectively improve the robustness and maintainability of the Wise connector, ensuring better handling of amount conversions and a cleaner code structure. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> Fixes #6121 ## How did you test 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/router/src/connector/wise.rs` - `crates/router/src/connector/wise/transformers.rs` - `crates/router/tests/connectors/wise.rs` **2. Type Definitions** - `crates/router/src/types/api.rs` **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (4 changes) - Extend existing types with new fields (9 changes) **Detailed Identifier Changes:** Commit 1ba3d84d: Files to modify: **crates/router/src/connector/wise.rs** Remove: - struct: pub::Wise Add: - function: pub::new - struct: pub::Wise - impl: impl Wise **crates/router/src/connector/wise/transformers.rs** Add: - function: private::from - struct: pub::WiseRouterData - impl: impl From<(MinorUnit, T)> for WiseRouterData<T> **crates/router/src/types/api.rs** Modify existing code **crates/router/tests/connectors/wise.rs** Modify existing code
{"pr_number": 6469, "pr_title": "refactor(connector): Added amount conversion framework to Wise.", "merged_at": "2024-11-07T07:36:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"connectors": ["crates/router/src/connector/wise.rs", "crates/router/src/connector/wise/transformers.rs", "crates/router/tests/connectors/wise.rs"], "types": ["crates/router/src/types/api.rs"]}, "change_types": {"structs_added": 2, "functions_added": 4, "fields_added": 9, "imports_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat: add support for sdk session call in v2 ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Added support for making the sdk session token call. The following features are not included: 1. Session routing 2. Session surcharge Will be taken up in a different 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` 3. `crates/router/src/configs` 4. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> 1. create an organization 2. create a merchant account 3. create a profile 4. create a MCA using the below curl. ``` curl --location 'http://localhost:8080/v2/connector_accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: cloth_seller_N5IUU6QU4XKPjxu9OzYY' \ --header 'x-profile-id: pro_BacI7RldfyAadGzdh2GH' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "payment_processor", "connector_name": "stripe", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "stripe_api_key" }, "payment_methods_enabled": [ { "payment_method": "card_redirect", "payment_method_types": [ { "payment_method_type": "card_redirect", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "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": "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_type": "apple_pay", "payment_experience": "invoke_sdk_client", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "we_chat_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "ali_pay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "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_type": "mb_way", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "payment_method_type": "klarna", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "affirm", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "afterpay_clearpay", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "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": "bank_redirect", "payment_method_types": [ { "payment_method_type": "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_type": "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_type": "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_type": "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_type": "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_type": "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_type": "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_type": "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_type": "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_type": "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": "bank_transfer", "payment_method_types": [ { "payment_method_type": "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_type": "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_type": "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": "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": "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_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 } ] } ], "metadata": { "apple_pay_combined": { }, "google_pay": { }, "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_BacI7RldfyAadGzdh2GH" }' ``` 5. Create a payment. ``` curl --location 'http://localhost:8080/v2/payments/create-intent' \ --header 'api-key: dev_eSh9CHYek0aNXMee5RUBuHSBAvdl1MIf9UBX9qZeeZ51woq7hQUXNBBL7niX2oCY' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: pro_BacI7RldfyAadGzdh2GH' \ --data '{ "amount_details": { "order_amount": 100, "currency": "USD" } }' ``` 6. Do sdk session call. ``` curl --location 'http://localhost:8080/v2/payments/12345_pay_01936d5f217d7e2088dd875ee666ee2f/create-external-sdk-tokens' \ --header 'api-key: pk_dev_d27ac6e5d2b24e9d870bb58f512c94e8' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: pro_BacI7RldfyAadGzdh2GH' \ --header 'x-client-secret: 12345_pay_01936d5f217d7e2088dd875ee666ee2f_secret_01936d5f217e75e39d7673941b016dc1' \ --data '{ }' ``` Should get below response: ``` { "payment_id": "12345_pay_01936d5f217d7e2088dd875ee666ee2f", "session_token": [ { "wallet_name": "google_pay", "merchant_info": { "merchant_id": "sundari", "merchant_name": "stripe" }, "shipping_address_required": false, "email_required": false, "shipping_address_parameters": { "phone_number_required": false }, "allowed_payment_methods": [ { "type": "CARD", "parameters": { "allowed_auth_methods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowed_card_networks": [ "AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA" ], "billing_address_required": false }, "tokenization_specification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "stripe", "stripe:version": "2018-10-31", "stripe:publishableKey": "some_publishable key" } } } ], "transaction_info": { "country_code": "US", "currency_code": "USD", "total_price_status": "Final", "total_price": "1.00" }, "delayed_session_token": false, "connector": "stripe", "sdk_next_action": { "next_action": "confirm" }, "secrets": null } ] } ``` screenshot. ![image](https://github.com/user-attachments/assets/0ef0f155-b4ee-4133-9d22-711cbcb85b96) ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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. 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/flows/session_flow.rs` - `crates/router/src/core/payments/operations.rs` - ... and 6 more files **4. Type Definitions** - `crates/common_utils/src/types.rs` **5. Utils** - `crates/common_utils/src/macros.rs` **6. Other** - `api-reference-v2/openapi_spec.json` - `crates/router/src/routes/app.rs` - `crates/router/src/routes/payments.rs` **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (32 changes) - Extend existing types with new fields (175 changes) - Add conditional logic for feature flags or filtering (4 changes) - Modify database queries (6 changes) **Detailed Identifier Changes:** Commit 707f48ce: Files to modify: **crates/api_models/src/events/payment.rs** Modify existing code **crates/api_models/src/payments.rs** Add: - struct: pub::PaymentsSessionResponse **crates/common_utils/src/macros.rs** Modify existing code **crates/common_utils/src/types.rs** Modify existing code **crates/hyperswitch_domain_models/src/merchant_connector_account.rs** Remove: - function: pub::new - function: pub::is_merchant_connector_account_id_in_connector_mandate_details - struct: pub::MerchantConnectorAccounts - impl: impl MerchantConnectorAccounts Add: - function: pub::get_metadata - function: pub::get_parsed_payment_methods_enabled **crates/hyperswitch_domain_models/src/payments.rs** Modify existing code **crates/router/src/core/payments.rs** Add: - function: pub::call_multiple_connectors_service - mod: pub::session_operation **crates/router/src/core/payments/flows/session_flow.rs** Modify existing code **crates/router/src/core/payments/operations.rs** Add: - mod: pub::payment_session_intent **crates/router/src/core/payments/operations/payment_create_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payment_get_intent.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** Add: - function: private::validate_status_for_operation - function: private::to_validate_request - function: private::to_get_tracker - function: private::to_domain - function: private::to_validate_request - function: private::to_get_tracker - function: private::to_domain - function: private::get_trackers - function: private::validate_request - function: private::get_customer_details - function: private::make_pm_data - function: private::perform_routing - function: private::guard_payment_against_blocklist - function: private::from - struct: pub::PaymentSessionIntent - impl: impl ValidateStatusForOperation for PaymentSessionIntent - impl: impl Operation<F, PaymentsSessionRequest> for &PaymentSessionIntent - impl: impl Operation<F, PaymentsSessionRequest> for PaymentSessionIntent - impl: impl GetTracker<F, payments::PaymentIntentData<F>, PaymentsSessionRequest> for PaymentSessionIntent - impl: impl ValidateRequest<F, PaymentsSessionRequest, payments::PaymentIntentData<F>> for PaymentSessionIntent - impl: impl Domain<F, PaymentsSessionRequest, payments::PaymentIntentData<F>> for PaymentSessionIntent - impl: impl From<api_models::enums::PaymentMethodType> for api::GetToken **crates/router/src/core/payments/session_operation.rs** Add: - function: pub::payments_session_core - function: pub::payments_session_operation_core **crates/router/src/core/payments/transformers.rs** Add: - function: pub::construct_payment_router_data_for_sdk_session - function: private::generate_response - impl: impl ToResponse<F, D, Op> for api::PaymentsSessionResponse **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/payments.rs** Add: - function: private::get_locking_input - impl: impl GetLockingInput for payment_types::PaymentsSessionRequest
{"pr_number": 6502, "pr_title": "feat: add support for sdk session call in v2", "merged_at": "2024-11-28T10:28:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/payment.rs", "crates/api_models/src/payments.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/flows/session_flow.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/payment_create_intent.rs", "crates/router/src/core/payments/operations/payment_get_intent.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/session_operation.rs", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/common_utils/src/types.rs"], "utils": ["crates/common_utils/src/macros.rs"], "other": ["api-reference-v2/openapi_spec.json", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs"]}, "change_types": {"structs_added": 2, "functions_added": 32, "fields_added": 175, "imports_added": 22, "conditionals_added": 4, "database_queries": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(router): add `click_to_pay` block in payments sessions response if enabled ## 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 `click_to_pay` block in payments sessions response if enabled ### 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)? --> Sanity sessions flow should be verified ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/payments.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments.rs` **3. Core Business Logic** - `crates/router/src/core/payments.rs` **4. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` - `crates/openapi/src/openapi.rs` - ... and 2 more files **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (1 changes) - Extend existing types with new fields (34 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit 5aa8ea03: Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments.rs** Add: - struct: pub::ClickToPayMetaData **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/router/src/consts.rs** Modify existing code **crates/router/src/core/payments.rs** Add: - function: pub::get_session_token_for_click_to_pay
{"pr_number": 6829, "pr_title": "feat(router): add `click_to_pay` block in payments sessions response if enabled", "merged_at": "2024-12-13T11:04:09Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "session"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments.rs"], "core_business": ["crates/router/src/core/payments.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/consts.rs"]}, "change_types": {"structs_added": 2, "functions_added": 1, "fields_added": 34, "imports_added": 3, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(router): resolve spell check for state introduced for ISO representation ## 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 --> resolve spell check fail introduced by the following PR: https://github.com/juspay/hyperswitch/pull/7300 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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)? --> Note: No Testing Required ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Configuration Files** - `.typos.toml`
{"pr_number": 7342, "pr_title": "fix(router): resolve spell check for state introduced for ISO representation", "merged_at": "2025-02-24T08:12:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"config": [".typos.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
feat(connector): Create Customer for Chargebee ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ### Summary This PR introduces a **create customer handler for the Chargebee connector**. It enables merchants to create and manage customers in Chargebee directly through Hyperswitch by mapping customer data between our domain models and Chargebee’s API. ### Key Changes * **New Connector Integration** * Added `ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, PaymentsResponseData>` implementation for Chargebee. * Added response mapper to convert Chargebee’s response into `PaymentsResponseData::ConnectorCustomerResponse`. * **Extended Response Model** * `ConnectorCustomerResponse` now carries optional fields: * `name` * `email` * `billing_address` * **Domain Models & Flow Types** * Extended `ConnectorCustomerData` to support new fields (`customer_id`, `billing_address`). ### Benefits * Merchants can now **create customers in Chargebee** via Hyperswitch. * Unified model for customer creation across connectors. * Future-proofing: response carries richer customer metadata, making subscription flows easier to support. ## How did you test it? cargo r <img width="1723" height="1065" alt="Screenshot 2025-09-10 at 4 11 52 PM" src="https://github.com/user-attachments/assets/10a67220-94f8-4d92-950d-acc933d11de0" /> just clippy <img width="1699" height="455" alt="Screenshot 2025-09-10 at 4 17 39 PM" src="https://github.com/user-attachments/assets/5ad6b2f9-84d0-4434-ad4e-ed98fbccc8eb" /> just clippy_v2 <img width="1728" height="459" alt="Screenshot 2025-09-10 at 4 22 46 PM" src="https://github.com/user-attachments/assets/65336216-67e5-4900-b638-c6543bb47b83" /> ## 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. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/router_request_types.rs` - `crates/hyperswitch_domain_models/src/router_response_types.rs` **2. Core Business Logic** - `crates/router/src/core/payments/customers.rs` - `crates/router/src/core/payments/operations/payment_response.rs` **3. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` - `crates/hyperswitch_connectors/src/connectors/chargebee.rs` - `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs` - ... and 9 more files **4. Type Definitions** - `crates/hyperswitch_interfaces/src/types.rs` **5. Other** - `crates/hyperswitch_interfaces/src/api/subscriptions.rs` - `crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs` **Code Patterns Applied:** - Define new data structures (4 changes) - Implement new functions (11 changes) - Extend existing types with new fields (61 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit e6706187: Files to modify: **crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs** Modify existing code **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 ConnectorCustomer for Chargebee - impl: impl ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, PaymentsResponseData> for Chargebee **crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs** Add: - function: private::try_from - function: private::try_from - struct: pub::ChargebeeCustomerCreateRequest - struct: pub::ChargebeeCustomerCreateResponse - struct: pub::ChargebeeCustomerDetails - impl: impl TryFrom<&ChargebeeRouterData<&hyperswitch_domain_models::types::ConnectorCustomerRouterData>> for ChargebeeCustomerCreateRequest - impl: impl TryFrom< ResponseRouterData< CreateConnectorCustomer, ChargebeeCustomerCreateResponse, ConnectorCustomerData, PaymentsResponseData, >, > for hyperswitch_domain_models::types::ConnectorCustomerRouterData **crates/hyperswitch_connectors/src/connectors/dwolla.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/hyperswitch_vault/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/stax/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/default_implementations.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_request_types.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_response_types.rs** Add: - function: pub::new_with_customer_id - function: pub::new - struct: pub::ConnectorCustomerResponseData - impl: impl ConnectorCustomerResponseData **crates/hyperswitch_interfaces/src/api/subscriptions.rs** Remove: - trait: pub::Subscriptions Add: - trait: pub::Subscriptions - trait: pub::ConnectorCustomer **crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs** Remove: - trait: pub::SubscriptionsV2 Add: - trait: pub::SubscriptionsV2 **crates/hyperswitch_interfaces/src/types.rs** Modify existing code **crates/router/src/core/payments/customers.rs** Modify existing code **crates/router/src/core/payments/operations/payment_response.rs** Modify existing code **crates/router/tests/connectors/stax.rs** Modify existing code **crates/router/tests/connectors/utils.rs** Modify existing code
{"pr_number": 9304, "pr_title": "feat(connector): Create Customer for Chargebee", "merged_at": "2025-09-18T14:29:16Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/payments/customers.rs", "crates/router/src/core/payments/operations/payment_response.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/chargebee.rs", "crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs", "crates/hyperswitch_connectors/src/connectors/dwolla.rs", "crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs", "crates/hyperswitch_connectors/src/connectors/hyperswitch_vault/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stax/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/router/tests/connectors/stax.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs"], "other": ["crates/hyperswitch_interfaces/src/api/subscriptions.rs", "crates/hyperswitch_interfaces/src/api/subscriptions_v2.rs"]}, "change_types": {"structs_added": 4, "functions_added": 11, "fields_added": 61, "imports_added": 7, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(payments): Add audit events for PaymentApprove update ## Type of Change - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description This PR adds an Audit event for the PaymentApprove operation. ### Additional Changes - [x] This PR modifies the files below - `crates/router/src/core/payments/operations/payment_approve.rs` - `crates/router/src/events/audit_events.rs` ## Motivation and Context This PR fixes #4680 ## How did you test it This requires FRM related flows to be tested, and may not be tested locally. ## Checklist - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code
To implement this **payment** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payments/operations/payment_approve.rs` **2. Other** - `crates/router/src/events/audit_events.rs` **Code Patterns Applied:** - Extend existing types with new fields (1 changes) **Detailed Identifier Changes:** Commit 6823418e: Files to modify: **crates/router/src/core/payments/operations/payment_approve.rs** Modify existing code **crates/router/src/events/audit_events.rs** Modify existing code
{"pr_number": 6432, "pr_title": "feat(payments): Add audit events for PaymentApprove update", "merged_at": "2024-11-08T10:20:37Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/payment_approve.rs"], "other": ["crates/router/src/events/audit_events.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): add template code for chargebee ## 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 --> connector integration template code for chargebee. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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)? --> Tests not required as this is template code generated PR, CI checks should be suffice. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payments/connector_integration_v2_impls.rs` - `crates/router/src/core/payments/flows.rs` **2. External Connector Integration** - `crates/common_enums/src/connector_enums.rs` - `crates/hyperswitch_connectors/src/connectors.rs` - `crates/hyperswitch_connectors/src/connectors/chargebee.rs` - ... and 9 more files **3. Type Definitions** - `crates/router/src/types/api.rs` - `crates/router/src/types/transformers.rs` **4. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **5. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 3 more files **Code Patterns Applied:** - Define new data structures (10 changes) - Implement new functions (78 changes) - Extend existing types with new fields (153 changes) **Detailed Identifier Changes:** Commit ad5491f1: Files to modify: **crates/common_enums/src/connector_enums.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors.rs** Add: - mod: pub::chargebee **crates/hyperswitch_connectors/src/connectors/chargebee.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::Chargebee - impl: impl Chargebee - impl: impl api::Payment for Chargebee - impl: impl api::PaymentSession for Chargebee - impl: impl api::ConnectorAccessToken for Chargebee - impl: impl api::MandateSetup for Chargebee - impl: impl api::PaymentAuthorize for Chargebee - impl: impl api::PaymentSync for Chargebee - impl: impl api::PaymentCapture for Chargebee - impl: impl api::PaymentVoid for Chargebee - impl: impl api::Refund for Chargebee - impl: impl api::RefundExecute for Chargebee - impl: impl api::RefundSync for Chargebee - impl: impl api::PaymentToken for Chargebee - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Chargebee - impl: impl ConnectorCommonExt<Flow, Request, Response> for Chargebee - impl: impl ConnectorCommon for Chargebee - impl: impl ConnectorValidation for Chargebee - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Chargebee - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Chargebee - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Chargebee - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Chargebee - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Chargebee - impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Chargebee - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Chargebee - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Chargebee - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Chargebee - impl: impl webhooks::IncomingWebhook for Chargebee - impl: impl ConnectorSpecifications for Chargebee - mod: pub::transformers **crates/hyperswitch_connectors/src/connectors/chargebee/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::ChargebeeRouterData - struct: pub::ChargebeePaymentsRequest - struct: pub::ChargebeeCard - struct: pub::ChargebeeAuthType - struct: pub::ChargebeePaymentsResponse - struct: pub::ChargebeeRefundRequest - struct: pub::RefundResponse - struct: pub::ChargebeeErrorResponse - enum: pub::ChargebeePaymentStatus - enum: pub::RefundStatus - impl: impl From<(StringMinorUnit, T)> for ChargebeeRouterData<T> - impl: impl TryFrom<&ChargebeeRouterData<&PaymentsAuthorizeRouterData>> for ChargebeePaymentsRequest - impl: impl TryFrom<&ConnectorAuthType> for ChargebeeAuthType - impl: impl From<ChargebeePaymentStatus> for common_enums::AttemptStatus - impl: impl TryFrom<ResponseRouterData<F, ChargebeePaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData> - impl: impl TryFrom<&ChargebeeRouterData<&RefundsRouterData<F>>> for ChargebeeRefundRequest - 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/chargebee.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::ChargebeeTest - impl: impl ConnectorActions for ChargebeeTest - impl: impl utils::Connector for ChargebeeTest **crates/router/tests/connectors/main.rs** Add: - mod: private::chargebee **crates/test_utils/src/connector_auth.rs** Modify existing code
{"pr_number": 7036, "pr_title": "feat(connector): add template code for chargebee", "merged_at": "2025-01-29T11:46:59Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/connector_integration_v2_impls.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/chargebee.rs", "crates/hyperswitch_connectors/src/connectors/chargebee/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/chargebee.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(authz): Create a permission generator ## 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 --> ### Entity level context in Permissions Currently the permissions we use doesn't have any entity level context. But some of our APIs need that context. For example, 1. `payment/list` - This can only be accessible by merchant level users or higher. Profile level users should not be able to access it. 2. `payment/profile/list` - This can be accessible by all level of users. With current setup, this is not directly possible by the permissions. We had to introduce `min_entity_level` to solve this, but this is very separated from the permissions. To solve this, we need to have entity level context at permissions level itself. ### Scope for permissions The write permissions currently doesn't have access to read APIs, but since write is a superset of read, they should be able to access read APIs as well. So, this PR also introduces scope context in permissions. --- This PR also improves the scalability of permissions, as the more entity levels being added in the control center, this will make it easy to extend the permissions 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` 4. `crates/router/src/configs` 5. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> Closes [#6391](https://github.com/juspay/hyperswitch/issues/6391). ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> This is an internal change, no APIs should be affected and all the APIs should be working as usual. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/user_role.rs` **2. Core Business Logic** - `crates/router/src/core/user_role.rs` **3. External Connector Integration** - `crates/router/src/routes/connector_onboarding.rs` - `crates/router/src/routes/verify_connector.rs` **4. Other** - `crates/common_enums/src/enums.rs` - `crates/router/src/analytics.rs` - `crates/router/src/routes/admin.rs` - ... and 25 more files **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (22 changes) - Extend existing types with new fields (259 changes) **Detailed Identifier Changes:** Commit 4a0afb82: Files to modify: **crates/api_models/src/user_role.rs** Remove: - enum: pub::ParentGroup **crates/common_enums/src/enums.rs** Add: - enum: pub::ParentGroup - enum: pub::Resource - enum: pub::PermissionScope **crates/router/src/analytics.rs** Modify existing code **crates/router/src/core/user_role.rs** Modify existing code **crates/router/src/routes/admin.rs** Modify existing code **crates/router/src/routes/api_keys.rs** Modify existing code **crates/router/src/routes/blocklist.rs** Modify existing code **crates/router/src/routes/connector_onboarding.rs** Modify existing code **crates/router/src/routes/customers.rs** Modify existing code **crates/router/src/routes/disputes.rs** Modify existing code **crates/router/src/routes/mandates.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/routes/payouts.rs** Modify existing code **crates/router/src/routes/profiles.rs** Modify existing code **crates/router/src/routes/recon.rs** Modify existing code **crates/router/src/routes/refunds.rs** Modify existing code **crates/router/src/routes/routing.rs** Modify existing code **crates/router/src/routes/user.rs** Modify existing code **crates/router/src/routes/user_role.rs** Modify existing code **crates/router/src/routes/verification.rs** Modify existing code **crates/router/src/routes/verify_connector.rs** Modify existing code **crates/router/src/routes/webhook_events.rs** Modify existing code **crates/router/src/services/authentication.rs** Modify existing code **crates/router/src/services/authorization.rs** Remove: - function: pub::check_entity **crates/router/src/services/authorization/info.rs** Modify existing code **crates/router/src/services/authorization/permission_groups.rs** Add: - function: private::scope - function: private::parent - function: private::resources - function: private::accessible_groups - function: private::resources - trait: pub::PermissionGroupExt - trait: pub::ParentGroupExt - impl: impl PermissionGroupExt for PermissionGroup - impl: impl ParentGroupExt for ParentGroup **crates/router/src/services/authorization/permissions.rs** Remove: - enum: pub::Permission **crates/router/src/services/authorization/roles.rs** Modify existing code **crates/router_derive/src/lib.rs** Add: - function: pub::generate_permissions **crates/router_derive/src/macros.rs** Add: - mod: pub::generate_permissions **crates/router_derive/src/macros/generate_permissions.rs** Add: - function: private::parse - function: private::parse - function: private::parse_label_with_punctuated_data - function: pub::generate_permissions_inner - struct: private::ResourceInput - struct: private::Input - impl: impl Parse for Input - impl: impl Parse for ResourceInput
{"pr_number": 6394, "pr_title": "feat(authz): Create a permission generator", "merged_at": "2024-10-24T14:36:07Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/user_role.rs"], "core_business": ["crates/router/src/core/user_role.rs"], "connectors": ["crates/router/src/routes/connector_onboarding.rs", "crates/router/src/routes/verify_connector.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/analytics.rs", "crates/router/src/routes/admin.rs", "crates/router/src/routes/api_keys.rs", "crates/router/src/routes/blocklist.rs", "crates/router/src/routes/customers.rs", "crates/router/src/routes/disputes.rs", "crates/router/src/routes/mandates.rs", "crates/router/src/routes/payment_methods.rs", "crates/router/src/routes/payments.rs", "crates/router/src/routes/payouts.rs", "crates/router/src/routes/profiles.rs", "crates/router/src/routes/recon.rs", "crates/router/src/routes/refunds.rs", "crates/router/src/routes/routing.rs", "crates/router/src/routes/user.rs", "crates/router/src/routes/user_role.rs", "crates/router/src/routes/verification.rs", "crates/router/src/routes/webhook_events.rs", "crates/router/src/services/authentication.rs", "crates/router/src/services/authorization.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.rs", "crates/router_derive/src/lib.rs", "crates/router_derive/src/macros.rs", "crates/router_derive/src/macros/generate_permissions.rs"]}, "change_types": {"structs_added": 2, "functions_added": 22, "enums_added": 4, "fields_added": 259, "imports_added": 16}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(payment_methods_session_v2): add payment methods session endpoints ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] New feature ## Description <!-- Describe your changes in detail --> This PR adds the payment methods session endpoints. - Create a payment method session - Retrieve a payment method session - List the payment methods for a payment method session - Update a saved payment method using the payment method session ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> These endpoints are used to list the saved payment methods of the customer and also to add a new payment method. ## How did you test 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 customer ```bash curl --location 'http://localhost:8080/v2/customers' \ --header 'x-profile-id: pro_UrFvAE8xRpWRzWGh4jQl' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_i5uKeLHzSyBhhYevUsPMm27DV5tz6wBrcMAyg9gpCoxUgaSZOLDcOu4dw9FzC7t2' \ --data-raw '{ "merchant_reference_id": "customer_1737964636", "name": "John Doe", "email": "guest@example.com", "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" } }' ``` - Create a payment method ( make sure if you are trying it on local, you have the locker setup ) ```bash curl --location 'http://localhost:8080/v2/payment-methods' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'X-Profile-Id: pro_Fk6kw8fzPZmZl2f730zh' \ --header 'api-key: dev_ZNc8i2UIurfLRh1HEc5i2CxOuvzCb26cuNGYHxeWzzuMvod0xIrVT3Kt7y3ieIw9' \ --data '{ "customer_id": "12345_cus_0194abb4c1b277e3a6b45551089cfd9e", "payment_method_type": "card", "payment_method_subtype": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "02", "card_exp_year": "2025", "card_holder_name": "joseph Doe" } } }' ``` - Create a merchant connector account with some payment methods enabled ```bash curl --location 'http://localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: cloth_seller_F3lF6vY9qhm6CMSpBZli' \ --header 'x-profile-id: pro_Fk6kw8fzPZmZl2f730zh' \ --header 'api-key: test_admin' \ --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", "payment_method_subtypes": [ { "payment_method_subtype": "credit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_subtype": "debit", "payment_experience": null, "card_networks": [ "Visa", "Mastercard" ], "accepted_currencies": null, "accepted_countries": null, "minimum_amount": -1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay", "account_name": "transaction_processing", "pricing_type": "fixed_price", "acquirer_bin": "438309", "acquirer_merchant_id": "00002000000" }, "frm_configs": null, "connector_webhook_details": { "merchant_secret": "" }, "profile_id": "pro_Fk6kw8fzPZmZl2f730zh" }' ``` - Create a payment method session for the customer ```bash curl --location 'http://localhost:8080/v2/payment-methods-session' \ --header 'x-profile-id: pro_xRLWRVTRCiA19cUJiISK' \ --header 'Content-Type: application/json' \ --header 'Authorization: api-key=dev_LbbvTZ2wfCGaO83BX3ywPgbenSsjKp2TGjkam9sXoWyDaAHqGCq6AUZKjuk1Ii5T' \ --data-raw '{ "customer_id": "12345_cus_0194bbe7403b72e0a4e1cc604db9ba6f", "billing": { "address": { "first_name": "John", "last_name": "Dough" }, "email": "example@example.com" } }' ``` - Retrieve the payment method session using the payment method session ```bash curl --location 'http://localhost:8080/v2/payment-methods-session/12345_pms_0194bbed44fc7ee1b08c649cdeaf1381' \ --header 'x-profile-id: pro_xRLWRVTRCiA19cUJiISK' \ --header 'Authorization: publishable-key=pk_dev_0156facfc6cd420b8f5146e4b980272f,client-secret=cs_0194bbed44fc7ee1b08c64ae9be8ed9a' ``` - List the payment methods for the session ```bash curl --location 'http://localhost:8080/v2/payment-methods-session/12345_pms_0194bbed44fc7ee1b08c649cdeaf1381/list-payment-methods' \ --header 'x-profile-id: pro_xRLWRVTRCiA19cUJiISK' \ --header 'Authorization: publishable-key=pk_dev_0156facfc6cd420b8f5146e4b980272f,client-secret=cs_0194bbed44fc7ee1b08c64ae9be8ed9a' ``` - Response ```json { "payment_methods_enabled": [ { "payment_method_type": "card", "payment_method_subtype": "credit", "required_fields": [ { "required_field": "payment_method_data.card.card_number", "display_name": "card_number", "field_type": "user_card_number", "value": null }, { "required_field": "payment_method_data.card.card_exp_year", "display_name": "card_exp_year", "field_type": "user_card_expiry_year", "value": null }, { "required_field": "payment_method_data.card.card_cvc", "display_name": "card_cvc", "field_type": "user_card_cvc", "value": null }, { "required_field": "payment_method_data.card.card_exp_month", "display_name": "card_exp_month", "field_type": "user_card_expiry_month", "value": null } ] }, { "payment_method_type": "card", "payment_method_subtype": "debit", "required_fields": [] } ], "customer_payment_methods": [ { "id": "12345_pm_0194abb4d9bc735292e1f5682da787ff", "customer_id": "12345_cus_0194abb4c1b277e3a6b45551089cfd9e", "payment_method_type": "card", "payment_method_subtype": "credit", "recurring_enabled": true, "payment_method_data": { "card": { "issuer_country": null, "last4_digits": "4242", "expiry_month": "02", "expiry_year": "2025", "card_holder_name": "joseph Doe", "card_fingerprint": null, "nick_name": null, "card_network": null, "card_isin": null, "card_issuer": null, "card_type": null, "saved_to_locker": true } }, "bank": null, "created": "2025-01-28T06:59:03.754Z", "requires_cvv": true, "last_used_at": "2025-01-28T06:59:03.754Z", "is_default": false, "billing": null } ] } ``` ## Update the saved payment method, can update only card nickname and card holder name for now. - Using the saved payment method using the payment method session ```bash curl --location --request PUT 'http://localhost:8080/v2/payment-methods-session/12345_pms_0194bbed44fc7ee1b08c649cdeaf1381/update-saved-payment-method' \ --header 'x-profile-id: pro_xRLWRVTRCiA19cUJiISK' \ --header 'Content-Type: application/json' \ --header 'Authorization: publishable-key=pk_dev_0156facfc6cd420b8f5146e4b980272f,client-secret=cs_0194bbed44fc7ee1b08c64ae9be8ed9a' \ --data '{ "payment_method_id": "12345_pm_0194b1ecabc172e28aeb71f70a4daba3", "payment_method_data": { "card": { "card_holder_name": "Narayan Bhat" } } }' ``` - Response ```json { "id": "12345_pm_0194b1ecabc172e28aeb71f70a4daba3", "merchant_id": "cloth_seller_UglVvGAf3zzfNzzt2QMC", "customer_id": "12345_cus_0194b1ec3c0472a2a579e435d24819bc", "payment_method_type": "card", "payment_method_subtype": "credit", "recurring_enabled": false, "created": "2025-01-29T11:57:45.282Z", "last_used_at": "2025-01-29T11:57:45.282Z", "payment_method_data": { "card": { "issuer_country": null, "last4_digits": "4242", "expiry_month": "02", "expiry_year": "2025", "card_holder_name": "Narayan Bhat", "card_fingerprint": null, "nick_name": null, "card_network": null, "card_isin": null, "card_issuer": null, "card_type": null, "saved_to_locker": true } } } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code
To implement this **payment** 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.rs` - ... and 4 more files **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/customers.rs` - `crates/diesel_models/src/ephemeral_key.rs` - `crates/diesel_models/src/lib.rs` - ... and 1 more files **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/customer.rs` - `crates/hyperswitch_domain_models/src/payment_methods.rs` **4. Core Business Logic** - `crates/router/src/core/payment_methods.rs` - `crates/router/src/core/payment_methods/cards.rs` - `crates/router/src/core/payment_methods/surcharge_decision_configs.rs` - ... and 4 more files **5. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/deutschebank.rs` **6. Type Definitions** - `crates/common_types/src/payment_methods.rs` - `crates/common_utils/src/types/authentication.rs` - `crates/router/src/types/storage/ephemeral_key.rs` - ... and 1 more files **7. Utils** - `crates/common_utils/src/crypto.rs` - `crates/common_utils/src/events.rs` - `crates/common_utils/src/id_type.rs` - ... and 5 more files **8. Configuration Files** - `config/development.toml` **9. Other** - `api-reference-v2/api-reference/customers/customers--list-saved-payment-methods.mdx` - `api-reference-v2/api-reference/payment-method-session/payment-method-session--create.mdx` - `api-reference-v2/api-reference/payment-method-session/payment-method-session--list-payment-methods.mdx` - ... and 20 more files **Code Patterns Applied:** - Define new data structures (17 changes) - Implement new functions (77 changes) - Extend existing types with new fields (270 changes) - Add conditional logic for feature flags or filtering (7 changes) **Detailed Identifier Changes:** Commit 96153824: Files to modify: **crates/api_models/src/customers.rs** Modify existing code **crates/api_models/src/ephemeral_key.rs** Remove: - struct: pub::EphemeralKeyCreateRequest Add: - struct: pub::ClientSecretCreateRequest - enum: pub::ResourceId **crates/api_models/src/events.rs** Add: - function: private::get_api_event_type - function: private::get_api_event_type - impl: impl ApiEventMetric for PaymentMethodIntentConfirmInternal - impl: impl ApiEventMetric for PaymentMethodSessionRequest - impl: impl ApiEventMetric for PaymentMethodsSessionResponse **crates/api_models/src/events/payment.rs** Remove: - impl: impl ApiEventMetric for PaymentsResponse Add: - impl: impl ApiEventMetric for payments::PaymentsResponse **crates/api_models/src/payment_methods.rs** Add: - function: private::from - struct: pub::PaymentMethodIntentConfirmInternal - struct: pub::PaymentMethodSessionRequest - struct: pub::PaymentMethodSessionUpdateSavedPaymentMethod - struct: pub::PaymentMethodsSessionResponse - impl: impl From<PaymentMethodIntentConfirmInternal> for PaymentMethodIntentConfirm **crates/api_models/src/payments.rs** Modify existing code **crates/api_models/src/webhooks.rs** Modify existing code **crates/common_enums/src/enums.rs** Add: - enum: pub::TokenizationType - enum: pub::NetworkTokenizationToggle **crates/common_types/src/payment_methods.rs** Add: - struct: pub::NetworkTokenization - struct: pub::PspTokenization **crates/common_utils/src/crypto.rs** Add: - function: pub::map **crates/common_utils/src/events.rs** Modify existing code **crates/common_utils/src/id_type.rs** Remove: - mod: private::ephemeral_key Add: - mod: private::client_secret **crates/common_utils/src/id_type/client_secret.rs** Add: - function: private::get_api_event_type - function: pub::generate_redis_key - impl: impl crate::events::ApiEventMetric for ClientSecretId - impl: impl ClientSecretId **crates/common_utils/src/id_type/ephemeral_key.rs** Remove: - function: private::get_api_event_type - function: pub::generate_redis_key - impl: impl crate::events::ApiEventMetric for EphemeralKeyId - impl: impl EphemeralKeyId **crates/common_utils/src/id_type/global_id.rs** Modify existing code **crates/common_utils/src/id_type/global_id/payment_methods.rs** Add: - function: pub::generate - function: pub::get_string_repr - function: pub::get_redis_key - function: private::get_api_event_type - function: private::build - function: private::to_sql - function: private::from_sql - struct: pub::GlobalPaymentMethodSessionId - enum: pub::GlobalPaymentMethodSessionIdError - impl: impl GlobalPaymentMethodSessionId - impl: impl crate::events::ApiEventMetric for GlobalPaymentMethodSessionId - impl: impl diesel::Queryable<diesel::sql_types::Text, DB> for GlobalPaymentMethodSessionId - impl: impl diesel::serialize::ToSql<diesel::sql_types::Text, DB> for GlobalPaymentMethodSessionId - impl: impl diesel::deserialize::FromSql<diesel::sql_types::Text, DB> for GlobalPaymentMethodSessionId **crates/common_utils/src/types/authentication.rs** Add: - function: pub::to_str - enum: pub::ResourceId - impl: impl ResourceId **crates/diesel_models/src/customers.rs** Modify existing code **crates/diesel_models/src/ephemeral_key.rs** Remove: - struct: pub::EphemeralKeyTypeNew - enum: pub::ResourceType Add: - struct: pub::ClientSecretTypeNew **crates/diesel_models/src/lib.rs** Add: - mod: pub::payment_methods_session **crates/diesel_models/src/payment_methods_session.rs** Add: - struct: pub::PaymentMethodsSession **crates/hyperswitch_connectors/src/connectors/deutschebank.rs** Modify existing code **crates/hyperswitch_domain_models/src/customer.rs** Modify existing code **crates/hyperswitch_domain_models/src/payment_methods.rs** Add: - function: private::convert - function: private::convert_back - function: private::construct_new - struct: pub::PaymentMethodsSession - impl: impl super::behaviour::Conversion for PaymentMethodsSession **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/openapi/src/routes/payment_method.rs** Add: - function: pub::payment_method_session_create - function: pub::payment_method_session_retrieve - function: pub::payment_method_session_list_payment_methods **crates/router/src/consts.rs** Modify existing code **crates/router/src/core/payment_methods.rs** Remove: - function: pub::payment_method_intent_confirm - function: private::perform_filtering - function: pub::list_payment_methods_enabled - function: pub::create_payment_method_in_db - trait: private::PerformFilteringOnEnabledPaymentMethods Add: - function: private::perform_filtering - function: private::encrypt_data - function: pub::payment_methods_session_create - function: pub::payment_methods_session_retrieve - function: pub::payment_methods_session_update_payment_method - trait: private::EncryptableData - impl: impl PerformFilteringOnEnabledPaymentMethods for hyperswitch_domain_models::merchant_connector_account::FlattenedPaymentMethodsEnabled - impl: impl EncryptableData for payment_methods::PaymentMethodSessionRequest **crates/router/src/core/payment_methods/cards.rs** Modify existing code **crates/router/src/core/payment_methods/surcharge_decision_configs.rs** Remove: - function: pub::perform_surcharge_decision_management_for_saved_cards **crates/router/src/core/payment_methods/transformers.rs** Add: - function: private::foreign_try_from - function: private::foreign_from - impl: impl transformers::ForeignTryFrom<domain::PaymentMethod> for api::CustomerPaymentMethod - impl: impl transformers::ForeignFrom<( hyperswitch_domain_models::payment_methods::PaymentMethodsSession, Secret<String>, )> for api_models::payment_methods::PaymentMethodsSessionResponse **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/routing/helpers.rs** Modify existing code **crates/router/src/db.rs** Add: - mod: pub::payment_method_session **crates/router/src/db/ephemeral_key.rs** Remove: - function: private::get_ephemeral_key - function: private::delete_ephemeral_key - function: private::create_ephemeral_key - function: private::get_ephemeral_key Add: - function: private::get_ephemeral_key - function: private::delete_ephemeral_key - function: private::delete_client_secret - function: private::create_client_secret - function: private::get_client_secret - trait: pub::ClientSecretInterface **crates/router/src/db/kafka_store.rs** Remove: - function: private::create_ephemeral_key - function: private::get_ephemeral_key Add: - function: private::create_client_secret - function: private::get_client_secret - function: private::insert_payment_methods_session - function: private::get_payment_methods_session - impl: impl db::payment_method_session::PaymentMethodsSessionInterface for KafkaStore - impl: impl db::payment_method_session::PaymentMethodsSessionInterface for KafkaStore **crates/router/src/db/payment_method_session.rs** Add: - function: private::insert_payment_methods_session - function: private::get_payment_methods_session - function: private::insert_payment_methods_session - function: private::get_payment_methods_session - trait: pub::PaymentMethodsSessionInterface - trait: pub::PaymentMethodsSessionInterface - impl: impl PaymentMethodsSessionInterface for crate::services::Store - impl: impl PaymentMethodsSessionInterface for Store - impl: impl PaymentMethodsSessionInterface for MockDb - impl: impl PaymentMethodsSessionInterface for MockDb - mod: private::storage **crates/router/src/lib.rs** Modify existing code **crates/router/src/routes.rs** Modify existing code **crates/router/src/routes/app.rs** Add: - function: pub::server - struct: pub::PaymentMethodsSession - impl: impl PaymentMethodsSession **crates/router/src/routes/customers.rs** Modify existing code **crates/router/src/routes/ephemeral_key.rs** Add: - function: pub::ephemeral_key_delete **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/routes/payment_methods.rs** Add: - function: private::get_api_event_type - function: pub::payment_method_session_update_saved_payment_method **crates/router/src/services/authentication.rs** Remove: - function: private::authenticate_and_fetch - function: pub::is_ephemeral_or_publishible_auth - impl: impl AuthenticateAndFetch<AuthenticationData, A> for EphemeralKeyAuth Add: - function: pub::get_auth_string_from_header - function: private::authenticate_and_fetch - function: private::authenticate_and_fetch - function: pub::api_or_client_auth - struct: pub::V2ApiKeyAuth - struct: pub::V2ClientAuth - impl: impl AuthenticateAndFetch<AuthenticationData, A> for V2ApiKeyAuth - impl: impl AuthenticateAndFetch<AuthenticationData, A> for V2ClientAuth **crates/router/src/types/storage/ephemeral_key.rs** Modify existing code **crates/router_env/src/logger/types.rs** Modify existing code
{"pr_number": 7107, "pr_title": "feat(payment_methods_session_v2): add payment methods session endpoints", "merged_at": "2025-02-11T12:32:02Z", "intent": {"feature_type": "payment", "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.rs", "crates/api_models/src/events/payment.rs", "crates/api_models/src/payment_methods.rs", "crates/api_models/src/payments.rs", "crates/api_models/src/webhooks.rs"], "database": ["crates/diesel_models/src/customers.rs", "crates/diesel_models/src/ephemeral_key.rs", "crates/diesel_models/src/lib.rs", "crates/diesel_models/src/payment_methods_session.rs"], "domain": ["crates/hyperswitch_domain_models/src/customer.rs", "crates/hyperswitch_domain_models/src/payment_methods.rs"], "core_business": ["crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/surcharge_decision_configs.rs", "crates/router/src/core/payment_methods/transformers.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/routing/helpers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/deutschebank.rs"], "types": ["crates/common_types/src/payment_methods.rs", "crates/common_utils/src/types/authentication.rs", "crates/router/src/types/storage/ephemeral_key.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/crypto.rs", "crates/common_utils/src/events.rs", "crates/common_utils/src/id_type.rs", "crates/common_utils/src/id_type/client_secret.rs", "crates/common_utils/src/id_type/ephemeral_key.rs", "crates/common_utils/src/id_type/global_id.rs", "crates/common_utils/src/id_type/global_id/payment_methods.rs", "crates/router/src/routes/lock_utils.rs"], "config": ["config/development.toml"], "other": ["api-reference-v2/api-reference/customers/customers--list-saved-payment-methods.mdx", "api-reference-v2/api-reference/payment-method-session/payment-method-session--create.mdx", "api-reference-v2/api-reference/payment-method-session/payment-method-session--list-payment-methods.mdx", "api-reference-v2/api-reference/payment-method-session/payment-method-session--retrieve.mdx", "api-reference-v2/api-reference/payment-method-session/payment-method-session--update-a-saved-payment-method.mdx", "api-reference-v2/api-reference/payment-methods/payment-methods--payment-methods-list.mdx", "api-reference-v2/mint.json", "api-reference-v2/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes/payment_method.rs", "crates/router/src/consts.rs", "crates/router/src/db.rs", "crates/router/src/db/ephemeral_key.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/payment_method_session.rs", "crates/router/src/lib.rs", "crates/router/src/routes.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/services/authentication.rs"]}, "change_types": {"structs_added": 17, "functions_added": 77, "enums_added": 5, "fields_added": 270, "imports_added": 31, "conditionals_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(router): Added authentication success check for fetching authentication value ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix ## Description <!-- Describe your changes in detail --> Currently in external 3ds authentication if we cancel a txn in acs bank page it is not getting handled gracefully rather its throwing an error stating failed to fetch authentication value from temp locker. ## How did you test 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 Juspay Threeds server in sandbox, once acs bank page opens click on cancel it should result in failed transaction. Create merchant connector account ```shell curl --location 'localhost:8080/account/sahkal11/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_Ln1VBidiPjZkR3OuxhdgOAMfwZ7atLwUDLPylBG22x9pnERlTCpvs18nnEkGqlCM' \ --data ' { "connector_type": "authentication_processor", "connector_name": "juspaythreedsserver", "connector_account_details": { "auth_type": "NoKey" }, "test_mode": true, "disabled": false, "metadata": { "merchant_category_code": "5411", "merchant_country_code": "840", "merchant_name": "Dummy Merchant", "endpoint_prefix": "flowbird", "three_ds_requestor_name": "juspay-prev", "three_ds_requestor_id": "juspay-prev", "pull_mechanism_for_external_3ds_enabled": false, "acquirer_bin":"400000", "acquirer_merchant_id":"00002000000", "acquirer_country_code": "356" } } ' ``` Enable authentication service ```shell curl --location 'localhost:8080/configs/' \ --header 'Content-Type: application/json' \ --header 'api-key: test_admin' \ --data '{ "key": "merchants_eligible_for_authentication_service", "value": "[\"sahkal11\"]" }' ``` Business profile update ```shell curl --location 'localhost:8080/account/sahkal11/business_profile/pro_IsxHaxNh6DOI25odFqHJ' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_Ln1VBidiPjZkR3OuxhdgOAMfwZ7atLwUDLPylBG22x9pnERlTCpvs18nnEkGqlCM' \ --data ' { "is_click_to_pay_enabled": true, "authentication_product_ids": {"click_to_pay": "mca_OqBRdcToAauJFZ08i9iI"}, "authentication_connector_details": { "authentication_connectors": ["juspaythreedsserver"], "three_ds_requestor_url": "https://google.com" }, "merchant_country_code": "004", "merchant_category_code": "5411" } ' ``` Payments Create ``` curl --location 'localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_Ln1VBidiPjZkR3OuxhdgOAMfwZ7atLwUDLPylBG22x9pnERlTCpvs18nnEkGqlCM' \ --data-raw '{ "amount": 10, "currency": "EUR", "confirm": false, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "psd2_sca_exemption_type": "low_value", "customer_id": "StripeCustomer", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://duck.com", "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "CA", "zip": "94122", "country": "US", "first_name": "PiX" }, "phone": { "number": "123456789", "country_code": "12" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "CA", "zip": "94122", "country": "US", "first_name": "PiX" }, "phone": { "number": "123456789", "country_code": "12" } }, "request_external_three_ds_authentication": true, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Payments Confirm ``` curl --location 'localhost:8080/payments/pay_Qbd9wicL1LXDa99P9wVk/confirm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_Ln1VBidiPjZkR3OuxhdgOAMfwZ7atLwUDLPylBG22x9pnERlTCpvs18nnEkGqlCM' \ --data '{ "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "115.99.183.2" }, "payment_method": "card", "payment_method_data": { "card": { "card_number": "5522604003479299", "card_exp_month": "06", "card_exp_year": "30", "card_holder_name": "sahkal poddar", "card_cvc": "909" } } }' ``` BRW authenticate ```shell curl --location 'localhost:8080/payments/pay_Qbd9wicL1LXDa99P9wVk/3ds/authentication' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_c5c226cace0b4d98b8f29407cd025440' \ --data '{ "client_secret": "pay_Qbd9wicL1LXDa99P9wVk_secret_5qzmt3NQLZR7GyKNpzZW", "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 **payment** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payments/operations/payment_confirm.rs` **2. Other** - `crates/common_enums/src/enums.rs` **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (1 changes)
{"pr_number": 9769, "pr_title": "fix(router): Added authentication success check for fetching authentication value", "merged_at": "2025-10-16T12:06:01Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/payment_confirm.rs"], "other": ["crates/common_enums/src/enums.rs"]}, "change_types": {"functions_added": 1, "fields_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
fix(connector): [fiuu] update PSync and webhooks 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 https://github.com/juspay/hyperswitch/pull/7211 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context Helps fix Fiuu connector specifically for DuitNow. ## How did you test it? DuitNow cannot be tested. Updated based on API documentation. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/fiuu.rs` - `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs` **Code Patterns Applied:** - Extend existing types with new fields (6 changes) **Detailed Identifier Changes:** Commit 135465ef: Files to modify: **crates/hyperswitch_connectors/src/connectors/fiuu.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs** Modify existing code
{"pr_number": 7231, "pr_title": "fix(connector): [fiuu] update PSync and webhooks response", "merged_at": "2025-02-10T12:37:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/fiuu.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs"]}, "change_types": {"fields_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(organization): add api version column ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR adds version column to the organisation. ### 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)? --> Test sanity of organization - Create organization in v1 <img width="406" alt="image" src="https://github.com/user-attachments/assets/6c013b47-b1ac-4918-a14b-ff8a0f0725f7" /> - Create organization in v2 <img width="402" alt="image" src="https://github.com/user-attachments/assets/864caf2d-d845-4368-942b-c8fd2778876b" /> ## Checklist <!-- Put 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/Cargo.toml` - `crates/diesel_models/src/organization.rs` - `crates/diesel_models/src/schema.rs` - ... and 1 more files **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/Cargo.toml` - `crates/hyperswitch_domain_models/src/business_profile.rs` - `crates/hyperswitch_domain_models/src/consts.rs` - ... and 2 more files **3. Core Business Logic** - `crates/router/src/core/admin.rs` - `crates/router/src/core/api_keys.rs` - `crates/router/src/core/customers.rs` - ... and 12 more files **4. External Connector Integration** - `crates/router/src/db/merchant_connector_account.rs` **5. Type Definitions** - `crates/common_types/src/consts.rs` - `crates/common_types/src/lib.rs` **6. Configuration Files** - `crates/scheduler/Cargo.toml` **7. Other** - `Cargo.lock` - `crates/scheduler/src/db/process_tracker.rs` - `migrations/2025-03-04-053541_add_api_version_to_organization/down.sql` - ... and 1 more files **Code Patterns Applied:** - Extend existing types with new fields (28 changes) - Modify database queries (1 changes) **Detailed Identifier Changes:** Commit bfb6f59a: Files to modify: **crates/common_types/src/consts.rs** Modify existing code **crates/common_types/src/lib.rs** Add: - mod: pub::consts **crates/diesel_models/src/organization.rs** Modify existing code **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/hyperswitch_domain_models/src/business_profile.rs** Modify existing code **crates/hyperswitch_domain_models/src/consts.rs** Modify existing code **crates/hyperswitch_domain_models/src/customer.rs** Modify existing code **crates/hyperswitch_domain_models/src/merchant_account.rs** Modify existing code **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/core/api_keys.rs** Modify existing code **crates/router/src/core/customers.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/tokenize/card_executor.rs** Modify existing code **crates/router/src/core/payment_methods/vault.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/payouts.rs** Modify existing code **crates/router/src/core/payouts/helpers.rs** Modify existing code **crates/router/src/core/pm_auth.rs** Modify existing code **crates/router/src/core/refunds.rs** Modify existing code **crates/router/src/core/revenue_recovery.rs** Modify existing code **crates/router/src/core/webhooks/outgoing.rs** Modify existing code **crates/router/src/db/merchant_connector_account.rs** Modify existing code **crates/scheduler/src/db/process_tracker.rs** Modify existing code
{"pr_number": 7418, "pr_title": "refactor(organization): add api version column", "merged_at": "2025-03-28T08:05:54Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"database": ["crates/diesel_models/Cargo.toml", "crates/diesel_models/src/organization.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/Cargo.toml", "crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/consts.rs", "crates/hyperswitch_domain_models/src/customer.rs", "crates/hyperswitch_domain_models/src/merchant_account.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/api_keys.rs", "crates/router/src/core/customers.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/tokenize/card_executor.rs", "crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payouts.rs", "crates/router/src/core/payouts/helpers.rs", "crates/router/src/core/pm_auth.rs", "crates/router/src/core/refunds.rs", "crates/router/src/core/revenue_recovery.rs", "crates/router/src/core/webhooks/outgoing.rs"], "connectors": ["crates/router/src/db/merchant_connector_account.rs"], "types": ["crates/common_types/src/consts.rs", "crates/common_types/src/lib.rs"], "config": ["crates/scheduler/Cargo.toml"], "other": ["Cargo.lock", "crates/scheduler/src/db/process_tracker.rs", "migrations/2025-03-04-053541_add_api_version_to_organization/down.sql", "migrations/2025-03-04-053541_add_api_version_to_organization/up.sql"]}, "change_types": {"fields_added": 28, "imports_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix: replace xtrim with xdel to support older redis version ## 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 support for xdel if redis client uses legacy version https://github.com/juspay/hyperswitch/issues/8389 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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)? --> Checked if the code compiled. Cannot be tested at runtime. without setting up a legacy and non legacy redis versions. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Other** - `crates/drainer/src/handler.rs` - `crates/drainer/src/metrics.rs` - `crates/drainer/src/services.rs` - ... and 1 more files **Code Patterns Applied:** - Implement new functions (2 changes) - Extend existing types with new fields (4 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit 3d085abf: Files to modify: **crates/drainer/src/handler.rs** Modify existing code **crates/drainer/src/metrics.rs** Modify existing code **crates/drainer/src/services.rs** Add: - function: pub::use_legacy_version **crates/drainer/src/stream.rs** Add: - function: pub::delete_from_stream
{"pr_number": 8515, "pr_title": "fix: replace xtrim with xdel to support older redis version", "merged_at": "2025-07-29T10:59:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["crates/drainer/src/handler.rs", "crates/drainer/src/metrics.rs", "crates/drainer/src/services.rs", "crates/drainer/src/stream.rs"]}, "change_types": {"functions_added": 2, "fields_added": 4, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor: make billing details optional during data migration ## 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 includes changes to make billing details related fields optional during batched operation of data migration. ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context Allows merchants who use connectors which does not mandate address fields to be present during a payment txn to be able to migrate their data. Billing details will not be mandated during batched operation of data migration. ## How did you test it? 1. Create MCA <details> <summary>2. Run batch migration</summary> cURL curl --location --request POST 'http://localhost:8080/payment_methods/migrate-batch' \ --header 'api-key: test_admin' \ --form 'merchant_id="merchant_1750764063"' \ --form 'merchant_connector_id="mca_F0qqizsBSwbZ77gQYLRs"' \ --form 'file=@"sample.csv"' Response [{"line_number":1,"payment_method_id":"pm_wY7TUBMPZZISgu2Zf74M","payment_method":"card","payment_method_type":"debit","customer_id":"45CC60D1F2283097BB1DE41A2636414445908518D50B8B4CDC57959CD7FB4539","migration_status":"Success","card_number_masked":"4360000 xxxx 0005","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":2,"payment_method_id":"pm_gNTfSTNVhvlURJPnsiYQ","payment_method":"card","payment_method_type":"credit","customer_id":"782BC898951D910C1A99DA69A4E4FAD6CEE53AB9311FA2C552028DA89428DB7F","migration_status":"Success","card_number_masked":"4111111 xxxx 1111","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":3,"payment_method_id":"pm_EeJ2hgF3OmHgTFEfe58X","payment_method":"card","payment_method_type":"credit","customer_id":"C81CC958611A803D9CC3E2E7818A1691943E3143E6DF603A7F45E55BA7629938","migration_status":"Success","card_number_masked":"222300 xxxx 0010","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":4,"payment_method_id":"pm_p1ckEakoWB12EtHYtjtm","payment_method":"card","payment_method_type":"credit","customer_id":"9F4BB23B3ED615753F5A27CF6D75274713B30A67ACFEA7CE44B058F6AC044E33","migration_status":"Success","card_number_masked":"5555555 xxxx 4444","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":5,"payment_method_id":"pm_0HrpkOfnLuIPSJiU3fdZ","payment_method":"card","payment_method_type":"debit","customer_id":"B22BFDD8BB5840B5F6EE0026A430B72359C50E631C7A2D9D2BC014BDB1EB212C","migration_status":"Success","card_number_masked":"222300 xxxx 0010","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":6,"payment_method_id":"pm_iOtdYdcOErhUz4bXmZgX","payment_method":"card","payment_method_type":"credit","customer_id":"EECB88827D346EDCFB9AB7302B0C387C42FB5EBAD87EC0E4FA4301F6148BB22B","migration_status":"Success","card_number_masked":"557700 xxxx 0004","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":7,"payment_method_id":"pm_JnzwASYJStJUQ02LEcqf","payment_method":"card","payment_method_type":"credit","customer_id":"C81CC958611A803D9CC3E2E7818A1691943E3143E6DF603A7F45E55BA7629938","migration_status":"Success","card_number_masked":"222241 xxxx 0002","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":8,"payment_method_id":"pm_CJsKWoBsOqkRlikFMO2t","payment_method":"card","payment_method_type":"credit","customer_id":"66C96C852E423B701EF06C5109C40D72E77B4C7F4CDD108AD4FCC3DCCC38AB2F","migration_status":"Success","card_number_masked":"513029 xxxx 0009","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":9,"payment_method_id":"pm_z0jFnOfXn1andQp9qbXd","payment_method":"card","payment_method_type":"credit","customer_id":"C81CC958611A803D9CC3E2E7818A1691943E3143E6DF603A7F45E55BA7629938","migration_status":"Success","card_number_masked":"510322 xxxx 9245","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":10,"payment_method_id":"pm_4lJAPwuf8iepQCWKDub1","payment_method":"card","payment_method_type":"credit","customer_id":"C81CC958611A803D9CC3E2E7818A1691943E3143E6DF603A7F45E55BA7629938","migration_status":"Success","card_number_masked":"222241 xxxx 0002","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":11,"payment_method_id":"pm_J1ZMlj5lzHyf2P5Lid6S","payment_method":"card","payment_method_type":"credit","customer_id":"ADE2795AC3C88525528F0DB95677BE9DB27E792850B1A67CA654BFFAEB31AFE3","migration_status":"Success","card_number_masked":"222241 xxxx 0018","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":12,"payment_method_id":"pm_zySRb0JCNxcCMH2Ubocc","payment_method":"card","payment_method_type":"credit","customer_id":"ADE2795AC3C88525528F0DB95677BE9DB27E792850B1A67CA654BFFAEB31AFE3","migration_status":"Success","card_number_masked":"411111 xxxx 1111","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":13,"payment_method_id":"pm_M9wKyu4kEYNcHIjyrVfI","payment_method":"card","payment_method_type":"credit","customer_id":"D83D0437F8883C26C75C04756D95E21B90877020743EA1C1CC49883A90E8DF97","migration_status":"Success","card_number_masked":"411111 xxxx 1111","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":14,"payment_method_id":"pm_RDiPAalAZkCj1uOqKYSb","payment_method":"card","payment_method_type":"credit","customer_id":"ADE2795AC3C88525528F0DB95677BE9DB27E792850B1A67CA654BFFAEB31AFE3","migration_status":"Success","card_number_masked":"624303 xxxx 0001","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":15,"payment_method_id":"pm_0XTr9lrG6LGNl9d4iFPR","payment_method":"card","payment_method_type":"debit","customer_id":"ADE2795AC3C88525528F0DB95677BE9DB27E792850B1A67CA654BFFAEB31AFE3","migration_status":"Success","card_number_masked":"222241 xxxx 0002","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":16,"payment_method_id":"pm_aUtJIRDcCH7CIwJ2hQEk","payment_method":"card","payment_method_type":"credit","customer_id":"D83D0437F8883C26C75C04756D95E21B90877020743EA1C1CC49883A90E8DF97","migration_status":"Success","card_number_masked":"817199 xxxx 0000","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":17,"payment_method_id":"pm_THz5Ds8VHAgyJPPOA4GY","payment_method":"card","payment_method_type":"credit","customer_id":"D83D0437F8883C26C75C04756D95E21B90877020743EA1C1CC49883A90E8DF97","migration_status":"Success","card_number_masked":"464646 xxxx 4644","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":18,"payment_method_id":"pm_l82mYW4tMsRkJF4hq5fn","payment_method":"card","payment_method_type":"credit","customer_id":"ADE2795AC3C88525528F0DB95677BE9DB27E792850B1A67CA654BFFAEB31AFE3","migration_status":"Success","card_number_masked":"222240 xxxx 0007","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":19,"payment_method_id":"pm_E8fkAc9RHknoPmnYFBOa","payment_method":"card","payment_method_type":"debit","customer_id":"ADE2795AC3C88525528F0DB95677BE9DB27E792850B1A67CA654BFFAEB31AFE3","migration_status":"Success","card_number_masked":"400006 xxxx 0006","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":20,"payment_method_id":"pm_TEEJO7DdZTkl55PH8P1T","payment_method":"card","payment_method_type":"credit","customer_id":"D83D0437F8883C26C75C04756D95E21B90877020743EA1C1CC49883A90E8DF97","migration_status":"Success","card_number_masked":"497794 xxxx 9497","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":21,"payment_method_id":"pm_3gTcA4MJsTjasj2XlJs2","payment_method":"card","payment_method_type":"credit","customer_id":"C81CC958611A803D9CC3E2E7818A1691943E3143E6DF603A7F45E55BA7629938","migration_status":"Success","card_number_masked":"436000 xxxx 0005","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":22,"payment_method_id":"pm_GzUYGU3GpOXOIkWFRkM0","payment_method":"card","payment_method_type":"credit","customer_id":"C80162F403CCA7AF1CB6732291D6D53B88636BB6A9B82D2CD43AC30775925B4F","migration_status":"Success","card_number_masked":"222241 xxxx 0002","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":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. API Request/Response Models** - `crates/api_models/src/payment_methods.rs` **2. Core Business Logic** - `crates/payment_methods/src/core/migration/payment_methods.rs` **Code Patterns Applied:** - Implement new functions (3 changes) - Extend existing types with new fields (31 changes) - Add conditional logic for feature flags or filtering (3 changes) **Detailed Identifier Changes:** Commit dee5d0c5: Files to modify: **crates/api_models/src/payment_methods.rs** Add: - function: private::create_address - function: private::create_phone - function: private::create_billing - impl: impl PaymentMethodRecord **crates/payment_methods/src/core/migration/payment_methods.rs** Modify existing code
{"pr_number": 8438, "pr_title": "refactor: make billing details optional during data migration", "merged_at": "2025-06-24T17:23:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "core_business": ["crates/payment_methods/src/core/migration/payment_methods.rs"]}, "change_types": {"functions_added": 3, "fields_added": 31, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [Checkout] Add Google Pay Predecrypt Flow ## 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/9129) ## Description <!-- Describe your changes in detail --> Added Google Pay Predecrypt 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. Payments - Create Request: ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_lCkY35u2evZqwny1tXdtyZuu7VufIiJjFTJhuI0kMJAP8RL9XmyomvPqQDBzDvo1' \ --data-raw '{ "amount": 7445, "currency": "USD", "confirm": true, "business_country": "US", "business_label": "default", "amount_to_capture": 7445, "customer_id": "cu_1756821388", "capture_method": "automatic", "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "in sit", "user_agent": "amet irure esse" } }, "capture_on": "2022-09-10T10:11:12Z", "authentication_type": "no_three_ds", "return_url": "https://google.com", "email": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "payment_method": "wallet", "payment_method_type": "google_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" } }, "payment_method_data": { "wallet": { "google_pay": { "type": "CARD", "description": "SuccessfulAuth: Visa •••• 4242", "info": { "assurance_details": { "account_verified": true, "card_holder_authenticated": false }, "card_details": "4242", "card_network": "MASTERCARD" }, "tokenization_data": { "application_primary_account_number": "4242424242424242", "card_exp_month": "10", "card_exp_year": "25", "cryptogram": CRYPTOGRAM } } } } }' ``` Response: ``` { "payment_id": "pay_kZOyskQtl91kB3oiAaFS", "merchant_id": "merchant_1756821155", "status": "processing", "amount": 7445, "net_amount": 7445, "shipping_cost": null, "amount_capturable": 7445, "amount_received": null, "connector": "checkout", "client_secret": "pay_kZOyskQtl91kB3oiAaFS_secret_1VaHJKidL1jl9DftOx0Z", "created": "2025-09-02T13:53:01.094Z", "currency": "USD", "customer_id": "cu_1756821181", "customer": { "id": "cu_1756821181", "name": "Joseph Doe", "email": "something@gmail.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "google_pay": { "last4": "4242", "card_network": "MASTERCARD", "type": "CARD" } }, "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", "origin_zip": null }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "google_pay", "connector_label": "checkout_US_default", "business_country": "US", "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1756821181", "created_at": 1756821181, "expires": 1756824781, "secret": "epk_39573ad4636840e2a30021f811f4a9c4" }, "manual_retry_allowed": false, "connector_transaction_id": "pay_ddjiyc5cghrernmk7gqlpnua6e", "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_kZOyskQtl91kB3oiAaFS_1", "payment_link": null, "profile_id": "pro_YQn8ejoAyLrvevnCJLnZ", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_hkY02nmI5cs4ygBEbIUg", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-09-02T14:08:01.094Z", "fingerprint": null, "browser_info": null, "payment_channel": null, "payment_method_id": null, "network_transaction_id": null, "payment_method_status": null, "updated": "2025-09-02T13:53:02.364Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": null, "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null } ``` 2. Payments - Retrieve Request: ``` curl --location 'http://localhost:8080/payments/pay_kZOyskQtl91kB3oiAaFS?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_lCkY35u2evZqwny1tXdtyZuu7VufIiJjFTJhuI0kMJAP8RL9XmyomvPqQDBzDvo1' ``` Response: ``` { "payment_id": "pay_kZOyskQtl91kB3oiAaFS", "merchant_id": "merchant_1756821155", "status": "succeeded", "amount": 7445, "net_amount": 7445, "shipping_cost": null, "amount_capturable": 0, "amount_received": 7445, "connector": "checkout", "client_secret": "pay_kZOyskQtl91kB3oiAaFS_secret_1VaHJKidL1jl9DftOx0Z", "created": "2025-09-02T13:53:01.094Z", "currency": "USD", "customer_id": "cu_1756821181", "customer": { "id": "cu_1756821181", "name": "Joseph Doe", "email": "something@gmail.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "google_pay": { "last4": "4242", "card_network": "MASTERCARD", "type": "CARD" } }, "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", "origin_zip": null }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "google_pay", "connector_label": "checkout_US_default", "business_country": "US", "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "pay_ddjiyc5cghrernmk7gqlpnua6e", "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_kZOyskQtl91kB3oiAaFS_1", "payment_link": null, "profile_id": "pro_YQn8ejoAyLrvevnCJLnZ", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_hkY02nmI5cs4ygBEbIUg", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-09-02T14:08:01.094Z", "fingerprint": null, "browser_info": null, "payment_channel": null, "payment_method_id": "pm_LSM4mcvLDbufpOlCjb1X", "network_transaction_id": null, "payment_method_status": "inactive", "updated": "2025-09-02T13:53:11.202Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": null, "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payments.rs` **2. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs` **3. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **4. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 3 more files **Code Patterns Applied:** - Define new data structures (1 changes) - Implement new functions (2 changes) - Extend existing types with new fields (17 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 96e44a75: Files to modify: **crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs** Modify existing code **crates/router/src/configs/settings.rs** Add: - enum: pub::GooglePayPreDecryptFlow **crates/router/src/core/payments.rs** Modify existing code
{"pr_number": 9130, "pr_title": "feat(connector): [Checkout] Add Google Pay Predecrypt Flow", "merged_at": "2025-09-26T08:09:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/checkout/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/router/src/configs/settings.rs"]}, "change_types": {"structs_added": 1, "functions_added": 2, "enums_added": 1, "fields_added": 17, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(authz): Make connector list accessible by operation groups ## 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 will make connector_view group accessible by operation groups. This PR will also change the permission of connector_retrieve API from connector_read to connector_write as it contains sensitive data. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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 #6788. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ``` curl 'http://localhost:8080/account/merchant_1733829021/profile/connectors' \ -H 'Content-Type: application/json' \ -H 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMzgyMWViZTktNGVkZS00Y2Y5LTlkNDQtNDgzZGFjMTM2ODEzIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzMzODI5MDIxIiwicm9sZV9pZCI6InJvbGVfRHZDdGFtenBGanZPdW9oSVpEMUEiLCJleHAiOjE3MzQwMDgzODEsIm9yZ19pZCI6Im9yZ19FWnZWZFJ6NVRxT1FxaWJzUERRZSIsInByb2ZpbGVfaWQiOiJwcm9fN2x3clIwWVVUbU1hbzhpWHJSVEkiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.GvNXaj3YAwfPYQhoR7EeC-PpQmocZ_y8G02fdN_DuQU' \ ``` The above API should be accessible by users who are in only `operations_view` group. ``` curl 'http://localhost:8080/account/merchant_1733829021/connectors/mca_NEyNsfAyBFqewjPVz7sY' \ -H 'Content-Type: application/json' \ -H 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNjA0N2I5NGYtYjlmYi00MGY4LWI1NWUtODcwMDdhZDc2M2ZhIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzMzODI5MDIxIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczNDAwODcyOCwib3JnX2lkIjoib3JnX0VadlZkUno1VHFPUXFpYnNQRFFlIiwicHJvZmlsZV9pZCI6InByb183bHdyUjBZVVRtTWFvOGlYclJUSSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.GMuhFhjCvP_3aM8IEHuKXH3la3uRgtCU3Q_zVVpEOyQ' \ ``` The above API should not be accessible by users who are not in `connector_manage` group. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Other** - `crates/router/src/routes/admin.rs` - `crates/router/src/services/authorization/permission_groups.rs` **Code Patterns Applied:** - Extend existing types with new fields (1 changes) **Detailed Identifier Changes:** Commit 6081283a: Files to modify: **crates/router/src/routes/admin.rs** Modify existing code **crates/router/src/services/authorization/permission_groups.rs** Modify existing code
{"pr_number": 6792, "pr_title": "refactor(authz): Make connector list accessible by operation groups", "merged_at": "2024-12-16T09:22:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "connector"]}, "hierarchy": {"other": ["crates/router/src/routes/admin.rs", "crates/router/src/services/authorization/permission_groups.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(framework): Added smithy, smithy-core and smithy-generator crates ## 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 --> ## Overview of the Three Crates ### 1. __smithy__ crate (Procedural Macro) This is a procedural macro crate that provides the `#[derive(SmithyModel)]` attribute. It's the entry point for developers who want to generate Smithy models from their Rust structs. __Key characteristics:__ - __Type__: Procedural macro library (`proc-macro = true`) - __Location__: `crates/smithy/` - __Dependencies__: `proc-macro2`, `quote`, `syn`, `smithy-core` - __Main export__: `SmithyModel` derive macro ### 2. __smithy-core__ crate (Core Logic) This contains the fundamental types and logic for Smithy model generation. It acts as the shared foundation between the macro and the generator. __Key characteristics:__ - __Type__: Library crate - __Location__: `crates/smithy-core/` - __Dependencies__: `serde`, `serde_json`, `syn`, `proc-macro2` - __Main modules__: - `types.rs` - Core data structures (SmithyModel, SmithyShape, SmithyTrait, etc.) - `generator.rs` - SmithyGenerator for converting models to IDL files ### 3. __smithy-generator__ crate (Code Generation Tool) This is an executable that scans the entire workspace for structs annotated with `#[derive(SmithyModel)]` and generates the corresponding Smithy IDL files. __Key characteristics:__ - __Type__: Binary crate with build script - __Location__: `crates/smithy-generator/` - __Dependencies__: `smithy-core`, workspace crates (`api_models`, `common_enums`, etc.) - __Components__: - `build.rs` - Workspace scanner and registry generator - `main.rs` - IDL file generator ## How They Work Together ### Step 1: Developer Annotation A developer annotates their Rust struct or enum with the derive macro: ```rust #[derive(SmithyModel)] #[smithy(namespace = "com.hyperswitch.payments")] pub struct PaymentRequest { #[smithy(value_type = "String", required)] pub payment_id: String, #[smithy(value_type = "Option<i64>")] pub amount: Option<i64>, } ``` ### Step 2: Procedural Macro Processing (`smithy` crate) When the code is compiled, the `smithy` crate's procedural macro: 1. __Parses the struct/enum definition__ using `syn` 2. __Extracts metadata__ from `#[smithy(...)]` attributes (namespace, constraints, field types) 3. __Generates implementation__ of the `SmithyModelGenerator` trait for the annotated type 4. __Handles complex scenarios__ like: - Flattened fields (`#[serde(flatten)]`) - Optional types (`Option<T>`) - Collections (`Vec<T>`, `HashMap<K,V>`) - Enum variants (both string enums and unions) - Constraint validation (patterns, ranges, lengths) The generated code implements `SmithyModelGenerator::generate_smithy_model()` which returns a `SmithyModel` containing the structure definition. ### Step 3: Build-Time Discovery (`smithy-generator` build script) The `smithy-generator` crate has a build script (`build.rs`) that: 1. __Scans the entire workspace__ recursively through all `crates/` subdirectories 2. __Uses regex parsing__ to find structs/enums with `#[derive(SmithyModel)]` 3. __Generates a registry file__ (`model_registry.rs`) containing: - Import statements for all discovered types - A `discover_smithy_models()` function that calls `generate_smithy_model()` on each type ### Step 4: IDL Generation (`smithy-generator` executable) When the `smithy-generator` binary runs: 1. __Loads the generated registry__ and calls `discover_smithy_models()` 2. __Collects all SmithyModel instances__ from across the workspace 3. __Groups models by namespace__ for organized file generation 4. __Uses SmithyGenerator__ from `smithy-core` to convert models to Smithy IDL syntax 5. __Writes `.smithy` files__ to `smithy/models/` directory ### Step 5: Smithy IDL Output The final output is proper Smithy IDL files like: ```smithy $version: "2" namespace com.hyperswitch.payments /// Payment request structure structure PaymentRequest { @required payment_id: String amount: Long } ``` ## Key Design Patterns ### Type Resolution System The `smithy-core/types.rs` contains sophisticated type resolution logic that: - Maps Rust primitive types to Smithy equivalents (`String` → `smithy.api#String`) - Handles generic types recursively (`Vec<T>` → `List` shapes, `Option<T>` → optional members) - Resolves custom types and manages cross-namespace references - Generates intermediate shapes for complex nested types ### Constraint System The framework supports rich constraint modeling: - __Validation constraints__: `pattern`, `range`, `length` - __HTTP binding constraints__: `httpLabel`, `httpQuery` - __Structural constraints__: `required`, `mixin` ### Workspace Integration The build script approach allows: - __Zero-configuration discovery__ of models across the entire workspace - __Compile-time validation__ that all referenced types exist - __Automatic regeneration__ when models change - __Selective inclusion__ of only relevant crates (excludes smithy crates themselves) This architecture provides a seamless developer experience where you simply derive `SmithyModel` on your types, and the toolchain automatically discovers them and generates proper Smithy IDL files during the build process. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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)? --> There are no test cases for this PR, since this is just addition of the Smithy Model generation framework to Hyperswitch. The only way to test this PR is to add the derive macros in structs and check the model generation, but that will be done in subsequent PRs. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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/smithy-core/Cargo.toml` - `crates/smithy-core/src/generator.rs` - `crates/smithy-core/src/lib.rs` - ... and 1 more files **2. Configuration Files** - `crates/smithy-generator/Cargo.toml` - `crates/smithy/Cargo.toml` **3. Other** - `Cargo.lock` - `crates/smithy-generator/build.rs` - `crates/smithy-generator/src/main.rs` - ... and 1 more files **Code Patterns Applied:** - Define new data structures (10 changes) - Implement new functions (42 changes) - Extend existing types with new fields (126 changes) - Add conditional logic for feature flags or filtering (94 changes) - Modify database queries (1 changes) **Detailed Identifier Changes:** Commit 0baae338: Files to modify: **crates/smithy-core/src/generator.rs** Add: - function: pub::new - function: pub::add_model - function: pub::generate_idl - function: private::generate_shape_definition - function: private::resolve_type - function: private::trait_to_string - function: private::default - struct: pub::SmithyGenerator - impl: impl SmithyGenerator - impl: impl Default for SmithyGenerator **crates/smithy-core/src/lib.rs** Add: - mod: pub::generator - mod: pub::types **crates/smithy-core/src/types.rs** Add: - function: pub::resolve_type_and_generate_shapes - function: private::extract_generic_inner_type - function: private::parse_map_types - struct: pub::SmithyModel - struct: pub::SmithyMember - struct: pub::SmithyEnumValue - struct: pub::SmithyField - struct: pub::SmithyEnumVariant - enum: pub::SmithyShape - enum: pub::SmithyTrait - enum: pub::SmithyConstraint - trait: pub::SmithyModelGenerator **crates/smithy-generator/build.rs** Add: - function: private::main - function: private::run_build - function: private::get_workspace_root - function: private::scan_crate_for_smithy_models - function: private::scan_directory - function: private::scan_rust_file - function: private::is_valid_rust_identifier - function: private::create_module_path - function: private::generate_model_registry - struct: private::SmithyModelInfo **crates/smithy-generator/src/main.rs** Add: - function: private::main **crates/smithy/src/lib.rs** Add: - function: pub::derive_smithy_model - function: private::generate_smithy_impl - function: private::generate_struct_impl - function: private::generate_enum_impl - function: private::extract_namespace_and_mixin - function: private::extract_fields - function: private::extract_enum_variants - function: private::parse_serde_attributes - function: private::parse_serde_enum_attributes - function: private::transform_variant_name - function: private::to_snake_case - function: private::to_camel_case - function: private::to_kebab_case - function: private::to_screaming_snake_case - function: private::parse_smithy_field_attributes - function: private::extract_documentation - function: private::parse_range - function: private::parse_length - struct: private::SmithyFieldAttributes - struct: private::SerdeAttributes - struct: private::SerdeEnumAttributes
{"pr_number": 9249, "pr_title": "feat(framework): Added smithy, smithy-core and smithy-generator crates", "merged_at": "2025-09-26T08:06:07Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment"]}, "hierarchy": {"core_business": ["crates/smithy-core/Cargo.toml", "crates/smithy-core/src/generator.rs", "crates/smithy-core/src/lib.rs", "crates/smithy-core/src/types.rs"], "config": ["crates/smithy-generator/Cargo.toml", "crates/smithy/Cargo.toml"], "other": ["Cargo.lock", "crates/smithy-generator/build.rs", "crates/smithy-generator/src/main.rs", "crates/smithy/src/lib.rs"]}, "change_types": {"structs_added": 10, "functions_added": 42, "enums_added": 3, "fields_added": 126, "imports_added": 14, "conditionals_added": 94, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(schema): add a new column for storing large customer user agents in mandate table ## 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 --> `customer_user_agent` column in `mandate` table has a `255` character length limit. Lately, there have been increased number of `5xx` errors due to the values in `customer_user_agent` column hitting that limit. This PR addresses this by introducing a new column `customer_device_user_agent` with `TEXT` type in the `mandate` table and also adds `customer_user_agent` as a fallback. Generate and run migrations: v1: ```sh just resurrect just migrate diesel migration generate <file-name> vi up.sql vi down.sql just migrate ``` v2: ```sh just resurrect just migrate_v2 diesel migration generate <file-name> --migration-dir v2_migrations --config-file diesel_v2.toml vi up.sql vi down.sql just migrate_v2 ``` ### 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` --> 1. `/migrations` 2. `/v2_migrations` ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> Below seems to have become a recurring issue where `customer_user_agent` constantly hits the `255` character limit: ```sh {"error":{"type":"api","message":"Something went wrong","code":"HE_00"}} ├╴at crates/router/src/services/api.rs:651:14 │ ├─:arrow_forwards: {"error":{"type":"server_not_available","code":"HE_00","message":"Something went wrong"}} │ ╰╴at crates/router/src/core/errors/utils.rs:74:17 │ ╰─:arrow_forwards: DatabaseError: An unknown error occurred ├╴at /router/crates/diesel_models/src/query/generics.rs:89:36 ├╴Error while inserting MandateNew { mandate_id: "man_AHPH51mC407li7Jaz9xJ", customer_id: CustomerId("cus_sVszwfsNvEnM45dSS5Ob"), merchant_id: MerchantId("abo_factory"), payment_method_id: "pm_pmc6vtfpo24GVxzUwfOw", mandate_status: Active, mandate_type: MultiUse, customer_accepted_at: Some(2025-07-10 14:25:10.867), customer_ip_address: Some(193.**.**.**), customer_user_agent: Some("Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/22F76 [FBAN/FBIOS;FBAV/520.0.0.38.101;FBBV/756351453;FBDV/iPhone14,7;FBMD/iPhone;FBSN/iOS;FBSV/18.5;FBSS/3;FBID/phone;FBLC/fr_FR;FBOP/5;FBRV/760683563;IABMV/1]"), network_transaction_id: None, previous_attempt_id: None, created_at: None, mandate_amount: Some(17800), mandate_currency: Some(EUR), amount_captured: None, connector: "stripe", connector_mandate_id: Some("pm_1RjLQUE9KgVj5AGnQfpGg6Wy"), start_date: None, end_date: None, metadata: None, connector_mandate_ids: Some(*** serde_json::value::Value ***), original_payment_id: Some(PaymentId("pay_RapWRO8bbLsGhgMJA4tm")), merchant_connector_id: Some(MerchantConnectorAccountId("mca_i6yLcyGKTCzgYaZpclld")), updated_by: Some("postgres_only") } │ ╰─:arrow_forwards: value too long for type character varying(255) ╰╴at /router/crates/diesel_models/src/query/generics.rs:89:22 ╰╴at crates/router/src/db/mandate.rs:334:38 ``` ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Did a mandate payment: <details> <summary>CIT</summary> ```curl curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_vF7qG9HUZoBwllgi22Tep4sJiwyoHZNWsHm682jzlis5UzBxrbwIP6z38tqTF0em' \ --data-raw '{ "currency": "USD", "amount": 301, "confirm": true, "amount_to_capture": 301, "customer_id": "payload_connector_test", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "authentication_type": "no_three_ds", "return_url": "https://www.google.com", "email": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "payment_method": "card", "setup_future_usage": "off_session", "payment_method_type": "debit", "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": "Harrison Street", "city": "San Fransico", "state": "CA", "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": "CA", "zip": "94122", "country": "US", "first_name": "john", "last_name": "Doe" } }, "browser_info": { "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/22F76 [FBAN/FBIOS;FBAV/520.0.0.38.101;FBBV/756351453;FBDV/iPhone14,7;FBMD/iPhone;FBSN/iOS;FBSV/18.5;FBSS/3;FBID/phone;FBLC/fr_FR;FBOP/5;FBRV/760683563;IABMV/1]", "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": "109.71.40.0" }, "metadata": { "order_category": "applepay" }, "order_details": [ { "product_name": "Apple iphone 15", "quantity": 1, "amount": 300, "account_name": "transaction_processing" } ], "mandate_data": { "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "125.0.0.1", "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/22F76 [FBAN/FBIOS;FBAV/520.0.0.38.101;FBBV/756351453;FBDV/iPhone14,7;FBMD/iPhone;FBSN/iOS;FBSV/18.5;FBSS/3;FBID/phone;FBLC/fr_FR;FBOP/5;FBRV/760683563;IABMV/1]" } }, "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" } } } } }' ``` ```json { "payment_id": "pay_ivzzdZaXOhhmlAlWvomn", "merchant_id": "spriteMerchantBornAt1753027902", "status": "succeeded", "amount": 301, "net_amount": 301, "shipping_cost": null, "amount_capturable": 0, "amount_received": 301, "connector": "stripe", "client_secret": "pay_ivzzdZaXOhhmlAlWvomn_secret_sfPbglwH6a2oBpmQOvAV", "created": "2025-07-20T16:12:18.556Z", "currency": "USD", "customer_id": "payload_connector_test", "customer": { "id": "payload_connector_test", "name": "Joseph Doe", "email": "something@gmail.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": "man_OrzwB85cMLyysmleVpVu", "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": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/22F76 [FBAN/FBIOS;FBAV/520.0.0.38.101;FBBV/756351453;FBDV/iPhone14,7;FBMD/iPhone;FBSN/iOS;FBSV/18.5;FBSS/3;FBID/phone;FBLC/fr_FR;FBOP/5;FBRV/760683563;IABMV/1]" } }, "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": 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": { "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": "CA", "first_name": "john", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "CA", "line3": "Harrison Street", "zip": "94122", "state": "CA", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": [ { "brand": null, "amount": 300, "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": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://www.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": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "payload_connector_test", "created_at": 1753027938, "expires": 1753031538, "secret": "epk_d47735e294184c85b09d74919af1ce3d" }, "manual_retry_allowed": false, "connector_transaction_id": "pi_3RmzqYD5R7gDAGff0rfZAqdm", "frm_message": null, "metadata": { "order_category": "applepay" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi_3RmzqYD5R7gDAGff0rfZAqdm", "payment_link": null, "profile_id": "pro_4ZdZ0fklzD0rF7Evl6mS", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_dgwtzHYk72GtX2jtpGip", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-20T16:27:18.556Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "109.71.40.0", "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/22F76 [FBAN/FBIOS;FBAV/520.0.0.38.101;FBBV/756351453;FBDV/iPhone14,7;FBMD/iPhone;FBSN/iOS;FBSV/18.5;FBSS/3;FBID/phone;FBLC/fr_FR;FBOP/5;FBRV/760683563;IABMV/1]", "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_naLa7iPMAtGQ3eLT3lIH", "payment_method_status": null, "updated": "2025-07-20T16:12:20.094Z", "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>MIT</summary> ```curl curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_vF7qG9HUZoBwllgi22Tep4sJiwyoHZNWsHm682jzlis5UzBxrbwIP6z38tqTF0em' \ --data-raw '{ "amount": 499, "currency": "USD", "confirm": true, "capture_method": "automatic", "customer_id": "payload_connector_test", "email": "guest@example.com", "off_session": true, "recurring_details": { "type": "mandate_id", "data": "man_OrzwB85cMLyysmleVpVu" }, "authentication_type": "no_three_ds" }' ``` ```json { "payment_id": "pay_DcwC0NPQYJAV15g6AWX4", "merchant_id": "spriteMerchantBornAt1753027902", "status": "succeeded", "amount": 499, "net_amount": 499, "shipping_cost": null, "amount_capturable": 0, "amount_received": 499, "connector": "stripe", "client_secret": "pay_DcwC0NPQYJAV15g6AWX4_secret_KMqk3ZVa9cyB0zRmvY73", "created": "2025-07-20T16:12:44.054Z", "currency": "USD", "customer_id": "payload_connector_test", "customer": { "id": "payload_connector_test", "name": "Joseph Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65" }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": true, "capture_on": null, "capture_method": "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": "26887a40-3562-43b2-8f19-9c56db3808e4", "shipping": null, "billing": null, "order_details": null, "email": "guest@example.com", "name": "Joseph Doe", "phone": "999999999", "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "payload_connector_test", "created_at": 1753027963, "expires": 1753031563, "secret": "epk_7bb634915c0e431e9cd15f7130c7bc74" }, "manual_retry_allowed": false, "connector_transaction_id": "pi_3RmzqyD5R7gDAGff1A6HUG3m", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi_3RmzqyD5R7gDAGff1A6HUG3m", "payment_link": null, "profile_id": "pro_4ZdZ0fklzD0rF7Evl6mS", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_dgwtzHYk72GtX2jtpGip", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-20T16:27:44.054Z", "fingerprint": null, "browser_info": null, "payment_method_id": "pm_naLa7iPMAtGQ3eLT3lIH", "payment_method_status": "active", "updated": "2025-07-20T16:12:45.157Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": "pm_1RmzqYD5R7gDAGffLVJOBbgW", "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>There's no 5xx around this "customer_user_agent" now</summary> <img width="1238" height="692" alt="image" src="https://github.com/user-attachments/assets/731b5eee-6b4e-4ada-9cbd-87a43bc0b8e0" /> </details> <details> <summary>"customer_user_agent" is getting stored in the db in the new column</summary> <img width="1117" height="567" alt="image" src="https://github.com/user-attachments/assets/77d09d63-b586-4030-939d-e072a52eca50" /> </details> <details> <summary>Check v2 DB</summary> <img width="337" height="233" alt="image" src="https://github.com/user-attachments/assets/f7641fdb-fa2f-42cc-a92d-8cfdd74a0e22" /> Command: ```psql SELECT EXISTS ( SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'mandate' AND column_name = 'customer_device_user_agent' ); ``` </details> > [!NOTE] > Tested for `v1` but not for `v2` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `just clippy && just clippy_v2` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Database Layer (Queries & Schema)** - `crates/diesel_models/src/mandate.rs` - `crates/diesel_models/src/schema.rs` - `crates/diesel_models/src/schema_v2.rs` **2. Core Business Logic** - `crates/router/src/core/payments/helpers.rs` **3. Type Definitions** - `crates/router/src/types/api/mandates.rs` **4. Other** - `crates/router/src/db/mandate.rs` - `migrations/2025-07-24-081357_customer_user_agent_extended/down.sql` - `migrations/2025-07-24-081357_customer_user_agent_extended/up.sql` **Code Patterns Applied:** - Extend existing types with new fields (7 changes) **Detailed Identifier Changes:** Commit b74c1e91: Files to modify: **crates/diesel_models/src/mandate.rs** Modify existing code **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/db/mandate.rs** Modify existing code **crates/router/src/types/api/mandates.rs** Modify existing code
{"pr_number": 8616, "pr_title": "refactor(schema): add a new column for storing large customer user agents in mandate table", "merged_at": "2025-07-25T09:48:06Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/mandate.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "core_business": ["crates/router/src/core/payments/helpers.rs"], "types": ["crates/router/src/types/api/mandates.rs"], "other": ["crates/router/src/db/mandate.rs", "migrations/2025-07-24-081357_customer_user_agent_extended/down.sql", "migrations/2025-07-24-081357_customer_user_agent_extended/up.sql"]}, "change_types": {"fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(router): populate `profile_id` in for the HeaderAuth of v1 ## 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 --> populate `profile_id` in for the HeaderAuth of v1 And also this pr involves the changes to unmask the profile id that is sent in the headers. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **2. Configuration Files** - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - `config/development.toml` - ... and 1 more files **3. Other** - `crates/router/src/services/authentication.rs` **Code Patterns Applied:** - Extend existing types with new fields (2 changes) **Detailed Identifier Changes:** Commit 10a43370: Files to modify: **crates/router/src/services/authentication.rs** Modify existing code
{"pr_number": 6936, "pr_title": "fix(router): populate `profile_id` in for the HeaderAuth of v1", "merged_at": "2024-12-26T10:49:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"], "other": ["crates/router/src/services/authentication.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat: add hyperswitch ai chats table ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> - Store the user query and response from the ai service for the analysis. - Allow the api only for internal user ### Additional Changes This pull request introduces support for encrypted chat conversations and adds database models and APIs for storing and retrieving chat interactions. The changes span configuration, API models, database schema, and core logic to enable secure chat storage and querying, with proper secret management for encryption keys. **Chat encryption and configuration:** * Added `encryption_key` to `[chat]` sections in all config files and updated `ChatSettings` to use a secret for the encryption key, with secret management integration for secure handling. **Chat API model extensions:** * Added new API models for listing chat conversations (`ChatListRequest`, `ChatConversation`, `ChatListResponse`) **Database schema and models for chat interactions:** * Introduced `hyperswitch_ai_interaction` table and corresponding Rust models for storing encrypted chat queries and **Core chat logic improvements:** * Enhanced chat workflow to fetch role information, set entity type, and use the decrypted chat encryption key for secure communication with the AI service. **Run this as part of migration** 1.Manual Partition creation for next two year. 2.Creates partitions for each 3-month range 3.Add calendar event to re run this after two year. ``` DO $$ DECLARE start_date date; end_date date; i int; partition_name text; BEGIN -- Get start date as the beginning of the current quarter start_date := date_trunc('quarter', current_date)::date; -- Create 8 quarterly partitions (2 years) FOR i IN 1..8 LOOP end_date := (start_date + interval '3 month')::date; partition_name := format( 'hyperswitch_ai_interaction_%s_q%s', to_char(start_date, 'YYYY'), extract(quarter from start_date) ); EXECUTE format( 'CREATE TABLE IF NOT EXISTS %I PARTITION OF hyperswitch_ai_interaction FOR VALUES FROM (%L) TO (%L)', partition_name, start_date, end_date ); start_date := end_date; END LOOP; END$$; ``` **General enhancements and constants:** * Added default limit and offset constants for list operations, improving pagination support for chat conversation queries. - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding 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 #8847 ## How did you test it? Hitting AI service, should store information in DB ``` curl --location 'http://localhost:8080/chat/ai/data' \ --header 'x-feature: integ-custom' \ --header 'x-chat-session-id: chat-dop' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer JWT' \ --data '{ "message": "total count of payments" }' ``` Can check hyperswitch AI interaction table for it. Internal roles can see the list of interactions for the given merchant id List ``` curl --location 'http://localhost:8080/chat/ai/list?merchant_id=merchant_id' \ --header 'Authorization: Bearer JWT' \ --data '' ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/chat.rs` - `crates/api_models/src/events/chat.rs` **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/hyperswitch_ai_interaction.rs` - `crates/diesel_models/src/lib.rs` - `crates/diesel_models/src/query.rs` - ... and 4 more files **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/chat.rs` **4. Core Business Logic** - `crates/router/src/core/chat.rs` - `crates/router/src/core/errors/chat.rs` **5. Type Definitions** - `crates/router/src/types/storage.rs` - `crates/router/src/types/storage/hyperswitch_ai_interaction.rs` - `crates/router_env/src/logger/types.rs` **6. Utils** - `crates/common_utils/src/consts.rs` - `crates/router/src/routes/lock_utils.rs` - `crates/router/src/utils.rs` - ... and 1 more files **7. Tests** - `loadtest/config/development.toml` **8. Configuration Files** - `config/config.example.toml` - `config/deployments/env_specific.toml` - `config/development.toml` - ... and 3 more files **9. Other** - `crates/router/src/db.rs` - `crates/router/src/db/hyperswitch_ai_interaction.rs` - `crates/router/src/db/kafka_store.rs` - ... and 5 more files **Code Patterns Applied:** - Define new data structures (5 changes) - Implement new functions (15 changes) - Extend existing types with new fields (119 changes) - Add conditional logic for feature flags or filtering (3 changes) - Modify database queries (2 changes) **Detailed Identifier Changes:** Commit 8ed3f7db: Files to modify: **crates/api_models/src/chat.rs** Add: - struct: pub::ChatListRequest - struct: pub::ChatConversation - struct: pub::ChatListResponse **crates/api_models/src/events/chat.rs** Modify existing code **crates/common_utils/src/consts.rs** Modify existing code **crates/diesel_models/src/hyperswitch_ai_interaction.rs** Add: - struct: pub::HyperswitchAiInteraction - struct: pub::HyperswitchAiInteractionNew **crates/diesel_models/src/lib.rs** Add: - mod: pub::hyperswitch_ai_interaction **crates/diesel_models/src/query.rs** Add: - mod: pub::hyperswitch_ai_interaction **crates/diesel_models/src/query/hyperswitch_ai_interaction.rs** Add: - function: pub::insert - function: pub::filter_by_optional_merchant_id - impl: impl HyperswitchAiInteractionNew - impl: impl HyperswitchAiInteraction **crates/diesel_models/src/query/utils.rs** Add: - function: private::get_local_unique_key - impl: impl CompositeKey for <schema::hyperswitch_ai_interaction::table as diesel::Table>::PrimaryKey **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/hyperswitch_domain_models/src/chat.rs** Modify existing code **crates/router/src/configs/secrets_transformers.rs** Add: - function: private::convert_to_raw_secret - impl: impl SecretsHandler for settings::ChatSettings **crates/router/src/configs/settings.rs** Modify existing code **crates/router/src/core/chat.rs** Modify existing code **crates/router/src/core/errors/chat.rs** Modify existing code **crates/router/src/db.rs** Add: - mod: pub::hyperswitch_ai_interaction **crates/router/src/db/hyperswitch_ai_interaction.rs** Add: - function: private::insert_hyperswitch_ai_interaction - function: private::list_hyperswitch_ai_interactions - function: private::insert_hyperswitch_ai_interaction - function: private::list_hyperswitch_ai_interactions - trait: pub::HyperswitchAiInteractionInterface - impl: impl HyperswitchAiInteractionInterface for Store - impl: impl HyperswitchAiInteractionInterface for MockDb **crates/router/src/db/kafka_store.rs** Add: - function: private::insert_hyperswitch_ai_interaction - function: private::list_hyperswitch_ai_interactions - impl: impl HyperswitchAiInteractionInterface for KafkaStore **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/chat.rs** Add: - function: pub::get_all_conversations **crates/router/src/routes/lock_utils.rs** Modify existing code **crates/router/src/types/storage.rs** Add: - mod: pub::hyperswitch_ai_interaction **crates/router/src/types/storage/hyperswitch_ai_interaction.rs** Modify existing code **crates/router/src/utils.rs** Add: - mod: pub::chat **crates/router/src/utils/chat.rs** Add: - function: pub::construct_hyperswitch_ai_interaction **crates/router_env/src/logger/types.rs** Modify existing code **crates/storage_impl/src/mock_db.rs** Modify existing code
{"pr_number": 8831, "pr_title": "feat: add hyperswitch ai chats table", "merged_at": "2025-09-16T09:14:36Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/chat.rs", "crates/api_models/src/events/chat.rs"], "database": ["crates/diesel_models/src/hyperswitch_ai_interaction.rs", "crates/diesel_models/src/lib.rs", "crates/diesel_models/src/query.rs", "crates/diesel_models/src/query/hyperswitch_ai_interaction.rs", "crates/diesel_models/src/query/utils.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/chat.rs"], "core_business": ["crates/router/src/core/chat.rs", "crates/router/src/core/errors/chat.rs"], "types": ["crates/router/src/types/storage.rs", "crates/router/src/types/storage/hyperswitch_ai_interaction.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/consts.rs", "crates/router/src/routes/lock_utils.rs", "crates/router/src/utils.rs", "crates/router/src/utils/chat.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/secrets_transformers.rs", "crates/router/src/configs/settings.rs"], "other": ["crates/router/src/db.rs", "crates/router/src/db/hyperswitch_ai_interaction.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/chat.rs", "crates/storage_impl/src/mock_db.rs", "migrations/2025-07-21-120614_add_table_for_hyperswitch_ai_interactions/down.sql", "migrations/2025-07-21-120614_add_table_for_hyperswitch_ai_interactions/up.sql"]}, "change_types": {"structs_added": 5, "functions_added": 15, "fields_added": 119, "imports_added": 31, "conditionals_added": 3, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(migration): perform card validation only for allowed payment methods ## 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 updates the migration flow around card validation to skip card expiry validation for `PayPal` and `SamsungPay` - these payment methods do not have the linked card's expiry 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 Allows migration of `PayPal` and `SamsungPay` PSP tokens. ## How did you test it? Performing PayPal migration without specifying card details. <details> <summary>Run migration</summary> cURL curl --location --request POST 'http://localhost:8080/payment_methods/migrate-batch' \ --header 'api-key: test_admin' \ --form 'merchant_id="merchant_1756723897"' \ --form 'merchant_connector_ids="mca_0HKNtxio5DvoSuELXkRm"' \ --form 'file=@"sample.csv"' Response [ { "line_number": 40, "payment_method_id": "pm_cy7Xo2En9vh9vqZydXO2", "payment_method": "wallet", "payment_method_type": "paypal", "customer_id": "ef57377bf54cd4ff3bfc26e1e60dbebf", "migration_status": "Success", "card_number_masked": "", "card_migrated": null, "network_token_migrated": true, "connector_mandate_details_migrated": true, "network_transaction_id_migrated": null }, { "line_number": 41, "payment_method_id": "pm_GPmSXeoPxhEtAxSC4uDD", "payment_method": "wallet", "payment_method_type": "paypal", "customer_id": "pet-5cda4ebb25e102e30043f14425915b58", "migration_status": "Success", "card_number_masked": "", "card_migrated": null, "network_token_migrated": true, "connector_mandate_details_migrated": true, "network_transaction_id_migrated": null }, { "line_number": 42, "payment_method_id": "pm_gB4DmNbBNqWsfKru9ZkE", "payment_method": "wallet", "payment_method_type": "paypal", "customer_id": "088e36d3b9ef09533b77d086497a8dc4", "migration_status": "Success", "card_number_masked": "", "card_migrated": null, "network_token_migrated": true, "connector_mandate_details_migrated": true, "network_transaction_id_migrated": 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. Core Business Logic** - `crates/payment_methods/src/core/migration/payment_methods.rs` **Code Patterns Applied:** - Extend existing types with new fields (1 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 04578801: Files to modify: **crates/payment_methods/src/core/migration/payment_methods.rs** Modify existing code
{"pr_number": 9131, "pr_title": "feat(migration): perform card validation only for allowed payment methods", "merged_at": "2025-09-03T13:04:56Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/payment_methods/src/core/migration/payment_methods.rs"]}, "change_types": {"fields_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
ci(cypress): reduce cargo build jobs to 3 ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [x] CI/CD ## Description <!-- Describe your changes in detail --> This PR reduces build jobs to 3 to see if it helps pass Cypress CI checks ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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)? --> CI should work ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Tests** - `.github/workflows/cypress-tests-runner.yml` **Code Patterns Applied:** - Extend existing types with new fields (1 changes)
{"pr_number": 6453, "pr_title": "ci(cypress): reduce cargo build jobs to 3", "merged_at": "2024-10-28T15:05:23Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": [".github/workflows/cypress-tests-runner.yml"]}, "change_types": {"fields_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
fix(payout): send latest status in outgoing webhook notifications during IncomingWebhook flow ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description This PR fixes the state update for `payout_attempt` where latest status resides. This fixes the bug mentioned in https://github.com/juspay/hyperswitch/issues/9278 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding 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 will allow the outgoing webhooks for payouts to receive the right status. ## How did you test it? <details> <summary>1. Create a successful payout</summary> cURL curl --location --request POST 'http://localhost:8080/payouts/create' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_o0Eo3tL2RDhcX3AzI9w5G5IguQslT7UDDYHne7W6QqjdBbQboNBTbHhW2ZuHFLIJ' \ --data-raw '{"amount":100,"currency":"EUR","profile_id":"pro_BAzWgR1xTKZGtzWKCUea","customer":{"id":"cus_yvCM0YPCw76nC5Dj2Kwm","email":"new_cust@example.com","name":"John Doe","phone":"999999999","phone_country_code":"+65"},"connector":["adyen"],"description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111 1111 1111 1111","expiry_month":"03","expiry_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"US","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"}},"entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}' Response {"payout_id":"payout_WIaDYW9nnqsiI50upbcg","merchant_id":"merchant_1756987500","merchant_order_reference_id":null,"amount":100,"currency":"EUR","connector":"adyen","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":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"auto_fulfill":true,"customer_id":"cus_yvCM0YPCw76nC5Dj2Kwm","customer":{"id":"cus_yvCM0YPCw76nC5Dj2Kwm","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_WIaDYW9nnqsiI50upbcg_secret_MBhR8Qp64emDZ3D0xsPq","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_B5g4wL5oJ6RGqSAdcsS5","status":"success","error_message":null,"error_code":null,"profile_id":"pro_BAzWgR1xTKZGtzWKCUea","created":"2025-09-04T12:22:28.359Z","connector_transaction_id":"TTGSSJV2MFZKTRV5","priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_8C3jiwCwp3fCfXMVcv6a"} </details> <details> <summary>2. Wait for incoming webhooks from Adyen and look at the status in outgoing webhook</summary> Expectation - for `Adyen` the incoming webhook received for payout will be mapped to `initiated` - updating the payout status to `initiated` - the latest status (`initiated` in this case) should be propagated in the outgoing webhook. HS outgoing webhook request {"merchant_id":"merchant_1756987500","event_id":"evt_019914af3ba678f1af65188c5722d96a","event_type":"payout_initiated","content":{"type":"payout_details","object":{"payout_id":"payout_WIaDYW9nnqsiI50upbcg","merchant_id":"merchant_1756987500","merchant_order_reference_id":null,"amount":100,"currency":"EUR","connector":"adyen","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":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"auto_fulfill":true,"customer_id":"cus_yvCM0YPCw76nC5Dj2Kwm","customer":{"id":"cus_yvCM0YPCw76nC5Dj2Kwm","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_WIaDYW9nnqsiI50upbcg_secret_MBhR8Qp64emDZ3D0xsPq","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_B5g4wL5oJ6RGqSAdcsS5","status":"initiated","error_message":null,"error_code":null,"profile_id":"pro_BAzWgR1xTKZGtzWKCUea","created":"2025-09-04T12:22:28.359Z","connector_transaction_id":"TTGSSJV2MFZKTRV5","priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_8C3jiwCwp3fCfXMVcv6a"}},"timestamp":"2025-09-04T12:24:12.454Z"} </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/webhooks/incoming.rs` **Code Patterns Applied:** - Extend existing types with new fields (2 changes) **Detailed Identifier Changes:** Commit 2fe6cdd5: Files to modify: **crates/router/src/core/webhooks/incoming.rs** Modify existing code
{"pr_number": 9283, "pr_title": "fix(payout): send latest status in outgoing webhook notifications during IncomingWebhook flow", "merged_at": "2025-09-07T14:38:56Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "merchant", "order"]}, "hierarchy": {"core_business": ["crates/router/src/core/webhooks/incoming.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
chore(ci): update postman ci credentials ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [x] Dependency updates - [ ] Documentation - [x] CI/CD ## Description <!-- Describe your changes in detail --> The S3 Source File Name in Postman Collection Runner Workflow has been changed because the Connector Auth File has been updated. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> The connector auth file has been updated, so updating the S3 source file name is required. ## How can we test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Stripe Test cases on Jenkins should pass. ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Configuration Files** - `.github/workflows/postman-collection-runner.yml` **Code Patterns Applied:** - Extend existing types with new fields (1 changes)
{"pr_number": 7637, "pr_title": "chore(ci): update postman ci credentials", "merged_at": "2025-03-27T12:12:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"config": [".github/workflows/postman-collection-runner.yml"]}, "change_types": {"fields_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
feat(analytics): modified authentication queries and added generate report for authentications ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR modifies authentication queries to improve the way we distinguish between authentication flows. Previously, `trans_status` was used for this purpose, but it has now been replaced with `authentication_type`, which more explicitly differentiates between **frictionless flow** and **challenge flow**. Additionally, this PR introduces support for **authentication report generation**, similar to the existing reports for payments, refunds, and disputes. ## Key Changes ### 1. **Updated Authentication Queries** - Replaced `trans_status` with `authentication_type` in authentication queries. - Ensures a clearer distinction between **frictionless flow** and **challenge flow** during authentication. ### 2. **Added Authentication Report Generation** - Introduced report generation for **authentications**, aligning with the existing reporting structure for `payments`, 'refunds` and `disputes`. ### Routes for the reporting service: - **Org level report**: `/analytics/v1/org/report/authentications` - **Merchant level report**: `/analytics/v1/merchant/report/authentications` - **Profile level report**: `/analytics/v1/profile/report/authentications` This PR resolves the data correctness issue raised here: [https://github.com/juspay/hyperswitch-cloud/issues/8727](https://github.com/juspay/hyperswitch-cloud/issues/8727) ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> - Using `authentication_type` instead of `trans_status` improves accuracy in flow differentiation. - Authentication reporting enables better tracking and analytics for user authentication flows. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Can check the test cases from the `How did you test it?` section from these 2 PRs: - [https://github.com/juspay/hyperswitch/pull/7451](https://github.com/juspay/hyperswitch/pull/7451) - [https://github.com/juspay/hyperswitch/pull/7433](https://github.com/juspay/hyperswitch/pull/7433) **Note**: The Response body should be validated from this PR for all the metrics: [https://github.com/juspay/hyperswitch/pull/7451](https://github.com/juspay/hyperswitch/pull/7451) Curl for Authentication Report: ```bash curl --location 'http://localhost:8080/analytics/v1/org/report/authentications' \ --header 'Accept: */*' \ --header 'Accept-Language: en-US,en;q=0.9' \ --header 'Connection: keep-alive' \ --header 'Content-Type: application/json' \ --header 'Origin: http://localhost:9000' \ --header 'Referer: http://localhost:9000/' \ --header 'Sec-Fetch-Dest: empty' \ --header 'Sec-Fetch-Mode: cors' \ --header 'Sec-Fetch-Site: same-site' \ --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \ --header 'api-key: test_admin' \ --header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNmNkZTA0NzYtMTFlMi00NGE5LTlkMjUtOTA5M2QzNDQwZjhlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzM1MDQxMjkzIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczNjYwNDY3OCwib3JnX2lkIjoib3JnX2pwanI5TkFEWlhqSENNYTU5MmF3IiwicHJvZmlsZV9pZCI6InByb19QRHUydVA3aWNuM2lXY0I3V0VVSSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.7_cuWH5XygVrtIDsbh7nusrjGcQ3jbcaPKhIOo3EbM8' \ --header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \ --header 'sec-ch-ua-mobile: ?0' \ --header 'sec-ch-ua-platform: "macOS"' \ --header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDU1MmY3YzctMmNjZC00ZmU3LThkM2ItY2U1M2ExMTJhZTIwIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxNjk5OTg4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTg3MjgwMiwib3JnX2lkIjoib3JnX2hQamlOektmbmV6NG8wNjdVVlFwIiwicHJvZmlsZV9pZCI6InByb19kWWJpUm9NVkFkNDAwWEh6R3hYTiIsInRlbmFudF9pZCI6InB1YmxpYyJ9.1bsDkYwwk8FtWrDEYdMIsjmH7DqWOVejX2GVseu68ZQ' \ --data-raw '{ "timeRange": { "startTime": "2025-01-08T13:56:15Z", "endTime": "2025-01-09T13:56:15.277Z" }, "emails": [ "sandeep.kumar@juspay.in" ] }' ``` Queries: #### Authentication Attempt Count: ```bash SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND authentication_status IN ('success', 'failed') AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1' ``` #### Authentication Count: ```bash SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1' ``` #### Authentication Success Count: ```bash SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND authentication_status = 'success' AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1' ``` #### Challenge Attempt Count: ```bash SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND authentication_type = 'challenge' AND authentication_status in ('success', 'failed') AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1' ``` #### Challenge Flow Count: ```bash SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND authentication_type = 'challenge' AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1' ``` #### Challenge Success Count: ```bash SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND authentication_status = 'success' AND authentication_type = 'challenge' AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1' ``` #### Frictionless Flow Count: ```bash SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND authentication_type = 'frictionless' AND created_at >= '1738402351' AND created_at <= '1740216751' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1' ``` #### Frictionless Success Count: ```bash SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND authentication_type = 'frictionless' AND authentication_status = 'success' AND created_at >= '1738402351' AND created_at <= '1740216751' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1' ``` #### Authentication Funnel: (2nd step): ```bash SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND trans_status IS NOT NULL AND created_at >= '1738434600' AND created_at <= '1740734520' ) ``` #### Authentication Funnel: (3rd step): ```bash SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND trans_status IS NOT NULL AND authentication_status IN ('success', 'failed') AND created_at >= '1738434600' AND created_at <= '1740734520' ) ``` #### Authentication Error Message: ```bash SELECT error_message, sum(sign_flag) AS count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1741712401' AND authentication_status = 'failed' AND error_message IS NOT NULL AND created_at >= '1738434600' AND created_at <= '1740734520' ) GROUP BY error_message HAVING sum(sign_flag) >= '1' ORDER BY count desc ``` Sample Output: You should be able to receive an email with the authentication report to the email specified in the request. Similarly, just replace `org` with `merchant` and `profile` in the URL for the corresponding authentication report at the merchant and profile level. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/analytics/auth_events.rs` - `crates/api_models/src/analytics/sdk_events.rs` **2. Database Layer (Queries & Schema)** - `crates/analytics/src/query.rs` **3. Core Business Logic** - `crates/analytics/src/auth_events/core.rs` **4. Other** - `crates/analytics/src/auth_events/filters.rs` - `crates/analytics/src/auth_events/metrics.rs` - `crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs` - ... and 12 more files **Code Patterns Applied:** - Define new data structures (1 changes) - Implement new functions (3 changes) - Extend existing types with new fields (36 changes) - Add conditional logic for feature flags or filtering (1 changes) - Modify database queries (1 changes) **Detailed Identifier Changes:** Commit 9683b2a8: Files to modify: **crates/analytics/src/auth_events/core.rs** Modify existing code **crates/analytics/src/auth_events/filters.rs** Modify existing code **crates/analytics/src/auth_events/metrics.rs** Modify existing code **crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs** Modify existing code **crates/analytics/src/auth_events/metrics/authentication_count.rs** Modify existing code **crates/analytics/src/auth_events/metrics/authentication_error_message.rs** Modify existing code **crates/analytics/src/auth_events/metrics/authentication_funnel.rs** Modify existing code **crates/analytics/src/auth_events/metrics/authentication_success_count.rs** Modify existing code **crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs** Modify existing code **crates/analytics/src/auth_events/metrics/challenge_flow_count.rs** Modify existing code **crates/analytics/src/auth_events/metrics/challenge_success_count.rs** Modify existing code **crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs** Modify existing code **crates/analytics/src/auth_events/metrics/frictionless_success_count.rs** Modify existing code **crates/analytics/src/lib.rs** Modify existing code **crates/analytics/src/query.rs** Modify existing code **crates/analytics/src/sqlx.rs** Modify existing code **crates/api_models/src/analytics/auth_events.rs** Add: - struct: pub::AuthenticationFunnel **crates/api_models/src/analytics/sdk_events.rs** Modify existing code **crates/router/src/analytics.rs** Add: - function: pub::generate_merchant_authentication_report - function: pub::generate_org_authentication_report - function: pub::generate_profile_authentication_report
{"pr_number": 7483, "pr_title": "feat(analytics): modified authentication queries and added generate report for authentications", "merged_at": "2025-03-12T11:35:14Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics/auth_events.rs", "crates/api_models/src/analytics/sdk_events.rs"], "database": ["crates/analytics/src/query.rs"], "core_business": ["crates/analytics/src/auth_events/core.rs"], "other": ["crates/analytics/src/auth_events/filters.rs", "crates/analytics/src/auth_events/metrics.rs", "crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs", "crates/analytics/src/auth_events/metrics/authentication_count.rs", "crates/analytics/src/auth_events/metrics/authentication_error_message.rs", "crates/analytics/src/auth_events/metrics/authentication_funnel.rs", "crates/analytics/src/auth_events/metrics/authentication_success_count.rs", "crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs", "crates/analytics/src/auth_events/metrics/challenge_flow_count.rs", "crates/analytics/src/auth_events/metrics/challenge_success_count.rs", "crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs", "crates/analytics/src/auth_events/metrics/frictionless_success_count.rs", "crates/analytics/src/lib.rs", "crates/analytics/src/sqlx.rs", "crates/router/src/analytics.rs"]}, "change_types": {"structs_added": 1, "functions_added": 3, "fields_added": 36, "imports_added": 9, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat: Add amount, currency and email to paze session response ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Add amount, currency and email to paze session 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). --> https://github.com/juspay/hyperswitch/issues/6410 ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Session Request Paze: ``` curl --location 'http://localhost:8080/payments/session_tokens' \ --header 'Content-Type: application/json' \ --header 'api-key: API_KEY_HERE' \ --data '{ "payment_id": "pay_Omdaxo733MC34fLvCfYw", "wallets": [], "client_secret": "pay_Omdaxo733MC34fLvCfYw_secret_ak2iLU1A5E6PK6XqqY6h" }' ``` Response: ``` { "payment_id": "pay_Omdaxo733MC34fLvCfYw", "client_secret": "pay_Omdaxo733MC34fLvCfYw_secret_ak2iLU1A5E6PK6XqqY6h", "session_token": [ { "wallet_name": "paze", "client_id": "HIDDEN", "client_name": "HIDDEN", "client_profile_id": "HIDDEN", "transaction_currency_code": "USD", "transaction_amount": "12.34", "email_address": "guest@example.com" } ] } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/payments.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/router_request_types.rs` **3. Core Business Logic** - `crates/router/src/core/payments/flows/session_flow.rs` - `crates/router/src/core/payments/transformers.rs` **4. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` **Code Patterns Applied:** - Extend existing types with new fields (8 changes) **Detailed Identifier Changes:** Commit a3ea62f8: Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_request_types.rs** Modify existing code **crates/router/src/core/payments/flows/session_flow.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code
{"pr_number": 6412, "pr_title": "feat: Add amount, currency and email to paze session response", "merged_at": "2024-10-25T13:52:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "session", "token"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payments/flows/session_flow.rs", "crates/router/src/core/payments/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"fields_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [XENDIT] Added Integrity Check for Authorize, Capture, Refund & RSync flows ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description In this PR, we have added integrity checks for Authorize, Capture, Refund and RSync flows for Xendit Connector Also, moved the integrity functions from `crates/router/src/connector/utils.rs` to `crates/hyperswitch_connectors/src/utils.rs`. Thereby also changing the imports in `Stripe.rs`. What is an integrity check? A scenario where there is a discrepancy between the amount sent in the request and the amount received from the connector, which is checked during response handling. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context This Pr holds the payment in a non-terminal state incase there is any data discrepancy in the above flows. ## How did you test it? Case 1: AUTOMATIC Capture Do a Payments - Create Request: ``` { "amount": 651200, "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": "4000000000001091", "card_exp_month": "12", "card_exp_year": "27", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "billing": { "phone": { "number": "8056594427", "country_code": "+91" }, "email": "guest@example.com" } } ``` Now after completing the 3DS authentication in the browser, Do a PSync on the payment_id you received in the response PSync cURL : ``` curl --location 'http://localhost:8080/payments/pay_ZiImJRPcy4lBxikZXPZW?force_sync=true&expand_captures=true&expand_attempts=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_iaxB63qB728km9UmcoRYaRDwLvz0ZMN9sEvIEZ3shfdxdqK0qwESalvaliyfhzVL' \ --header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' ``` Response: ``` { "error": { "type": "api", "message": "Integrity Check Failed! as data mismatched for amount expected 651200 but found 651300", "code": "IE_00", "connector_transaction_id": "pr-dbc3c6aa-6734-47c6-b198-c88ca69173a0" } } ``` Why this behaviour? I have hardcoded the amount in the code and the amount i hardcoded is more than the amount in the request causing the payment to fail. Case 2: MANUAL Capture Do a payments create Request: ``` { "amount": 651200, "currency": "IDR", "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": "4000000000001091", "card_exp_month": "12", "card_exp_year": "27", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "billing": { "phone": { "number": "8056594427", "country_code": "+91" }, "email": "guest@example.com" } } ``` Now do a force PSync after the 3DS authentication is done in the web browser and you got the payment_id PSync cURL : ``` curl --location 'http://localhost:8080/payments/pay_TsnuX8XgHwIdYQWYBEIO?force_sync=true&expand_captures=true&expand_attempts=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_iaxB63qB728km9UmcoRYaRDwLvz0ZMN9sEvIEZ3shfdxdqK0qwESalvaliyfhzVL' \ --header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' ``` Response : ``` { "error": { "type": "api", "message": "Integrity Check Failed! as data mismatched for amount expected 651200 but found 651300", "code": "IE_00", "connector_transaction_id": "pr-a452cba4-c24f-43a1-9e36-9e7bd066e448" } } ``` Why this behaviour? I have hardcoded the amount in code for it to fail Case 3: Refunds Do a payments create and this time donot hardcode anything in the code for Payments Create ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_iaxB63qB728km9UmcoRYaRDwLvz0ZMN9sEvIEZ3shfdxdqK0qwESalvaliyfhzVL' \ --header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \ --data-raw '{ "amount": 651200, "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": "4000000000001091", "card_exp_month": "12", "card_exp_year": "27", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "billing": { "phone": { "number": "8056594427", "country_code": "+91" }, "email": "guest@example.com" } }' ``` Now do a force PSync after the 3DS authentication is completed in the web browser and you have the payment_id PSync cURL : ``` curl --location 'http://localhost:8080/payments/pay_PUy3X0USglGXRhUZwa6y?force_sync=true&expand_captures=true&expand_attempts=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_iaxB63qB728km9UmcoRYaRDwLvz0ZMN9sEvIEZ3shfdxdqK0qwESalvaliyfhzVL' \ --header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' ``` Response: ``` { "payment_id": "pay_PUy3X0USglGXRhUZwa6y", "merchant_id": "merchant_1747372268", "status": "succeeded", "amount": 651200, "net_amount": 651200, "shipping_cost": null, "amount_capturable": 0, "amount_received": 651200, "connector": "xendit", "client_secret": "pay_PUy3X0USglGXRhUZwa6y_secret_nMwSH8e7SAzjh0Yq253O", "created": "2025-05-16T05:59:21.548Z", "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, "attempts": [ { "attempt_id": "pay_PUy3X0USglGXRhUZwa6y_1", "status": "pending", "amount": 651200, "order_tax_amount": null, "currency": "IDR", "connector": "xendit", "error_message": null, "payment_method": "card", "connector_transaction_id": "pr-6899118b-61ed-4eaa-85ed-c19ebafa0517", "capture_method": "automatic", "authentication_type": "three_ds", "created_at": "2025-05-16T05:59:21.548Z", "modified_at": "2025-05-16T05:59:36.701Z", "cancellation_reason": null, "mandate_id": null, "error_code": null, "payment_token": null, "connector_metadata": null, "payment_experience": null, "payment_method_type": "credit", "reference_id": "dd99b9db-2807-4393-a160-18ac5e2598b3", "unified_code": null, "unified_message": null, "client_source": null, "client_version": null } ], "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1091", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "400000", "card_extended_bin": null, "card_exp_month": "12", "card_exp_year": "27", "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": "guest@example.com" }, "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": "pr-6899118b-61ed-4eaa-85ed-c19ebafa0517", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "dd99b9db-2807-4393-a160-18ac5e2598b3", "payment_link": null, "profile_id": "pro_p9XcyZ68jQWhZVhjDfvA", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_Yrd0AB3I63wrPAxClDXT", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-05-16T06:14:21.548Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-05-16T05:59:45.207Z", "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 } ``` Now do a Refunds Create and in postman send an amount which is lower than the Captured Amount Refunds Create cURL : ``` curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_iaxB63qB728km9UmcoRYaRDwLvz0ZMN9sEvIEZ3shfdxdqK0qwESalvaliyfhzVL' \ --header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \ --data '{ "payment_id": "pay_PUy3X0USglGXRhUZwa6y", "amount": 651100, "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response: ``` { "refund_id": "ref_UL8G03huxgVfg85dBBpj", "payment_id": "pay_PUy3X0USglGXRhUZwa6y", "amount": 651100, "currency": "IDR", "status": "review", "reason": "Customer returned product", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "error_message": "Integrity Check Failed! as data mismatched for fields refund_amount expected 651100 but found 651200", "error_code": "IE", "unified_code": null, "unified_message": null, "created_at": "2025-05-16T05:59:52.764Z", "updated_at": "2025-05-16T05:59:54.555Z", "connector": "xendit", "profile_id": "pro_p9XcyZ68jQWhZVhjDfvA", "merchant_connector_id": "mca_Yrd0AB3I63wrPAxClDXT", "split_refunds": null, "issuer_error_code": null, "issuer_error_message": null } ``` Why this behaviour? I have hardcoded the amount to be refunded in the code as the same as the captured amount but in postman the amount i have sent is less than that, causing the payments to fail (intentionally) ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/xendit.rs` - `crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs` - `crates/hyperswitch_connectors/src/utils.rs` - ... and 1 more files **Code Patterns Applied:** - Implement new functions (4 changes) - Extend existing types with new fields (31 changes) **Detailed Identifier Changes:** Commit caa07235: Files to modify: **crates/hyperswitch_connectors/src/connectors/xendit.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs** Modify existing code **crates/hyperswitch_connectors/src/utils.rs** Remove: - function: pub::get_refund_integrity_object - function: pub::get_capture_integrity_object - function: pub::get_sync_integrity_object - function: pub::get_authorise_integrity_object Add: - 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/connector/utils.rs** Modify existing code
{"pr_number": 8049, "pr_title": "feat(connector): [XENDIT] Added Integrity Check for Authorize, Capture, Refund & RSync flows", "merged_at": "2025-05-23T09:53:17Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/xendit.rs", "crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/utils.rs"]}, "change_types": {"functions_added": 4, "fields_added": 31, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(reveue_recovery): Add support for multiple retry algorithms in revenue recovery workflow ## 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 support for updating the retry Algorithm from Monitoring to Smart , once the threshold is reached - It also adds support in the process tracker workflow for revenue recovery , to consume schedule time for retry based on different retry algorithms ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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? - Create a MA and a Billing connector - The retry_Algorithm type in business profile will be switched to Monitoring - Once the time in the revenue_recovery_config is surpassed , the `retry_Algorithm type` field in business profile will be updated to Cascading ![Screenshot 2025-05-15 at 7 45 53 PM](https://github.com/user-attachments/assets/24d3349f-9177-46f6-ba55-8e284e641458) ## 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. Database Layer (Queries & Schema)** - `crates/diesel_models/src/business_profile.rs` **2. Core Business Logic** - `crates/router/src/core/admin.rs` - `crates/router/src/core/errors.rs` - `crates/router/src/core/files.rs` - ... and 3 more files **3. Type Definitions** - `crates/router/src/types/storage/revenue_recovery.rs` **4. Tests** - `config/deployments/integration_test.toml` **5. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 4 more files **6. Other** - `crates/common_enums/src/enums.rs` - `crates/router/src/workflows/revenue_recovery.rs` **Code Patterns Applied:** - Define new data structures (1 changes) - Implement new functions (4 changes) - Extend existing types with new fields (24 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 151b57fa: Files to modify: **crates/common_enums/src/enums.rs** Modify existing code **crates/diesel_models/src/business_profile.rs** Add: - function: pub::has_exceeded_monitoring_threshold - impl: impl RevenueRecoveryAlgorithmData **crates/router/src/configs/secrets_transformers.rs** Modify existing code **crates/router/src/configs/settings.rs** Modify existing code **crates/router/src/core/admin.rs** Add: - function: pub::update_revenue_recovery_algorithm_under_profile **crates/router/src/core/errors.rs** Modify existing code **crates/router/src/core/files.rs** Modify existing code **crates/router/src/core/revenue_recovery.rs** Modify existing code **crates/router/src/core/revenue_recovery/types.rs** Modify existing code **crates/router/src/core/webhooks/recovery_incoming.rs** Add: - function: private::handle_monitoring_threshold **crates/router/src/types/storage/revenue_recovery.rs** Add: - function: pub::get_schedule_time_based_on_retry_type - struct: pub::RevenueRecoverySettings - impl: impl RevenueRecoveryPaymentData **crates/router/src/workflows/revenue_recovery.rs** Modify existing code
{"pr_number": 7915, "pr_title": "feat(reveue_recovery): Add support for multiple retry algorithms in revenue recovery workflow", "merged_at": "2025-05-20T13:04:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector"]}, "hierarchy": {"database": ["crates/diesel_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/errors.rs", "crates/router/src/core/files.rs", "crates/router/src/core/revenue_recovery.rs", "crates/router/src/core/revenue_recovery/types.rs", "crates/router/src/core/webhooks/recovery_incoming.rs"], "types": ["crates/router/src/types/storage/revenue_recovery.rs"], "tests": ["config/deployments/integration_test.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/secrets_transformers.rs", "crates/router/src/configs/settings.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/workflows/revenue_recovery.rs"]}, "change_types": {"structs_added": 1, "functions_added": 4, "fields_added": 24, "imports_added": 7, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [cybersource] add changes for field CybersourceConsumerAuthInformation ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [X] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Context - Cybersource payments via Netcetera are failing for a France based acquirer in prod, the PR provides fix for the same by introducing field **_consumerAuthenticationInformation. effectiveAuthenticationType_** and making sure **_consumerAuthenticationInformation.specificationVersion** is sent. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies 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 <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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 for field effective_authentication_type and specification_version** ### Step 1 - Call /payments **Curl** `curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-feature: integ-custom' \ --header 'api-key: dev_TSUxfiSwiAelCPTr9xN2ValUdd1fvmeYg0AtMUwdJukRkTlCpHL9p2IWxn6fouYl' \ --data-raw '{ "amount": 2540, "currency": "USD", "profile_id": "pro_aKVBsBqyTIq2T1UIaapY", "confirm": true, "amount_to_capture": 2540, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "StripeCustomer", "email": "abcdef123@gmail.com", "name": "John Doe", "phone": "999999999", "request_external_three_ds_authentication": true, "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://google.com", "setup_future_usage": "on_session", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "127.0.0.1" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" } }, "routing": { "type": "single", "data": "nmi" }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4000000000002370", "card_exp_month": "08", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "999" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" } } }'` <img width="837" height="743" alt="Screenshot 2025-07-29 at 6 40 54 PM" src="https://github.com/user-attachments/assets/5810eda7-6dcf-474a-813b-eab7f2fb3e28" /> ### Step 2- Call /3ds/authentication via Netcetera **Curl** `curl --location 'http://localhost:8080/payments/pay_1tQlG51BwoiUpLE3YKBV/3ds/authentication' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_8891a001315d40d0a26d1028ad51fe0b' \ --data '{ "client_secret": "pay_1tQlG51BwoiUpLE3YKBV_secret_EqDy0WeEHEfkkOjUd9R0", "device_channel": "BRW", "threeds_method_comp_ind": "Y" }'` <img width="1035" height="782" alt="Screenshot 2025-07-29 at 6 41 14 PM" src="https://github.com/user-attachments/assets/0b683f45-472f-47fe-9ef8-84a8db019c3b" /> ### Step 3- Call /authorize via Cybersource `curl --location --request POST 'http://localhost:8080/payments/pay_1tQlG51BwoiUpLE3YKBV/merchant_1753777600/authorize/cybersource' \ --header 'api-key: dev_TSUxfiSwiAelCPTr9xN2ValUdd1fvmeYg0AtMUwdJukRkTlCpHL9p2IWxn6fouYl'` <img width="1035" height="750" alt="Screenshot 2025-07-29 at 6 44 11 PM" src="https://github.com/user-attachments/assets/6ae685e7-0816-4164-9fae-840cd5f2266e" /> **specificationVersion and effectiveAuthenticationType are getting populated, and are sent to Cybersource_** <img width="1488" height="343" alt="Screenshot 2025-07-29 at 3 25 00 PM" src="https://github.com/user-attachments/assets/a62d4e3d-a168-48a2-bd02-67c279b087ad" /> Please note - Effective authentication type is FR, since the test flow is Frictionless ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/router_request_types.rs` **2. Core Business Logic** - `crates/router/src/core/payments/types.rs` **3. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (14 changes) **Detailed Identifier Changes:** Commit 6ff75754: Files to modify: **crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs** Add: - enum: pub::EffectiveAuthenticationType **crates/hyperswitch_domain_models/src/router_request_types.rs** Modify existing code **crates/router/src/core/payments/types.rs** Modify existing code
{"pr_number": 8768, "pr_title": "feat(connector): [cybersource] add changes for field CybersourceConsumerAuthInformation", "merged_at": "2025-07-31T09:51:22Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payments/types.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs"]}, "change_types": {"functions_added": 1, "enums_added": 1, "fields_added": 14}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(ucs): transmit merchant order reference id to unified connector service ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR introduces the capability to send the Merchant Order Reference ID to the Unified Connector Service (UCS) as part of gRPC request headers. This enhancement allows the UCS to be aware of the merchant's original identifier for a transaction, which can be crucial for tracking, reconciliation, and reporting purposes. ### Key Changes: 1. **New `UcsReferenceId` Type:** * Added a new enum `UcsReferenceId` in `crates/common_utils/src/ucs_types.rs`. This type can represent either a `PaymentReferenceId` or a `RefundReferenceId`, providing a unified structure for reference IDs in UCS communications. * Includes a `get_string_repr()` method for easy string conversion. 2. **gRPC Header Enhancement:** * Modified `GrpcHeadersUcs` in `crates/external_services/src/grpc_client.rs` to include an optional `merchant_reference_id` field of type `UcsReferenceId`. * Updated the corresponding builder types to support this new field. * A new gRPC header constant, `UCS_HEADER_REFERENCE_ID` (`"x-reference-id"`), has been added in `crates/external_services/src/lib.rs` to transmit this ID. 3. **Integration in Payment Flows:** * **Authorize & Repeat Authorize Flows:** The `merchant_order_reference_id` is now parsed from the request, validated, and wrapped in `UcsReferenceId::Payment` before being added to the UCS gRPC headers. * **External Vault Proxy Flow:** The `merchant_order_reference_id` is directly mapped and sent to UCS. * Other flows like Payment Sync (`psync_flow`) and Setup Mandate (`setup_mandate_flow`) have been updated to explicitly set `merchant_reference_id` to `None` in their UCS headers, maintaining consistency. 4. **Data Type and Transformer Updates:** * The `merchant_order_reference_id` in `ExternalVaultProxyPaymentsData` (`hyperswitch_domain_models`) is now strongly typed as `Option<id_type::PaymentReferenceId>` instead of `Option<String>`. * Transformers have been updated to correctly handle the new `UcsReferenceId` type, ensuring the string representation is used when constructing payloads for UCS. ### Additional Changes - [x] This PR modifies the API contract (internal gRPC headers to UCS) - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> By providing the UCS with the merchant's original order reference ID, we enable better traceability and linking of transactions between the merchant's system and Hyperswitch/UCS. This is a foundational step for features that might rely on this identifier for enhanced customer support, detailed analytics, or streamlined reconciliation processes within the UCS. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Verified is the headers send from Hyperwitch are included in UCS events. <img width="1103" height="614" alt="Screenshot 2025-09-15 at 12 28 57 PM" src="https://github.com/user-attachments/assets/9c98bb53-2754-4f5b-9981-6253f17dee6d" /> <img width="1039" height="605" alt="Screenshot 2025-09-15 at 12 29 07 PM" src="https://github.com/user-attachments/assets/aa64df29-679b-4c3a-a445-fc606c1c3586" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments.rs` - `crates/hyperswitch_domain_models/src/router_request_types.rs` **2. Core Business Logic** - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/flows/authorize_flow.rs` - `crates/router/src/core/payments/flows/external_proxy_flow.rs` - ... and 5 more files **3. External Connector Integration** - `crates/external_services/src/grpc_client/unified_connector_service.rs` **4. Type Definitions** - `crates/common_utils/src/ucs_types.rs` - `crates/router/src/types/transformers.rs` **5. Utils** - `crates/common_utils/src/lib.rs` **6. Other** - `crates/external_services/src/grpc_client.rs` - `crates/external_services/src/lib.rs` - `crates/router/src/lib.rs` **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (7 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit 261bed2d: Files to modify: **crates/common_utils/src/lib.rs** Remove: - mod: pub::hashing - mod: pub::metrics Add: - mod: pub::hashing - mod: pub::metrics - mod: pub::ucs_types **crates/common_utils/src/ucs_types.rs** Add: - function: pub::get_string_repr - enum: pub::UcsReferenceId - impl: impl UcsReferenceId **crates/external_services/src/grpc_client.rs** Modify existing code **crates/external_services/src/grpc_client/unified_connector_service.rs** Modify existing code **crates/external_services/src/lib.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_request_types.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/flows/authorize_flow.rs** Modify existing code **crates/router/src/core/payments/flows/external_proxy_flow.rs** Modify existing code **crates/router/src/core/payments/flows/psync_flow.rs** Modify existing code **crates/router/src/core/payments/flows/setup_mandate_flow.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/unified_connector_service.rs** Modify existing code **crates/router/src/core/unified_connector_service/transformers.rs** Modify existing code **crates/router/src/lib.rs** Modify existing code **crates/router/src/types/transformers.rs** Modify existing code
{"pr_number": 9352, "pr_title": "feat(ucs): transmit merchant order reference id to unified connector service", "merged_at": "2025-09-18T08:51:58Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/flows/authorize_flow.rs", "crates/router/src/core/payments/flows/external_proxy_flow.rs", "crates/router/src/core/payments/flows/psync_flow.rs", "crates/router/src/core/payments/flows/setup_mandate_flow.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/unified_connector_service.rs", "crates/router/src/core/unified_connector_service/transformers.rs"], "connectors": ["crates/external_services/src/grpc_client/unified_connector_service.rs"], "types": ["crates/common_utils/src/ucs_types.rs", "crates/router/src/types/transformers.rs"], "utils": ["crates/common_utils/src/lib.rs"], "other": ["crates/external_services/src/grpc_client.rs", "crates/external_services/src/lib.rs", "crates/router/src/lib.rs"]}, "change_types": {"functions_added": 1, "enums_added": 1, "fields_added": 7, "imports_added": 12, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(trustpay): add connector request reference ID generation 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 --> The length of receipt for Trustpay order request should not exceed 35 characters. So added generate_connector_request_reference_id specific to trustpay which generates less than 35 charcters. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> TrustPay API rejects payment requests when the reference field exceeds 35 characters, causing payment failures so now after this it generates uuid of 35 character for reference field specific to trustpay. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> PaymentCreateIntent ``` { "amount_details": { "order_amount": 10000, "currency": "USD" }, "capture_method":"automatic", "customer_id": "{{customer_id}}", "authentication_type": "no_three_ds", "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "email": "example@example.com" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "email": "example@example.com" } } ``` Response: ``` { "id": "12345_pay_01989df58ff572d3b6b44f2b110eed5d", "status": "requires_payment_method", "amount_details": { "order_amount": 10000, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null }, "client_secret": "cs_01989df590017d239418f1f4e74544b6", "profile_id": "pro_FUMMIiBgcHOyCYD5Fcy5", "merchant_reference_id": null, "routing_algorithm_id": null, "capture_method": "automatic", "authentication_type": "no_three_ds", "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe", "origin_zip": null }, "phone": null, "email": "example@example.com" }, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe", "origin_zip": null }, "phone": null, "email": "example@example.com" }, "customer_id": "12345_cus_01989df586017c72a786fa20899c15ed", "customer_present": "present", "description": null, "return_url": null, "setup_future_usage": "on_session", "apply_mit_exemption": "Skip", "statement_descriptor": null, "order_details": null, "allowed_payment_method_types": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "payment_link_enabled": "Skip", "payment_link_config": null, "request_incremental_authorization": "false", "expires_on": "2025-08-12T11:21:12.862Z", "frm_metadata": null, "request_external_three_ds_authentication": "Skip" } ``` Confirm-intent: ``` { "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "01", "card_exp_year": "26", "card_holder_name": "John Doe", "card_cvc": "100" } }, "payment_method_type": "card", "payment_method_subtype": "credit", "browser_info": { "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36", "accept_header": "text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,*\\/*;q=0.8", "language": "en-GB", "color_depth": 24, "screen_height": 1440, "screen_width": 2560, "time_zone": -330, "java_enabled": true, "java_script_enabled": true, "ip_address": "0.0.0.0" } } ``` Response: ``` { "id": "12345_pay_01989df58ff572d3b6b44f2b110eed5d", "status": "succeeded", "amount": { "order_amount": 10000, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 10000, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": 10000 }, "customer_id": "12345_cus_01989df586017c72a786fa20899c15ed", "connector": "trustpay", "created": "2025-08-12T11:06:12.862Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": "SV8ChATq2PXphJpZCzkK2A", "connector_reference_id": null, "merchant_connector_id": "mca_VLpyWHJKJ36kuAYfbmcW", "browser_info": null, "error": null, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": "no_three_ds", "authentication_type_applied": "no_three_ds", "is_iframe_redirection_enabled": null, "merchant_reference_id": null, "raw_connector_response": null, "feature_metadata": null } ``` <img width="720" height="167" alt="image" src="https://github.com/user-attachments/assets/bc21eb59-5c41-422b-8e96-849b6d19b00f" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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` **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (2 changes) **Detailed Identifier Changes:** Commit 041656ec: Files to modify: **crates/hyperswitch_connectors/src/connectors/trustpay.rs** Add: - function: private::generate_connector_request_reference_id
{"pr_number": 8925, "pr_title": "fix(trustpay): add connector request reference ID generation for v2", "merged_at": "2025-09-10T08:51:15Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/trustpay.rs"]}, "change_types": {"functions_added": 1, "fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [PAYSTACK] EFT Payment Flows ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Paystack EFT flow (Payments, PSync, Refunds, RSync, Webhooks). ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> 1. Merchant Account Create: ``` curl --location 'http://localhost:8080/accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data-raw '{ "merchant_id": "merchant_1739960795", "locker_id": "m0010", "merchant_name": "NewAge Retailer", "merchant_details": { "primary_contact_person": "John Test", "primary_email": "JohnTest@test.com", "primary_phone": "sunt laborum", "secondary_contact_person": "John Test2", "secondary_email": "JohnTest2@test.com", "secondary_phone": "cillum do dolor id", "website": "https://www.example.com", "about_business": "Online Retail with a wide selection of organic products for North America", "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } }, "return_url": "https://google.com/success", "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true }, "sub_merchants_enabled": false, "metadata": { "city": "NY", "unit": "245" }, "primary_business_details": [ { "country": "US", "business": "food" } ] }' ``` 2. API Key Create: ``` curl --location 'http://localhost:8080/api_keys/merchant_1739898797' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data '{ "name": "API Key 1", "description": null, "expiration": "2025-09-23T01:02:03.000Z" }' ``` 3. Paystack Connector Create: ``` curl --location 'http://localhost:8080/account/merchant_1739898797/connectors?=' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "payment_processor", "connector_name": "paystack", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "abc" }, "test_mode": false, "disabled": false, "payment_methods_enabled": [ { "payment_method": "bank_redirect", "payment_method_types": [ { "payment_method_type": "eft", "payment_experience": "redirect_to_url", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false } ] } ], "connector_webhook_details": { "merchant_secret": "abc", "additional_secret": null } }' ``` 4. Payments Create: Request: ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_ykM0z3Y0k65EtZIce9BsbJXPtoq7KzcAWsLZUS3SIT13cdYEOQQ4mMkb4UMB5Oyd' \ --data-raw '{ "amount": 6540, "currency": "ZAR", "confirm": true, "amount_to_capture": 6540, "customer_id": "StripbmnxeCustomer", "email": "abc@gmail.com", "description": "Its my first payment request", "return_url": "https://google.com", "payment_method": "bank_redirect", "payment_method_type": "eft", "payment_method_data": { "bank_redirect": { "eft": { "provider": "ozow" } } } }' ``` Response: ``` { "payment_id": "pay_kQrdGr1rVMmwEKYXorLM", "merchant_id": "merchant_1739898797", "status": "requires_customer_action", "amount": 6540, "net_amount": 6540, "shipping_cost": null, "amount_capturable": 6540, "amount_received": null, "connector": "paystack", "client_secret": "pay_kQrdGr1rVMmwEKYXorLM_secret_U7lStVK9TuKNY4l0mxmc", "created": "2025-02-19T10:32:31.775Z", "currency": "ZAR", "customer_id": "StripbmnxeCustomer", "customer": { "id": "StripbmnxeCustomer", "name": null, "email": "abc@gmail.com", "phone": null, "phone_country_code": null }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": null, "payment_method": "bank_redirect", "payment_method_data": { "bank_redirect": { "type": "BankRedirectResponse", "bank_name": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": null, "order_details": null, "email": "abc@gmail.com", "name": null, "phone": null, "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": { "type": "redirect_to_url", "redirect_to_url": "http://localhost:8080/payments/redirect/pay_kQrdGr1rVMmwEKYXorLM/merchant_1739898797/pay_kQrdGr1rVMmwEKYXorLM_1" }, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "eft", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "StripbmnxeCustomer", "created_at": 1739961151, "expires": 1739964751, "secret": "epk_09592792e8504aa3a943feff38c3e3e2" }, "manual_retry_allowed": null, "connector_transaction_id": "sug0jyf5kbbbpe5", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_z5wMP3CJUUrMDF5CBGl9", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_Ux3UO8AL0iD9BlzLSE83", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-02-19T10:47:31.774Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-02-19T10:32:32.739Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` 5. Payments Retrieve Request: ``` curl --location 'http://localhost:8080/payments/pay_kWVz157PfvGL9GyAiTnI?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_ykM0z3Y0k65EtZIce9BsbJXPtoq7KzcAWsLZUS3SIT13cdYEOQQ4mMkb4UMB5Oyd' \ --data '' ``` Response: Same as payments response> 6. Refunds Create Request: ``` curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_ykM0z3Y0k65EtZIce9BsbJXPtoq7KzcAWsLZUS3SIT13cdYEOQQ4mMkb4UMB5Oyd' \ --data '{ "payment_id": "pay_6Ww3WmcWCT8ni7O5K5gV", "amount": 1000, "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response: ``` { "refund_id": "ref_XSsCj6O6bujAZypJAFJk", "payment_id": "pay_6Ww3WmcWCT8ni7O5K5gV", "amount": 1000, "currency": "ZAR", "status": "succeeded", "reason": "Customer returned product", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "error_message": null, "error_code": null, "unified_code": null, "unified_message": null, "created_at": "2025-02-19T10:31:32.658Z", "updated_at": "2025-02-19T10:31:34.094Z", "connector": "paystack", "profile_id": "pro_z5wMP3CJUUrMDF5CBGl9", "merchant_connector_id": "mca_Ux3UO8AL0iD9BlzLSE83", "split_refunds": null } ``` 7. Refunds Retrieve Request: ``` curl --location 'http://localhost:8080/refunds/ref_XSsCj6O6bujAZypJAFJk' \ --header 'Accept: application/json' \ --header 'api-key: dev_ZgTXlFsnanc0o4AW2Ag32dJQsA1rAvU1prQVsIE0JbUjPv7g65ZU5pO7MyiPLL5J' ``` Response: Same as Refunds response. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/connector_configs/toml/development.toml` - `crates/connector_configs/toml/production.toml` - `crates/connector_configs/toml/sandbox.toml` - ... and 2 more files **Code Patterns Applied:** - Define new data structures (11 changes) - Implement new functions (10 changes) - Extend existing types with new fields (126 changes) - Add conditional logic for feature flags or filtering (1 changes)
{"pr_number": 7286, "pr_title": "feat(connector): [PAYSTACK] EFT Payment Flows", "merged_at": "2025-03-03T14:28:32Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/paystack.rs", "crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs"]}, "change_types": {"structs_added": 11, "functions_added": 10, "enums_added": 6, "fields_added": 126, "imports_added": 5, "conditionals_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
fix(connector): Add Trustpay in Authentication Providers Config ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD Closes this [issue](https://github.com/juspay/hyperswitch/issues/8623) ## Description <!-- Describe your changes in detail --> Added trustpay in authentication providers config ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Steps for testing is given in this [PR](https://github.com/juspay/hyperswitch/pull/8304) Screenshot that is showing `card_brands` in Session Call for Trustpay: <img width="653" height="542" alt="Screenshot 2025-07-13 at 2 07 31 PM" src="https://github.com/user-attachments/assets/4249444b-9558-49b3-a257-cabc9219ca19" /> Cypress Screenshot: <img width="1442" height="1932" alt="image (6)" src="https://github.com/user-attachments/assets/e72b900c-a90a-40aa-8230-a6766c75249e" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Tests** - `config/deployments/integration_test.toml` **2. Configuration Files** - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - `config/development.toml` - ... and 1 more files
{"pr_number": 8622, "pr_title": "fix(connector): Add Trustpay in Authentication Providers Config", "merged_at": "2025-07-22T12:49:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "session", "card"]}, "hierarchy": {"tests": ["config/deployments/integration_test.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
Refactor(refunds_v2): Refactor api event metric for refunds v2 apis ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR adds support for API Event Metric logging, the events will be logged to clickhouse when a request/response is triggered. In refunds v2, it will be for requests and responses for 4 apis 1. Refunds Create 2. Refunds Metadata Update 3. Refunds Retrieve 4. Refunds List ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> It will help us in keeping track of the requests/response and for analytical purposes and help in debugging. ## How did you test 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 will be tested when kafka and clickhouse is enabled for 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/refund.rs` **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/refund.rs` **3. Core Business Logic** - `crates/router/src/core/refunds_v2.rs` **4. Utils** - `crates/common_utils/src/events.rs` **5. Other** - `crates/router/src/routes/refunds.rs` **Code Patterns Applied:** - Extend existing types with new fields (8 changes) **Detailed Identifier Changes:** Commit bc4bab93: Files to modify: **crates/api_models/src/events/refund.rs** Remove: - function: private::get_api_event_type - impl: impl ApiEventMetric for refunds::RefundsCreateRequest **crates/common_utils/src/events.rs** Modify existing code **crates/diesel_models/src/refund.rs** Modify existing code **crates/router/src/core/refunds_v2.rs** Modify existing code **crates/router/src/routes/refunds.rs** Modify existing code
{"pr_number": 8041, "pr_title": "Refactor(refunds_v2): Refactor api event metric for refunds v2 apis", "merged_at": "2025-05-27T07:22:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["refund"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/refund.rs"], "database": ["crates/diesel_models/src/refund.rs"], "core_business": ["crates/router/src/core/refunds_v2.rs"], "utils": ["crates/common_utils/src/events.rs"], "other": ["crates/router/src/routes/refunds.rs"]}, "change_types": {"fields_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): revert noon-paypal ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Revert [7610](https://github.com/juspay/hyperswitch/pull/7610) ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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? ## How did you test it? 1. create a payment ``` { "amount": 390, "currency": "AED", "confirm": true, // "business_country": "US", // "business_label": "default", "capture_method": "automatic", // "amount_to_capture": 0, "customer_id": "sammantest2722", "capture_on": "2022-09-10T10:11:12Z", "authentication_type": "three_ds", "return_url": "https://google.com", "email": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4000000000002701", "card_exp_month": "01", "card_exp_year": "2035", "card_holder_name": "joseph Doe", "card_cvc": "100" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "AE", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla\/5.0 (iPhone NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "128.0.0.1" }, "connector_metadata": { "noon": { "order_category": "pay" } }, "order_details": [ { "product_name": "Apple iphone 15", "quantity": 1, "amount": 390, "account_name": "transaction_processing" } ] } ``` Response ``` { "payment_id": "pay_V0v670gKQ6VpINzK22j0", "merchant_id": "postman_merchant_GHAction_90b727a5-ea96-45a7-8909-a06d6957306f", "status": "requires_customer_action", "amount": 390, "net_amount": 390, "shipping_cost": null, "amount_capturable": 390, "amount_received": null, "connector": "noon", "client_secret": "pay_V0v670gKQ6VpINzK22j0_secret_kPP7zOI0hthokevNroTK", "created": "2025-04-22T08:08:30.447Z", "currency": "AED", "customer_id": "sammantest2722", "customer": { "id": "sammantest2722", "name": "Joseph Doe", "email": "something@gmail.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment", "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": "2701", "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": "2035", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "AE", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": [ { "brand": null, "amount": 390, "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": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": { "type": "redirect_to_url", "redirect_to_url": "http://localhost:8080/payments/redirect/pay_V0v670gKQ6VpINzK22j0/postman_merchant_GHAction_90b727a5-ea96-45a7-8909-a06d6957306f/pay_V0v670gKQ6VpINzK22j0_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": "sammantest2722", "created_at": 1745309310, "expires": 1745312910, "secret": "epk_17993e32e0654c9e8e57da7cf54493ef" }, "manual_retry_allowed": null, "connector_transaction_id": "241937804856", "frm_message": null, "metadata": null, "connector_metadata": { "apple_pay": null, "airwallex": null, "noon": { "order_category": "pay" }, "braintree": null }, "feature_metadata": null, "reference_id": "pay_V0v670gKQ6VpINzK22j0_1", "payment_link": null, "profile_id": "pro_OSpJE2LHPMhYUEI3jIy4", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_fLV56uBCQKxgx1CZZ44i", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-04-22T08:23:30.447Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "128.0.0.1", "user_agent": "Mozilla/5.0 (iPhone 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-22T08:08:33.090Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null } ``` Complete payment vis redirection 2. do psync ``` curl --location 'http://localhost:8080/payments/pay_V0v670gKQ6VpINzK22j0?force_sync=true' \ --header 'Accept: application/json' \ --header 'api-key: _' ``` Response ``` { "payment_id": "pay_V0v670gKQ6VpINzK22j0", "merchant_id": "postman_merchant_GHAction_90b727a5-ea96-45a7-8909-a06d6957306f", "status": "succeeded", "amount": 390, "net_amount": 390, "shipping_cost": null, "amount_capturable": 0, "amount_received": 390, "connector": "noon", "client_secret": "pay_V0v670gKQ6VpINzK22j0_secret_kPP7zOI0hthokevNroTK", "created": "2025-04-22T08:08:30.447Z", "currency": "AED", "customer_id": "sammantest2722", "customer": { "id": "sammantest2722", "name": "Joseph Doe", "email": "something@gmail.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment", "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": "2701", "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": "2035", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "AE", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": [ { "brand": null, "amount": 390, "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": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "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": "241937804856", "frm_message": null, "metadata": null, "connector_metadata": { "apple_pay": null, "airwallex": null, "noon": { "order_category": "pay" }, "braintree": null }, "feature_metadata": null, "reference_id": "pay_V0v670gKQ6VpINzK22j0_1", "payment_link": null, "profile_id": "pro_OSpJE2LHPMhYUEI3jIy4", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_fLV56uBCQKxgx1CZZ44i", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-04-22T08:23:30.447Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "128.0.0.1", "user_agent": "Mozilla/5.0 (iPhone 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-22T08:08:42.714Z", "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/connector_configs/toml/production.toml` - `crates/hyperswitch_connectors/src/connectors/noon.rs` - `crates/hyperswitch_connectors/src/connectors/noon/transformers.rs` - ... and 1 more files **2. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **3. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 2 more files **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (1 changes) **Detailed Identifier Changes:** Commit 776bde00: Files to modify: **crates/hyperswitch_connectors/src/connectors/noon.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/noon/transformers.rs** Remove: - function: private::try_from - function: private::try_from - struct: pub::NoonPaymentsCompleteAuthorizeRequest - struct: pub::NoonCompleteOrder - struct: pub::NoonCompletePaymentData - struct: pub::NoonData - struct: pub::NoonQueryData - struct: pub::PaypalQueryData - struct: pub::NoonPaypalResponse - struct: pub::NoonPaypalResponseResult - struct: pub::NoonPaypalPaymentData - struct: pub::PaypalData - enum: pub::NoonPaymentMethodType - enum: pub::NoonAuthPaymentResponse - impl: impl TryFrom<&NoonRouterData<&PaymentsCompleteAuthorizeRouterData>> for NoonPaymentsCompleteAuthorizeRequest - impl: impl TryFrom<ResponseRouterData<F, NoonPaypalResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData> **crates/hyperswitch_connectors/src/default_implementations.rs** Modify existing code
{"pr_number": 7864, "pr_title": "fix(connector): revert noon-paypal", "merged_at": "2025-04-22T11:39:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/production.toml", "crates/hyperswitch_connectors/src/connectors/noon.rs", "crates/hyperswitch_connectors/src/connectors/noon/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.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, "fields_added": 1, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): removed forked josekit dependency from payout connector Nomupay ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [x] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Instead of using a forked repo to support empty payloads in josekit's JWT implementation, switch to using the josekit JWS directly, which supports empty payloads. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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)? --> Payouts Create Request ``` curl --location 'http://localhost:8080/payouts/create' \ --header 'x-feature: integ-custom' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_********hayH' \ --data-raw '{ "amount": 11, "currency": "EUR", "email": "payout_c*****ample.com", "name": "John Doe", "phone": "99*****9", "phone_country_code": "+65", "description": "Its my first payout request", "payout_type": "bank", "payout_method_data": { "bank": { "iban": "D***9", "bic": "DEU****1", "bank_name": "******k", "bank_country_code": "NL", "bank_city": "A******" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "CA", "zip": "94122", "country": "DE", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": "payout_cust*****2@example.com" }, "entity_type": "Individual", "recurring": true, "metadata": { "ref": "123" }, "connector": [ "nomupay" ], "profile_id": "pro_Mh******Nqp", "confirm": true, "auto_fulfill": true }' ``` Payouts Create Response ``` { "payout_id": "d7e******93", "merchant_id": "merchant_17******", "amount": 11, "currency": "EUR", "connector": "nomupay", "payout_type": "bank", "payout_method_data": { "bank": { "iban": "DE573************39", "bank_name": "******ank", "bank_country_code": "NL", "bank_city": "Am******", "bic": "DEU*****551" } }, "billing": { "address": { "city": "San Fransico", "country": "DE", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "CA", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": "payout_*****2@example.com" }, "auto_fulfill": true, "customer_id": "cus_zwWD******K", "customer": { "id": "cus_zwWDxIF******WK", "name": "John Doe", "email": "payout_******@example.com", "phone": "99******9", "phone_country_code": "+65" }, "client_secret": "payout_d7e35482-******-d43f0bbbd193_******X24LXbh", "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_OTsg******Rrn", "status": "pending", "error_message": null, "error_code": null, "profile_id": "pro_Mh******GNqp", "created": "2025-05-30T08:12:51.997Z", "connector_transaction_id": "PMT-0683******8112", "priority": null, "payout_link": null, "email": "payout_customer@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "unified_code": null, "unified_message": null, "payout_method_id": "pm_vvSrJ******1ljs" } ``` Payout Retrieve Request ``` curl --location 'http://localhost:8080/payouts/d7e35482*********193?force_sync=true' \ --header 'api-key: dev_Gk8*******hayH' ``` Payout Retrieve Response ``` { "payout_id": "d7e35482********bbbd193", "merchant_id": "merc********6", "amount": 11, "currency": "EUR", "connector": "nomupay", "payout_type": "bank", "payout_method_data": { "bank": { "iban": "DE573************42639", "bank_name": "********ank", "bank_country_code": "NL", "bank_city": "A********", "bic": "DEU*****551" } }, "billing": { "address": { "city": "San Fransico", "country": "DE", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "CA", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "80********427", "country_code": "+91" }, "email": "payout_cust********72@example.com" }, "auto_fulfill": true, "customer_id": "cus_zw********prWK", "customer": { "id": "cus_z********rWK", "name": "John Doe", "email": "payou********er@example.com", "phone": "999********9", "phone_country_code": "+65" }, "client_secret": "payout_d7e35482********bbbd193_secret_9Ut2Y3********LXbh", "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_******Rrn", "status": "pending", "error_message": null, "error_code": null, "profile_id": "pro_M********Nqp", "created": "2025-05-30T08:12:51.997Z", "connector_transaction_id": "PMT-068********b8112", "priority": null, "payout_link": null, "email": "payout_customer@example.com", "name": "John Doe", "phone": "99********9", "phone_country_code": "+65", "unified_code": null, "unified_message": null, "payout_method_id": "pm_vv********Qb1ljs" } ``` [Payout] [Bank transfer] [SEPA] Fulfill using Token fails because it called after a successful payout. Nomupay needs a transfer_method_id along with connector_customer_id for subsequent payouts. ![Screenshot 2025-05-27 at 11 43 08 AM](https://github.com/user-attachments/assets/66ad1ae4-bc7e-4354-bd01-b4ba22ce5381) ## 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/Cargo.toml` - `crates/hyperswitch_connectors/src/connectors/nomupay.rs` **2. Other** - `Cargo.lock` **Detailed Identifier Changes:** Commit b1628f79: Files to modify: **crates/hyperswitch_connectors/src/connectors/nomupay.rs** Modify existing code
{"pr_number": 8183, "pr_title": "fix(connector): removed forked josekit dependency from payout connector Nomupay", "merged_at": "2025-06-10T07:09:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "merchant", "user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/Cargo.toml", "crates/hyperswitch_connectors/src/connectors/nomupay.rs"], "other": ["Cargo.lock"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
ci(cypress): fix braintree connector ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [x] CI/CD ## Description Fix save card flow for braintree , earlier we were passing on_session for off_session 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 Test cases were failing ## How did you test it? <img width="689" height="978" alt="image" src="https://github.com/user-attachments/assets/16b8a2da-2e79-47b3-87da-0f474d7741b6" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Tests** - `cypress-tests/cypress/e2e/configs/Payment/Braintree.js` **Code Patterns Applied:** - Extend existing types with new fields (11 changes)
{"pr_number": 9435, "pr_title": "ci(cypress): fix braintree connector", "merged_at": "2025-09-18T11:59:06Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "session", "card"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Braintree.js"]}, "change_types": {"fields_added": 11}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
chore: add stripe to network transaction id support ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description adding `stripe` in connector list for network transaction id. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Configuration Files** - `config/deployments/production.toml`
{"pr_number": 7096, "pr_title": "chore: add stripe to network transaction id support", "merged_at": "2025-01-28T20:16:00Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector", "transaction"]}, "hierarchy": {"config": ["config/deployments/production.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
chore: address Rust 1.87.0 clippy lints ## Type of Change - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR addresses the clippy lints occurring due to new rust version 1.87.0 https://rust-lang.github.io/rust-clippy/master/index.html ### 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)? --> CI checks should pass as this PR addresses clippy lints. 1. ran `rustc --version` <img width="381" alt="Screenshot 2025-05-24 at 5 18 56 AM" src="https://github.com/user-attachments/assets/dfb59d28-3085-4e96-b3b9-2bd635086356" /> 3. ran `just clippy` with new rust version (1.87.0) <img width="1004" alt="Screenshot 2025-04-07 at 5 46 05 PM" src="https://github.com/user-attachments/assets/5951c74e-8f3d-44e2-8172-e376c01c2e9d" /> 4. ran `just clippy_v2` with new rust version (1.87.0) <img width="948" alt="Screenshot 2025-05-24 at 5 19 50 AM" src="https://github.com/user-attachments/assets/a04d74c4-a1e0-48b1-8f93-09b70cde32c2" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **connector_integration** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payments/helpers.rs` **2. Utils** - `crates/kgraph_utils/src/error.rs` - `crates/kgraph_utils/src/transformers.rs` **3. Other** - `crates/external_services/src/email/ses.rs` - `crates/masking/src/serde.rs` - `crates/router/src/bin/router.rs` **Code Patterns Applied:** - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit fab9f5ee: Files to modify: **crates/external_services/src/email/ses.rs** Modify existing code **crates/kgraph_utils/src/error.rs** Modify existing code **crates/kgraph_utils/src/transformers.rs** Modify existing code **crates/masking/src/serde.rs** Modify existing code **crates/router/src/bin/router.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code
{"pr_number": 8130, "pr_title": "chore: address Rust 1.87.0 clippy lints", "merged_at": "2025-05-27T10:37:27Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/helpers.rs"], "utils": ["crates/kgraph_utils/src/error.rs", "crates/kgraph_utils/src/transformers.rs"], "other": ["crates/external_services/src/email/ses.rs", "crates/masking/src/serde.rs", "crates/router/src/bin/router.rs"]}, "change_types": {"conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(configs): prod base url updated for 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 --> Updated the outdated/incorrect base urls for some connectors with the new ones. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [x] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> some of the base_url links of the connectors in `config/deployments/production.toml` were for sandbox/demo/test links. Updated the same for with prod/live links. Note: for `aci`, `digitalvirgo` and `gpayments` not updated as there are no references available. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ### References: - [bamboraapac (ref1)](https://dev-apac.bambora.com/migration.html) - [bamboraapac (ref2)](https://dev-apac.bambora.com/checkout/guides/get-up-and-running/migration-to-production) - [dlocal](https://docs.dlocal.com/docs/make-a-test-payment#make-test-calls) - [ebanx](https://developer.ebanx.com/docs/integration/guides/integration-guide/#test-matrix) - [forte](https://restdocs.forte.net/#:~:text=Base%20URI&text=For%20example%2C%20to%20find%20a,attached%20to%20that%20customer's%20token.) - [globalpay](https://developer.globalpay.com/docs/getting-started/going-to-production#receive-production-credentials) - [multisafepay](https://docs.multisafepay.com/reference/environments) - [nuvei](https://docs.nuvei.com/api/main/indexMain_v1_0.html?json#voidTransaction) - [rapyd](https://docs.rapyd.net/en/environments.html) - [square (ref1)](https://developer.squareup.com/docs/build-basics/general-considerations/using-rest-api#specify-a-resource-url) - [square (ref2)](https://developer.squareup.com/forums/t/whitelisted-square-domains-for-content-security-policy-web-payments-sdk/8186/3) - [wise](https://docs.wise.com/api-docs/guides/partner-account#environments) - [worldline](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/endpoints.html?paymentPlatform=ALL) - [worldpay](https://developer.worldpay.com/products/access/hosted-payment-pages/go-live) ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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/chargebee.rs` **2. Configuration Files** - `config/deployments/production.toml` **Detailed Identifier Changes:** Commit 0250f169: Files to modify: **crates/hyperswitch_connectors/src/connectors/chargebee.rs** Modify existing code
{"pr_number": 7582, "pr_title": "refactor(configs): prod base url updated for connectors", "merged_at": "2025-04-30T10:46:14Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "connector"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/chargebee.rs"], "config": ["config/deployments/production.toml"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [katapult]add template code for katapult ## 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 template code for katapult ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [x] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> No test cases required, Since this is template code PR, CI checks should be suffice. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/connector_endpoints.rs` **2. External Connector Integration** - `crates/connector_configs/src/connector.rs` - `crates/connector_configs/toml/development.toml` - `crates/connector_configs/toml/production.toml` - ... and 11 more files **3. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **4. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 2 more files **Code Patterns Applied:** - Define new data structures (10 changes) - Implement new functions (83 changes) - Extend existing types with new fields (163 changes) **Detailed Identifier Changes:** Commit c6e4e720: Files to modify: **crates/connector_configs/src/connector.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors.rs** Add: - mod: pub::katapult **crates/hyperswitch_connectors/src/connectors/katapult.rs** Add: - function: pub::new - function: private::build_headers - function: private::id - function: private::get_currency_unit - function: private::common_get_content_type - function: private::base_url - function: private::get_auth_header - function: private::build_error_response - function: private::validate_mandate_payment - function: private::validate_psync_reference_id - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::get_request_body - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_headers - function: private::get_content_type - function: private::get_url - function: private::build_request - function: private::handle_response - function: private::get_error_response - function: private::get_webhook_object_reference_id - function: private::get_webhook_event_type - function: private::get_webhook_resource_object - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - struct: pub::Katapult - impl: impl Katapult - impl: impl api::Payment for Katapult - impl: impl api::PaymentSession for Katapult - impl: impl api::ConnectorAccessToken for Katapult - impl: impl api::MandateSetup for Katapult - impl: impl api::PaymentAuthorize for Katapult - impl: impl api::PaymentSync for Katapult - impl: impl api::PaymentCapture for Katapult - impl: impl api::PaymentVoid for Katapult - impl: impl api::Refund for Katapult - impl: impl api::RefundExecute for Katapult - impl: impl api::RefundSync for Katapult - impl: impl api::PaymentToken for Katapult - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Katapult - impl: impl ConnectorCommonExt<Flow, Request, Response> for Katapult - impl: impl ConnectorCommon for Katapult - impl: impl ConnectorValidation for Katapult - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Katapult - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Katapult - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Katapult - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Katapult - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Katapult - impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Katapult - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Katapult - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Katapult - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Katapult - impl: impl webhooks::IncomingWebhook for Katapult - impl: impl ConnectorSpecifications for Katapult - mod: pub::transformers **crates/hyperswitch_connectors/src/connectors/katapult/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::KatapultRouterData - struct: pub::KatapultPaymentsRequest - struct: pub::KatapultCard - struct: pub::KatapultAuthType - struct: pub::KatapultPaymentsResponse - struct: pub::KatapultRefundRequest - struct: pub::RefundResponse - struct: pub::KatapultErrorResponse - enum: pub::KatapultPaymentStatus - enum: pub::RefundStatus - impl: impl From<(StringMinorUnit, T)> for KatapultRouterData<T> - impl: impl TryFrom<&KatapultRouterData<&PaymentsAuthorizeRouterData>> for KatapultPaymentsRequest - impl: impl TryFrom<&ConnectorAuthType> for KatapultAuthType - impl: impl From<KatapultPaymentStatus> for common_enums::AttemptStatus - impl: impl TryFrom<ResponseRouterData<F, KatapultPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData> - impl: impl TryFrom<&KatapultRouterData<&RefundsRouterData<F>>> for KatapultRefundRequest - impl: impl From<RefundStatus> for enums::RefundStatus - impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute> - impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync> **crates/hyperswitch_connectors/src/default_implementations.rs** Modify existing code **crates/hyperswitch_connectors/src/default_implementations_v2.rs** Modify existing code **crates/hyperswitch_domain_models/src/connector_endpoints.rs** Modify existing code **crates/router/src/connector.rs** Modify existing code **crates/router/tests/connectors/katapult.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::KatapultTest - impl: impl ConnectorActions for KatapultTest - impl: impl utils::Connector for KatapultTest **crates/router/tests/connectors/main.rs** Add: - mod: private::katapult **crates/test_utils/src/connector_auth.rs** Modify existing code
{"pr_number": 8783, "pr_title": "feat(connector): [katapult]add template code for katapult", "merged_at": "2025-07-31T11:50:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/connector_endpoints.rs"], "connectors": ["crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/katapult.rs", "crates/hyperswitch_connectors/src/connectors/katapult/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/katapult.rs", "crates/router/tests/connectors/main.rs", "crates/test_utils/src/connector_auth.rs", "scripts/add_connector.sh"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 10, "functions_added": 83, "enums_added": 2, "fields_added": 163, "imports_added": 22}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(core): Add Merchant Tax ID in Merchant Profile ## 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 --> ### Changes Made **Merchant Tax ID in L2/L3 Data** - Added merchant_tax_registration_id field to merchant details in merchant profile - Added `merchant_tax_registration_id` field to L2/L3 data structure. - Integrated tax ID as `card_acceptor_tax_id` in Vantiv's `DetailTax` structure. ### 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? MCA without `merchant_tax_registration_id` ``` <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> curl --location 'http://localhost:8080/accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data-raw '{ "merchant_id": "merchant_1756720797", "locker_id": "m0010", "merchant_name": "NewAge Retailer", "merchant_details": { "primary_contact_person": "John Test", "primary_email": "JohnTest@test.com", "primary_phone": "sunt laborum", "secondary_contact_person": "John Test2", "secondary_email": "JohnTest2@test.com", "secondary_phone": "cillum do dolor id", "website": "www.example.com", "about_business": "Online Retail with a wide selection of organic products for North America", "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } }, "return_url": "https://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" } ] }' ``` Response ``` { "merchant_id": "merchant_1756720785", "merchant_name": "NewAge Retailer", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "payment_response_hash_key": "h9YV1MQpUvv7aYbXIaDDyat4kxEYq5QTPeau4ZXG9qR2JNNTuVbU8bxBq1zD8vN2", "redirect_to_merchant_with_http_post": false, "merchant_details": { "primary_contact_person": "John Test", "primary_phone": "sunt laborum", "primary_email": "JohnTest@test.com", "secondary_contact_person": "John Test2", "secondary_phone": "cillum do dolor id", "secondary_email": "JohnTest2@test.com", "website": "www.example.com", "about_business": "Online Retail with a wide selection of organic products for North America", "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": null, "last_name": null, "origin_zip": null }, "merchant_tax_registration_id": null }, "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "webhook_url": null, "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true, "payment_statuses_enabled": null, "refund_statuses_enabled": null, "payout_statuses_enabled": null }, "payout_routing_algorithm": null, "sub_merchants_enabled": false, "parent_merchant_id": null, "publishable_key": "pk_dev_a111e19dec254888bc57a36be5addbd8", "metadata": { "city": "NY", "unit": "245", "compatible_connector": null }, "locker_id": "m0010", "primary_business_details": [ { "country": "US", "business": "default" } ], "frm_routing_algorithm": null, "organization_id": "org_9B6C3zBlLMDGMVceWKpK", "is_recon_enabled": false, "default_profile": "pro_qUFX9ttJj0DYJc7ukaiI", "recon_status": "not_requested", "pm_collect_link_config": null, "product_type": "orchestration", "merchant_account_type": "standard" } ``` Merchant Account Create ``` curl --location 'http://localhost:8080/accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data-raw '{ "merchant_id": "merchant_1756221630", "locker_id": "m0010", "merchant_name": "NewAge Retailer", "merchant_details": { "primary_contact_person": "John Test", "primary_email": "JohnTest@test.com", "primary_phone": "sunt laborum", "merchant_tax_registration_id":"3243242", "secondary_contact_person": "John Test2", "secondary_email": "JohnTest2@test.com", "secondary_phone": "cillum do dolor id", "website": "www.example.com", "about_business": "Online Retail with a wide selection of organic products for North America", "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } }, "return_url": "https://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" } ] }' ``` Response ``` { "merchant_id": "merchant_1756196112", "merchant_name": "NewAge Retailer", "return_url": "https://google.com/success", "enable_payment_response_hash": true, "payment_response_hash_key": "emximn2G1kgk04HFlgrwCXqRa5qXr9RcztLPiFrbkS92zbuKNGp0W7olSpRotKdr", "redirect_to_merchant_with_http_post": false, "merchant_details": { "primary_contact_person": "John Test", "primary_phone": "sunt laborum", "primary_email": "JohnTest@test.com", "secondary_contact_person": "John Test2", "secondary_phone": "cillum do dolor id", "secondary_email": "JohnTest2@test.com", "website": "www.example.com", "about_business": "Online Retail with a wide selection of organic products for North America", "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": null, "last_name": null, "origin_zip": null }, "merchant_tax_registration_id": "3243242" }, "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "webhook_url": null, "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true, "payment_statuses_enabled": null, "refund_statuses_enabled": null, "payout_statuses_enabled": null }, "payout_routing_algorithm": null, "sub_merchants_enabled": false, "parent_merchant_id": null, "publishable_key": "", "metadata": { "city": "NY", "unit": "245", "compatible_connector": null }, "locker_id": "m0010", "primary_business_details": [ { "country": "US", "business": "default" } ], "frm_routing_algorithm": null, "organization_id": "org_67oU0sqPVcn2MapB4diR", "is_recon_enabled": false, "default_profile": "pro_QCai34tt21MrTW7wq67o", "recon_status": "not_requested", "pm_collect_link_config": null, "product_type": "orchestration", "merchant_account_type": "standard" } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/admin.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/merchant_account.rs` - `crates/hyperswitch_domain_models/src/router_data.rs` **3. Core Business Logic** - `crates/router/src/core/payments/transformers.rs` **4. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs` **5. Other** - `api-reference/v1/openapi_spec_v1.json` - `api-reference/v2/openapi_spec_v2.json` **Code Patterns Applied:** - Implement new functions (2 changes) - Extend existing types with new fields (6 changes) - Modify database queries (1 changes) **Detailed Identifier Changes:** Commit ff14b7ca: Files to modify: **crates/api_models/src/admin.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs** Modify existing code **crates/hyperswitch_domain_models/src/merchant_account.rs** Add: - function: pub::get_merchant_details - function: pub::get_merchant_tax_registration_id **crates/hyperswitch_domain_models/src/router_data.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code
{"pr_number": 8992, "pr_title": "feat(core): Add Merchant Tax ID in Merchant Profile ", "merged_at": "2025-09-01T11:02:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs"], "domain": ["crates/hyperswitch_domain_models/src/merchant_account.rs", "crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json"]}, "change_types": {"functions_added": 2, "fields_added": 6, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(cypress): [worldpayvantiv] add cypress test ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [x] CI/CD ## Description <!-- Describe your changes in detail --> Worldpayvantiv supports non 3ds payments. Recurring payments are not supported. Mandate using PMID failing because of the missing connector id - which is expected. But throws an unexpected error <img width="416" alt="Screenshot 2025-06-04 at 11 31 41 AM" src="https://github.com/user-attachments/assets/50300d8f-03ba-452f-8567-3a9c3ccbd3f8" /> ## How did you test it? <!-- <img width="416" alt="Screenshot 2025-06-04 at 11 31 41 AM" src="https://github.com/user-attachments/assets/a2df3fa4-11cd-42da-9a53-3dc67e9afd07" /> 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="802" alt="Screenshot 2025-06-04 at 11 21 09 AM" src="https://github.com/user-attachments/assets/670d33d1-81fe-480f-baa0-d36b5d32bc82" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **payment** feature, you'll need to modify these architectural layers: **1. Tests** - `cypress-tests/cypress/e2e/configs/Payment/Utils.js` - `cypress-tests/cypress/e2e/configs/Payment/Worldpayvantiv.js` **Code Patterns Applied:** - Extend existing types with new fields (367 changes)
{"pr_number": 8234, "pr_title": "feat(cypress): [worldpayvantiv] add cypress test", "merged_at": "2025-07-07T12:53:33Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/configs/Payment/Worldpayvantiv.js"]}, "change_types": {"fields_added": 367}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
feat(core): Add cardbrand union fetch logic for click to pay session response ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Enhancement ## Description <!-- Describe your changes in detail --> Add cardbrand union fetch logic for click to pay session response Previously for click to pay card brands was needed to be configured via dashboard in click to pay connector create tab, with this change we will provide card brands as a union of all card networks under active payment processor ## How did you test 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 connectors that supports click to pay Lets take the example of adyen and cybersource in adyen configure card network as ["Visa", "Mastercard"] and in cybersource configure card network as ["American_Express"] ```shell curl --location 'http://localhost:8080/account/sahkal/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_Yo6nUGV4YXm5VBniRWzk7w3gd8z7qIodkbIYZOqkxf7wfrUpWrDYcIJdpeYnDZcX' \ --data ' { "connector_type": "payment_processor", "connector_name": "adyen", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "API-KEY", "key1": "KEY1", "api_secret": "API-SECRET" }, "test_mode": true, "disabled": false, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "city": "NY", "unit": "245", "live_endpoint_prefix": "vsfbjh" }, "connector_webhook_details": { "merchant_secret": "556B655EBE2F2F0912F6DBC893C23C8A30F5F5293746B80114844AB30549E2AB" }, "business_country": "US", "business_label": "default" } ' ``` CYBERSOURCE ``` curl --location 'http://localhost:8080/account/sahkal/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_m0TdtUXCOCjuHAx86maD6MNJ0OAnmSYY3cnXHAZUclbMdN5Vy7C1wnq6mDFyNwBs' \ --data ' { "connector_type": "payment_processor", "connector_name": "cybersource", "connector_account_details": { "auth_type": "SignatureKey", "api_secret": "API-SECRET", "api_key": "API-KEY", "key1": "KET1" }, "test_mode": true, "disabled": false, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "card_networks": [ "AmericanExpress" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "city": "NY", "unit": "245", "live_endpoint_prefix": "vsfbjh" }, "connector_webhook_details": { "merchant_secret": "MERCHANT-SECRET" } } ' ``` CTP_MASTERCARD ```shell curl --location 'http://localhost:8080/account/sahkal/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_m0TdtUXCOCjuHAx86maD6MNJ0OAnmSYY3cnXHAZUclbMdN5Vy7C1wnq6mDFyNwBs' \ --data '{ "connector_type": "authentication_processor", "connector_name": "ctp_mastercard", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "API-KEY" }, "test_mode": true, "disabled": false, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "debit", "card_networks": [ "Visa", "Mastercard" ], "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "connector_webhook_details": { "merchant_secret": "MERCHANT-SECRET" }, "business_country": "US", "business_label": "default", "metadata": { "dpa_id": "DPA-ID", "dpa_name": "TestMerchant", "locale": "en_AU", "card_brands": [ "mastercard", "visa" ], "acquirer_bin": "545301", "acquirer_merchant_id": "SRC3DS", "merchant_category_code": "0001", "merchant_country_code": "US", "dpa_client_id": "TestMerchant" } } ' ``` update business profile ```shell curl --location 'http://localhost:8080/account/sahkal/business_profile/pro_7TUGcXiWxKKIE5nV0n53' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_Yo6nUGV4YXm5VBniRWzk7w3gd8z7qIodkbIYZOqkxf7wfrUpWrDYcIJdpeYnDZcX' \ --data '{ "is_click_to_pay_enabled": true, "authentication_product_ids": {"click_to_pay": "mca_lChk9Kk2GUHabZjoQYOu"} }' ``` Create a payment ```shell curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_Yo6nUGV4YXm5VBniRWzk7w3gd8z7qIodkbIYZOqkxf7wfrUpWrDYcIJdpeYnDZcX' \ --data-raw ' { "amount": 100, "currency": "USD", "confirm": false, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" }, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65" } ' ``` do session call ```shell curl --location 'http://localhost:8080/payments/session_tokens' \ --header 'Content-Type: application/json' \ --header 'api-key: pk_dev_220c67f397a446a5bd74670be511dc22' \ --data '{ "payment_id": "pay_psophzCF50w1qjRjKR1O", "wallets": [], "client_secret": "pay_psophzCF50w1qjRjKR1O_secret_WUPOg3OCoQX1lcRHHCYk" }' ``` Response ```shell { "payment_id": "pay_psophzCF50w1qjRjKR1O", "client_secret": "pay_psophzCF50w1qjRjKR1O_secret_WUPOg3OCoQX1lcRHHCYk", "session_token": [ { "wallet_name": "click_to_pay", "dpa_id": "DPA-ID", "dpa_name": "TestMerchant", "locale": "en_AU", "card_brands": [ "AmericanExpress", "Mastercard", "Visa" ], "acquirer_bin": "545301", "acquirer_merchant_id": "SRC3DS", "merchant_category_code": "0001", "merchant_country_code": "US", "transaction_amount": "1.00", "transaction_currency_code": "USD", "phone_number": "999999999", "email": "guest@example.com", "phone_country_code": "+65", "provider": "mastercard", "dpa_client_id": null } ] } ``` card brands should contain union of card brands supported via both cybersource and adyen ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **payment** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/payments.rs` **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/query/merchant_connector_account.rs` **3. Core Business Logic** - `crates/router/src/core/payments.rs` **4. External Connector Integration** - `crates/connector_configs/toml/development.toml` - `crates/connector_configs/toml/production.toml` - `crates/connector_configs/toml/sandbox.toml` - ... and 1 more files **5. Configuration Files** - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - `config/development.toml` - ... and 3 more files **6. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` - `crates/router/src/db/kafka_store.rs` **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (4 changes) - Extend existing types with new fields (17 changes) - Add conditional logic for feature flags or filtering (3 changes) - Modify database queries (4 changes) **Detailed Identifier Changes:** Commit d2ff66bb: Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/diesel_models/src/query/merchant_connector_account.rs** Add: - function: pub::list_enabled_by_profile_id **crates/router/src/configs/secrets_transformers.rs** Modify existing code **crates/router/src/configs/settings.rs** Add: - function: private::deserialize_connector_list - struct: pub::AuthenticationProviders - struct: private::Wrapper **crates/router/src/core/payments.rs** Add: - function: private::get_card_brands_based_on_active_merchant_connector_account **crates/router/src/db/kafka_store.rs** Modify existing code **crates/router/src/db/merchant_connector_account.rs** Modify existing code
{"pr_number": 7858, "pr_title": "feat(core): Add cardbrand union fetch logic for click to pay session response", "merged_at": "2025-04-28T12:21:01Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/query/merchant_connector_account.rs"], "core_business": ["crates/router/src/core/payments.rs"], "connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/router/src/db/merchant_connector_account.rs"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/secrets_transformers.rs", "crates/router/src/configs/settings.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/router/src/db/kafka_store.rs"]}, "change_types": {"structs_added": 2, "functions_added": 4, "fields_added": 17, "imports_added": 1, "conditionals_added": 3, "database_queries": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(core): add psync support for recovery external payments ## 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 --> Generally in case of external payments we don't get the network error code and error messages from the billing connector. Since this data is important we need to fetch them using Psync call for the Payment connectors and update our payment attempts. In this PR we have added support for Psync in record attempt 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). --> We are currently recording external attempts from billing connector. To populate necessary data to take decision from ML model we will call payment connector to get network error code and network error message. Note : this step should be avoided for interal payments which uses record attempt flow. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> **Note:** Can't test this flow via chargebee, becuase chargebee supports stripe and braintree. And we can't get stripe and braintree network error code or network error message to update the payment attempt from PSYNC call. But providing steps to check this flow for future reference. 1) create any payment processor ```curl --location 'http://localhost:8080/v2/connector-accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-merchant-id: cloth_seller_u1obmbS8P5wzyGRLpGoG' \ --header 'x-profile-id: pro_aco3I1QJWu0ZWyKxzIDo' \ --header 'Authorization: admin-api-key=test_admin' \ --header 'api-key: ••••••' \ --data '{ "connector_type": "payment_processor", "connector_name": "stripe", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "stripe_api_key" }, "connector_webhook_details": { "merchant_secret": "" }, "metadata" : { "prefix_url" :"" }, "profile_id": "pro_aco3I1QJWu0ZWyKxzIDo" }' ``` 2) create any billing processor, and add payment processor in revenue recovery 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_u1obmbS8P5wzyGRLpGoG' \ --header 'x-profile-id: pro_aco3I1QJWu0ZWyKxzIDo' \ --header 'Authorization: admin-api-key=test_admin' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "billing_processor", "connector_name": "chargebee", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "chargebee_api_key" }, "connector_webhook_details": { "merchant_secret": "username", "additional_secret" : "password" }, "feature_metadata": { "revenue_recovery": { "max_retry_count": 27, "billing_connector_retry_threshold": 2, "billing_account_reference": { "mca_HM2cIezxfzOFtlys1R53": "gw_AzZixQUeNJUxX9ye" } } }, "metadata": { "site": "nish-test" }, "profile_id": "pro_aco3I1QJWu0ZWyKxzIDo" }' ``` 3) trigger payment failed external webhook from billing processor(this can be trigger from either dashboard of cb or use below curl) ``` curl --location 'http://localhost:8080/v2/webhooks/recovery/cloth_seller_u1obmbS8P5wzyGRLpGoG/pro_aco3I1QJWu0ZWyKxzIDo/mca_X3udn11zAvLQkJ1r7Yyo' \ --header 'Content-Type: application/json' \ --header 'Authorization: ••••••' \ --data-raw '{ "id": "ev_169vy3UaPFn4L4mf", "occurred_at": 1737361021, "source": "admin_console", "user": "ns22eem1r18@student.nitw.ac.in", "object": "event", "api_version": "v2", "content": { "transaction": { "id": "txn_169vy3UaPFmC44mq", "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": "pi_3RLK2JSH4GMzd3pv0BWF0cuj", "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": "2234r5tgfasasdfdfad3", "customer_id": "Azq8o5UaLqWWvyGd", "subscription_id": "Azq8o5UaLr2WnyHG", "recurring": false, "status": "paid", "price_type": "tax_exclusive", "date": 1737361018, "due_date": 1737361018, "net_term_days": 0, "exchange_rate": 1, "total": 5, "amount_paid": 0, "amount_adjusted": 0, "write_off_amount": 0, "credits_applied": 0, "amount_due": 0, "paid_at": 1737361019, "updated_at": 1737361021, "resource_version": 1737361021401, "deleted": false, "object": "invoice", "first_invoice": false, "amount_to_collect": 0, "round_off_amount": 0, "has_advance_charges": false, "currency_code": "INR", "base_currency_code": "INR", "generated_at": 1737361018, "is_gifted": false, "term_finalized": true, "channel": "web", "tax": 0, "line_items": [ { "id": "li_169vy3UaPFmBR4md", "date_from": 1737361004, "date_to": 1737361004, "unit_amount": 500000, "quantity": 1, "amount": 500000, "pricing_model": "flat_fee", "is_taxed": false, "tax_amount": 0, "object": "line_item", "subscription_id": "Azq8o5UaLr2WnyHG", "customer_id": "Azq8o5UaLqWWvyGd", "description": "Implementation Charge", "entity_type": "charge_item_price", "entity_id": "cbdemo_implementation-charge-INR", "tax_exempt_reason": "tax_not_configured", "discount_amount": 0, "item_level_discount_amount": 0 } ], "sub_total": 500000, "linked_payments": [ { "txn_id": "txn_169vy3UaPFmC44me", "applied_amount": 500000, "applied_at": 1737361021, "txn_status": "success", "txn_date": 1737361019, "txn_amount": 500000 } ], "applied_credits": [], "adjustment_credit_notes": [], "issued_credit_notes": [], "linked_orders": [], "dunning_attempts": [], "billing_address": { "first_name": "test1", "last_name": "name", "email": "johndoe@gmail.com", "company": "johndoe", "phone": "+91 83 17 575848", "line1": "asdf", "line2": "asd", "line3": "ahjkd", "city": "asdf", "state_code": "TG", "state": "Telangana", "country": "IN", "zip": "561432", "validation_status": "not_validated", "object": "billing_address" }, "site_details_at_creation": { "timezone": "Asia/Calcutta" } }, "customer": { "id": "Azq8o5UaLqWWvyGd", "first_name": "john", "last_name": "doe", "email": "john@gmail.com", "phone": "831 757 5848", "company": "johndoe", "auto_collection": "on", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1737310670, "created_from_ip": "205.254.163.189", "taxability": "taxable", "updated_at": 1737360899, "pii_cleared": "active", "channel": "web", "resource_version": 1737360899990, "deleted": false, "object": "customer", "billing_address": { "first_name": "test1", "last_name": "name", "email": "johndoe@gmail.com", "company": "johndoe", "phone": "+91 83 17 575848", "line1": "asdf", "line2": "asd", "line3": "ahjkd", "city": "asdf", "state_code": "TG", "state": "Telangana", "country": "IN", "zip": "561432", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "valid", "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "INR", "mrr": 0, "primary_payment_source_id": "pm_169vy3UaPDo0t4hL", "payment_method": { "object": "payment_method", "type": "card", "reference_id": "cus_RcUo8xTwe0sHP7/card_1QjG2dSHworDX2hs6YIjKdML", "gateway": "stripe", "gateway_account_id": "gw_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": "johndoe@gmail.com", "company": "johndoe", "phone": "+91 83 17 575848", "line1": "asdf", "line2": "asd", "line3": "ahjkd", "city": "asdf", "state_code": "TG", "state": "Telangana", "country": "IN", "zip": "561432", "validation_status": "not_validated", "object": "shipping_address" }, "due_invoices_count": 0, "mrr": 0, "exchange_rate": 1, "base_currency_code": "INR", "has_scheduled_advance_invoices": false } }, "event_type": "payment_failed", "webhook_status": "scheduled", "webhooks": [ { "id": "whv2_6oZfZUaLmtchA5Bl", "webhook_status": "scheduled", "object": "webhook" } ] }' ``` 4) Using gateway transaction id, recovery record attempt flow should call the connector and fetch network error code and network error message. ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments.rs` **2. Core Business Logic** - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/operations/payment_attempt_record.rs` **Code Patterns Applied:** - Extend existing types with new fields (22 changes) **Detailed Identifier Changes:** Commit 60835abe: Files to modify: **crates/hyperswitch_domain_models/src/payments.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/operations/payment_attempt_record.rs** Modify existing code
{"pr_number": 7855, "pr_title": "feat(core): add psync support for recovery external payments", "merged_at": "2025-05-12T14:30:04Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/payments.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_attempt_record.rs"]}, "change_types": {"fields_added": 22}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [Adyen] Fetch email from customer email for payment request ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [X] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Fetch email from customer email whenever billing email is not present for payment request ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test 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 in Postman [Testing Doc](https://docs.google.com/document/d/1IFP36183A8gMwJz0gB8hHi2nIoTLgmppE15XM5g0yz0/edit?usp=sharing) ## Checklist <!-- Put an `x` in the boxes that apply --> - [X] I formatted the code `cargo +nightly fmt --all` - [X] I addressed lints thrown by `cargo clippy` - [X] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/router/src/connector/adyen/transformers.rs` **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (2 changes) **Detailed Identifier Changes:** Commit 9998c557: Files to modify: **crates/router/src/connector/adyen/transformers.rs** Add: - function: private::get_optional_shopper_email
{"pr_number": 6676, "pr_title": "feat(connector): [Adyen] Fetch email from customer email for payment request", "merged_at": "2024-11-29T10:28:36Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment"]}, "hierarchy": {"connectors": ["crates/router/src/connector/adyen/transformers.rs"]}, "change_types": {"functions_added": 1, "fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(core): accept merchant_connector_details in Payments and Psync flow ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description - Accept merchant_connector_credentials in the Request Body of payments and psync - Add a new POST endpoint `payments_status_with_gateway_creds` - Add merchant_reference_id in payments response ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? 1. Create a Iatapay UPI Collect Payment using merchant_connector_details in request ``` curl --location 'http://localhost:8080/v2/payments' \ --header 'x-profile-id: pro_0kVhEGeBzYWrYTKjPNsu' \ --header 'Content-Type: application/json' \ --header 'Authorization: api-key=_' \ --data-raw '{ "amount_details": { "currency": "INR", "order_amount": 5000 }, "merchant_connector_details": { "connector_name": "iatapay", "merchant_connector_creds": { "auth_type": "SignatureKey", "api_secret": "_", "api_key": "_", "key1": "_" } }, "merchant_reference_id": "12345_pay_01970c787911748861401", "payment_method_data": { "upi": { "upi_collect": { "vpa_id": "successtest@iata" } }, "billing": { "phone": { "number": "8056594427", "country_code": "+91" }, "email": "swangi.kumari@juspay.in" } }, "payment_method_subtype": "upi_collect", "payment_method_type": "upi" }' ``` Response ``` "id": "12345_pay_01973043e4f07320a2fb3fa247d53663", "status": "requires_customer_action", "amount": { "order_amount": 5000, "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": 5000, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": null }, "customer_id": null, "connector": "iatapay", "created": "2025-06-02T10:50:45.360Z", "payment_method_data": { "billing": { "address": null, "phone": { "number": "8056594427", "country_code": "+91" }, "email": "swangi.kumari@juspay.in" } }, "payment_method_type": "upi", "payment_method_subtype": "upi_collect", "connector_transaction_id": "PXABN7QEGDQE6", "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": "redirect_to_url", "redirect_to_url": "http://localhost:8080/v2/payments/12345_pay_01973043e4f07320a2fb3fa247d53663/start-redirection?publishable_key=pk_dev_5dd7e3043d9a4d88a2c8d2939b3f9f25&profile_id=pro_0kVhEGeBzYWrYTKjPNsu" }, "return_url": "https://google.com/success", "authentication_type": null, "authentication_type_applied": "no_three_ds", "is_iframe_redirection_enabled": null, "merchant_reference_id": "12345_pay_01970c787911748934115" } ``` Complete the payment using redirection url. use `successtest@iata` upi for testing 2. Do a post Psync call with merchant_connector_details in request ``` curl --location 'http://localhost:8080/v2/payments/12345_pay_01973047de457891be56cf7b828a964e' \ --header 'x-profile-id: pro_0kVhEGeBzYWrYTKjPNsu' \ --header 'Content-Type: application/json' \ --header 'Authorization: api-key=_' \ --data '{ "merchant_connector_details": { "connector_name": "iatapay", "merchant_connector_creds": { "auth_type": "SignatureKey", "api_secret": "_", "api_key": "_", "key1": "_" } }, "force_sync" : true }' ``` Response ``` { "id": "12345_pay_01973047de457891be56cf7b828a964e", "status": "succeeded", "amount": { "order_amount": 5000, "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": 5000, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": 5000 }, "customer_id": null, "connector": "iatapay", "created": "2025-06-02T10:55:05.797Z", "payment_method_data": { "billing": { "address": null, "phone": { "number": "8056594427", "country_code": "+91" }, "email": "swangi.kumari@juspay.in" } }, "payment_method_type": "upi", "payment_method_subtype": "upi_collect", "connector_transaction_id": "P18ISDL9I3LI3", "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/success", "authentication_type": null, "authentication_type_applied": null, "is_iframe_redirection_enabled": null, "merchant_reference_id": "12345_pay_01970c787911748934115" } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for providing merchant connector details directly in payment requests and responses, enabling enhanced gateway credential handling. - Introduced new request and response fields for merchant connector details and merchant reference IDs to improve idempotency and tracking. - Added new endpoints and request types for retrieving payment status with gateway credentials. - **Improvements** - Updated multiple APIs and flows to support both merchant connector account and direct connector details, increasing flexibility in integration scenarios. - Enhanced OpenAPI documentation to include new payment request types and connector detail structures. - **Bug Fixes** - Improved handling of optional merchant connector IDs in payment flows to prevent errors when details are provided directly. - **Refactor** - Unified and streamlined how merchant connector account information is passed and processed across payment, vault, and payout flows. - Updated function signatures and internal logic to consistently support the new merchant connector details abstraction. <!-- 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/payments.rs` **2. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/customer.rs` - `crates/hyperswitch_domain_models/src/merchant_connector_account.rs` - `crates/hyperswitch_domain_models/src/payments.rs` - ... and 2 more files **3. Core Business Logic** - `crates/router/src/core/fraud_check/flows/checkout_flow.rs` - `crates/router/src/core/fraud_check/flows/record_return.rs` - `crates/router/src/core/fraud_check/flows/sale_flow.rs` - ... and 32 more files **4. 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 (23 changes) - Extend existing types with new fields (130 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit b8b19605: Files to modify: **crates/api_models/src/payments.rs** Add: - struct: pub::MerchantConnectorDetails - struct: pub::PaymentsStatusRequest **crates/hyperswitch_domain_models/src/customer.rs** Modify existing code **crates/hyperswitch_domain_models/src/merchant_connector_account.rs** Add: - function: pub::get_connector_account_details - function: pub::is_disabled - function: pub::get_metadata - function: pub::get_id - function: pub::get_mca_id - function: pub::get_connector_name - function: pub::get_inner_db_merchant_connector_account - enum: pub::MerchantConnectorAccountTypeDetails - impl: impl MerchantConnectorAccountTypeDetails **crates/hyperswitch_domain_models/src/payments.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code **crates/hyperswitch_domain_models/src/revenue_recovery.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/router/src/core/fraud_check/flows/checkout_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/payment_methods.rs** Modify existing code **crates/router/src/core/payment_methods/vault.rs** Modify existing code **crates/router/src/core/payments.rs** Add: - function: pub::internal_payments_operation_core **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** Remove: - function: pub::get_inner_db_merchant_connector_account Add: - function: pub::get_connector_data_from_request **crates/router/src/core/payments/operations.rs** Add: - function: private::get_connector_from_request **crates/router/src/core/payments/operations/payment_confirm_intent.rs** Add: - function: private::get_connector_from_request **crates/router/src/core/payments/operations/payment_get.rs** Add: - function: private::get_connector_from_request **crates/router/src/core/payments/operations/proxy_payments_intent.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/payments/vault_session.rs** Modify existing code **crates/router/src/core/payouts/helpers.rs** Modify existing code **crates/router/src/core/revenue_recovery/api.rs** Modify existing code **crates/router/src/core/utils.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/routes/app.rs** Modify existing code **crates/router/src/routes/payments.rs** Add: - function: pub::payments_status_with_gateway_creds
{"pr_number": 8199, "pr_title": "feat(core): accept merchant_connector_details in Payments and Psync flow", "merged_at": "2025-06-17T15:54:49Z", "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/customer.rs", "crates/hyperswitch_domain_models/src/merchant_connector_account.rs", "crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/revenue_recovery.rs"], "core_business": ["crates/router/src/core/fraud_check/flows/checkout_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/payment_methods.rs", "crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/payments.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.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/proxy_payments_intent.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/payments/vault_session.rs", "crates/router/src/core/payouts/helpers.rs", "crates/router/src/core/revenue_recovery.rs", "crates/router/src/core/revenue_recovery/api.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/incoming_v2.rs", "crates/router/src/core/webhooks/recovery_incoming.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/payments.rs"]}, "change_types": {"structs_added": 2, "functions_added": 23, "enums_added": 1, "fields_added": 130, "imports_added": 6, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(utils): add to_state_code to router crate ## 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 --> klarna in router crate uses to_state_code in branch hotfix-2025.02.05, thus, to_state_code implementation needs to be present in router 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). --> ## How did you test 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/router/src/connector/utils.rs` **Code Patterns Applied:** - Implement new functions (4 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 7691108e: Files to modify: **crates/router/src/connector/utils.rs** Add: - function: private::to_state_code - function: private::to_state_code_as_optional
{"pr_number": 7293, "pr_title": "fix(utils): add to_state_code to router crate", "merged_at": "2025-02-17T18:21:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/router/src/connector/utils.rs"]}, "change_types": {"functions_added": 4, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): [STRIPE] Throwing Missing Required Field Error if connector_customer is not present ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description If there's no connector customer present corresponding to the customer_id of hyperswitch, then it throws a missing required field error. This shouldn't happen. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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? Payments Create - Stripe cURL: ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_vfxFoWMrWCpCBEJVGRW8G2roAA39FU3iR1axn70BcPvluPBFMx6ApNWrvMc5mscP' \ --header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \ --data-raw '{ "amount": 6540, "authentication_type": "no_three_ds", "confirm": true, "currency": "USD", "customer_acceptance": { "acceptance_type": "online" }, "customer_id": "cus_uYakn3OQTUtAgetLDOE1", "payment_method": "card", "payment_method_type": "debit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "card_cvc": "737" } }, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" }, "email": "xyz@gmail.com", "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } } }' ``` Response : ``` { "payment_id": "pay_nbRh3f4gebbql2kUQT86", "merchant_id": "merchant_1749478802", "status": "succeeded", "amount": 6540, "net_amount": 6540, "shipping_cost": null, "amount_capturable": 0, "amount_received": 6540, "connector": "stripe", "client_secret": "pay_nbRh3f4gebbql2kUQT86_secret_NThetuLmVBXVFF6wUld7", "created": "2025-06-10T13:43:43.297Z", "currency": "USD", "customer_id": "cus_uYakn3OQTUtAgetLDOE1", "customer": { "id": "cus_uYakn3OQTUtAgetLDOE1", "name": null, "email": "xyz@gmail.com", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": null, "payment_method": "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": { "cvc_check": "pass", "address_line1_check": "pass", "address_postal_code_check": "pass" }, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": "xyz@gmail.com", "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cus_uYakn3OQTUtAgetLDOE1", "created_at": 1749563023, "expires": 1749566623, "secret": "epk_f55d7c66cc534405869d74f14604494c" }, "manual_retry_allowed": false, "connector_transaction_id": "pi_3RYSSpBijkbtUqNS1JC1ZM3z", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "pi_3RYSSpBijkbtUqNS1JC1ZM3z", "payment_link": null, "profile_id": "pro_Awzz3cqq9GCpCuPYgAwf", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_xtzXeEZ7fUMIoBoodWqu", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-06-10T13:58:43.297Z", "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-06-10T13:43:44.488Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved handling of customer information during payment authorization, allowing payments to proceed even if customer details are not provided. - **API Updates** - Updated payment method responses to clarify recurring payment support: customer payment methods now require a non-null recurring eligibility indicator, while general payment methods have this indicator as optional. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs` **2. Other** - `api-reference-v2/openapi_spec.json` **Code Patterns Applied:** - Extend existing types with new fields (1 changes) **Detailed Identifier Changes:** Commit c3a7f5c4: Files to modify: **crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs** Modify existing code
{"pr_number": 8309, "pr_title": "fix(connector): [STRIPE] Throwing Missing Required Field Error if connector_customer is not present", "merged_at": "2025-06-10T15:09:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(router): Make v2 endpoints follow standard naming conventions ## 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 --> - Consistently use kebab case in endpoint URLs - Use plural form of resources in URLs, i.e. instead of `/v2/organization`, use `/v2/organizations` Renamed (current version removed) endpoints: `/v2/organization` -> `/v2/organizations` `/v2/routing-algorithm` -> `/v2/routing-algorithms` `/v2/payment-methods-session` -> `/v2/payment-method-sessions` (refunds) `/update_metadata` -> `update-metadata` Duplicated (current version not removed) endpoints: `/v2/user` -> `/v2/users` `/create_merchant` -> `/create-merchant` `/v2/process_tracker/revenue_recovery_workflow` -> `/v2/process-trackers/revenue-recovery-workflow` `/list_attempts` -> `/list-attempts` ### 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 #8629 ## How did you test 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. Organization Request: ``` curl --location 'http://localhost:8080/v2/organizations' \ --header 'Authorization: admin-api-key=test_admin' \ --header 'Content-Type: application/json' \ --data '{ "organization_name": "v2_org_1752571446" }' ``` Response: ```json { "id": "org_4YoqpRWuOelFCr7Lbh2l", "organization_name": "v2_org_1752571419", "organization_details": null, "metadata": null, "modified_at": "2025-07-15 09:23:39.045598", "created_at": "2025-07-15 09:23:39.045496" } ``` 2. Payment Method Sessions: Request: ``` curl --location 'http://localhost:8080/v2/payment-method-sessions' \ --header 'x-profile-id: pro_k5m9OvIbAwRr29ZJrZFN' \ --header 'Authorization: api-key=dev_e0A7pdYme3jeCbLscKnTIXBci4IcuiixFCwaN0H3usrmeVSkKcn5r701nisZsvZc' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_e0A7pdYme3jeCbLscKnTIXBci4IcuiixFCwaN0H3usrmeVSkKcn5r701nisZsvZc' \ --data-raw '{ "customer_id": "12345_cus_01980d66d85c78f28c2f25980c48a60b", "billing": { "address": { "first_name": "John", "last_name": "Dough" }, "email": "example@example.com" } }' ``` Response: ```json { "id": "12345_pms_01980d66e6ab715093173e3078818fc5", "customer_id": "12345_cus_01980d66d85c78f28c2f25980c48a60b", "billing": { "address": { "city": null, "country": null, "line1": null, "line2": null, "line3": null, "zip": null, "state": null, "first_name": "John", "last_name": "Dough" }, "phone": null, "email": "example@example.com" }, "psp_tokenization": null, "network_tokenization": null, "tokenization_data": null, "expires_at": "2025-07-15T09:40:04.299Z", "client_secret": "cs_01980d66e6ab715093173e43f85db63a", "return_url": null, "next_action": null, "authentication_details": null, "associated_payment_methods": null, "associated_token_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/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs` **2. Tests** - `cypress-tests-v2/cypress/support/commands.js` **3. Other** - `api-reference/v2/openapi_spec_v2.json` - `api-reference/v2/organization/organization--create.mdx` - `api-reference/v2/organization/organization--merchant-account--list.mdx` - ... and 19 more files **Code Patterns Applied:** - Define new data structures (3 changes) - Implement new functions (2 changes) **Detailed Identifier Changes:** Commit db147646: Files to modify: **crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs** Modify existing code **crates/openapi/src/routes/organization.rs** Modify existing code **crates/openapi/src/routes/payment_method.rs** Modify existing code **crates/openapi/src/routes/refunds.rs** Modify existing code **crates/openapi/src/routes/revenue_recovery.rs** Modify existing code **crates/openapi/src/routes/routing.rs** Modify existing code **crates/router/src/lib.rs** Modify existing code **crates/router/src/routes.rs** Modify existing code **crates/router/src/routes/app.rs** Remove: - struct: pub::User Add: - function: pub::server - function: pub::server - struct: pub::User - struct: pub::ProcessTrackerDeprecated - impl: impl User - impl: impl ProcessTrackerDeprecated
{"pr_number": 8630, "pr_title": "fix(router): Make v2 endpoints follow standard naming conventions", "merged_at": "2025-07-21T15:41:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs"], "tests": ["cypress-tests-v2/cypress/support/commands.js"], "other": ["api-reference/v2/openapi_spec_v2.json", "api-reference/v2/organization/organization--create.mdx", "api-reference/v2/organization/organization--merchant-account--list.mdx", "api-reference/v2/organization/organization--retrieve.mdx", "api-reference/v2/organization/organization--update.mdx", "api-reference/v2/payment-method-session/payment-method-session--confirm-a-payment-method-session.mdx", "api-reference/v2/payment-method-session/payment-method-session--create.mdx", "api-reference/v2/payment-method-session/payment-method-session--delete-a-saved-payment-method.mdx", "api-reference/v2/payment-method-session/payment-method-session--list-payment-methods.mdx", "api-reference/v2/payment-method-session/payment-method-session--retrieve.mdx", "api-reference/v2/payment-method-session/payment-method-session--update-a-saved-payment-method.mdx", "api-reference/v2/revenue-recovery/revenue-recovery--retrieve.mdx", "api-reference/v2/routing/routing--create.mdx", "api-reference/v2/routing/routing--retrieve.mdx", "crates/openapi/src/routes/organization.rs", "crates/openapi/src/routes/payment_method.rs", "crates/openapi/src/routes/refunds.rs", "crates/openapi/src/routes/revenue_recovery.rs", "crates/openapi/src/routes/routing.rs", "crates/router/src/lib.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs"]}, "change_types": {"structs_added": 3, "functions_added": 2, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
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 --> 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": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "card_cvc": "737" } }, "billing": { "address": { "line1": "1467", "line2": "CA", "line3": "CA", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "CA", "line3": "CA", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8", "language": "nl-NL", "color_depth": 24, "ip_address": "127.2.2.0", "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } } ``` Response: ``` { "payment_id": "pay_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": "guest@example.com", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_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": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://google.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "StripeCustomer", "created_at": 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": "guest@example.com" } }, "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": "guest@example.com" }, "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": "guest@example.com" }, "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": "guest@example.com" }, "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 1fc94105: Files to modify: **crates/router/src/configs/defaults/payment_connector_required_fields.rs** Modify existing code
{"pr_number": 6911, "pr_title": "fix(connector): [Cybersource] fix the required fields for wallet mandate payments", "merged_at": "2024-12-23T09:38:59Z", "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"}
fix(dummyconnector): add tenant id in dummyconnector requests ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix ## Description <!-- Describe your changes in detail --> Add tenant id in dummy connector requests ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> Dummy connector calls `http://localhost:8080` plus respective endpoints. But when multi tenancy is enabled app server expects the requests to have `x-tenant-id` header in the request. Absence of this would call the dummy connector requests to fail. This PR addresses that ## How did you test 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 `stripe_test` PaymentsConnector ```bash curl --location 'http://localhost:8080/account/1736322673/connectors' \ --header 'cache-control: no-cache' \ --header 'content-type: application/json' \ --header 'x-tenant-id: public' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "payment_processor", "connector_name": "stripe_test", "connector_label": "stripe_test_default", "disabled": false, "test_mode": true, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "debit", "card_networks": [ "Mastercard" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "card_networks": [ "Visa" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "card_networks": [ "Interac" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "card_networks": [ "AmericanExpress" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "card_networks": [ "JCB" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "card_networks": [ "DinersClub" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "card_networks": [ "Discover" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "card_networks": [ "CartesBancaires" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "debit", "card_networks": [ "UnionPay" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "card_networks": [ "Mastercard" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "card_networks": [ "Visa" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "card_networks": [ "Interac" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "card_networks": [ "AmericanExpress" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "card_networks": [ "JCB" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "card_networks": [ "DinersClub" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "card_networks": [ "Discover" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "card_networks": [ "CartesBancaires" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false }, { "payment_method_type": "credit", "card_networks": [ "UnionPay" ], "minimum_amount": 0, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": false } ] } ], "metadata": {}, "connector_account_details": { "api_key": "test_key", "auth_type": "HeaderKey" }, "additional_merchant_data": null, "status": "active", "pm_auth_config": null, "connector_wallets_details": null }' ``` 2. Create a Payment with `stripe_test` as the connector ```bash curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-tenant-id: public' \ --header 'api-key: dev_Pkb2Z4Lk00hQnSOtWXWxGL7NjZ41ySJ1KRLrmMRnbNCChaPnj0m8Uc9EnYE9SW86' \ --data-raw '{ "amount": 600, "currency": "USD", "confirm": true, "capture_method": "automatic", "customer_id": "HScustomer1234", "email": "p143@example.com", "amount_to_capture": 600, "description": "Its my first payment request", "capture_on": "2022-09-10T10:11:12Z", "return_url": "https://google.com", "name": "Preetam", "phone": "999999999", "setup_future_usage": "off_session", "connector": ["stripe_test"], "phone_country_code": "+65", "authentication_type": "three_ds", "payment_method": "card", "payment_method_type": "debit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "card_cvc": "737" } }, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "128.0.0.1" }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "preetam", "last_name": "revankar" }, "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" } }, "order_details": [ { "product_name": "Apple iphone 15", "quantity": 1, "amount": 6540, "account_name": "transaction_processing" } ], "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` This should return status code 200 <img width="1284" alt="Screenshot 2025-01-08 at 1 32 46 PM" src="https://github.com/user-attachments/assets/6863c4fb-534c-4b64-9ceb-dcf216e163ee" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code
To implement this **payment** feature, you'll need to modify these architectural layers: **1. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/router_data.rs` - `crates/hyperswitch_domain_models/src/router_data_v2.rs` **2. Core Business Logic** - `crates/router/src/core/authentication.rs` - `crates/router/src/core/authentication/transformers.rs` - `crates/router/src/core/fraud_check/flows/checkout_flow.rs` - ... and 16 more files **3. External Connector Integration** - `crates/router/src/connector/dummyconnector.rs` - `crates/router/src/types/api/verify_connector.rs` - `crates/router/src/types/api/verify_connector/paypal.rs` - ... and 2 more files **4. Type Definitions** - `crates/router/src/types.rs` **5. Other** - `crates/router/src/services/conversion_impls.rs` **Code Patterns Applied:** - Extend existing types with new fields (62 changes) **Detailed Identifier Changes:** Commit 9c983b68: Files to modify: **crates/hyperswitch_domain_models/src/router_data.rs** Modify existing code **crates/hyperswitch_domain_models/src/router_data_v2.rs** Modify existing code **crates/router/src/connector/dummyconnector.rs** Modify existing code **crates/router/src/core/authentication.rs** Modify existing code **crates/router/src/core/authentication/transformers.rs** Modify existing code **crates/router/src/core/fraud_check/flows/checkout_flow.rs** Modify existing code **crates/router/src/core/fraud_check/flows/fulfillment_flow.rs** Modify existing code **crates/router/src/core/fraud_check/flows/record_return.rs** Modify existing code **crates/router/src/core/fraud_check/flows/sale_flow.rs** Modify existing code **crates/router/src/core/fraud_check/flows/transaction_flow.rs** Modify existing code **crates/router/src/core/mandate.rs** Modify existing code **crates/router/src/core/mandate/utils.rs** Modify existing code **crates/router/src/core/payments/helpers.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/payouts.rs** Modify existing code **crates/router/src/core/relay/utils.rs** Modify existing code **crates/router/src/core/unified_authentication_service.rs** Modify existing code **crates/router/src/core/unified_authentication_service/utils.rs** Modify existing code **crates/router/src/core/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/utils.rs** Modify existing code **crates/router/src/services/conversion_impls.rs** Modify existing code **crates/router/src/types.rs** Modify existing code **crates/router/src/types/api/verify_connector.rs** Modify existing code **crates/router/src/types/api/verify_connector/paypal.rs** Modify existing code **crates/router/tests/connectors/aci.rs** Modify existing code **crates/router/tests/connectors/utils.rs** Modify existing code
{"pr_number": 7008, "pr_title": "fix(dummyconnector): add tenant id in dummyconnector requests", "merged_at": "2025-01-09T09:39:26Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_data_v2.rs"], "core_business": ["crates/router/src/core/authentication.rs", "crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/fraud_check/flows/checkout_flow.rs", "crates/router/src/core/fraud_check/flows/fulfillment_flow.rs", "crates/router/src/core/fraud_check/flows/record_return.rs", "crates/router/src/core/fraud_check/flows/sale_flow.rs", "crates/router/src/core/fraud_check/flows/transaction_flow.rs", "crates/router/src/core/mandate.rs", "crates/router/src/core/mandate/utils.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/payouts.rs", "crates/router/src/core/relay/utils.rs", "crates/router/src/core/unified_authentication_service.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/utils.rs"], "connectors": ["crates/router/src/connector/dummyconnector.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/src/types/api/verify_connector/paypal.rs", "crates/router/tests/connectors/aci.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/router/src/types.rs"], "other": ["crates/router/src/services/conversion_impls.rs"]}, "change_types": {"fields_added": 62, "imports_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(update_metadata): Update Metadata for any connectors other than stripe gives 500 error ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description HOTFIX PR <!-- Describe your changes in detail --> Update metadata gives `500` error for other connectors than stripe Change this to `400` - Base pr : https://github.com/juspay/hyperswitch/pull/7984 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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 successful payment using any connector other than stripe - make update metadata request ```sh curl --location 'http://localhost:8080/payments/pay_X77ffJsUvEW94JadFVpw/update_metadata' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_bTSpZN98PGIduROqZNoagEkN7XUxd7dof6cgl8K061T2Vvw6rRaplOVejfRiYUI9' \ --data '{ "metadata": { "order_id": "999999897989", "dbehcb": "2324", "abb": "efe" } }' ``` Response should be 400 ```json { "error": { "type": "connector", "message": "IR_20: Flow is not implemented for this connector", "code": "CE_00", "connector": "cybersource" } } ``` - update metadata for successful payment created via stripe should give success response ```json { "payment_id": "pay_fvWhpXtZwWZSE1JfTUI4", "metadata": { "abb": "efe", "dbehcb": "2324", "order_id": "999999897989" } } ``` ## Checklist <!-- Put 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/flows/update_metadata_flow.rs` - `crates/router/src/core/payments/transformers.rs` **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (60 changes) **Detailed Identifier Changes:** Commit 900fe338: Files to modify: **crates/router/src/core/payments/flows/update_metadata_flow.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Add: - function: pub::construct_payment_router_data_for_update_metadata
{"pr_number": 7986, "pr_title": "fix(update_metadata): Update Metadata for any connectors other than stripe gives 500 error", "merged_at": "2025-05-08T11:04:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "order", "connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/flows/update_metadata_flow.rs", "crates/router/src/core/payments/transformers.rs"]}, "change_types": {"functions_added": 1, "fields_added": 60}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
chore(connectors): [fiuu] update pm_filters for apple pay and google pay ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description This PR enables country Malaysia for processing APay and GPay transactions via Fiuu ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context Helps process APay and GPay txns using MYR currency. ## How did you test it? For valid currency - MYR <img width="665" alt="Screenshot 2025-02-05 at 7 46 56 PM" src="https://github.com/user-attachments/assets/3611f5ae-0c69-4a11-9907-81ec4eca4385" /> For invalid currency - ex. USD <img width="628" alt="Screenshot 2025-02-05 at 7 47 51 PM" src="https://github.com/user-attachments/assets/f12d3952-4f19-4526-a999-466426841eb2" /> ## Checklist <!-- Put 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. Tests** - `config/deployments/integration_test.toml` **2. Configuration Files** - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - `config/development.toml`
{"pr_number": 7182, "pr_title": "chore(connectors): [fiuu] update pm_filters for apple pay and google pay", "merged_at": "2025-02-06T15:20:10Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "transaction"]}, "hierarchy": {"tests": ["config/deployments/integration_test.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
feat(router): Add v2 endpoint to list payment attempts by intent_id ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR introduces an API to list all payment attempts associated with a given intent_id. #### Why this is needed: In payment flows that involve retries—such as smart , cascading retires —a single payment intent may result in multiple attempts. Previously, there was no clean way to retrieve all these attempts together. #### Implemented API Flow: - Adds a new endpoint: GET /v2/payments/{intent_id}/list_attempts - Validates the request and ensures merchant authorization - Retrieves all associated payment attempts linked to that intent_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? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> I inserted two payment attempts for a payment intent as part of testing. ### Curl ``` curl --location 'http://localhost:8080/v2/payments/12345_pay_01978809316e7850b05ab92288ed7746/list_attempts' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: pro_pF6sS2TBfhg0Vdp6N04E' \ --header 'api-key: dev_bzJEoDI7SlTyV0M7Vq6VdtCtbKGwOPphw39wD1mYdu8rY3GoydtnymDbkkMxDopB' \ --header 'Authorization: api-key=dev_bzJEoDI7SlTyV0M7Vq6VdtCtbKGwOPphw39wD1mYdu8rY3GoydtnymDbkkMxDopB' ``` ### Response ``` { "payment_attempts": [ { "id": "12345_att_01975ae7bf32760282f479794fbf810c", "status": "failure", "amount": { "net_amount": 10000, "amount_to_capture": null, "surcharge_amount": null, "tax_on_surcharge": null, "amount_capturable": 10000, "shipping_cost": null, "order_tax_amount": null }, "connector": "stripe", "error": null, "authentication_type": "no_three_ds", "created_at": "2025-06-17T13:50:49.173Z", "modified_at": "2025-06-17T13:50:49.173Z", "cancellation_reason": null, "payment_token": null, "connector_metadata": null, "payment_experience": null, "payment_method_type": "card", "connector_reference_id": null, "payment_method_subtype": "credit", "connector_payment_id": { "TxnId": "ch_3RYW3N06IkU6uKNZ01mrX2tD" }, "payment_method_id": null, "client_source": null, "client_version": null, "feature_metadata": { "revenue_recovery": { "attempt_triggered_by": "external" } } }, { "id": "12345_att_01975ae7bf32760282f479794fbf810d", "status": "failure", "amount": { "net_amount": 10000, "amount_to_capture": null, "surcharge_amount": null, "tax_on_surcharge": null, "amount_capturable": 10000, "shipping_cost": null, "order_tax_amount": null }, "connector": "stripe", "error": null, "authentication_type": "no_three_ds", "created_at": "2025-06-17T13:51:16.812Z", "modified_at": "2025-06-17T13:51:16.812Z", "cancellation_reason": null, "payment_token": null, "connector_metadata": null, "payment_experience": null, "payment_method_type": "card", "connector_reference_id": null, "payment_method_subtype": "credit", "connector_payment_id": { "TxnId": "ch_3RYW3N06IkU6uKNZ01mrX2tD" }, "payment_method_id": null, "client_source": null, "client_version": null, "feature_metadata": { "revenue_recovery": { "attempt_triggered_by": "external" } } } ] } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/payments.rs` - `crates/hyperswitch_domain_models/src/router_flow_types/payments.rs` **3. Core Business Logic** - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/operations.rs` - `crates/router/src/core/payments/operations/payment_attempt_list.rs` - ... and 1 more files **4. Type Definitions** - `crates/router/src/types/api/payments.rs` - `crates/router_env/src/logger/types.rs` **5. Utils** - `crates/router/src/routes/lock_utils.rs` **6. 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 (5 changes) - Implement new functions (66 changes) - Extend existing types with new fields (91 changes) **Detailed Identifier Changes:** Commit 7943fb4b: Files to modify: **crates/api_models/src/events/payment.rs** Add: - function: private::get_api_event_type - function: private::get_api_event_type - impl: impl ApiEventMetric for PaymentAttemptListRequest - impl: impl ApiEventMetric for PaymentAttemptListResponse **crates/api_models/src/payments.rs** Add: - struct: pub::PaymentAttemptListRequest - struct: pub::PaymentAttemptListResponse **crates/hyperswitch_domain_models/src/payments.rs** Add: - struct: pub::PaymentAttemptListData **crates/hyperswitch_domain_models/src/router_flow_types/payments.rs** Add: - struct: pub::PaymentGetListAttempts **crates/openapi/src/openapi_v2.rs** Modify existing code **crates/router/src/core/payments.rs** Add: - function: pub::payments_attempt_operation_core - function: pub::payments_list_attempts_using_payment_intent_id - function: private::list_payments_attempts - function: private::list_payments_attempts - function: private::list_payments_attempts - function: private::list_payments_attempts - function: private::get_payment_attempt - function: private::list_payments_attempts - function: private::get_client_secret - function: private::get_payment_intent - function: private::get_payment_method_info - function: private::get_mandate_id - function: private::get_address - function: private::get_creds_identifier - function: private::get_token - function: private::get_multiple_capture_data - function: private::get_payment_link_data - function: private::get_ephemeral_key - function: private::get_setup_mandate - function: private::get_poll_config - function: private::get_authentication - function: private::get_frm_message - function: private::get_refunds - function: private::get_disputes - function: private::get_authorizations - function: private::get_attempts - function: private::get_recurring_details - function: private::get_payment_intent_profile_id - function: private::get_currency - function: private::get_amount - function: private::get_payment_attempt_connector - function: private::get_merchant_connector_id_in_attempt - function: private::get_connector_customer_id - function: private::get_billing_address - function: private::get_payment_method_data - function: private::get_sessions_token - function: private::get_token_data - function: private::get_mandate_connector - function: private::get_force_sync - function: private::get_capture_method - function: private::get_optional_payment_attempt - function: private::get_all_keys_required - function: private::get_whole_connector_response - function: private::get_pre_routing_result - function: private::get_merchant_connector_details - function: private::get_optional_external_vault_session_details - impl: impl OperationSessionGetters<F> for PaymentAttemptListData<F> **crates/router/src/core/payments/operations.rs** Remove: - mod: pub::proxy_payments_intent Add: - mod: pub::payment_attempt_list - mod: pub::proxy_payments_intent **crates/router/src/core/payments/operations/payment_attempt_list.rs** Add: - 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::get_trackers - function: private::update_trackers - function: private::validate_request - function: private::get_customer_details - function: private::make_pm_data - function: private::perform_routing - function: private::guard_payment_against_blocklist - struct: pub::PaymentGetListAttempts - impl: impl Operation<F, PaymentAttemptListRequest> for &PaymentGetListAttempts - impl: impl Operation<F, PaymentAttemptListRequest> for PaymentGetListAttempts - impl: impl GetTracker<F, payments::PaymentAttemptListData<F>, PaymentAttemptListRequest> for PaymentGetListAttempts - impl: impl UpdateTracker<F, payments::PaymentAttemptListData<F>, PaymentAttemptListRequest> for PaymentGetListAttempts - impl: impl ValidateRequest<F, PaymentAttemptListRequest, payments::PaymentAttemptListData<F>> for PaymentGetListAttempts - impl: impl Domain<F, PaymentAttemptListRequest, payments::PaymentAttemptListData<F>> for PaymentGetListAttempts **crates/router/src/core/payments/transformers.rs** Add: - function: private::generate_response - impl: impl ToResponse<F, D, Op> for api::PaymentAttemptListResponse **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::list_payment_attempts **crates/router/src/types/api/payments.rs** Modify existing code **crates/router_env/src/logger/types.rs** Modify existing code
{"pr_number": 8368, "pr_title": "feat(router): Add v2 endpoint to list payment attempts by intent_id", "merged_at": "2025-06-20T06:58:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "order"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/payment.rs", "crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/router_flow_types/payments.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/payment_attempt_list.rs", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router/src/types/api/payments.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "other": ["api-reference/v2/openapi_spec_v2.json", "crates/openapi/src/openapi_v2.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs"]}, "change_types": {"structs_added": 5, "functions_added": 66, "fields_added": 91, "imports_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
docs: update the setup docs ## 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 --> Updated the readme and local setup guide to add the new script ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> Docs update for fix made to resolve #7761 ## How did you test 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** - `README.md` - `docs/try_local_system.md`
{"pr_number": 7839, "pr_title": "docs: update the setup docs", "merged_at": "2025-04-24T07:56:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["README.md", "docs/try_local_system.md"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
fix(postman): [ARCHIPEL] Remove Trailing Whitespace ## 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 --> There was a trailing whitespace in `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication `. Because of which there was an error when attempting to clone the repo in other systems like Windows etc. Removed this trailing whitespace. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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)? --> Cloned the repo in a windows pc with this branch <img width="1377" height="679" alt="Screenshot 2025-09-27 at 12 46 06 PM" src="https://github.com/user-attachments/assets/1ef0c58f-d237-4dcb-bb8d-d43f1375b353" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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** - `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Confirm/event.test.js` - `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Create/event.test.js` - `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Retrieve after confirm/event.test.js` **2. Other** - `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /.meta.json` - `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Confirm/.event.meta.json` - `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Confirm/event.prerequest.js` - ... and 9 more files
{"pr_number": 9578, "pr_title": "fix(postman): [ARCHIPEL] Remove Trailing Whitespace", "merged_at": "2025-10-07T17:32:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"tests": ["postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Confirm/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Retrieve after confirm/event.test.js"], "other": ["postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Confirm/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Confirm/event.prerequest.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Confirm/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Confirm/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Create/event.prerequest.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Create/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Retrieve after confirm/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Retrieve after confirm/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Retrieve after confirm/response.json"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
fix(router): make `x_merchant_domain` as required value only for session call done on web ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> The merchant domain url is only required in case of samsung pay payments on web. While processing payments on app the merchant domain is not required. Hence mandate the merchant domain only if the `x-client-platform` is `web` ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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 connector with samsung pay enabled -> Create a payment ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_GhK0bBcXMIVjqoKmEip0XbSEvPXOuaEOLlMdBQWL4gdD51LsgHsjj2vzyuxMahw1' \ --data '{ "amount": 100000, "currency": "USD", "capture_method": "automatic", "authentication_type": "no_three_ds", "confirm": false, "customer_id": "cu_1728548597" }' ``` ``` { "payment_id": "pay_rXRkcJK4eiTFnb29Meks", "merchant_id": "merchant_1729239061", "status": "requires_payment_method", "amount": 100000, "net_amount": 100000, "amount_capturable": 0, "amount_received": null, "connector": null, "client_secret": "pay_rXRkcJK4eiTFnb29Meks_secret_OmhCTXdoKth6331TaKJu", "created": "2024-10-18T09:06:02.530Z", "currency": "USD", "customer_id": "cu_1728548597", "customer": { "id": "cu_1728548597", "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": null, "payment_method_data": null, "payment_token": null, "shipping": null, "billing": null, "order_details": null, "email": null, "name": null, "phone": null, "return_url": null, "authentication_type": "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": "cu_1728548597", "created_at": 1729242362, "expires": 1729245962, "secret": "epk_d521808e21a34868a01d050538f1f602" }, "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_jh473NMl0nqGqosp7dqW", "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-10-18T09:21:02.530Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-10-18T09:06:02.581Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` -> Session call, pass `x-client-platform` as `web` and `x-merchant-domain` as `sdk-test-app.netlify.app` ``` curl --location 'http://localhost:8080/payments/session_tokens' \ --header 'Content-Type: application/json' \ --header 'x-browser-name: Chrome' \ --header 'x-client-platform: web' \ --header 'x-merchant-domain: sdk-test-app.netlify.app' \ --header 'api-key: pk_dev_f2a5482b81f34fd884e8efbae5e2598c' \ --data '{ "payment_id": "pay_rXRkcJK4eiTFnb29Meks", "wallets": [], "client_secret": "pay_rXRkcJK4eiTFnb29Meks_secret_OmhCTXdoKth6331TaKJu" }' ``` ``` { "payment_id": "pay_rXRkcJK4eiTFnb29Meks", "client_secret": "pay_rXRkcJK4eiTFnb29Meks_secret_OmhCTXdoKth6331TaKJu", "session_token": [ { "wallet_name": "google_pay", "merchant_info": { "merchant_name": "Stripe" }, "shipping_address_required": false, "email_required": false, "shipping_address_parameters": { "phone_number_required": false }, "allowed_payment_methods": [ { "type": "CARD", "parameters": { "allowed_auth_methods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowed_card_networks": [ "AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA" ], "billing_address_required": false }, "tokenization_specification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "stripe", "stripe:version": "2018-10-31", "stripe:publishableKey": "" } } } ], "transaction_info": { "country_code": "US", "currency_code": "USD", "total_price_status": "Final", "total_price": "1000.00" }, "delayed_session_token": false, "connector": "cybersource", "sdk_next_action": { "next_action": "confirm" }, "secrets": null }, { "wallet_name": "samsung_pay", "version": "2", "service_id": "49400558c67f4a97b3925f", "order_number": "pay-rXRkcJK4eiTFnb29Meks", "merchant": { "name": "Hyperswitch", "url": "sdk-test-app.netlify.app", "country_code": "IN" }, "amount": { "option": "FORMAT_TOTAL_PRICE_ONLY", "currency_code": "USD", "total": "1000.00" }, "protocol": "PROTOCOL3DS", "allowed_brands": [ "visa", "masterCard", "amex", "discover" ] }, { "wallet_name": "apple_pay", "payment_request_data": { "country_code": "US", "currency_code": "USD", "total": { "label": "applepay", "type": "final", "amount": "1000.00" }, "merchant_capabilities": [ "supports3DS" ], "supported_networks": [ "visa", "masterCard", "amex", "discover" ], "merchant_identifier": "merchant.com.hyperswitch.checkout" }, "connector": "cybersource", "delayed_session_token": false, "sdk_next_action": { "next_action": "confirm" }, "connector_reference_id": null, "connector_sdk_public_key": null, "connector_merchant_id": null } ] } ``` -> Session call, pass `x-client-platform` as `web` and do not pass `x-merchant-domain`. Response will not contain the samsung pay session token. ``` curl --location 'http://localhost:8080/payments/session_tokens' \ --header 'Content-Type: application/json' \ --header 'x-browser-name: Chrome' \ --header 'x-client-platform: web' \ --header 'api-key: pk_dev_f2a5482b81f34fd884e8efbae5e2598c' \ --data '{ "payment_id": "pay_rXRkcJK4eiTFnb29Meks", "wallets": [], "client_secret": "pay_rXRkcJK4eiTFnb29Meks_secret_OmhCTXdoKth6331TaKJu" }' ``` ``` { "payment_id": "pay_rXRkcJK4eiTFnb29Meks", "client_secret": "pay_rXRkcJK4eiTFnb29Meks_secret_OmhCTXdoKth6331TaKJu", "session_token": [ { "wallet_name": "google_pay", "merchant_info": { "merchant_name": "Stripe" }, "shipping_address_required": false, "email_required": false, "shipping_address_parameters": { "phone_number_required": false }, "allowed_payment_methods": [ { "type": "CARD", "parameters": { "allowed_auth_methods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowed_card_networks": [ "AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA" ], "billing_address_required": false }, "tokenization_specification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "stripe", "stripe:version": "2018-10-31", "stripe:publishableKey": "pk_test_51Msk2GAGHc77EJXX78h549SX2uaOnEkUYqBfjcoD05PIpAnDkYxMn8nQ4d19im85NQuX4Z6WDyHaUw2fFTPBWsIY00Wa7oNerO" } } } ], "transaction_info": { "country_code": "US", "currency_code": "USD", "total_price_status": "Final", "total_price": "1000.00" }, "delayed_session_token": false, "connector": "cybersource", "sdk_next_action": { "next_action": "confirm" }, "secrets": null }, { "wallet_name": "apple_pay", "payment_request_data": { "country_code": "US", "currency_code": "USD", "total": { "label": "applepay", "type": "final", "amount": "1000.00" }, "merchant_capabilities": [ "supports3DS" ], "supported_networks": [ "visa", "masterCard", "amex", "discover" ], "merchant_identifier": "merchant.com.hyperswitch.checkout" }, "connector": "cybersource", "delayed_session_token": false, "sdk_next_action": { "next_action": "confirm" }, "connector_reference_id": null, "connector_sdk_public_key": null, "connector_merchant_id": null } ] } ``` -> Session call, do not pass `x-client-platform` ``` curl --location 'http://localhost:8080/payments/session_tokens' \ --header 'Content-Type: application/json' \ --header 'x-browser-name: Chrome' \ --header 'api-key: pk_dev_f2a5482b81f34fd884e8efbae5e2598c' \ --data '{ "payment_id": "pay_rXRkcJK4eiTFnb29Meks", "wallets": [], "client_secret": "pay_rXRkcJK4eiTFnb29Meks_secret_OmhCTXdoKth6331TaKJu" }' ``` ``` { "payment_id": "pay_rXRkcJK4eiTFnb29Meks", "client_secret": "pay_rXRkcJK4eiTFnb29Meks_secret_OmhCTXdoKth6331TaKJu", "session_token": [ { "wallet_name": "google_pay", "merchant_info": { "merchant_name": "Stripe" }, "shipping_address_required": false, "email_required": false, "shipping_address_parameters": { "phone_number_required": false }, "allowed_payment_methods": [ { "type": "CARD", "parameters": { "allowed_auth_methods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowed_card_networks": [ "AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA" ], "billing_address_required": false }, "tokenization_specification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "stripe", "stripe:version": "2018-10-31", "stripe:publishableKey": "pk_test_51Msk2GAGHc77EJXX78h549SX2uaOnEkUYqBfjcoD05PIpAnDkYxMn8nQ4d19im85NQuX4Z6WDyHaUw2fFTPBWsIY00Wa7oNerO" } } } ], "transaction_info": { "country_code": "US", "currency_code": "USD", "total_price_status": "Final", "total_price": "1000.00" }, "delayed_session_token": false, "connector": "cybersource", "sdk_next_action": { "next_action": "confirm" }, "secrets": null }, { "wallet_name": "samsung_pay", "version": "2", "service_id": "49400558c67f4a97b3925f", "order_number": "pay-rXRkcJK4eiTFnb29Meks", "merchant": { "name": "Hyperswitch", "url": null, "country_code": "IN" }, "amount": { "option": "FORMAT_TOTAL_PRICE_ONLY", "currency_code": "USD", "total": "1000.00" }, "protocol": "PROTOCOL3DS", "allowed_brands": [ "visa", "masterCard", "amex", "discover" ] }, { "wallet_name": "apple_pay", "payment_request_data": { "country_code": "US", "currency_code": "USD", "total": { "label": "applepay", "type": "final", "amount": "1000.00" }, "merchant_capabilities": [ "supports3DS" ], "supported_networks": [ "visa", "masterCard", "amex", "discover" ], "merchant_identifier": "merchant.com.hyperswitch.checkout" }, "connector": "cybersource", "delayed_session_token": false, "sdk_next_action": { "next_action": "confirm" }, "connector_reference_id": null, "connector_sdk_public_key": null, "connector_merchant_id": null } ] } ``` -> Session call, pass `x-client-platform` as `ios` ``` curl --location 'http://localhost:8080/payments/session_tokens' \ --header 'Content-Type: application/json' \ --header 'x-browser-name: Chrome' \ --header 'x-client-platform: ios' \ --header 'api-key: pk_dev_f2a5482b81f34fd884e8efbae5e2598c' \ --data '{ "payment_id": "pay_rXRkcJK4eiTFnb29Meks", "wallets": [], "client_secret": "pay_rXRkcJK4eiTFnb29Meks_secret_OmhCTXdoKth6331TaKJu" }' ``` ``` { "payment_id": "pay_rXRkcJK4eiTFnb29Meks", "client_secret": "pay_rXRkcJK4eiTFnb29Meks_secret_OmhCTXdoKth6331TaKJu", "session_token": [ { "wallet_name": "google_pay", "merchant_info": { "merchant_name": "Stripe" }, "shipping_address_required": false, "email_required": false, "shipping_address_parameters": { "phone_number_required": false }, "allowed_payment_methods": [ { "type": "CARD", "parameters": { "allowed_auth_methods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowed_card_networks": [ "AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA" ], "billing_address_required": false }, "tokenization_specification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "stripe", "stripe:version": "2018-10-31", "stripe:publishableKey": "pk_test_51Msk2GAGHc77EJXX78h549SX2uaOnEkUYqBfjcoD05PIpAnDkYxMn8nQ4d19im85NQuX4Z6WDyHaUw2fFTPBWsIY00Wa7oNerO" } } } ], "transaction_info": { "country_code": "US", "currency_code": "USD", "total_price_status": "Final", "total_price": "1000.00" }, "delayed_session_token": false, "connector": "cybersource", "sdk_next_action": { "next_action": "confirm" }, "secrets": null }, { "wallet_name": "samsung_pay", "version": "2", "service_id": "49400558c67f4a97b3925f", "order_number": "pay-rXRkcJK4eiTFnb29Meks", "merchant": { "name": "Hyperswitch", "url": null, "country_code": "IN" }, "amount": { "option": "FORMAT_TOTAL_PRICE_ONLY", "currency_code": "USD", "total": "1000.00" }, "protocol": "PROTOCOL3DS", "allowed_brands": [ "visa", "masterCard", "amex", "discover" ] }, { "wallet_name": "apple_pay", "payment_request_data": { "country_code": "US", "currency_code": "USD", "total": { "label": "applepay", "type": "final", "amount": "1000.00" }, "merchant_capabilities": [ "supports3DS" ], "supported_networks": [ "visa", "masterCard", "amex", "discover" ], "merchant_identifier": "merchant.com.hyperswitch.checkout" }, "connector": "cybersource", "delayed_session_token": false, "sdk_next_action": { "next_action": "confirm" }, "connector_reference_id": null, "connector_sdk_public_key": null, "connector_merchant_id": null } ] } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/payments.rs` **2. Core Business Logic** - `crates/router/src/core/payments/flows/session_flow.rs` **3. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` **Code Patterns Applied:** - Extend existing types with new fields (1 changes) **Detailed Identifier Changes:** Commit ba6f7a81: Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/router/src/core/payments/flows/session_flow.rs** Modify existing code
{"pr_number": 6362, "pr_title": "fix(router): make `x_merchant_domain` as required value only for session call done on web", "merged_at": "2024-10-19T14:22:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "core_business": ["crates/router/src/core/payments/flows/session_flow.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
Feat(Customer): Added search Feature to the Customer Page ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR introduces improvements to the **Customer page API**: Added **search bar functionality** to filter customers by `customer_id`. These changes enhance API usability and improve performance when handling large customer datasets. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> - Search functionality allows **direct lookup by `customer_id`**, making customer retrieval faster and more user-friendly. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Executed the following API call to fetch the list of roles: Before: No search bar for the searching Items. ```bash curl --location 'http://localhost:8080/customers/list?limit=50&offset=0' \ --header 'Accept: application/json' \ --header 'api-key: <YOUR_API_KEY>' \ --header 'Content-Type: application/json' \ --data-binary '@' ``` Response: ```json [ { "customer_id": "cus_123", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T08:05:42.489Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_124", "name": "Venu Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:34:15.146Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_125", "name": "Venu Madhav", "email": "guest123@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:34:23.527Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_126", "name": "Bandarupalli", "email": "guest1@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:34:39.328Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_127", "name": "venu 2", "email": "guest1@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:35:06.393Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_128", "name": "venu 3", "email": "guest2@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:35:15.853Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_129", "name": "venu 4", "email": "guest3@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:35:21.549Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_129", "name": "venu 5", "email": "guest4@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:35:27.178Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_130", "name": "venu 6", "email": "guest6@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:35:51.674Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_131", "name": "venu 7", "email": "guest7@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:35:56.948Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_132", "name": "venu 8", "email": "guest8@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:36:03.017Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_133", "name": "venu 9", "email": "guest9@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T09:36:08.331Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_134", "name": null, "email": "guest@example.com", "phone": null, "phone_country_code": null, "description": null, "address": null, "created_at": "2025-09-24T10:29:03.242Z", "metadata": null, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_135", "name": "John Doe", "email": "customer@gmail.com", "phone": "9999999999", "phone_country_code": "+1", "description": null, "address": null, "created_at": "2025-09-24T10:30:14.808Z", "metadata": null, "default_payment_method_id": "pm_wQqUQeEP9YgJCLpa8NkG", "tax_registration_id": null }, { "customer_id": "cus_136", "name": "John Doe", "email": "customer@gmail.com", "phone": "9999999999", "phone_country_code": "+1234", "description": null, "address": null, "created_at": "2025-09-24T13:49:24.111Z", "metadata": null, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_137", "name": "venu 10", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-25T13:25:45.670Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_138", "name": null, "email": "guest@example.com", "phone": null, "phone_country_code": null, "description": null, "address": null, "created_at": "2025-09-25T13:39:37.242Z", "metadata": null, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_139", "name": null, "email": "guest@example.com", "phone": null, "phone_country_code": null, "description": null, "address": null, "created_at": "2025-09-25T13:39:54.772Z", "metadata": null, "default_payment_method_id": null, "tax_registration_id": null }, { "customer_id": "cus_140", "name": null, "email": "guest@example.com", "phone": null, "phone_country_code": null, "description": null, "address": null, "created_at": "2025-09-25T13:42:24.499Z", "metadata": null, "default_payment_method_id": null, "tax_registration_id": null } ] ``` After adding the customer_id search feature ```bash curl --location 'http://localhost:8080/customers/list?limit=50&offset=0&customer_id=cus_123' \ --header 'Accept: application/json' \ --header 'api-key: <YOUR_API_KEY>' \ --header 'Content-Type: application/json' \ --data-binary '@' ``` Response ```json [ { "customer_id": "cus_123", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65", "description": "First customer", "address": null, "created_at": "2025-09-24T08:05:42.489Z", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "default_payment_method_id": null, "tax_registration_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 - [x] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/customers.rs` **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/query/customers.rs` **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/customer.rs` **4. Core Business Logic** - `crates/router/src/core/customers.rs` - `crates/router/src/core/locker_migration.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 (2 changes) - Modify database queries (7 changes) **Detailed Identifier Changes:** Commit e186a0f4: Files to modify: **crates/api_models/src/customers.rs** Modify existing code **crates/diesel_models/src/query/customers.rs** Modify existing code **crates/hyperswitch_domain_models/src/customer.rs** Modify existing code **crates/router/src/core/customers.rs** Modify existing code **crates/router/src/core/locker_migration.rs** Modify existing code
{"pr_number": 9619, "pr_title": "Feat(Customer): Added search Feature to the Customer Page", "merged_at": "2025-10-03T10:06:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/customers.rs"], "database": ["crates/diesel_models/src/query/customers.rs"], "domain": ["crates/hyperswitch_domain_models/src/customer.rs"], "core_business": ["crates/router/src/core/customers.rs", "crates/router/src/core/locker_migration.rs"]}, "change_types": {"functions_added": 1, "fields_added": 9, "conditionals_added": 2, "database_queries": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(user_roles): implement parent group info based role APIs ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description #### **POST** `/user/role/v2` - Creates a role using `parent_groups` (with `name` + `scopes`) instead of granular `groups`. - Internally maps `parent_groups` + `scopes` to existing granular permissions for DB storage. #### **GET** `/user/role/list/?entity_type={entity_type}&groups=true` - Replicates existing `/user/role/list` functionality but replaces the `groups` field with a `parent_groups` array containing: - `name` - `description` - `scopes` #### **GET** `/user/parent/list/?entity_type={entity_type}` - Added entity_type filter for current parent/list which used to take user role entity_type. ### 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 We are standardizing all role-related APIs (/role/list, /role/v2) to use parent group + scopes rather than granular permissions like we use in the Invite api. Improves readability for FE consumers and ensures consistency across role creation and retrieval. ## How did you test it? 1. Create Custom Role Request: ``` curl --location 'http://localhost:8080/user/role/v2' \ --header 'Cookie: ******* --header 'Content-Type: application/json' \ --data '{ "role_scope": "merchant", "parent_groups": [ { "name": "Operations", "scopes": [ "read", "write" ] }, { "name": "Connectors", "scopes": [ "write" ] }, { "name": "Analytics", "scopes": [ "read" ] }, { "name": "Internal", "scopes": [ "read", "write" ] } ], "role_name": "roles_123" }' ``` 2. Get Role Info List ``` curl --location 'http://localhost:8080/user/role/list/?entity_type=organization&groups=true' \ --header 'Cookie: ******* ``` Response: ``` [ { "role_id": "org_admin", "role_name": "organization_admin", "entity_type": "organization", "parent_groups": [ { "name": "ReconReports", "description": "Generate & Verify Reconciliation Token, Reconciliation Analytics, Reconciliation Reports, Organization Account", "scopes": [ "read", "write" ] }, { "name": "Account", "description": "Organization Account, Api Keys, Webhook Events", "scopes": [ "read", "write" ] }, { "name": "Theme", "description": "Themes", "scopes": [ "write", "read" ] }, { "name": "Workflows", "description": "Routing, 3DS Decision Manager, Surcharge Decision Manager, Organization Account, Revenue Recovery", "scopes": [ "read", "write" ] }, { "name": "Users", "description": "Users, Organization Account", "scopes": [ "write", "read" ] }, { "name": "Analytics", "description": "Analytics, Operation Reports, Organization Account", "scopes": [ "read" ] }, { "name": "ReconOps", "description": "Generate & Verify Reconciliation Token, Reconciliation Process Manager, Reconciliation File Upload, Run Reconciliation Process, Reconciliation Configurations, Reconciliation Analytics, Reconciliation Reports, Organization Account", "scopes": [ "write", "read" ] }, { "name": "Operations", "description": "Payments, Refunds, Mandates, Disputes, Customers, Payouts, Operation Reports, Organization Account", "scopes": [ "read", "write" ] }, { "name": "Connectors", "description": "Payment Processors, Payout Processors, Fraud & Risk Managers, Organization Account", "scopes": [ "read", "write" ] } ], "role_scope": "organization" } ] ``` 3. Parent List ``` curl --location 'http://localhost:8080/user/parent/list/?entity_type=profile' \ --header 'Cookie: ******* ``` ``` [ { "name": "Connectors", "description": "Payment Processors, Payout Processors, Fraud & Risk Managers, Business Profile Account", "scopes": [ "read", "write" ] }, { "name": "ReconReports", "description": "Business Profile Account", "scopes": [ "read", "write" ] }, { "name": "Analytics", "description": "Analytics, Operation Reports, Business Profile Account", "scopes": [ "read" ] }, { "name": "Workflows", "description": "Routing, 3DS Decision Manager, Business Profile Account, Revenue Recovery", "scopes": [ "write", "read" ] }, { "name": "Operations", "description": "Payments, Refunds, Disputes, Payouts, Operation Reports, Business Profile Account", "scopes": [ "read", "write" ] }, { "name": "ReconOps", "description": "Business Profile Account", "scopes": [ "read", "write" ] }, { "name": "Account", "description": "Business Profile Account, Webhook Events", "scopes": [ "write", "read" ] }, { "name": "Users", "description": "Users, Business Profile Account", "scopes": [ "read", "write" ] } ] ``` ## 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/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` - `crates/router/src/utils/user_role.rs` **5. Other** - `crates/common_enums/src/enums.rs` - `crates/router/src/routes/app.rs` - `crates/router/src/routes/user_role.rs` - ... and 1 more files **Code Patterns Applied:** - Define new data structures (5 changes) - Implement new functions (8 changes) - Extend existing types with new fields (55 changes) - Add conditional logic for feature flags or filtering (9 changes) - Modify database queries (12 changes) **Detailed Identifier Changes:** Commit e3c46b7d: Files to modify: **crates/api_models/src/events/user_role.rs** Modify existing code **crates/api_models/src/user_role/role.rs** Remove: - struct: pub::ListRolesRequest Add: - struct: pub::CreateRoleV2Request - struct: pub::ParentGroupInfoRequest - struct: pub::ListRolesQueryParams - struct: pub::GetParentGroupsInfoQueryParams - enum: pub::ListRolesResponse **crates/common_enums/src/enums.rs** Modify existing code **crates/router/src/core/user_role.rs** Modify existing code **crates/router/src/core/user_role/role.rs** Add: - function: pub::create_role_v2 **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::create_role_v2 **crates/router/src/services/authorization/permission_groups.rs** Modify existing code **crates/router/src/utils/user_role.rs** Add: - function: pub::parent_group_info_request_to_permission_groups - function: pub::permission_groups_to_parent_group_info **crates/router_env/src/logger/types.rs** Modify existing code
{"pr_number": 8896, "pr_title": "refactor(user_roles): implement parent group info based role APIs", "merged_at": "2025-08-22T14:03:34Z", "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", "crates/router/src/utils/user_role.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/permission_groups.rs"]}, "change_types": {"structs_added": 5, "functions_added": 8, "enums_added": 1, "fields_added": 55, "imports_added": 4, "conditionals_added": 9, "database_queries": 12}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): Revert [AUTHORIZEDOTNET] customer id population fixed in authorize flow ORIGINAL PR:https://github.com/juspay/hyperswitch/pull/9253 Reverts https://github.com/juspay/hyperswitch/pull/9079
To implement this **unknown** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` **Code Patterns Applied:** - Extend existing types with new fields (12 changes) **Detailed Identifier Changes:** Commit 77c7ec33: Files to modify: **crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs** Modify existing code
{"pr_number": 9276, "pr_title": "fix(connector): Revert [AUTHORIZEDOTNET] customer id population fixed in authorize flow", "merged_at": "2025-09-04T11:07:11Z", "intent": {"feature_type": "unknown", "action": "unknown", "entities": []}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs"]}, "change_types": {"fields_added": 12}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
build(deps): bump tonic version from 0.12 to 0.13 ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description bumping tonic version from 0.12 to 0.13 ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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? - The client connection was success <img width="1725" alt="Screenshot 2025-06-25 at 6 00 12 PM" src="https://github.com/user-attachments/assets/7981c4cc-041e-4426-a158-d66af2d1e2cd" /> - got response for the health check api ``` { "database": true, "redis": true, "analytics": true, "opensearch": false, "outgoing_request": true, "grpc_health_check": { "dynamic_routing_service": true }, "decision_engine": false } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Configuration Files** - `crates/external_services/Cargo.toml` **2. Other** - `Cargo.lock` - `crates/external_services/build.rs` - `crates/external_services/src/grpc_client.rs` **Code Patterns Applied:** **Detailed Identifier Changes:** Commit 9e435929: Files to modify: **crates/external_services/build.rs** Modify existing code **crates/external_services/src/grpc_client.rs** Modify existing code
{"pr_number": 8461, "pr_title": "build(deps): bump tonic version from 0.12 to 0.13", "merged_at": "2025-06-26T06:26:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"config": ["crates/external_services/Cargo.toml"], "other": ["Cargo.lock", "crates/external_services/build.rs", "crates/external_services/src/grpc_client.rs"]}, "change_types": {"imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(payment_v2): implement payments sync ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] New feature ## Description <!-- Describe your changes in detail --> Implement payments sync for v2. Using this endpoint the status of the payment can be retrieved and also synced with the connector. ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> - Create a payment ```bash curl --location 'http://localhost:8080/v2/payments/create-intent' \ --header 'api-key: dev_5BpYAlWiFrmujr10auC6jj48LPGkN7vMJYXv7hKTuLVRLSEt0BancBwWgfzAELii' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: pro_NZsp8AqhIFzKshd7BxX4' \ --data '{ "amount_details": { "order_amount": 100, "currency": "USD" } }' ``` ```json { "id": "12345_pay_01931afcc2667a839d75d2e760b99d1e", "status": "requires_payment_method", "amount_details": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "skip_external_tax_calculation": "Skip", "skip_surcharge_calculation": "Skip", "surcharge_amount": null, "tax_on_surcharge": null }, "client_secret": "12345_pay_01931afcc2667a839d75d2e760b99d1e_secret_01931afcc2667a839d75d2f412de1c77", "merchant_reference_id": null, "routing_algorithm_id": null, "capture_method": "automatic", "authentication_type": "no_three_ds", "billing": null, "shipping": null, "customer_id": null, "customer_present": "Present", "description": null, "return_url": null, "setup_future_usage": "on_session", "apply_mit_exemption": "Skip", "statement_descriptor": null, "order_details": null, "allowed_payment_method_types": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "payment_link_enabled": "Skip", "payment_link_config": null, "request_incremental_authorization": "default", "expires_on": "2024-11-11T11:44:52.743Z", "frm_metadata": null, "request_external_three_ds_authentication": "Skip" } ``` - Confirm the payment ```bash curl --location 'http://localhost:8080/v2/payments/12345_pay_0192d87d5bfc72e2bd4985b52eb608b5/confirm-intent' \ --header 'x-profile-id: pro_NZsp8AqhIFzKshd7BxX4' \ --header 'x-client-secret: 12345_pay_0192d87d5bfc72e2bd4985b52eb608b5_secret_0192d87d5bfc72e2bd4985c73c6ae36d' \ --header 'Content-Type: application/json' \ --header 'api-key: pk_dev_d48019a209df4d5d8567c9e5d2bdc5af' \ --data '{ "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "01", "card_exp_year": "27", "card_holder_name": "John Doe", "card_cvc": "100" } }, "payment_method_type": "card", "payment_method_subtype": "credit" }' ``` ```json { "id": "12345_pay_01931afcc2667a839d75d2e760b99d1e", "status": "succeeded", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "skip_external_tax_calculation": "Skip", "skip_surcharge_calculation": "Skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": null }, "connector": "stripe", "client_secret": "12345_pay_01931afcc2667a839d75d2e760b99d1e_secret_01931afcc2667a839d75d2f412de1c77", "created": "2024-11-11T11:29:52.743Z", "payment_method_data": null, "payment_method_type": "card", "payment_method_subtype": "credit", "next_action": null, "connector_transaction_id": "pi_3QJvocIVaesDjvMP0szRoodA", "connector_reference_id": null, "merchant_connector_id": "mca_It087vhsTsNtgtnTnYd6", "browser_info": null, "error": null } ``` - Retrieve the payment ```bash curl --location 'http://localhost:8080/v2/payments/12345_pay_0192d87d5bfc72e2bd4985b52eb608b5' \ --header 'x-profile-id: pro_NZsp8AqhIFzKshd7BxX4' \ --header 'x-client-secret: 12345_pay_0192d87d5bfc72e2bd4985b52eb608b5_secret_0192d87d5bfc72e2bd4985c73c6ae36d' \ --header 'Content-Type: application/json' \ --header 'api-key: pk_dev_d48019a209df4d5d8567c9e5d2bdc5af' ``` ```json { "id": "12345_pay_01931afcc2667a839d75d2e760b99d1e", "status": "succeeded", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "skip_external_tax_calculation": "Skip", "skip_surcharge_calculation": "Skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": null }, "connector": "stripe", "client_secret": "12345_pay_01931afcc2667a839d75d2e760b99d1e_secret_01931afcc2667a839d75d2f412de1c77", "created": "2024-11-11T11:29:52.743Z", "payment_method_data": null, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": "pi_3QJvocIVaesDjvMP0szRoodA", "connector_reference_id": null, "merchant_connector_id": "mca_It087vhsTsNtgtnTnYd6", "browser_info": null, "error": 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
To implement this **payment** 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/kv.rs` - `crates/diesel_models/src/payment_attempt.rs` - `crates/diesel_models/src/payment_intent.rs` - ... and 3 more files **3. Domain Models (Business Logic Types)** - `crates/hyperswitch_domain_models/src/merchant_connector_account.rs` - `crates/hyperswitch_domain_models/src/payments.rs` - `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs` - ... and 3 more files **4. Core Business Logic** - `crates/router/src/core/authentication/utils.rs` - `crates/router/src/core/fraud_check/flows/checkout_flow.rs` - `crates/router/src/core/fraud_check/flows/record_return.rs` - ... and 25 more files **5. Type Definitions** - `crates/common_utils/src/types.rs` - `crates/router/src/types/api.rs` - `crates/router/src/types/transformers.rs` **6. Other** - `api-reference-v2/openapi_spec.json` - `crates/common_enums/src/enums.rs` - `crates/common_enums/src/transformers.rs` - ... and 17 more files **Code Patterns Applied:** - Define new data structures (4 changes) - Implement new functions (130 changes) - Extend existing types with new fields (454 changes) - Modify database queries (3 changes) **Detailed Identifier Changes:** Commit 42bdf47f: Files to modify: **crates/api_models/src/events/payment.rs** Add: - function: private::get_api_event_type - impl: impl ApiEventMetric for super::PaymentsRetrieveResponse **crates/api_models/src/payments.rs** Add: - struct: pub::PaymentsRetrieveRequest - struct: pub::PaymentsRetrieveResponse **crates/common_enums/src/enums.rs** Add: - function: pub::should_force_sync_with_connector - impl: impl IntentStatus **crates/common_enums/src/transformers.rs** Add: - function: private::from - impl: impl From<AttemptStatus> for IntentStatus **crates/common_utils/src/types.rs** Add: - function: pub::wrap - function: pub::into_inner **crates/diesel_models/src/kv.rs** Modify existing code **crates/diesel_models/src/payment_attempt.rs** Add: - enum: pub::RedirectForm **crates/diesel_models/src/payment_intent.rs** Modify existing code **crates/diesel_models/src/query/payment_attempt.rs** Modify existing code **crates/diesel_models/src/query/payment_intent.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/hyperswitch_domain_models/src/merchant_connector_account.rs** Add: - function: pub::is_disabled - function: pub::get_connector_account_details **crates/hyperswitch_domain_models/src/payments.rs** Add: - struct: pub::PaymentStatusData **crates/hyperswitch_domain_models/src/payments/payment_attempt.rs** Modify existing code **crates/hyperswitch_domain_models/src/payments/payment_intent.rs** Remove: - function: private::from - impl: impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal - impl: impl From<PaymentIntentUpdate> for DieselPaymentIntentUpdate Add: - impl: impl From<PaymentIntentUpdate> for diesel_models::PaymentIntentUpdateInternal **crates/hyperswitch_domain_models/src/router_data.rs** Add: - function: private::get_payment_intent_update - function: private::get_payment_attempt_update - function: private::get_payment_intent_update - function: private::get_payment_attempt_update - trait: pub::TrackerPostUpdateObjects - impl: impl TrackerPostUpdateObjects< router_flow_types::Authorize, router_request_types::PaymentsAuthorizeData, > for RouterData< router_flow_types::Authorize, router_request_types::PaymentsAuthorizeData, router_response_types::PaymentsResponseData, > - impl: impl TrackerPostUpdateObjects<router_flow_types::PSync, router_request_types::PaymentsSyncData> for RouterData< router_flow_types::PSync, router_request_types::PaymentsSyncData, router_response_types::PaymentsResponseData, > **crates/hyperswitch_domain_models/src/router_response_types.rs** Add: - function: private::from - function: private::from - impl: impl From<RedirectForm> for diesel_models::payment_attempt::RedirectForm - impl: impl From<diesel_models::payment_attempt::RedirectForm> for RedirectForm **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/utils.rs** Modify existing code **crates/router/src/core/fraud_check/flows/checkout_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/payments.rs** Add: - function: private::get_optional_payment_attempt - function: private::get_optional_payment_attempt - function: private::get_optional_payment_attempt - function: private::get_payment_attempt - function: private::get_payment_intent - function: private::get_payment_method_info - function: private::get_mandate_id - function: private::get_address - function: private::get_creds_identifier - function: private::get_token - function: private::get_multiple_capture_data - function: private::get_payment_link_data - function: private::get_ephemeral_key - function: private::get_setup_mandate - function: private::get_poll_config - function: private::get_authentication - function: private::get_frm_message - function: private::get_refunds - function: private::get_disputes - function: private::get_authorizations - function: private::get_attempts - function: private::get_recurring_details - function: private::get_payment_intent_profile_id - function: private::get_currency - function: private::get_amount - function: private::get_payment_attempt_connector - function: private::get_billing_address - function: private::get_payment_method_data - function: private::get_sessions_token - function: private::get_token_data - function: private::get_mandate_connector - function: private::get_force_sync - function: private::get_capture_method - function: private::get_optional_payment_attempt - function: private::set_payment_intent - function: private::set_payment_attempt - function: private::set_payment_method_data - function: private::set_payment_method_id_in_attempt - function: private::set_email_if_not_present - function: private::set_pm_token - function: private::set_connector_customer_id - function: private::push_sessions_token - function: private::set_surcharge_details - function: private::set_merchant_connector_id_in_attempt - function: private::set_frm_message - function: private::set_payment_intent_status - function: private::set_authentication_type_in_attempt - function: private::set_recurring_mandate_payment_data - function: private::set_mandate_id - function: private::set_setup_future_usage_in_payment_intent - function: private::set_connector_in_payment_attempt - impl: impl OperationSessionGetters<F> for PaymentStatusData<F> - impl: impl OperationSessionSetters<F> for PaymentStatusData<F> **crates/router/src/core/payments/flows.rs** Modify existing code **crates/router/src/core/payments/flows/approve_flow.rs** Add: - function: private::construct_router_data **crates/router/src/core/payments/flows/authorize_flow.rs** Modify existing code **crates/router/src/core/payments/flows/cancel_flow.rs** Add: - function: private::construct_router_data **crates/router/src/core/payments/flows/capture_flow.rs** Add: - function: private::construct_router_data **crates/router/src/core/payments/flows/complete_authorize_flow.rs** Add: - function: private::construct_router_data **crates/router/src/core/payments/flows/incremental_authorization_flow.rs** Add: - function: private::construct_router_data **crates/router/src/core/payments/flows/post_session_tokens_flow.rs** Add: - function: private::construct_router_data **crates/router/src/core/payments/flows/psync_flow.rs** Add: - function: private::construct_router_data - function: private::get_merchant_recipient_data - impl: impl ConstructFlowSpecificData<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for hyperswitch_domain_models::payments::PaymentStatusData<api::PSync> **crates/router/src/core/payments/flows/reject_flow.rs** Add: - function: private::construct_router_data **crates/router/src/core/payments/flows/session_flow.rs** Add: - function: private::construct_router_data **crates/router/src/core/payments/flows/session_update_flow.rs** Add: - function: private::construct_router_data **crates/router/src/core/payments/flows/setup_mandate_flow.rs** Add: - function: private::construct_router_data **crates/router/src/core/payments/operations.rs** Remove: - function: private::get_customer_details Add: - trait: pub::CallConnector - trait: pub::ShouldCallConnector - mod: pub::payment_get **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** 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 - struct: pub::PaymentGet - impl: impl ValidateStatusForOperation for PaymentGet - impl: impl Operation<F, PaymentsRetrieveRequest> for &PaymentGet - impl: impl Operation<F, PaymentsRetrieveRequest> for PaymentGet - impl: impl ValidateRequest<F, PaymentsRetrieveRequest, PaymentStatusData<F>> for PaymentGet - impl: impl GetTracker<F, PaymentStatusData<F>, PaymentsRetrieveRequest> for PaymentGet - impl: impl Domain<F, PaymentsRetrieveRequest, PaymentStatusData<F>> for PaymentGet - impl: impl UpdateTracker<F, PaymentStatusData<F>, PaymentsRetrieveRequest> for PaymentGet **crates/router/src/core/payments/operations/payment_get_intent.rs** Modify existing code **crates/router/src/core/payments/operations/payment_response.rs** Add: - function: private::to_post_update_tracker - impl: impl Operation<F, types::PaymentsSyncData> for PaymentResponse **crates/router/src/core/payments/retry.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Add: - function: pub::construct_router_data_for_psync - function: private::generate_response - function: private::foreign_from - impl: impl ToResponse<F, D, Op> for api_models::payments::PaymentsRetrieveResponse - impl: impl ForeignFrom<( &hyperswitch_domain_models::payments::AmountDetails, Option<&hyperswitch_domain_models::payments::payment_attempt::AttemptAmountDetails>, )> for api_models::payments::ConfirmIntentAmountDetailsResponse **crates/router/src/core/payouts.rs** Add: - function: pub::complete_payout_retrieve **crates/router/src/db/kafka_store.rs** Modify existing code **crates/router/src/routes/app.rs** Modify existing code **crates/router/src/routes/payments.rs** Add: - function: pub::payment_status **crates/router/src/routes/routing.rs** Modify existing code **crates/router/src/services/authentication.rs** Remove: - function: private::get_client_secret - struct: pub::ApiKeyAuthV2 - impl: impl ClientSecretFetch for payments::PaymentsRetrieveRequest Add: - function: private::get_client_secret - impl: impl ClientSecretFetch for payments::PaymentsRetrieveRequest **crates/router/src/types/api.rs** Modify existing code **crates/router/src/types/transformers.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_attempt.rs** Modify existing code **crates/storage_impl/src/mock_db/payment_intent.rs** Add: - function: private::update_payment_intent **crates/storage_impl/src/payments/payment_attempt.rs** Modify existing code **crates/storage_impl/src/payments/payment_intent.rs** Add: - function: private::update_payment_intent
{"pr_number": 6464, "pr_title": "feat(payment_v2): implement payments sync ", "merged_at": "2024-11-11T14:06:06Z", "intent": {"feature_type": "payment", "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/kv.rs", "crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/query/payment_attempt.rs", "crates/diesel_models/src/query/payment_intent.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/merchant_connector_account.rs", "crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/authentication/utils.rs", "crates/router/src/core/fraud_check/flows/checkout_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/payments.rs", "crates/router/src/core/payments/flows.rs", "crates/router/src/core/payments/flows/approve_flow.rs", "crates/router/src/core/payments/flows/authorize_flow.rs", "crates/router/src/core/payments/flows/cancel_flow.rs", "crates/router/src/core/payments/flows/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/operations.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_get_intent.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/payouts.rs"], "types": ["crates/common_utils/src/types.rs", "crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/common_enums/src/transformers.rs", "crates/router/src/compatibility/stripe/payment_intents.rs", "crates/router/src/compatibility/stripe/setup_intents.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs", "crates/router/src/routes/routing.rs", "crates/router/src/services/authentication.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", "v2_migrations/2024-08-28-081721_add_v2_columns/down.sql", "v2_migrations/2024-08-28-081721_add_v2_columns/up.sql", "v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/down.sql", "v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/up.sql", "v2_migrations/2024-10-08-081847_drop_v1_columns/down.sql", "v2_migrations/2024-10-08-081847_drop_v1_columns/up.sql"]}, "change_types": {"structs_added": 4, "functions_added": 130, "enums_added": 1, "fields_added": 454, "imports_added": 25, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(refunds_v2): Add feature flags and db methods to non kv config ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR contains support for db calls that are used in refunds v2 core flows for non kv config. There are 2 ways that HS use to interact with DB, using KV and without KV. In code we represent it by `kv_store` feature flag. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> Since KV is default in HyperSwitch, if some opensource merchant wants to use our product without this kv feature, the refunds v2 flow will still be supported through postgres DB 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)? --> - Go to router crate's `Cargo.toml`, in default_common under features, remove `kv_store` - Use `just run_v2` to run the app. - Create Refund API Call ``` curl --location 'http://localhost:8080/v2/refunds' \ --header 'X-Profile-Id: pro_qxkJLjzL3XeuzDKGsp1S' \ --header 'Content-Type: application/json' \ --header 'Authorization: api-key=dev_R1HetQC825xDVj4cT8Pjj5EARrN86R1hBluyhMbXqMVQcJC1JvUHQKrIzaKzPCZt' \ --data '{ "payment_id":"12345_pay_019734bc76567f31ae472001903e2185", "merchant_reference_id":"1748936520", "reason":"Paid by mistake", "metadata":{ "foo":"bar" } }' ``` - Response from the above call ``` { "id": "12345_ref_019734bcee6c76a3bd9f37fb0a57a062", "payment_id": "12345_pay_019734bc76567f31ae472001903e2185", "merchant_reference_id": "1748936487", "amount": 70, "currency": "EUR", "status": "succeeded", "reason": "Paid by mistake", "metadata": { "foo": "bar" }, "error_details": { "code": "", "message": "" }, "created_at": "2025-06-03T07:41:26.559Z", "updated_at": "2025-06-03T07:41:27.758Z", "connector": "stripe", "profile_id": "pro_qxkJLjzL3XeuzDKGsp1S", "merchant_connector_id": "mca_tgPFo4p9Yhg6COBKqVLF", "connector_refund_reference_id": null } ``` - Refunds Retrieve API Call ``` curl --location 'http://localhost:8080/v2/refunds/12345_ref_019734bcee6c76a3bd9f37fb0a57a062' \ --header 'x-profile-id: pro_qxkJLjzL3XeuzDKGsp1S' \ --header 'Authorization: api-key=dev_R1HetQC825xDVj4cT8Pjj5EARrN86R1hBluyhMbXqMVQcJC1JvUHQKrIzaKzPCZt' ``` - Response from the above call ``` { "id": "12345_ref_019734bcee6c76a3bd9f37fb0a57a062", "payment_id": "12345_pay_019734bc76567f31ae472001903e2185", "merchant_reference_id": "1748936487", "amount": 70, "currency": "EUR", "status": "succeeded", "reason": "Paid by mistake", "metadata": { "foo": "bar" }, "error_details": { "code": "", "message": "" }, "created_at": "2025-06-03T07:41:26.559Z", "updated_at": "2025-06-03T07:41:27.758Z", "connector": "stripe", "profile_id": "pro_qxkJLjzL3XeuzDKGsp1S", "merchant_connector_id": "mca_tgPFo4p9Yhg6COBKqVLF", "connector_refund_reference_id": null } ``` - Screenshot of DB record of this refund <img width="586" alt="Screenshot 2025-06-03 at 1 14 30 PM" src="https://github.com/user-attachments/assets/e875aa2c-fb32-4cf7-8530-f70532d21046" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Other** - `crates/router/src/db/refund.rs` **Code Patterns Applied:** - Implement new functions (4 changes) - Extend existing types with new fields (13 changes) **Detailed Identifier Changes:** Commit e6482fbe: Files to modify: **crates/router/src/db/refund.rs** Add: - function: private::find_refund_by_id - function: private::update_refund - function: private::filter_refund_by_constraints - function: private::get_total_count_of_refunds
{"pr_number": 7987, "pr_title": "refactor(refunds_v2): Add feature flags and db methods to non kv config", "merged_at": "2025-06-03T08:51:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"other": ["crates/router/src/db/refund.rs"]}, "change_types": {"functions_added": 4, "fields_added": 13, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connector): [AUTHORIZEDOTNET] customer id population fixed in authorize flow ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Fixed customer ID population in the Authorize flow. - Previously, when passing customer details for normal payments, the createConnectorCustomer flow correctly created the customer. - However, in the `Authorize` flow, we were passing the payment_id as the customer_id. If the length validation failed, a random string was being passed instead. - This resulted in a random string always being sent as the customer_id, which caused a new customer to be created on Authorize.NET’s dashboard for every transaction. - As a result, duplicate customers were being created. Fix: - Updated the flow to pass the correct customer_id in the customer details instead of payment_id. - This prevents duplicate customer creation on Authorize.NET. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_HcJT7607MkJ2yANWr7PUgr8djox0jNozuRQSSW40guBXj5RQnH0CPKvbtjZ4MKBA' \ --data-raw ' { "amount": 1, "currency": "USD", "confirm": true, // "customer_id": "cus_sweta2", // "email": "johndoe@gmail.com", "capture_method": "manual", "description": "test payment", "customer": { "id": "sweta33", "name": "Sweta Sharma", "email": "sweta33@gmail.com", "phone": "1234567890", "phone_country_code": "+1" }, "setup_future_usage": "off_session", "payment_type": "normal", "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": "johndoe@gmail.com" }, "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": "cus_sweta@gmail.com" } } ' ``` Response ``` {"payment_id":"pay_Itc4g0ujKGRW0tWhku2e","merchant_id":"merchant_1756373651","status":"requires_capture","amount":1,"net_amount":1,"shipping_cost":null,"amount_capturable":1,"amount_received":null,"connector":"authorizedotnet","client_secret":"pay_Itc4g0ujKGRW0tWhku2e_secret_7YHCDDZ805TWhxdirnfP","created":"2025-08-28T12:33:37.236Z","currency":"USD","customer_id":"sweta33","customer":{"id":"sweta33","name":"Sweta Sharma","email":"sweta33@gmail.com","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":"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":"07","card_exp_year":"26","card_holder_name":"Joseph Does","payment_checks":{"description":"The street address and postal code matched.","avs_result_code":"Y"},"authentication_data":null},"billing":null},"payment_token":null,"shipping":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"cus_sweta@gmail.com"},"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":"johndoe@gmail.com"},"order_details":null,"email":"sweta33@gmail.com","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":"sweta33","created_at":1756384417,"expires":1756388017,"secret":"epk_5af34f19e9754bd79f97846e3ef3c2c9"},"manual_retry_allowed":false,"connector_transaction_id":"120069967875","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":"120069967875","payment_link":null,"profile_id":"pro_uSL0fZR2ECJYAD8I2u1r","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_yyPYHyKpU13WHygZFtpl","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-28T12:48:37.235Z","fingerprint":null,"browser_info":null,"payment_channel":null,"payment_method_id":"pm_dcrhr0yU9aq5L3qwH90J","network_transaction_id":"HWAN991WJ003XPFWKEF1T5E","payment_method_status":"active","updated":"2025-08-28T12:33:40.138Z","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} ``` customer created only once for normal payments <img width="597" height="525" alt="Screenshot 2025-08-28 at 6 09 09 PM" src="https://github.com/user-attachments/assets/6184684f-b99a-43d1-8b8f-f77b0d6bf16c" /> ## 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 (12 changes) - Add conditional logic for feature flags or filtering (4 changes) **Detailed Identifier Changes:** Commit 60ef06e8: Files to modify: **crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs** Modify existing code
{"pr_number": 9079, "pr_title": "fix(connector): [AUTHORIZEDOTNET] customer id population fixed in authorize flow", "merged_at": "2025-08-29T10:41:40Z", "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": 12, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(openapi): update create_platform endpoint in api-reference docs ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Updated the create_platform endpoint in api-reference docs Previously the endpoint was: ```bash /create_platform ``` Updated the endpoint now to: ```bash /user/create_platform ``` ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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 locally <img width="1728" height="1031" alt="image" src="https://github.com/user-attachments/assets/062500fb-4b04-429f-83b0-a746ee8dddf0" /> <img width="1390" height="902" alt="image" src="https://github.com/user-attachments/assets/5dff52ca-1095-45d2-811b-59d8a480919c" /> ## Checklist <!-- Put an `x` in the boxes that 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. Other** - `api-reference/v1/openapi_spec_v1.json` - `api-reference/v1/platform/platform--create.mdx` - `crates/openapi/src/routes/platform.rs` **Detailed Identifier Changes:** Commit 8dc4061f: Files to modify: **crates/openapi/src/routes/platform.rs** Modify existing code
{"pr_number": 8782, "pr_title": "fix(openapi): update create_platform endpoint in api-reference docs", "merged_at": "2025-07-30T06:57:15Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v1/platform/platform--create.mdx", "crates/openapi/src/routes/platform.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(core): Hyperswitch <|> UCS integration v2 ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ### Fixes #8440 ## Description <!-- Describe your changes in detail --> This PR implements **V2 UCS (Unified Connector Service) Integration** for authorization and synchronization flows, building upon the existing V1 UCS integration (PR#[8280](https://github.com/juspay/hyperswitch/pull/8280)), with enhanced V2 schema support according to updated gRPC contract. **Key Features Implemented:** 1. **Authorization Flow (Payments)**: Full V2 schema support for payment authorization 2. **PSync Flow**: Payment status synchronization through UCS V2 3. **UPI Payment Method**: Support for UPI Collect payment method 4. **Enhanced Response Handling**: Improved status mapping and error handling 5. **Address Transformation Fix**: Better handling of optional address fields **Key Changes from V1 to V2:** 1. **Updated gRPC Schema**: - Migrated from `PaymentsAuthorizeRequest` to `PaymentServiceAuthorizeRequest` - Added `PaymentServiceGetRequest` for PSync flow - Enhanced field structure for better type safety 2. **New Payment Methods**: - Added UPI Collect payment method support - Proper VPA ID extraction and handling 3. **Enhanced Transformers**: - Updated transformers for authorization and sync flows - Improved card details, address structure, and payment method handling - Fixed address transformation to handle None values gracefully 4. **V2 Flow Architecture**: - Refactored payment flow to separate UCS prerequisites and decision logic - Added PSync flow integration through UCS - Feature flag protection for clean V1/V2 separation 5. **Improved Response Handling**: - Enhanced response parsing with new identifier structure - Added support for more payment states (Started, AuthenticationSuccessful, Authorizing, etc.) - Better error handling and status mapping **V2 Architecture Flow:** V2 Payment Request → call_connector_service_prerequisites() → decide_unified_connector_service_call() → ├── UCS Available → V2 Transformers → gRPC Call → V2 Response Handling └── UCS Unavailable → Traditional Connector Flow (Fallback) V2 PSync Request → call_unified_connector_service() → ├── UCS Available → V2 PSync Transformer → gRPC Get Call → Status Response └── UCS Unavailable → Traditional Connector Sync Flow **Key Technical Improvements:** - **Refactored Payment Functions**: Split `call_connector_service()` into `call_connector_service_prerequisites()` and `decide_unified_connector_service_call()` for better separation of concerns - **Enhanced V2 Transformers**: Updated card data transformation, address structure, and authentication data handling - **PSync Flow Integration**: Added complete payment synchronization support through UCS - **UPI Payment Support**: Added UPI Collect payment method with VPA ID handling - **Improved Error Handling**: Better response parsing with new identifier structure - **Customer ID Support**: Added customer ID mapping in V2 transformer implementation - **Enhanced Authentication**: Added tenant_id and merchant_id to ConnectorAuthMetadata **Files Modified:** - `crates/router/Cargo.toml` - Updated rust-grpc-client dependency to main branch - `crates/router/src/core/payments.rs` - Refactored UCS integration with V2 prerequisite and decision functions - `crates/router/src/core/payments/flows/authorize_flow.rs` - Updated to use `PaymentServiceAuthorizeRequest` - `crates/router/src/core/payments/flows/psync_flow.rs` - Added UCS V2 support for payment synchronization - `crates/router/src/core/payments/transformers.rs` - Added V2 PaymentsAuthorizeData transformer implementation and customer_id support - `crates/router/src/core/unified_connector_service/` - Updated transformers and response handlers for V2 schema - `crates/router/src/core/unified_connector_service.rs` - Added UPI payment method support and enhanced response handling - `crates/router/src/core/unified_connector_service/transformers.rs` - Major updates for V2 gRPC schema compatibility - `crates/external_services/src/grpc_client/unified_connector_service.rs` - Added payment get operations support ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> **V2 UCS Integration Evolution:** This change builds upon the existing V1 UCS integration to support the updated V2 gRPC schema and enhanced payment flow architecture. Key motivations: **Schema Evolution:** - **Updated gRPC Contracts**: V2 introduces improved field structures for better type safety and extensibility - **Enhanced Data Models**: New card details structure, improved address handling, and better identifier management - **Backward Compatibility**: V2 implementation maintains compatibility while leveraging new schema features **Feature Additions:** - **PSync Flow Support**: Enables payment status synchronization through UCS, reducing direct connector calls - **UPI Payment Method**: Adds support for popular Indian payment method through unified interface - **Enhanced Status Handling**: More granular payment states for better payment lifecycle tracking **Architectural Improvements:** - **Separation of Concerns**: Split monolithic UCS functions into prerequisite preparation and decision logic phases - **Better Feature Flag Management**: Clean V1/V2 separation using `#[cfg(feature = "v2")]` prevents conflicts - **Enhanced Error Handling**: Improved response parsing and identifier handling for better reliability - **Maintainability**: Cleaner code structure for easier debugging and future enhancements **Business Value:** - **Future-Proofing**: V2 schema supports upcoming UCS enhancements and new payment flows - **Improved Reliability**: Better error handling and response parsing reduces failure rates - **Enhanced Developer Experience**: Cleaner API interfaces and better type safety - **Operational Excellence**: Maintains existing rollout controls while improving monitoring capabilities - **Broader Payment Support**: UPI integration opens up access to Indian market payment preferences ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ### Manual Testing (HAPPY CASE) #### **V2 Payment Intent Creation (Adyen via UCS)** *Request:* ```bash curl --location 'http://localhost:8080/v2/payments/create-intent' \ --header 'api-key: dev_ymXSN8By3WESknjGnFyLVwDE4tK9v8ZjnkMZsKb2cM7KgjlzLfU1SOnJ63LsIrfR' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: pro_2MBjeGslBsr2Lr7AoLvr' \ --header 'Authorization: api-key=dev_ymXSN8By3WESknjGnFyLVwDE4tK9v8ZjnkMZsKb2cM7KgjlzLfU1SOnJ63LsIrfR' \ --data '{ "amount_details": { "order_amount": 100, "currency": "USD" }, "capture_method": "automatic", "authentication_type": "no_three_ds", "customer_id": "12345_cus_0197abe38df57a408b928b4111ff5038", "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" } } }' ``` *Response:* ```json { "id": "12345_pay_0197ac4f440c73c0b34c7050d248e483", "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_0197ac4f4421744094d3abffdeae634c", "profile_id": "pro_2MBjeGslBsr2Lr7AoLvr", "merchant_reference_id": null, "routing_algorithm_id": null, "capture_method": "automatic", "authentication_type": "no_three_ds", "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": null, "email": 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": null, "email": null }, "customer_id": "12345_cus_0197abe38df57a408b928b4111ff5038", "customer_present": "present", "description": null, "return_url": null, "setup_future_usage": "on_session", "apply_mit_exemption": "Skip", "statement_descriptor": null, "order_details": null, "allowed_payment_method_types": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "payment_link_enabled": "Skip", "payment_link_config": null, "request_incremental_authorization": "default", "expires_on": "2025-06-26T13:11:05.403Z", "frm_metadata": null, "request_external_three_ds_authentication": "Skip" } ``` #### **V2 Payment Confirmation (Adyen via UCS)** *Request:* ```bash curl --location 'http://localhost:8080/v2/payments/12345_pay_0197ac4f440c73c0b34c7050d248e483/confirm-intent' \ --header 'x-client-secret: cs_0197ac4f4421744094d3abffdeae634c' \ --header 'x-profile-id: pro_2MBjeGslBsr2Lr7AoLvr' \ --header 'x-connected-merchant-id: cloth_seller_2_X5u3WjKKaUMMtPMYCNQM' \ --header 'Authorization: publishable-key=pk_dev_b78d41b686d54407842e55c1be492fce,client-secret=cs_0197ac4f4421744094d3abffdeae634c' \ --header 'Content-Type: application/json' \ --header 'api-key: pk_dev_b78d41b686d54407842e55c1be492fce' \ --data '{ "payment_method_type": "card", "payment_method_subtype": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "Joseph Doe", "card_cvc": "737" } }, "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 } }' ``` *Response:* ```json { "id": "12345_pay_0197ac4f440c73c0b34c7050d248e483", "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": "12345_cus_0197abe38df57a408b928b4111ff5038", "connector": "adyen", "created": "2025-06-26T12:56:05.403Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": "12345_pay_0197ac4f440c73c0b34c7050d248e483", "connector_reference_id": null, "merchant_connector_id": "mca_YUhrsoeHfh0EQJE6Zqut", "browser_info": null, "error": null, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": "no_three_ds", "authentication_type_applied": "no_three_ds", "is_iframe_redirection_enabled": null, "merchant_reference_id": null } ``` #### **V2 Payment Intent Creation (Adyen via Traditional Connector Flow)** *Request:* ```bash curl --location 'http://localhost:8080/v2/payments/create-intent' \ --header 'api-key: dev_ymXSN8By3WESknjGnFyLVwDE4tK9v8ZjnkMZsKb2cM7KgjlzLfU1SOnJ63LsIrfR' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: pro_2MBjeGslBsr2Lr7AoLvr' \ --header 'Authorization: api-key=dev_ymXSN8By3WESknjGnFyLVwDE4tK9v8ZjnkMZsKb2cM7KgjlzLfU1SOnJ63LsIrfR' \ --data '{ "amount_details": { "order_amount": 100, "currency": "USD" }, "capture_method": "automatic", "authentication_type": "no_three_ds", "customer_id": "12345_cus_0197abe38df57a408b928b4111ff5038", "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" } } }' ``` *Response:* ```json { "id": "12345_pay_0197ac4c67657d81a796bc358b364d04", "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_0197ac4c67ac7731907d52f9dac88996", "profile_id": "pro_2MBjeGslBsr2Lr7AoLvr", "merchant_reference_id": null, "routing_algorithm_id": null, "capture_method": "automatic", "authentication_type": "no_three_ds", "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": null, "email": 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": null, "email": null }, "customer_id": "12345_cus_0197abe38df57a408b928b4111ff5038", "customer_present": "present", "description": null, "return_url": null, "setup_future_usage": "on_session", "apply_mit_exemption": "Skip", "statement_descriptor": null, "order_details": null, "allowed_payment_method_types": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "payment_link_enabled": "Skip", "payment_link_config": null, "request_incremental_authorization": "default", "expires_on": "2025-06-26T13:07:57.887Z", "frm_metadata": null, "request_external_three_ds_authentication": "Skip" } ``` #### **V2 Payment Confirmation (Adyen via Traditional Connector Flow)** *Request:* ```bash curl --location 'http://localhost:8080/v2/payments/12345_pay_0197ac4c67657d81a796bc358b364d04/confirm-intent' \ --header 'x-client-secret: cs_0197ac4c67ac7731907d52f9dac88996' \ --header 'x-profile-id: pro_2MBjeGslBsr2Lr7AoLvr' \ --header 'x-connected-merchant-id: cloth_seller_2_X5u3WjKKaUMMtPMYCNQM' \ --header 'Authorization: publishable-key=pk_dev_b78d41b686d54407842e55c1be492fce,client-secret=cs_0197ac4c67ac7731907d52f9dac88996' \ --header 'Content-Type: application/json' \ --header 'api-key: pk_dev_b78d41b686d54407842e55c1be492fce' \ --data '{ "payment_method_type": "card", "payment_method_subtype": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "Joseph Doe", "card_cvc": "737" } }, "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 } }' ``` *Response:* ```json { "id": "12345_pay_0197ac4c67657d81a796bc358b364d04", "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": "12345_cus_0197abe38df57a408b928b4111ff5038", "connector": "adyen", "created": "2025-06-26T12:52:57.887Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": "K2LGMPJFQZ9TPM75", "connector_reference_id": null, "merchant_connector_id": "mca_YUhrsoeHfh0EQJE6Zqut", "browser_info": null, "error": null, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": "no_three_ds", "authentication_type_applied": "no_three_ds", "is_iframe_redirection_enabled": null, "merchant_reference_id": null } ``` ### Manual Testing (FAILURE CASE) #### **V2 Payment Intent Creation (Adyen via UCS)** *Request:* ```bash curl --location 'http://localhost:8080/v2/payments/create-intent' \ --header 'api-key: dev_ymXSN8By3WESknjGnFyLVwDE4tK9v8ZjnkMZsKb2cM7KgjlzLfU1SOnJ63LsIrfR' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: pro_2MBjeGslBsr2Lr7AoLvr' \ --header 'Authorization: api-key=dev_ymXSN8By3WESknjGnFyLVwDE4tK9v8ZjnkMZsKb2cM7KgjlzLfU1SOnJ63LsIrfR' \ --data '{ "amount_details": { "order_amount": 100, "currency": "USD" }, "capture_method": "automatic", "authentication_type": "no_three_ds", "customer_id": "12345_cus_0197abe38df57a408b928b4111ff5038", "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" } } }' ``` *Response:* ```json { "id": "12345_pay_0197ac52cee5796099a0ae352092a707", "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_0197ac52cefb77e2be6097f5d54b1152", "profile_id": "pro_2MBjeGslBsr2Lr7AoLvr", "merchant_reference_id": null, "routing_algorithm_id": null, "capture_method": "automatic", "authentication_type": "no_three_ds", "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": null, "email": 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": null, "email": null }, "customer_id": "12345_cus_0197abe38df57a408b928b4111ff5038", "customer_present": "present", "description": null, "return_url": null, "setup_future_usage": "on_session", "apply_mit_exemption": "Skip", "statement_descriptor": null, "order_details": null, "allowed_payment_method_types": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "payment_link_enabled": "Skip", "payment_link_config": null, "request_incremental_authorization": "default", "expires_on": "2025-06-26T13:14:57.559Z", "frm_metadata": null, "request_external_three_ds_authentication": "Skip" } ``` #### **V2 Payment Confirmation (Adyen via UCS)** *Request:* ```bash curl --location 'http://localhost:8080/v2/payments/12345_pay_0197ac52cee5796099a0ae352092a707/confirm-intent' \ --header 'x-client-secret: cs_0197ac52cefb77e2be6097f5d54b1152' \ --header 'x-profile-id: pro_2MBjeGslBsr2Lr7AoLvr' \ --header 'x-connected-merchant-id: cloth_seller_2_X5u3WjKKaUMMtPMYCNQM' \ --header 'Authorization: publishable-key=pk_dev_b78d41b686d54407842e55c1be492fce,client-secret=cs_0197ac52cefb77e2be6097f5d54b1152' \ --header 'Content-Type: application/json' \ --header 'api-key: pk_dev_b78d41b686d54407842e55c1be492fce' \ --data '{ "payment_method_type": "card", "payment_method_subtype": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "Joseph Doe", "card_cvc": "730" } }, "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 } }' ``` *Response:* ```json { "id": "12345_pay_0197ac52cee5796099a0ae352092a707", "status": "failed", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": 0 }, "customer_id": "12345_cus_0197abe38df57a408b928b4111ff5038", "connector": "adyen", "created": "2025-06-26T12:59:57.559Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": "G4QT66CH8WCFHJ75", "connector_reference_id": null, "merchant_connector_id": "mca_YUhrsoeHfh0EQJE6Zqut", "browser_info": null, "error": { "code": "24", "message": "CVC Declined", "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": null } ``` #### **V2 Payment Intent Creation (Adyen via Traditional Connector Flow)** *Request:* ```bash curl --location 'http://localhost:8080/v2/payments/create-intent' \ --header 'api-key: dev_ymXSN8By3WESknjGnFyLVwDE4tK9v8ZjnkMZsKb2cM7KgjlzLfU1SOnJ63LsIrfR' \ --header 'Content-Type: application/json' \ --header 'x-profile-id: pro_2MBjeGslBsr2Lr7AoLvr' \ --header 'Authorization: api-key=dev_ymXSN8By3WESknjGnFyLVwDE4tK9v8ZjnkMZsKb2cM7KgjlzLfU1SOnJ63LsIrfR' \ --data '{ "amount_details": { "order_amount": 100, "currency": "USD" }, "capture_method": "automatic", "authentication_type": "no_three_ds", "customer_id": "12345_cus_0197abe38df57a408b928b4111ff5038", "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" } } }' ``` *Response:* ```json { "id": "12345_pay_0197ac5574b37982b150606298590cfb", "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_0197ac5574c57c50b773a7230ffffe69", "profile_id": "pro_2MBjeGslBsr2Lr7AoLvr", "merchant_reference_id": null, "routing_algorithm_id": null, "capture_method": "automatic", "authentication_type": "no_three_ds", "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": null, "email": 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": null, "email": null }, "customer_id": "12345_cus_0197abe38df57a408b928b4111ff5038", "customer_present": "present", "description": null, "return_url": null, "setup_future_usage": "on_session", "apply_mit_exemption": "Skip", "statement_descriptor": null, "order_details": null, "allowed_payment_method_types": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "payment_link_enabled": "Skip", "payment_link_config": null, "request_incremental_authorization": "default", "expires_on": "2025-06-26T13:17:51.072Z", "frm_metadata": null, "request_external_three_ds_authentication": "Skip" } ``` #### **V2 Payment Confirmation (Adyen via Traditional Connector Flow)** *Request:* ```bash curl --location 'http://localhost:8080/v2/payments/12345_pay_0197ac5574b37982b150606298590cfb/confirm-intent' \ --header 'x-client-secret: cs_0197ac5574c57c50b773a7230ffffe69' \ --header 'x-profile-id: pro_2MBjeGslBsr2Lr7AoLvr' \ --header 'x-connected-merchant-id: cloth_seller_2_X5u3WjKKaUMMtPMYCNQM' \ --header 'Authorization: publishable-key=pk_dev_b78d41b686d54407842e55c1be492fce,client-secret=cs_0197ac5574c57c50b773a7230ffffe69' \ --header 'Content-Type: application/json' \ --header 'api-key: pk_dev_b78d41b686d54407842e55c1be492fce' \ --data '{ "payment_method_type": "card", "payment_method_subtype": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "Joseph Doe", "card_cvc": "730" } }, "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 } }' ``` *Response:* ```json { "id": "12345_pay_0197ac5574b37982b150606298590cfb", "status": "failed", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": 0 }, "customer_id": "12345_cus_0197abe38df57a408b928b4111ff5038", "connector": "adyen", "created": "2025-06-26T13:02:51.072Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": "DXZQPDL34QGTPM75", "connector_reference_id": null, "merchant_connector_id": "mca_YUhrsoeHfh0EQJE6Zqut", "browser_info": null, "error": { "code": "24", "message": "CVC Declined", "unified_code": null, "unified_message": null, "network_advice_code": null, "network_decline_code": null, "network_error_message": "DECLINED CVC Incorrect" }, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": "no_three_ds", "authentication_type_applied": "no_three_ds", "is_iframe_redirection_enabled": null, "merchant_reference_id": null } ``` ###UPI Collect payment through UCS *Request* ```bash curl --location 'http://localhost:8080/v2/payments' \ --header 'x-profile-id: pro_2MBjeGslBsr2Lr7AoLvr' \ --header 'x-merchant-id: cloth_seller_2_H3Oh1h4iu0wg8BWGvMzu' \ --header 'x-tenant-id: public' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_ymXSN8By3WESknjGnFyLVwDE4tK9v8ZjnkMZsKb2cM7KgjlzLfU1SOnJ63LsIrfR' \ --data-raw '{ "amount_details": { "currency": "INR", "order_amount": 1000 }, "merchant_connector_details": { "connector_name": "razorpay", "merchant_connector_creds": { "auth_type": "SignatureKey", "key1": "*************************", "api_key": "********************", "api_secret": "*******************" } }, "merchant_reference_id": "12345_pay_01970c787911751013554", "payment_method_data": { "upi": { "upi_collect": { "vpa_id": "failure@razorpay" } }, "billing": { "phone": { "number": "8800574493", "country_code": "+91" }, "email": "uzair.khan@juspay.in" } }, "payment_method_subtype": "upi_collect", "payment_method_type": "upi" }' ``` *Response* ```json { "id": "12345_pay_0197ceee564473609731b2ab35827cc7", "status": "processing", "amount": { "order_amount": 1000, "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": 1000, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": null }, "customer_id": null, "connector": "razorpay", "created": "2025-07-03T06:16:55.621Z", "payment_method_data": { "billing": { "address": null, "phone": { "number": "8800574493", "country_code": "+91" }, "email": "uzair.khan@juspay.in" } }, "payment_method_type": "upi", "payment_method_subtype": "upi_collect", "connector_transaction_id": "pay_QoUbCBtcPCfaWY", "connector_reference_id": "order_QoUbBDL6PKnuZY", "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/success", "authentication_type": null, "authentication_type_applied": "no_three_ds", "is_iframe_redirection_enabled": null, "merchant_reference_id": "12345_pay_01970c787911751013554", "whole_connector_response": null } ``` ### PSync through UCS *Request* ```bash curl --location 'http://localhost:8080/v2/payments/12345_pay_0197ceee564473609731b2ab35827cc7' \ --header 'x-profile-id: pro_2MBjeGslBsr2Lr7AoLvr' \ --header 'x-merchant-id: cloth_seller_2_H3Oh1h4iu0wg8BWGvMzu' \ --header 'x-tenant-id: public' \ --header 'Content-Type: application/json' \ --header 'api-key: dev_ymXSN8By3WESknjGnFyLVwDE4tK9v8ZjnkMZsKb2cM7KgjlzLfU1SOnJ63LsIrfR' \ --data '{ "merchant_connector_details": { "connector_name": "razorpay", "merchant_connector_creds": { "auth_type": "SignatureKey", "key1": "**************", "api_key": "********************", "api_secret": "******************" } }, "force_sync": true }'``` *Response* ```json { "id": "12345_pay_0197ceee564473609731b2ab35827cc7", "status": "failed", "amount": { "order_amount": 1000, "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": 1000, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": 0 }, "customer_id": null, "connector": "razorpay", "created": "2025-07-03T06:16:55.621Z", "payment_method_data": { "billing": { "address": null, "phone": { "number": "8800574493", "country_code": "+91" }, "email": "uzair.khan@juspay.in" } }, "payment_method_type": "upi", "payment_method_subtype": "upi_collect", "connector_transaction_id": "pay_QoUbCBtcPCfaWY", "connector_reference_id": "order_QoUbBDL6PKnuZY", "merchant_connector_id": null, "browser_info": null, "error": { "code": "", "message": "", "unified_code": null, "unified_message": null, "network_advice_code": null, "network_decline_code": null, "network_error_message": null }, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": null, "authentication_type_applied": null, "is_iframe_redirection_enabled": null, "merchant_reference_id": "12345_pay_01970c787911751013554", "whole_connector_response": null } ``` **V2 Schema Testing:** - V2 gRPC schema compatibility verification - `PaymentServiceAuthorizeRequest` field mapping validation - Enhanced card details and address structure testing - Response identifier parsing with new structure **Fallback Testing:** - UCS service unavailable → Automatic fallback to traditional connector flow - Invalid authentication → Fallback with error logging - V2 transformer errors → Graceful degradation to V1 flow - Rollout percentage = 0% → Traditional flow used - Rollout percentage = 100% → UCS V2 flow used ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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/merchant_connector_account.rs` **2. Core Business Logic** - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/flows.rs` - `crates/router/src/core/payments/flows/authorize_flow.rs` - ... and 4 more files **3. External Connector Integration** - `crates/external_services/src/grpc_client/unified_connector_service.rs` **4. Type Definitions** - `crates/router/src/types.rs` **5. Configuration Files** - `crates/external_services/Cargo.toml` - `crates/router/Cargo.toml` **6. Other** - `Cargo.lock` **Code Patterns Applied:** - Implement new functions (12 changes) - Extend existing types with new fields (162 changes) - Add conditional logic for feature flags or filtering (10 changes) **Detailed Identifier Changes:** Commit ae9feca8: Files to modify: **crates/external_services/src/grpc_client/unified_connector_service.rs** Add: - function: pub::payment_get **crates/hyperswitch_domain_models/src/merchant_connector_account.rs** Modify existing code **crates/router/src/core/payments.rs** Modify existing code **crates/router/src/core/payments/flows.rs** Modify existing code **crates/router/src/core/payments/flows/authorize_flow.rs** Modify existing code **crates/router/src/core/payments/flows/psync_flow.rs** Add: - function: private::call_unified_connector_service **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/src/core/unified_connector_service.rs** Modify existing code **crates/router/src/core/unified_connector_service/transformers.rs** Add: - function: private::foreign_try_from - impl: impl ForeignTryFrom<&RouterData<PSync, PaymentsSyncData, PaymentsResponseData>> for payments_grpc::PaymentServiceGetRequest **crates/router/src/types.rs** Modify existing code
{"pr_number": 8439, "pr_title": "feat(core): Hyperswitch <|> UCS integration v2", "merged_at": "2025-07-11T14:44:46Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/merchant_connector_account.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/flows.rs", "crates/router/src/core/payments/flows/authorize_flow.rs", "crates/router/src/core/payments/flows/psync_flow.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/unified_connector_service.rs", "crates/router/src/core/unified_connector_service/transformers.rs"], "connectors": ["crates/external_services/src/grpc_client/unified_connector_service.rs"], "types": ["crates/router/src/types.rs"], "config": ["crates/external_services/Cargo.toml", "crates/router/Cargo.toml"], "other": ["Cargo.lock"]}, "change_types": {"functions_added": 12, "fields_added": 162, "imports_added": 3, "conditionals_added": 10}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(external_services): Fixed Url for Unified Connector Service gRPC Client ## 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 --> Changed the Unified Connector Service gRPC Client config to accept the entire base url instead of host and port. ## What is Unified Connector Service? The Unified Connector Service is a __gRPC-based microservice__ that acts as an intermediary layer between Hyperswitch and payment connectors. Here are its key characteristics: ### Core Purpose: - __Centralized Payment Processing__: UCS handles payment operations like authorization and payment sync/get operations - __Protocol Abstraction__: It provides a unified gRPC interface for interacting with various payment connectors - __Scalability__: Allows Hyperswitch to offload payment processing logic to a dedicated service ### Supported Operations: 1. __Payment Authorization__ (`payment_authorize`) 2. __Payment Sync/Get__ (`payment_get`) ### Technical Architecture: - __Protocol__: Uses gRPC with Protocol Buffers for communication - __Authentication__: Supports multiple connector auth types (HeaderKey, BodyKey, SignatureKey) - __Configuration__: Configurable host, port, and connection timeout settings ## How Hyperswitch Routes Traffic to UCS The routing to UCS follows a sophisticated decision-making process: ### 1. __Decision Logic__ (`should_call_unified_connector_service`) Hyperswitch determines whether to use UCS based on: - __Feature Rollout__: Percentage-based rollout configuration per merchant/connector/payment method/flow - __Configuration Key Format__: `UCS_ROLLOUT_PERCENT_<merchant_id>_<connector>_<payment_method>_<flow>` - __Client Availability__: Checks if UCS gRPC client is configured and available ### 2. __Routing Flow Integration__ The UCS routing is integrated at multiple levels: #### Payment Operations Core: ```rust // In decide_unified_connector_service_call() if should_call_unified_connector_service(state, merchant_context, &router_data).await? { router_data.call_unified_connector_service(state, merchant_connector_account, merchant_context).await?; } else { // Regular connector service call call_connector_service(/* parameters */).await } ``` #### Both V1 and V2 Flows: - __V1__: Integrated in `payments_operation_core` and `decide_unified_connector_service_call` - __V2__: Integrated in `payments_operation_core`, `internal_payments_operation_core`, and `connector_service_decider` ### 3. __Request Processing__ When UCS is selected: 1. __Authentication Setup__: - Builds `ConnectorAuthMetadata` with connector credentials - Handles different auth types (API keys, signatures, etc.) 2. __gRPC Communication__: - Establishes connection using configured host/port - Injects authentication headers and merchant metadata - Sends payment requests via gRPC protocol 3. __Response Handling__: - Processes gRPC responses and converts them to Hyperswitch's internal format - Handles various payment statuses and error scenarios ### 4. __Configuration Management__ UCS routing is controlled through: - __Rollout Configuration__: Stored in the database/cache with percentage-based feature flags - __Client Configuration__: Host, port, connection timeout settings - __Merchant/Connector Specific__: Fine-grained control per merchant and connector combination ### 5. __Fallback Mechanism__ If UCS is not available or the rollout percentage doesn't select it, Hyperswitch falls back to direct connector integration. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [x] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> It was decided to give the entire base URL (inclusive of http/https, domain name, and optional port number) in the config. This would allow us to use all sorts of URLs like these: - http://localhost:3000/ - http://connector-service-grpc.connector-service.svc.cluster.local/ (cluster local URL, used when both are deployed in same cluster) - https://connector-service.sandbox.juspay.in/ ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ### Happy Case (Adyen) **Payment (Through Hyperswitch)** -Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_7xsxWdU69lVRQZHPxhX3m4retRElSfYR5UPaVTwoOPvwrAmzLyqVCmmTCIU6bJ2p' \ --data-raw '{ "amount": 1000, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 1000, "customer_id": "abcdef", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "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": "9123456789", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "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_nYvxwltgwLLkgoofWldv", "merchant_id": "postman_merchant_GHAction_be0d276f-8177-4c23-9d78-e2590128391d", "status": "succeeded", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 0, "amount_received": 1000, "connector": "adyen", "client_secret": "pay_nYvxwltgwLLkgoofWldv_secret_KWeea2KoCzZSKD6k0qow", "created": "2025-06-06T12:13:18.720Z", "currency": "USD", "customer_id": "abcdef", "customer": { "id": "abcdef", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "order_details": null, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "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": "abcdef", "created_at": 1749211998, "expires": 1749215598, "secret": "epk_4ab0c2e897284f14962fc5f19c424092" }, "manual_retry_allowed": false, "connector_transaction_id": "L8T7XPGBM6XLLR65", "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_nYvxwltgwLLkgoofWldv_1", "payment_link": null, "profile_id": "pro_PAIDVbsAbyEWQDTK7fHD", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_aL03aMAluMPtmE5JHDEl", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-06-06T12:28:18.720Z", "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-06-06T12:13:20.638Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null } ``` **Payment (Through Unified Connector Service)** -Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_7xsxWdU69lVRQZHPxhX3m4retRElSfYR5UPaVTwoOPvwrAmzLyqVCmmTCIU6bJ2p' \ --data-raw '{ "amount": 1000, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 1000, "customer_id": "abcdef", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "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": "9123456789", "country_code": "+91" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "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_bkVrJMZvIAEiJmz2j5cR", "merchant_id": "postman_merchant_GHAction_be0d276f-8177-4c23-9d78-e2590128391d", "status": "succeeded", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 0, "amount_received": 1000, "connector": "adyen", "client_secret": "pay_bkVrJMZvIAEiJmz2j5cR_secret_JCjopg5BaNBEAJrOWp5I", "created": "2025-06-06T12:09:30.018Z", "currency": "USD", "customer_id": "abcdef", "customer": { "id": "abcdef", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "order_details": null, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "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": "abcdef", "created_at": 1749211769, "expires": 1749215369, "secret": "epk_3217360d3a924cf991bde23c6155ad75" }, "manual_retry_allowed": false, "connector_transaction_id": "pay_bkVrJMZvIAEiJmz2j5cR_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_bkVrJMZvIAEiJmz2j5cR_1", "payment_link": null, "profile_id": "pro_PAIDVbsAbyEWQDTK7fHD", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_aL03aMAluMPtmE5JHDEl", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-06-06T12:24:30.018Z", "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-06-06T12:09:32.852Z", "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 } ``` ### Failure Case (Adyen) **Payment (Through Hyperswitch)** -Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_IyPRyeEZQVWdKHz40sZZNdJWhK9VzN2sj1I2pBroIt1nmHWM2O2qvtKo7wXDFjhf' \ --data-raw '{ "amount": 1000, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 1000, "customer_id": "abcdef", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "joseph Doe", "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", "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": "125.0.0.1" } }' ``` -Response ``` { "payment_id": "pay_XxNJgnR11lsEdsN2dT9r", "merchant_id": "postman_merchant_GHAction_43152e6c-e97e-47b9-859e-63f125c146cc", "status": "failed", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "adyen", "client_secret": "pay_XxNJgnR11lsEdsN2dT9r_secret_K1M26AfFNIHLYDpNrG1V", "created": "2025-06-09T11:45:57.628Z", "currency": "USD", "customer_id": "abcdef", "customer": { "id": "abcdef", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "order_details": null, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": "24", "error_message": "CVC Declined", "unified_code": "UE_9000", "unified_message": "Something went wrong", "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "abcdef", "created_at": 1749469557, "expires": 1749473157, "secret": "epk_d38fe6bfd1874be7beda3f1ce333dec2" }, "manual_retry_allowed": true, "connector_transaction_id": "G88K4K5FM6XLLR65", "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_lJyta4Kl5ASi3ssVgHiB", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_DO0Hlz6fvzvMUFoC7SaT", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-06-09T12:00:57.628Z", "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-06-09T11:46:00.200Z", "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": "DECLINED CVC Incorrect", "is_iframe_redirection_enabled": null, "whole_connector_response": null } ``` **Payment (Through Unified Connector Service)** -Request ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_IyPRyeEZQVWdKHz40sZZNdJWhK9VzN2sj1I2pBroIt1nmHWM2O2qvtKo7wXDFjhf' \ --data-raw '{ "amount": 1000, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 1000, "customer_id": "abcdef", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "joseph Doe", "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", "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": "125.0.0.1" } }' ``` -Response ``` { "payment_id": "pay_qA0AgXeMZeo0eRv7zttj", "merchant_id": "postman_merchant_GHAction_43152e6c-e97e-47b9-859e-63f125c146cc", "status": "failed", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "adyen", "client_secret": "pay_qA0AgXeMZeo0eRv7zttj_secret_AvdqzELk9yZfJm603Mkj", "created": "2025-06-09T12:20:15.206Z", "currency": "USD", "customer_id": "abcdef", "customer": { "id": "abcdef", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1111", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "411111", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "30", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+91" }, "email": null }, "order_details": null, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": "24", "error_message": "CVC Declined", "unified_code": "UE_9000", "unified_message": "Something went wrong", "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "abcdef", "created_at": 1749471615, "expires": 1749475215, "secret": "epk_3e37b132c42a44ec95100ff1ebe10ecc" }, "manual_retry_allowed": true, "connector_transaction_id": "QQJHXJ8V8XTGLXT5", "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_lJyta4Kl5ASi3ssVgHiB", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_DO0Hlz6fvzvMUFoC7SaT", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-06-09T12:35:15.206Z", "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-06-09T12:20:17.622Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/external_services/src/grpc_client/unified_connector_service.rs` **2. Configuration Files** - `config/config.example.toml` - `config/deployments/env_specific.toml` - `config/development.toml` **Code Patterns Applied:** - Extend existing types with new fields (1 changes) **Detailed Identifier Changes:** Commit 988c1707: Files to modify: **crates/external_services/src/grpc_client/unified_connector_service.rs** Modify existing code
{"pr_number": 8587, "pr_title": "feat(external_services): Fixed Url for Unified Connector Service gRPC Client", "merged_at": "2025-08-05T08:54:50Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/external_services/src/grpc_client/unified_connector_service.rs"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/development.toml"]}, "change_types": {"fields_added": 1, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(dynamic_routing): Decision engine config API integration ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> This PR integrates the decision engine config APIs The integration sits in the dynamic routing config flows. Based on ENV, if decision engine is enabled, we would call DE instead of Dynamo. ### 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)? --> 1. Create a merchant account (Call to Decision Engine should be made for merchant creation) <img width="791" alt="image" src="https://github.com/user-attachments/assets/d01b64a5-9767-4fb2-ae88-8ebbe187dafe" /> 2. Toggle SR config (Call to Decision Engine should be made for SR config creation) ``` curl --location --request POST 'http://localhost:8080/account/merchant_1747841259/business_profile/pro_GUovaynfuaBwH3DUaBbJ/dynamic_routing/success_based/toggle?enable=dynamic_connector_selection' \ --header 'api-key: dev_9gwSrzjH1Xbs7HMswLgx0Av8upsibfu8wORNxyzpIls3NvT08auKe4RBQlkBgqRl' ``` ``` {"id":"routing_wd4JSbjaMmLDB96OxP7d","profile_id":"pro_GUovaynfuaBwH3DUaBbJ","name":"Success rate based dynamic routing algorithm","kind":"dynamic","description":"","created_at":1747841362,"modified_at":1747841362,"algorithm_for":"payment","decision_engine_routing_id":null} ``` <img width="816" alt="image" src="https://github.com/user-attachments/assets/92a3dba9-b77a-4f54-a004-51e52b452334" /> 3. Update SR config ``` curl --location --request PATCH 'http://localhost:8080/account/merchant_1747841259/business_profile/pro_GUovaynfuaBwH3DUaBbJ/dynamic_routing/success_based/config/routing_wd4JSbjaMmLDB96OxP7d' \ --header 'api-key: dev_9gwSrzjH1Xbs7HMswLgx0Av8upsibfu8wORNxyzpIls3NvT08auKe4RBQlkBgqRl' \ --header 'Content-Type: application/json' \ --data '{ "decision_engine_configs": { "defaultLatencyThreshold": 90, "defaultSuccessRate": 0.5, "defaultBucketSize": 200, "defaultHedgingPercent": 5, "subLevelInputConfig": [ { "paymentMethodType": "upi", "paymentMethod": "upi_collect", "bucketSize": 250, "hedgingPercent": 1 } ] } }' ``` ``` {"id":"routing_tgng0ubQwdK3hSaSjRye","profile_id":"pro_GUovaynfuaBwH3DUaBbJ","name":"Success rate based dynamic routing algorithm","kind":"dynamic","description":"","created_at":1747841498,"modified_at":1747841498,"algorithm_for":"payment","decision_engine_routing_id":null} ``` 4. Activate updated SR config (Call to Decision Engine should be made for SR config updation) ``` curl --location --request POST 'http://localhost:8080/routing/routing_tgng0ubQwdK3hSaSjRye/activate' \ --header 'api-key: dev_9gwSrzjH1Xbs7HMswLgx0Av8upsibfu8wORNxyzpIls3NvT08auKe4RBQlkBgqRl' ``` <img width="805" alt="image" src="https://github.com/user-attachments/assets/09345e37-8cf7-478f-b53a-44043883df4b" /> 4. Enable volume split ``` curl --location --request POST 'http://localhost:8080/account/merchant_1747841259/business_profile/pro_GUovaynfuaBwH3DUaBbJ/dynamic_routing/set_volume_split?split=100' \ --header 'api-key: dev_9gwSrzjH1Xbs7HMswLgx0Av8upsibfu8wORNxyzpIls3NvT08auKe4RBQlkBgqRl' ``` 5. Toggle ER config (Call to Decision Engine should be made for ER config creation) ``` curl --location --request POST 'http://localhost:8080/account/merchant_1747380349/business_profile/pro_28WNE1lOkSX9w3VdEPAN/dynamic_routing/elimination/toggle?enable=dynamic_connector_selection' \ --header 'api-key: dev_d87bY8HlyzBj4YYtGOIK2cj6yZLnPTxEkJN2o3lNJSxck0t3RghiH9zwrOR6Rexs' ``` ``` {"id":"routing_S5d4ArS1VLlyrnpZ3tTx","profile_id":"pro_28WNE1lOkSX9w3VdEPAN","name":"Elimination based dynamic routing algorithm","kind":"dynamic","description":"","created_at":1747380532,"modified_at":1747380532,"algorithm_for":"payment"} ``` <img width="1559" alt="image" src="https://github.com/user-attachments/assets/f849243c-1f51-4a7f-94e6-9f7c60917dfd" /> 6. Update ER config ``` curl --location --request PATCH 'http://localhost:8080/account/merchant_1747380349/business_profile/pro_28WNE1lOkSX9w3VdEPAN/dynamic_routing/elimination/config/routing_S5d4ArS1VLlyrnpZ3tTx' \ --header 'api-key: dev_d87bY8HlyzBj4YYtGOIK2cj6yZLnPTxEkJN2o3lNJSxck0t3RghiH9zwrOR6Rexs' \ --header 'Content-Type: application/json' \ --data '{ "decision_engine_configs": { "threshold": 0.45 } }' ``` ``` {"id":"routing_vOZoBnvZarFhmmLVXElW","profile_id":"pro_28WNE1lOkSX9w3VdEPAN","name":"Elimination based dynamic routing algorithm","kind":"dynamic","description":"","created_at":1747380711,"modified_at":1747380711,"algorithm_for":"payment"} ``` 7. Activate updated ER config (Call to Decision Engine should be made for ER config updation) ``` curl --location --request POST 'http://localhost:8080/routing/routing_vOZoBnvZarFhmmLVXElW/activate' \ --header 'api-key: dev_d87bY8HlyzBj4YYtGOIK2cj6yZLnPTxEkJN2o3lNJSxck0t3RghiH9zwrOR6Rexs' ``` <img width="1536" alt="image" src="https://github.com/user-attachments/assets/21c83167-e5c4-4f5b-9b1e-ca9b1e2f91ef" /> 8. Disable ER config ``` curl --location --request POST 'http://localhost:8080/account/merchant_1747380349/business_profile/pro_28WNE1lOkSX9w3VdEPAN/dynamic_routing/elimination/toggle?enable=none' \ --header 'api-key: dev_d87bY8HlyzBj4YYtGOIK2cj6yZLnPTxEkJN2o3lNJSxck0t3RghiH9zwrOR6Rexs' ``` <img width="1545" alt="image" src="https://github.com/user-attachments/assets/6e5ca5b1-06ef-4083-8271-603b6e108000" /> 9. make a payment ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_d87bY8HlyzBj4YYtGOIK2cj6yZLnPTxEkJN2o3lNJSxck0t3RghiH9zwrOR6Rexs' \ --data-raw '{ "amount": 6540, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "StripeCustomer", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "123" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "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" } }' ``` ``` {"payment_id":"pay_WMa1HPuv2m4y1eUa8bJf","merchant_id":"merchant_1747380349","status":"succeeded","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":0,"amount_received":6540,"connector":"stripe","client_secret":"pay_WMa1HPuv2m4y1eUa8bJf_secret_dLcjgQ2dafDp8Nl1vWZ7","created":"2025-05-16T07:52:09.020Z","currency":"USD","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":"John Doe","email":"guest@example.com","phone":"999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"4242","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"424242","card_extended_bin":null,"card_exp_month":"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":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":"guest@example.com","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"StripeCustomer","created_at":1747381929,"expires":1747385529,"secret":"epk_30f63c59ee2f4ce8b0d4e34a1bdd9119"},"manual_retry_allowed":false,"connector_transaction_id":"pi_3RPJ3tD5R7gDAGff0Jgz3U6C","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_3RPJ3tD5R7gDAGff0Jgz3U6C","payment_link":null,"profile_id":"pro_28WNE1lOkSX9w3VdEPAN","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_Zm1nyERaPTww6jSUgtak","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-05-16T08:07:09.020Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-05-16T07:52:10.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} ``` <img width="1253" alt="image" src="https://github.com/user-attachments/assets/ec3600d7-08f5-47d1-ac08-992890ea1bcd" /> <img width="1241" alt="image" src="https://github.com/user-attachments/assets/2d51e889-3e75-428f-b995-bf936c0cb905" /> ## Checklist <!-- Put 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/open_router.rs` - `crates/api_models/src/routing.rs` **2. Core Business Logic** - `crates/router/src/core/admin.rs` - `crates/router/src/core/payments/routing.rs` - `crates/router/src/core/payments/routing/utils.rs` - ... and 2 more files **3. Other** - `api-reference/openapi_spec.json` - `crates/openapi/src/openapi.rs` **Code Patterns Applied:** - Define new data structures (8 changes) - Implement new functions (20 changes) - Extend existing types with new fields (104 changes) - Add conditional logic for feature flags or filtering (26 changes) - Modify database queries (2 changes) **Detailed Identifier Changes:** Commit d41f6538: Files to modify: **crates/api_models/src/open_router.rs** Add: - function: pub::update - function: pub::update - function: pub::update - function: pub::update - struct: pub::DecisionEngineConfigSetupRequest - struct: pub::DecisionEngineSuccessRateData - struct: pub::DecisionEngineSRSubLevelInputConfig - struct: pub::DecisionEngineGatewayWiseExtraScore - struct: pub::DecisionEngineEliminationData - struct: pub::MerchantAccount - struct: pub::FetchRoutingConfig - enum: pub::DecisionEngineConfigVariant - enum: pub::AlgorithmType - impl: impl DecisionEngineSuccessRateData - impl: impl DecisionEngineSRSubLevelInputConfig - impl: impl DecisionEngineGatewayWiseExtraScore - impl: impl DecisionEngineEliminationData **crates/api_models/src/routing.rs** Add: - function: pub::open_router_config_default - function: pub::get_decision_engine_configs - function: pub::open_router_config_default **crates/openapi/src/openapi.rs** Modify existing code **crates/router/src/core/admin.rs** Modify existing code **crates/router/src/core/payments/routing.rs** Modify existing code **crates/router/src/core/payments/routing/utils.rs** Add: - function: private::send_decision_engine_request - impl: impl DecisionEngineApiHandler for EuclidApiClient **crates/router/src/core/routing.rs** Modify existing code **crates/router/src/core/routing/helpers.rs** Add: - function: pub::enable_decision_engine_dynamic_routing_setup - function: pub::update_decision_engine_dynamic_routing_setup - function: pub::disable_decision_engine_dynamic_routing_setup - function: pub::create_decision_engine_merchant - function: pub::delete_decision_engine_merchant
{"pr_number": 8044, "pr_title": "feat(dynamic_routing): Decision engine config API integration ", "merged_at": "2025-05-22T18:43:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/open_router.rs", "crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/payments/routing/utils.rs", "crates/router/src/core/routing.rs", "crates/router/src/core/routing/helpers.rs"], "other": ["api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs"]}, "change_types": {"structs_added": 8, "functions_added": 20, "enums_added": 2, "fields_added": 104, "imports_added": 4, "conditionals_added": 26, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(dynamic_routing): analytics improvement using separate postgres table ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [x] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Previously we were pushing the Dynamic routing metrics to Prometheus, but due to high cardinality of some values(payment_id) we were not able to add that in our attributes, hence we are pushing this after creating a new table in our Database (dynamic_routing_stats). The further enhancement will be done in this track: https://github.com/juspay/hyperswitch/issues/6756 ### 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). --> Required to get the payment_id for our metrics purpose. ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Can be tested in the following ways: 1. enable success_based_routing(feature = metrics) for merchant. ``` curl --location --request POST 'http://localhost:8080/account/m_id/business_profile/pro_id/dynamic_routing/success_based/toggle?enable=metrics' \ --header 'api-key:api_key' ``` 2. Make a payment afterwards. 3. Check the `dynamic_routing_stats` table for the specific value associated with the `payment_id`. <img width="645" alt="Screenshot 2024-12-06 at 6 31 56 PM" src="https://github.com/user-attachments/assets/8317e26b-347d-489a-a8fa-661ab692b157"> ## Migration ``` CREATE TYPE "SuccessBasedRoutingConclusiveState" AS ENUM( 'true_positive', 'false_positive', 'true_negative', 'false_negative' ); CREATE TABLE IF NOT EXISTS dynamic_routing_stats ( payment_id VARCHAR(64) NOT NULL, attempt_id VARCHAR(64) NOT NULL, merchant_id VARCHAR(64) NOT NULL, profile_id VARCHAR(64) NOT NULL, amount BIGINT NOT NULL, success_based_routing_connector VARCHAR(64) NOT NULL, payment_connector VARCHAR(64) NOT NULL, currency "Currency", payment_method VARCHAR(64), capture_method "CaptureMethod", authentication_type "AuthenticationType", payment_status "AttemptStatus" NOT NULL, conclusive_classification "SuccessBasedRoutingConclusiveState" NOT NULL, created_at TIMESTAMP NOT NULL, PRIMARY KEY(attempt_id, merchant_id) ); CREATE INDEX profile_id_index ON dynamic_routing_stats (profile_id); ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/routing.rs` **2. Database Layer (Queries & Schema)** - `crates/diesel_models/src/dynamic_routing_stats.rs` - `crates/diesel_models/src/enums.rs` - `crates/diesel_models/src/lib.rs` - ... and 4 more files **3. Core Business Logic** - `crates/router/src/core/routing/helpers.rs` **4. Type Definitions** - `crates/router/src/types/storage.rs` - `crates/router/src/types/storage/dynamic_routing_stats.rs` **5. Other** - `crates/common_enums/src/enums.rs` - `crates/router/src/db.rs` - `crates/router/src/db/dynamic_routing_stats.rs` - ... and 2 more files **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (5 changes) - Extend existing types with new fields (46 changes) **Detailed Identifier Changes:** Commit 5918014d: Files to modify: **crates/api_models/src/routing.rs** Modify existing code **crates/common_enums/src/enums.rs** Modify existing code **crates/diesel_models/src/dynamic_routing_stats.rs** Add: - struct: pub::DynamicRoutingStatsNew - struct: pub::DynamicRoutingStats **crates/diesel_models/src/enums.rs** Modify existing code **crates/diesel_models/src/lib.rs** Add: - mod: pub::dynamic_routing_stats **crates/diesel_models/src/query.rs** Add: - mod: pub::dynamic_routing_stats **crates/diesel_models/src/query/dynamic_routing_stats.rs** Add: - function: pub::insert - impl: impl DynamicRoutingStatsNew **crates/diesel_models/src/schema.rs** Modify existing code **crates/diesel_models/src/schema_v2.rs** Modify existing code **crates/router/src/core/routing/helpers.rs** Modify existing code **crates/router/src/db.rs** Add: - mod: pub::dynamic_routing_stats **crates/router/src/db/dynamic_routing_stats.rs** Add: - function: private::insert_dynamic_routing_stat_entry - function: private::insert_dynamic_routing_stat_entry - function: private::insert_dynamic_routing_stat_entry - trait: pub::DynamicRoutingStatsInterface - impl: impl DynamicRoutingStatsInterface for Store - impl: impl DynamicRoutingStatsInterface for MockDb - impl: impl DynamicRoutingStatsInterface for KafkaStore **crates/router/src/types/storage.rs** Add: - mod: pub::dynamic_routing_stats **crates/router/src/types/storage/dynamic_routing_stats.rs** Modify existing code
{"pr_number": 6723, "pr_title": "feat(dynamic_routing): analytics improvement using separate postgres table", "merged_at": "2024-12-07T09:31:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/routing.rs"], "database": ["crates/diesel_models/src/dynamic_routing_stats.rs", "crates/diesel_models/src/enums.rs", "crates/diesel_models/src/lib.rs", "crates/diesel_models/src/query.rs", "crates/diesel_models/src/query/dynamic_routing_stats.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "core_business": ["crates/router/src/core/routing/helpers.rs"], "types": ["crates/router/src/types/storage.rs", "crates/router/src/types/storage/dynamic_routing_stats.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/db.rs", "crates/router/src/db/dynamic_routing_stats.rs", "migrations/2024-12-02-095127_add_new_table_dynamic_routing_stats/down.sql", "migrations/2024-12-02-095127_add_new_table_dynamic_routing_stats/up.sql"]}, "change_types": {"structs_added": 2, "functions_added": 5, "fields_added": 46, "imports_added": 14}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(l2l3): enable l2l3 for integ ## 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 --> Enable L2l3 config for integ NO test needed. Just enabling config ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## Checklist <!-- Put an `x` in the boxes that apply --> - [ ] I formatted the code `cargo +nightly fmt --all` - [ ] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Tests** - `config/deployments/integration_test.toml`
{"pr_number": 9538, "pr_title": "fix(l2l3): enable l2l3 for integ", "merged_at": "2025-09-25T17:55:49Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["config/deployments/integration_test.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
feat(connector): [GETNET,HIPAY,KLARNA,MONERIS,OPENNODE] add in feature matrix api ## 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/7872) ## Description <!-- Describe your changes in detail --> Added Getnet, Hipay, Klarna, Moneris, Opennode in feature matrix API ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Postman Tests Request: ``` curl --location 'http://localhost:8080/feature_matrix' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header '[api-key]' ``` Response: ``` { "connector_count": 5, "connectors": [ { "name": "GETNET", "display_name": "Getnet", "description": "Getnet is a high-tech global payment platform that helps businesses accept payments securely while providing the best frictionless experience for customers everywhere.", "category": "payment_gateway", "supported_payment_methods": [ { "payment_method": "card", "payment_method_type": "credit", "payment_method_type_display_name": "Credit Card", "mandates": "not_supported", "refunds": "supported", "supported_capture_methods": [ "automatic", "manual", "sequential_automatic" ], "three_ds": "not_supported", "no_three_ds": "supported", "supported_card_networks": [ "Mastercard", "Visa", "Interac", "AmericanExpress", "JCB", "DinersClub", "Discover", "CartesBancaires", "UnionPay", "RuPay", "Maestro" ], "supported_countries": [ "FIN", "BEL", "SWE", "IRL", "ESP", "NLD", "ARG", "NOR", "ARE", "POL", "MEX", "BRA", "ITA", "GBR", "CHE", "AUT", "DNK", "IND", "PRT", "CHL", "URY", "LUX", "FRA", "DEU" ], "supported_currencies": [ "ARS", "UYU", "EUR", "SEK", "NOK", "CHF", "INR", "AED", "MXN", "PLN", "DKK", "CLP", "BRL", "GBP" ] } ], "supported_webhook_flows": [ "payments", "refunds" ] }, { "name": "HIPAY", "display_name": "Hipay", "description": "HiPay is an independent global payment service provider that is based in France.", "category": "payment_gateway", "supported_payment_methods": [ { "payment_method": "card", "payment_method_type": "credit", "payment_method_type_display_name": "Credit Card", "mandates": "not_supported", "refunds": "supported", "supported_capture_methods": [ "automatic", "manual", "sequential_automatic" ], "three_ds": "supported", "no_three_ds": "supported", "supported_card_networks": [ "Mastercard", "Visa", "Interac", "AmericanExpress", "JCB", "DinersClub", "Discover", "CartesBancaires", "UnionPay" ], "supported_countries": [ "ZAF", "SWE", "CAN", "JPN", "HKG", "NOR", "CZE", "POL", "DNK", "USA", "GBR", "AUS", "CHE" ], "supported_currencies": [ "EUR", "GBP", "NOK", "HKD", "AUD", "ZAR", "CHF", "SEK", "DKK", "PLN", "CZK", "USD", "CAD", "JPY" ] }, { "payment_method": "card", "payment_method_type": "debit", "payment_method_type_display_name": "Debit Card", "mandates": "not_supported", "refunds": "supported", "supported_capture_methods": [ "automatic", "manual", "sequential_automatic" ], "three_ds": "supported", "no_three_ds": "supported", "supported_card_networks": [ "Mastercard", "Visa", "Interac", "AmericanExpress", "JCB", "DinersClub", "Discover", "CartesBancaires", "UnionPay" ], "supported_countries": [ "AUS", "USA", "CAN", "CZE", "POL", "SWE", "GBR", "NOR", "ZAF", "DNK", "CHE", "JPN", "HKG" ], "supported_currencies": [ "HKD", "DKK", "SEK", "PLN", "GBP", "CAD", "CZK", "JPY", "USD", "EUR", "AUD", "NOK", "CHF", "ZAR" ] } ], "supported_webhook_flows": [] }, { "name": "KLARNA", "display_name": "Klarna", "description": "Klarna provides payment processing services for the e-commerce industry, managing store claims and customer payments.", "category": "payment_gateway", "supported_payment_methods": [ { "payment_method": "pay_later", "payment_method_type": "klarna", "payment_method_type_display_name": "Klarna", "mandates": "not_supported", "refunds": "supported", "supported_capture_methods": [ "automatic", "manual", "sequential_automatic" ], "supported_countries": [ "GRC", "PRT", "ESP", "CHE", "SWE", "CZE", "IRL", "FIN", "USA", "GBR", "NZL", "POL", "DNK", "NLD", "BEL", "NOR", "CAN", "AUS", "ITA", "DEU", "FRA", "AUT" ], "supported_currencies": [ "PLN", "CZK", "NOK", "CHF", "CAD", "AUD", "NZD", "DKK", "GBP", "SEK", "EUR", "USD" ] } ], "supported_webhook_flows": [] }, { "name": "MONERIS", "display_name": "Moneris", "description": "Moneris is Canada's top payment solutions provider, empowering businesses with innovative mobile, online & in-store solutions.", "category": "payment_gateway", "supported_payment_methods": [ { "payment_method": "card", "payment_method_type": "credit", "payment_method_type_display_name": "Credit Card", "mandates": "supported", "refunds": "supported", "supported_capture_methods": [ "automatic", "manual" ], "three_ds": "not_supported", "no_three_ds": "supported", "supported_card_networks": [ "Mastercard", "Visa", "Interac", "AmericanExpress", "JCB", "DinersClub", "Discover", "CartesBancaires", "UnionPay" ], "supported_countries": [ "VUT", "SGP", "HUN", "DOM", "TUN", "LAO", "THA", "WSM", "PRY", "SLV", "BDI", "SVN", "KAZ", "TZA", "ESP", "TUR", "SLE", "BLZ", "MDA", "SWE", "BMU", "AGO", "ISR", "PRT", "BGR", "KWT", "DEU", "JOR", "SYC", "MRT", "BGD", "IDN", "CHL", "LUX", "GRC", "RWA", "VNM", "BIH", "SHN", "UGA", "HRV", "SRB", "CHE", "MDV", "FIN", "PER", "KEN", "BTN", "GIN", "ROU", "NIC", "KOR", "NAM", "COM", "CUB", "LVA", "DJI", "ZAF", "SLB", "ARE", "AUT", "MDG", "ITA", "GBR", "SAU", "LKA", "BHR", "RUS", "ZMB", "BRB", "NZL", "LSO", "MAC", "LBR", "HND", "PNG", "PAK", "USA", "GTM", "TKM", "AZE", "CRI", "POL", "BEL", "TJK", "AUS", "BRA", "UZB", "QAT", "EGY", "MWI", "CYM", "NOR", "ALB", "AFG", "DZA", "MEX", "DNK", "HKG", "MYS", "GUY", "FRA", "SWZ", "BLR", "JPN", "BRN", "NGA", "IND", "SVK", "LTU", "TWN", "MAR", "JAM", "BOL", "CZE", "EST", "TTO", "CYP", "COL", "ISL", "IRL", "GEO", "URY", "ABW", "MLT", "MKD", "GIB", "FJI", "CHN", "NLD", "OMN", "HTI", "NPL", "SUR", "GMB", "CPV", "ARG", "MOZ", "MUS" ], "supported_currencies": [ "PGK", "ZAR", "LSL", "MGA", "MWK", "AZN", "BIF", "NGN", "NIO", "JOD", "KWD", "NOK", "MYR", "HUF", "NAD", "AFN", "SBD", "INR", "BBD", "GTQ", "RUB", "GMD", "WST", "ALL", "MXN", "RON", "BYN", "MAD", "OMR", "HRK", "BAM", "HTG", "RSD", "BDT", "TMT", "CHF", "AUD", "AWG", "AED", "TTD", "QAR", "BND", "SEK", "TND", "DZD", "RWF", "BOB", "JMD", "XPF", "NZD", "VUV", "UZS", "PYG", "ARS", "TJS", "AOA", "MOP", "UGX", "DOP", "SLL", "BRL", "KYD", "THB", "FJD", "BZD", "KMF", "MKD", "UYU", "XOF", "DKK", "PHP", "SHP", "SGD", "BTN", "MUR", "SCR", "XCD", "ZMW", "JPY", "PEN", "ANG", "HKD", "KES", "LAK", "SZL", "CRC", "PLN", "CNY", "SVC", "IDR", "MDL", "USD", "VND", "BMD", "DJF", "GEL", "KRW", "KZT", "NPR", "PKR", "CUP", "MRU", "CZK", "ILS", "GYD", "LKR", "LRD", "BGN", "GIP", "TZS", "EUR", "GBP", "MZN", "BHD", "MVR", "SAR", "TWD", "COP", "GNF", "SRD", "TRY", "HNL", "EGP", "ISK", "CLP", "CVE" ] }, { "payment_method": "card", "payment_method_type": "debit", "payment_method_type_display_name": "Debit Card", "mandates": "supported", "refunds": "supported", "supported_capture_methods": [ "automatic", "manual" ], "three_ds": "not_supported", "no_three_ds": "supported", "supported_card_networks": [ "Mastercard", "Visa", "Interac", "AmericanExpress", "JCB", "DinersClub", "Discover", "CartesBancaires", "UnionPay" ], "supported_countries": [ "RWA", "MDV", "ISL", "FIN", "PRT", "COM", "USA", "UZB", "POL", "LAO", "SVK", "UGA", "BRN", "DOM", "MDA", "COL", "CRI", "BEL", "TKM", "KWT", "BGR", "MAR", "CHL", "SWE", "TWN", "JOR", "AUS", "MUS", "ARE", "KOR", "LUX", "SLV", "GRC", "URY", "LBR", "AUT", "HTI", "EST", "DEU", "ABW", "MAC", "MLT", "SLE", "OMN", "HND", "DJI", "AFG", "MYS", "THA", "SYC", "NIC", "GMB", "VUT", "PAK", "IND", "MOZ", "ROU", "JPN", "MKD", "ZAF", "BLR", "HKG", "LSO", "BDI", "PNG", "DNK", "EGY", "LKA", "ARG", "PRY", "BRA", "HRV", "JAM", "NOR", "IRL", "GIN", "BIH", "MEX", "BMU", "ITA", "WSM", "BRB", "BOL", "TJK", "FJI", "TUR", "NLD", "HUN", "CYP", "SAU", "ZMB", "ESP", "GEO", "RUS", "MDG", "DZA", "TTO", "AGO", "GTM", "SGP", "CYM", "GIB", "SVN", "FRA", "GUY", "MWI", "QAT", "LTU", "PER", "SWZ", "VNM", "LVA", "AZE", "BHR", "ISR", "CUB", "GBR", "BLZ", "CZE", "SLB", "MRT", "NGA", "BGD", "CHN", "SUR", "KEN", "ALB", "TUN", "SHN", "CHE", "BTN", "NZL", "KAZ", "NAM", "TZA", "CPV", "IDN", "SRB", "NPL" ], "supported_currencies": [ "DOP", "ISK", "AUD", "BMD", "SBD", "XOF", "AFN", "RWF", "PGK", "UZS", "HRK", "LAK", "BBD", "CVE", "MZN", "CLP", "MUR", "GBP", "BHD", "JPY", "ALL", "KMF", "NZD", "QAR", "BZD", "GYD", "TJS", "NIO", "LKR", "LRD", "MKD", "PKR", "XCD", "MXN", "TMT", "USD", "SHP", "VND", "NOK", "GIP", "MYR", "BYN", "KZT", "BAM", "BDT", "BGN", "EUR", "NPR", "PHP", "ZAR", "XPF", "SLL", "BND", "CRC", "JOD", "RON", "WST", "SZL", "GNF", "TWD", "KES", "MOP", "JMD", "TZS", "GTQ", "CZK", "INR", "SCR", "GMD", "TRY", "HTG", "NGN", "MDL", "OMR", "KYD", "SGD", "HNL", "AED", "AWG", "SRD", "VUV", "CNY", "THB", "RUB", "SEK", "CHF", "KWD", "BIF", "BOB", "PLN", "MGA", "SAR", "TND", "PYG", "SVC", "TTD", "UGX", "ANG", "DJF", "DKK", "EGP", "DZD", "ZMW", "BRL", "AOA", "AZN", "IDR", "FJD", "MWK", "MRU", "GEL", "ARS", "HUF", "ILS", "MVR", "UYU", "MAD", "HKD", "LSL", "PEN", "NAD", "CUP", "KRW", "COP", "BTN", "RSD" ] } ], "supported_webhook_flows": [] }, { "name": "OPENNODE", "display_name": "Opennode", "description": "OpenNode offers accessible way for e-commerce businesses to process bitcoin payments.", "category": "payment_gateway", "supported_payment_methods": [ { "payment_method": "crypto", "payment_method_type": "crypto_currency", "payment_method_type_display_name": "Crypto", "mandates": "not_supported", "refunds": "not_supported", "supported_capture_methods": [ "automatic" ], "supported_countries": [ "SVN", "PHL", "CAN", "AUS", "BEL", "MEX", "NLD", "FIN", "GBR", "MLT", "ESP", "USA", "EST", "PRT", "SVK", "JPN", "CYP", "LVA", "LTU", "ZAF", "BRA", "HRV", "DEU", "GRC", "ITA", "SGP", "FRA", "LUX", "IRL", "NZL", "AUT" ], "supported_currencies": [ "AUD", "JPY", "BRL", "CAD", "USD", "MXN", "PHP", "GBP", "EUR", "ZAR", "SGD", "NZD" ] } ], "supported_webhook_flows": [ "payments" ] } ] } ``` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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/getnet.rs` - `crates/hyperswitch_connectors/src/connectors/hipay.rs` - `crates/hyperswitch_connectors/src/connectors/klarna.rs` - ... and 2 more files **2. Tests** - `config/deployments/integration_test.toml` - `loadtest/config/development.toml` **3. Configuration Files** - `config/config.example.toml` - `config/deployments/production.toml` - `config/deployments/sandbox.toml` - ... and 2 more files **Code Patterns Applied:** - Implement new functions (15 changes) - Extend existing types with new fields (55 changes) **Detailed Identifier Changes:** Commit 69ba651a: Files to modify: **crates/hyperswitch_connectors/src/connectors/getnet.rs** Remove: - function: private::validate_connector_against_payment_request - impl: impl ConnectorSpecifications for Getnet Add: - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl ConnectorSpecifications for Getnet **crates/hyperswitch_connectors/src/connectors/hipay.rs** Remove: - function: private::validate_connector_against_payment_request - impl: impl ConnectorValidation for Hipay - impl: impl ConnectorSpecifications for Hipay Add: - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl ConnectorValidation for Hipay - impl: impl ConnectorSpecifications for Hipay **crates/hyperswitch_connectors/src/connectors/klarna.rs** Remove: - function: private::validate_connector_against_payment_request - impl: impl ConnectorValidation for Klarna - impl: impl ConnectorSpecifications for Klarna Add: - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl ConnectorValidation for Klarna - impl: impl ConnectorSpecifications for Klarna **crates/hyperswitch_connectors/src/connectors/moneris.rs** Remove: - function: private::validate_connector_against_payment_request - impl: impl ConnectorSpecifications for Moneris Add: - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl ConnectorSpecifications for Moneris **crates/hyperswitch_connectors/src/connectors/opennode.rs** Remove: - impl: impl ConnectorSpecifications for Opennode Add: - function: private::get_connector_about - function: private::get_supported_payment_methods - function: private::get_supported_webhook_flows - impl: impl ConnectorSpecifications for Opennode
{"pr_number": 7873, "pr_title": "feat(connector): [GETNET,HIPAY,KLARNA,MONERIS,OPENNODE] add in feature matrix api", "merged_at": "2025-04-25T09:54:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "refund"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/getnet.rs", "crates/hyperswitch_connectors/src/connectors/hipay.rs", "crates/hyperswitch_connectors/src/connectors/klarna.rs", "crates/hyperswitch_connectors/src/connectors/moneris.rs", "crates/hyperswitch_connectors/src/connectors/opennode.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": 15, "fields_added": 55, "imports_added": 11}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(refunds): remove to schema from refund aggregate response and exclude it from open api documentation ## 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 --> Removed all the openapi references to `RefundAggregateResponse`. 1. Removed `ToSchema` trait for `RefundAggregateResponse`. 2. Removed references from `openapi` and `openapi_v2` to `RefundAggregateResponse`. 3. Generated new `openapi_spec` file based on the above 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). --> #5990 ## How did you test 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. The references of `RefundAggregateResponse` is removed in openapi generated json file after the modification. <img width="871" alt="image" src="https://github.com/user-attachments/assets/70f23a10-37e9-420e-8031-f41e6b5f11da"> <img width="1015" alt="image" src="https://github.com/user-attachments/assets/614b9c86-2735-445c-8aa0-d54248f944a5"> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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/refunds.rs` **2. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` - `crates/openapi/src/openapi.rs` - ... and 1 more files **Detailed Identifier Changes:** Commit 449c9cfe: Files to modify: **crates/api_models/src/refunds.rs** Modify existing code **crates/openapi/src/openapi.rs** Modify existing code **crates/openapi/src/openapi_v2.rs** Modify existing code
{"pr_number": 6405, "pr_title": "fix(refunds): remove to schema from refund aggregate response and exclude it from open api documentation", "merged_at": "2024-11-05T09:26:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "refund"]}, "hierarchy": {"api_models": ["crates/api_models/src/refunds.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(core): populate shipping_cost in payment response ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Populate `shipping_cost` in payment response ### Additional Changes - [x] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? 1. Create a Merchant account 2. Create APi Key 3. Create MCA for Stripe Connector ``` curl --location 'http://localhost:8080/account/postman_merchant_GHAction_477eb276-4b24-4ddc-87d7-77b86eef7637/connectors' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data '{ "connector_type": "payment_processor", "connector_name": "stripe", "business_country": "US", "business_label": "default", "connector_account_details": { "auth_type": "HeaderKey", "api_key": "_______" }, "test_mode": false, "disabled": false, "payment_methods_enabled": [ { "payment_method": "pay_later", "payment_method_types": [ { "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true, "payment_experience": "redirect_to_url", "payment_method_type": "affirm" } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true, "payment_experience": "redirect_to_url", "payment_method_type": "afterpay_clearpay" } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true, "payment_experience": "redirect_to_url", "payment_method_type": "klarna" } ] }, { "payment_method": "pay_later", "payment_method_types": [ { "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true, "payment_experience": "invoke_sdk_client", "payment_method_type": "klarna" } ] }, { "payment_method": "bank_redirect", "payment_method_types": [ { "payment_method_type": "ideal", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "giropay", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "sofort", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "eps", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "bank_debit", "payment_method_types": [ { "payment_method_type": "ach", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "becs", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "sepa", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "bank_transfer", "payment_method_types": [ { "payment_method_type": "ach", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "bacs", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true }, { "payment_method_type": "sepa", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true, "card_networks": [ "AmericanExpress", "Discover", "Interac", "JCB", "Mastercard", "Visa", "DinersClub", "UnionPay", "RuPay" ] } ] }, { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "debit", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true, "card_networks": [ "AmericanExpress", "Discover", "Interac", "JCB", "Mastercard", "Visa", "DinersClub", "UnionPay", "RuPay" ] } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "apple_pay", "payment_experience": "invoke_sdk_client", "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_type": "we_chat_pay", "payment_experience": "invoke_sdk_client", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "metadata": { "google_pay": { "allowed_payment_methods": [ { "type": "CARD", "parameters": { "allowed_auth_methods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowed_card_networks": [ "AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA" ] }, "tokenization_specification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "example", "gateway_merchant_id": "" } } } ], "merchant_info": { "merchant_name": "Narayan Bhat" } } } }' ``` 4. Create Payment ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_k20iz8rRAC0stoBKDHAqizHgeTazec3GVCvCYb8vnSVcO0OxO38ykg1meVbhz5wk' \ --data-raw '{ "amount": 2000, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "StripeCustomer", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "shipping_cost" : 200, "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "payment_method": "card", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "123" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "sundari" } }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "sundari" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "routing": { "type": "single", "data": "stripe" } }' ``` Response ``` { "payment_id": "pay_XYUrQG1N19wpnInBhOFp", "merchant_id": "postman_merchant_GHAction_477eb276-4b24-4ddc-87d7-77b86eef7637", "status": "succeeded", "amount": 2000, "net_amount": 2200, "shipping_cost": 200, "amount_capturable": 0, "amount_received": 2200, "connector": "stripe", "client_secret": "pay_XYUrQG1N19wpnInBhOFp_secret_Af4KrMcaidb1cCSgnsEk", "created": "2024-10-17T12:59:41.291Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": null, "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": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "StripeCustomer", "created_at": 1729169981, "expires": 1729173581, "secret": "epk_63ceec3ede144bfe98ea4e02289f354b" }, "manual_retry_allowed": false, "connector_transaction_id": "pi_3QAtIoD5R7gDAGff0DTVzBPx", "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_3QAtIoD5R7gDAGff0DTVzBPx", "payment_link": null, "profile_id": "pro_yRBwJHghRVOIboiPQrA2", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_WqzONRn2jBWofwQHtpVd", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-10-17T13:14:41.291Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-10-17T12:59:43.229Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` In response check for `shipping_cost` 5. Create Payment Retrieve ``` curl --location 'http://localhost:8080/payments/pay_XYUrQG1N19wpnInBhOFp' \ --header 'Accept: application/json' \ --header 'api-key: dev_k20iz8rRAC0stoBKDHAqizHgeTazec3GVCvCYb8vnSVcO0OxO38ykg1meVbhz5wk' ``` Response ``` { "payment_id": "pay_XYUrQG1N19wpnInBhOFp", "merchant_id": "postman_merchant_GHAction_477eb276-4b24-4ddc-87d7-77b86eef7637", "status": "succeeded", "amount": 2000, "net_amount": 2200, "shipping_cost": 200, "amount_capturable": 0, "amount_received": 2200, "connector": "stripe", "client_secret": "pay_XYUrQG1N19wpnInBhOFp_secret_Af4KrMcaidb1cCSgnsEk", "created": "2024-10-17T12:59:41.291Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "4242", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "424242", "card_extended_bin": null, "card_exp_month": "10", "card_exp_year": "25", "card_holder_name": null, "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": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "pi_3QAtIoD5R7gDAGff0DTVzBPx", "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_3QAtIoD5R7gDAGff0DTVzBPx", "payment_link": null, "profile_id": "pro_yRBwJHghRVOIboiPQrA2", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_WqzONRn2jBWofwQHtpVd", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-10-17T13:14:41.291Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2024-10-17T12:59:43.229Z", "charges": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null } ``` In response check for `shipping_cost` ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/payments.rs` **2. Core Business Logic** - `crates/router/src/core/payments/transformers.rs` **3. Tests** - `crates/router/tests/payments.rs` - `crates/router/tests/payments2.rs` **4. Other** - `api-reference-v2/openapi_spec.json` - `api-reference/openapi_spec.json` **Code Patterns Applied:** - Extend existing types with new fields (7 changes) **Detailed Identifier Changes:** Commit 368e6b53: Files to modify: **crates/api_models/src/payments.rs** Modify existing code **crates/router/src/core/payments/transformers.rs** Modify existing code **crates/router/tests/payments.rs** Modify existing code **crates/router/tests/payments2.rs** Modify existing code
{"pr_number": 6351, "pr_title": "refactor(core): populate shipping_cost in payment response", "merged_at": "2024-10-18T13:44:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "core_business": ["crates/router/src/core/payments/transformers.rs"], "tests": ["crates/router/tests/payments.rs", "crates/router/tests/payments2.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(revenue_recovery): Add configs for calculate job ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [x] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Add configs for calculate job ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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` - [ ] 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/revenue_recovery.rs` - `crates/router/src/core/revenue_recovery/types.rs` **2. Type Definitions** - `crates/router/src/types/storage/revenue_recovery.rs` **3. Configuration Files** - `config/config.example.toml` - `config/deployments/env_specific.toml` - `config/development.toml` - ... and 1 more files **4. Other** - `crates/router/src/workflows/revenue_recovery.rs` **Code Patterns Applied:** - Extend existing types with new fields (9 changes) **Detailed Identifier Changes:** Commit 8ce36a2f: Files to modify: **crates/router/src/core/revenue_recovery.rs** Modify existing code **crates/router/src/core/revenue_recovery/types.rs** Modify existing code **crates/router/src/types/storage/revenue_recovery.rs** Modify existing code **crates/router/src/workflows/revenue_recovery.rs** Modify existing code
{"pr_number": 9106, "pr_title": "refactor(revenue_recovery): Add configs for calculate job", "merged_at": "2025-08-29T15:31:36Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/revenue_recovery.rs", "crates/router/src/core/revenue_recovery/types.rs"], "types": ["crates/router/src/types/storage/revenue_recovery.rs"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/development.toml", "config/docker_compose.toml"], "other": ["crates/router/src/workflows/revenue_recovery.rs"]}, "change_types": {"fields_added": 9}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
refactor(routing): add support to accept the `saving_percentage` in decision engine response <!-- 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 refactors the `DebitRoutingOutput` structure to introduce a new `CoBadgedCardNetworksInfo` type, enhancing the representation of co-badged card networks by including additional metadata such as saving percentages. It also updates related methods and structures to align with this change. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> -> Enable debit routing for a profile and configure adyen connector -> Make a payment ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-feature: router-custom' \ --header 'x-tenant-id: hyperswitch' \ --header 'api-key: ' \ --data-raw '{ "amount": 10000, "amount_to_capture": 10000, "currency": "USD", "confirm": true, "capture_method": "automatic", "setup_future_usage": "on_session", "capture_on": "2022-09-10T10:11:12Z", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "customer_id": "cu_1750319776", "return_url": "http://127.0.0.1:4040", "payment_method": "card", "payment_method_type": "debit", "payment_method_data": { "card": { "card_number": "4400 0020 0000 0004", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "joseph Doe", "card_cvc": "737" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX", "last_name": "ss" }, "email": "raj@gmail.com" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "PiX" } }, "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "in sit", "user_agent": "amet irure esse" } }, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "125.0.0.1" }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` ``` { "payment_id": "pay_7aTZkTRH72iemhbxOqvc", "merchant_id": "merchant_1750232289", "status": "succeeded", "amount": 10000, "net_amount": 10000, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10000, "connector": "adyen", "client_secret": "pay_7aTZkTRH72iemhbxOqvc_secret_2v6ATAqLFQsKVhms16hF", "created": "2025-06-18T07:40:06.149Z", "currency": "USD", "customer_id": "cu_1750232406", "customer": { "id": "cu_1750232406", "name": "John Doe", "email": "guest@example.com", "phone": "999999999", "phone_country_code": "+1" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "on_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "0004", "card_type": null, "card_network": "Accel", "card_issuer": null, "card_issuing_country": null, "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": "raj@gmail.com" }, "order_details": null, "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "return_url": "http://127.0.0.1:4040/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "cu_1750232406", "created_at": 1750232406, "expires": 1750236006, "secret": "epk_1a8a73a55db941eb89b3c5a54b42bc3d" }, "manual_retry_allowed": false, "connector_transaction_id": "JKCHRB6V9DDHL975", "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_7aTZkTRH72iemhbxOqvc_1", "payment_link": null, "profile_id": "pro_n23wrYOtUyaiFMM71SEq", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_xC22XUKnNCBkg5vHm1W0", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-06-18T07:55:06.149Z", "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-06-18T07:40:07.133Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": null } ``` Once the payment is done the api events should have the `saving_percentage` in the decision engine response ``` { "decided_gateway": "ADYEN", "gateway_priority_map": null, "filter_wise_gateways": null, "priority_logic_tag": null, "routing_approach": "NONE", "gateway_before_evaluation": null, "priority_logic_output": null, "debit_routing_output": { "co_badged_card_networks_info": [ { "network": "ACCEL", "saving_percentage": 0.14 }, { "network": "STAR", "saving_percentage": 0.04 }, { "network": "VISA", "saving_percentage": 0.0 } ], "issuer_country": "US", "is_regulated": true, "regulated_name": "GOVERNMENT EXEMPT INTERCHANGE FEE", "card_type": "debit" }, "reset_approach": "NO_RESET", "routing_dimension": null, "routing_dimension_level": null, "is_scheduled_outage": false, "is_dynamic_mga_enabled": false, "gateway_mga_id_map": 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/open_router.rs` **2. Core Business Logic** - `crates/router/src/core/debit_routing.rs` **Code Patterns Applied:** - Define new data structures (1 changes) - Implement new functions (1 changes) - Extend existing types with new fields (6 changes) **Detailed Identifier Changes:** Commit 639b92c1: Files to modify: **crates/api_models/src/open_router.rs** Add: - function: pub::get_co_badged_card_networks - struct: pub::CoBadgedCardNetworksInfo - impl: impl DebitRoutingOutput **crates/router/src/core/debit_routing.rs** Modify existing code
{"pr_number": 8388, "pr_title": "refactor(routing): add support to accept the `saving_percentage` in decision engine response", "merged_at": "2025-06-20T13:28:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/open_router.rs"], "core_business": ["crates/router/src/core/debit_routing.rs"]}, "change_types": {"structs_added": 1, "functions_added": 1, "fields_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(core): Add payment_link_data in PaymentData for Psync ## Type of Change <!-- Put an `x` in the boxes that apply --> - [X] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description `payment_link` currently comes as null in psync response, even if payment link exists for the particular payment id <img width="1284" alt="Screenshot 2025-01-29 at 15 50 02" src="https://github.com/user-attachments/assets/9c4d3fad-9b02-43d8-91f8-8ef946c6dc62" /> Solution: Added payment_link_data in PaymentData for psync 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)? --> ### Steps **1. Make /payments request for payment link** **cURL** `curl --location --request POST 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_MgoxEWsv7zTlaklfuH9JES5qOTfnLHjrroIYHEjLaRbu68NxqrCMbqYZkyTtYJTF' \ --data-raw '{ "authentication_type": "three_ds", "amount": 100, "currency": "HKD", "payment_link": true, "setup_future_usage": "off_session", "description": "This is my description of why this payment was requested.", "connector": [ "adyen" ], "capture_method": "automatic", "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "CA", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "email": "john.doe@example.com", "session_expiry": 100000, "return_url": "https://example.com", "payment_link_config": { "theme": "#14356f", "logo": "https://static.wikia.nocookie.net/logopedia/images/4/41/Zurich-1997-Horizontal.png", "seller_name": "Hyperswitch Inc." } }'` **Response** <img width="1278" alt="Screenshot 2025-01-29 at 14 57 44" src="https://github.com/user-attachments/assets/009b3a90-c924-4704-b977-79f3cb06e15b" /> **2. Make Psync call** **cURL** `curl --location --request GET 'http://localhost:8080/payments/pay_HzBbmenHRxBehZ8pVyNK?forceSync=true' \ --header 'Accept: application/json' \ --header 'api-key: dev_MgoxEWsv7zTlaklfuH9JES5qOTfnLHjrroIYHEjLaRbu68NxqrCMbqYZkyTtYJTF' \ --data-raw ''` **Response** <img width="1278" alt="Screenshot 2025-01-29 at 14 57 35" src="https://github.com/user-attachments/assets/8ca68fb3-1f02-4fd0-a699-61d802ba532e" /> ## Checklist <!-- Put an `x` in the boxes that apply --> - [X] I formatted the code `cargo +nightly fmt --all` - [X] I addressed lints thrown by `cargo clippy` - [X] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Core Business Logic** - `crates/router/src/core/payments.rs` - `crates/router/src/core/payments/operations/payment_status.rs` **Code Patterns Applied:** - Implement new functions (1 changes) - Extend existing types with new fields (5 changes) **Detailed Identifier Changes:** Commit 94ffcd63: Files to modify: **crates/router/src/core/payments.rs** Add: - function: pub::get_payment_link_response_from_id **crates/router/src/core/payments/operations/payment_status.rs** Modify existing code Commit af65e27b: Files to modify: **crates/router/src/core/payments.rs** Add: - function: pub::get_payment_link_response_from_id **crates/router/src/core/payments/operations/payment_status.rs** Modify existing code Commit 8917235b: Files to modify: **crates/router/src/core/payments.rs** Add: - function: pub::get_payment_link_response_from_id **crates/router/src/core/payments/operations/payment_status.rs** Modify existing code
{"pr_number": 7137, "pr_title": "fix(core): Add payment_link_data in PaymentData for Psync", "merged_at": "2025-02-05T15:08:58Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_status.rs"]}, "change_types": {"functions_added": 1, "fields_added": 5}, "has_identifier_data": true, "commits_matched": 3, "match_method": "pr_number"}
fix(docs): incorrect description for refund api ## Type of Change - [ ] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [x] Documentation - [ ] CI/CD ## Description The current description for refund - list is incorrect. Newer one looks more apt. ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with 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 #6751. ## How did you test 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` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. Other** - `api-reference/openapi_spec.json` - `crates/openapi/src/routes/refunds.rs` **Detailed Identifier Changes:** Commit 8954e8a2: Files to modify: **crates/openapi/src/routes/refunds.rs** Modify existing code
{"pr_number": 6443, "pr_title": "fix(docs): incorrect description for refund api", "merged_at": "2024-12-10T11:02:10Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["refund"]}, "hierarchy": {"other": ["api-reference/openapi_spec.json", "crates/openapi/src/routes/refunds.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(dummy_connector): allow a dummy connector to succeed a failed card …rd payment ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> For one connector alone to hard code success with a particular failure card ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> `stripe_test` if the card number is `4000000000009995` previously it was failure with insufficient funds. But now we need to allow it to become success. ## Motivation and Context Objective is to show user how smart retry works so a relevant error message will help ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> ## failure for other gateways <details> <summary>Request </summary> ```json { "amount": 333, "currency": "EUR", "confirm": true, "capture_method": "automatic", "payment_method": "card", "payment_method_type": "credit", "authentication_type": "no_three_ds", "description": "hellow world", "connector":["paypal_test"], "billing": { "address": { "zip": "560095", "country": "IN", "first_name": "Sakil", "last_name": "Mostak", "line1": "Fasdf", "line2": "Fasdf", "city": "Fasdf" } }, "payment_method_data": { "card": { "card_number": "4000000000009995", "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": "John Smith", "card_cvc": "100" } } } ``` </details> <details> <summary>Response</summary> ```json { "payment_id": "pay_04Vahgm5zSgQLH5y5o0S", "merchant_id": "merchant_1750933328", "status": "failed", "amount": 333, "net_amount": 333, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "paypal_test", "client_secret": "pay_04Vahgm5zSgQLH5y5o0S_secret_iKiVIRw76fiMFvPXCzU7", "created": "2025-06-26T10:32:26.951Z", "currency": "EUR", "customer_id": null, "customer": null, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "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": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "IN", "line1": "Fasdf", "line2": "Fasdf", "line3": null, "zip": "560095", "state": null, "first_name": "Sakil", "last_name": "Mostak" }, "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": "DC_08", "error_message": "Payment declined: Internal Server Error", "unified_code": "UE_9000", "unified_message": "Something went wrong", "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": 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_tvhMochAzQxRKYmWKPgs", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_XioVM508jgIaVMwxgAsw", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-06-26T10:47:26.951Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-06-26T10:32:28.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, "is_iframe_redirection_enabled": null, "whole_connector_response": null } ``` </details> ## success for `stripe_test` <details> <summary>Request</summary> ```json { "amount": 333, "currency": "EUR", "confirm": true, "capture_method": "automatic", "payment_method": "card", "payment_method_type": "credit", "authentication_type": "no_three_ds", "description": "hellow world", "connector":["stripe_test"], "billing": { "address": { "zip": "560095", "country": "IN", "first_name": "Sakil", "last_name": "Mostak", "line1": "Fasdf", "line2": "Fasdf", "city": "Fasdf" } }, "payment_method_data": { "card": { "card_number": "4000000000009995", "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": "John Smith", "card_cvc": "100" } } } ``` </details> <details> <summary>Response</summary> ```json { "payment_id": "pay_OqK97rLSs9s7NnwRvLV0", "merchant_id": "merchant_1750933328", "status": "succeeded", "amount": 333, "net_amount": 333, "shipping_cost": null, "amount_capturable": 0, "amount_received": 333, "connector": "stripe_test", "client_secret": "pay_OqK97rLSs9s7NnwRvLV0_secret_ZfXwEiZvzXjz0jiQFt7y", "created": "2025-06-26T10:39:21.936Z", "currency": "EUR", "customer_id": null, "customer": null, "description": "hellow world", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "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": null, "authentication_data": null }, "billing": null }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "Fasdf", "country": "IN", "line1": "Fasdf", "line2": "Fasdf", "line3": null, "zip": "560095", "state": null, "first_name": "Sakil", "last_name": "Mostak" }, "phone": null, "email": null }, "order_details": null, "email": null, "name": null, "phone": null, "return_url": null, "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "pay_LDgbgr5HUer6sqe8YSsq", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_tvhMochAzQxRKYmWKPgs", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_KNpkA14s7QSE6SE8SuUA", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-06-26T10:54:21.936Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-06-26T10:39:22.945Z", "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> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --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/routes/dummy_connector/utils.rs` **Code Patterns Applied:** - Extend existing types with new fields (2 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit 69ab2553: Files to modify: **crates/router/src/routes/dummy_connector/utils.rs** Modify existing code
{"pr_number": 8469, "pr_title": "feat(dummy_connector): allow a dummy connector to succeed a failed card", "merged_at": "2025-07-01T12:31:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/routes/dummy_connector/utils.rs"]}, "change_types": {"fields_added": 2, "imports_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat(connector): [Barclaycard] Add Google Pay Payment Method ## 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/8784) ## Description <!-- Describe your changes in detail --> Added Google Pay Payment Method ### Additional Changes - [ ] This PR modifies the API contract - [ ] This PR modifies the database schema - [ ] This PR modifies application configuration/environment variables <!-- Provide links to the files with corresponding changes. Following are the paths where you can find config files: 1. `config` 2. `crates/router/src/configs` 3. `loadtest/config` --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. If you don't have an issue, we'd recommend starting with one first so the PR can focus on the implementation (unless it is an obvious bug or documentation fix that will have little conversation). --> ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Payments - Create: Request: ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_ZJ8oxbhNRWAqo9uJJXbWZF92Y0ym0c9yIDIVZ5tXfsQPOHtBzVsd37g3QGqSGKK7' \ --data-raw ' { "amount": 1000, "currency": "USD", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 1000, "customer_id": "StripeCustomer", "email": "abcdef123@gmail.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "billing": { "address": { "first_name": "John", "last_name": "Doe", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } }, "payment_method": "wallet", "payment_method_type": "google_pay", "payment_method_data": { "wallet": { "google_pay": { "description": "Visa •••• 1111", "tokenization_data": { "type": "PAYMENT_GATEWAY", "token": "TOKEN" }, "type": "CARD", "info": { "card_network": "VISA", "card_details": "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": "127.0.0.1" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2025-07-25T11:46:12Z" } }' ``` Response: ``` { "payment_id": "pay_OXOmL1tg7bb13kFx9tFL", "merchant_id": "merchant_1753778023", "status": "succeeded", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 0, "amount_received": 1000, "connector": "barclaycard", "client_secret": "pay_OXOmL1tg7bb13kFx9tFL_secret_pNHiqQi8WiXXXLkluaJW", "created": "2025-07-29T08:33:55.882Z", "currency": "USD", "customer_id": "StripeCustomer", "customer": { "id": "StripeCustomer", "name": "John Doe", "email": "abcdef123@gmail.com", "phone": "999999999", "phone_country_code": "+65" }, "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "wallet", "payment_method_data": { "wallet": { "google_pay": { "last4": "1111", "card_network": "VISA", "type": "CARD" } }, "billing": null }, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "US", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "order_details": null, "email": "abcdef123@gmail.com", "name": "John Doe", "phone": "999999999", "return_url": "https://duck.com/", "authentication_type": "no_three_ds", "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "google_pay", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "StripeCustomer", "created_at": 1753778035, "expires": 1753781635, "secret": "epk_b31322ddae424bd2beb80cd2cb99524b" }, "manual_retry_allowed": false, "connector_transaction_id": "7537780387666315904807", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2025-07-25T11:46:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_OXOmL1tg7bb13kFx9tFL_1", "payment_link": null, "profile_id": "pro_9kjWPGq7O6DWWt5nKz01", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_dXVXqDFV5tjATHuyDMbn", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-29T08:48:55.882Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-07-29T08:34:00.138Z", "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. 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** - `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:** - Define new data structures (2 changes) - Implement new functions (6 changes) - Extend existing types with new fields (27 changes) **Detailed Identifier Changes:** Commit 434e7a7a: Files to modify: **crates/hyperswitch_connectors/src/connectors/barclaycard.rs** Modify existing code **crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs** Add: - function: private::from - struct: pub::GooglePayPaymentInformation - enum: pub::PaymentSolution - impl: impl From<PaymentSolution> for String **crates/payment_methods/src/configs/payment_connector_required_fields.rs** Modify existing code
{"pr_number": 8786, "pr_title": "feat(connector): [Barclaycard] Add Google Pay Payment Method", "merged_at": "2025-08-06T07:35:30Z", "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/barclaycard.rs", "crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 2, "functions_added": 6, "enums_added": 1, "fields_added": 27, "imports_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
fix(connectors): [Nuvei] payments, refunds and chargeback webhooks ## Type of Change <!-- Put an `x` in the boxes that apply --> - [x] Bugfix - [ ] New feature - [ ] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description <!-- Describe your changes in detail --> Fix Nuvei payments and chargeback webhooks ## How did you test it? <!-- Did you write an integration/unit/API test to verify the code changes? Or did you test this change manually (provide relevant screenshots)? --> Tested it by configuring payments, refunds and chargeback Webhooks at Nuvei <details> <summary>1.Test manual failure case </summary> 1. Create a manual payment with failure card ```sh curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_1GzDDtw7u8wOD5LgwtaSVe9S6ycpAy73s9BPr72X3mCpSLmE1oA1bWmQgDUjfmGx' \ --data-raw '{ "amount": 30030, "currency": "USD", "confirm": true, "capture_method": "manual", "billing": { "address": { "line1": "3 Main St.", "city": "Bloomfield", "state": "CT", "zip": "06002", "country": "US", "first_name": "Eileen Jones" } }, "email": "email16@here.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4008370896662369", "card_exp_month": "03", "card_exp_year": "50", "card_cvc": "758" } } ,"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_MklD1Rd6goefCSNRpl7G", "merchant_id": "postman_merchant_GHAction_cf8f5ac7-8547-418b-a12e-1451b474ac8a", "status": "failed", "amount": 30030, "net_amount": 30030, "shipping_cost": null, "amount_capturable": 30030, "amount_received": null, "connector": "nuvei", "client_secret": "pay_MklD1Rd6goefCSNRpl7G_secret_bQViOfLwoapfPsIUonTt", "created": "2025-09-17T08:21:18.431Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "email16@here.com", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "manual", "payment_method": "card", "payment_method_data": { "card": { "last4": "2369", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "400837", "card_extended_bin": null, "card_exp_month": "03", "card_exp_year": "50", "card_holder_name": null, "payment_checks": { "avs_result": "", "cvv_2_reply": "", "avs_description": null, "cvv_2_description": null, "merchant_advice_code": "", "merchant_advice_code_description": null }, "authentication_data": { "challengePreferenceReason": "12" } }, "billing": null }, "payment_token": "token_uCdvPzx1vBfDH4ifrStG", "shipping": null, "billing": { "address": { "city": "Bloomfield", "country": "US", "line1": "3 Main St.", "line2": null, "line3": null, "zip": "06002", "state": "CT", "first_name": "Eileen Jones", "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": "-1", "error_message": "Decline", "unified_code": "UE_9000", "unified_message": "Something went wrong", "payment_experience": null, "payment_method_type": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": null, "connector_transaction_id": "8110000000014575811", "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_Y0YKlaXCpv5VLrjGwNLm", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_Hv2lKARGaUwIrhXxAXH8", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-09-17T08:36:18.431Z", "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-09-17T08:21:19.815Z", "split_payments": null, "frm_metadata": null, "extended_authorization_applied": null, "capture_before": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null, "card_discovery": "manual", "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": "-1", "issuer_error_message": "Decline", "is_iframe_redirection_enabled": null, "whole_connector_response": null, "enable_partial_authorization": null, "enable_overcapture": null, "is_overcapture_enabled": null, "network_details": { "network_advice_code": "" } } ``` Webhook from the connector should show 2xx response </details> <details> <summary>2. Create a payment and do a refund</summary> Create a payment ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_1GzDDtw7u8wOD5LgwtaSVe9S6ycpAy73s9BPr72X3mCpSLmE1oA1bWmQgDUjfmGx' \ --data-raw '{ "amount": 30030, "currency": "USD", "confirm": true, "capture_method": "automatic", "billing": { "address": { "line1": "3 Main St.", "city": "Bloomfield", "state": "CT", "zip": "06002", "country": "US", "first_name": "Eileen Jones" } }, "email": "email16@here.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "50", "card_cvc": "758" } } ,"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_cK62pqa8F4P32DqPGwf1", "merchant_id": "postman_merchant_GHAction_cf8f5ac7-8547-418b-a12e-1451b474ac8a", "status": "succeeded", "amount": 30030, "net_amount": 30030, "shipping_cost": null, "amount_capturable": 0, "amount_received": 30030, "connector": "nuvei", "client_secret": "pay_cK62pqa8F4P32DqPGwf1_secret_Dvc0djCVscjQY1BcDt9x", "created": "2025-09-17T08:23:51.019Z", "currency": "USD", "customer_id": null, "customer": { "id": null, "name": null, "email": "email16@here.com", "phone": null, "phone_country_code": null }, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "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": "50", "card_holder_name": null, "payment_checks": { "avs_result": "", "cvv_2_reply": "", "avs_description": null, "cvv_2_description": null, "merchant_advice_code": "", "merchant_advice_code_description": null }, "authentication_data": { "challengePreferenceReason": "12" } }, "billing": null }, "payment_token": "token_Bu1xBMepQFrpomazI8VC", "shipping": null, "billing": { "address": { "city": "Bloomfield", "country": "US", "line1": "3 Main St.", "line2": null, "line3": null, "zip": "06002", "state": "CT", "first_name": "Eileen Jones", "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": "8110000000014576020", "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": "8894221111", "payment_link": null, "profile_id": "pro_Y0YKlaXCpv5VLrjGwNLm", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_Hv2lKARGaUwIrhXxAXH8", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-09-17T08:38:51.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_channel": null, "payment_method_id": null, "network_transaction_id": "480213756277396", "payment_method_status": null, "updated": "2025-09-17T08:23:52.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": "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 } ``` Webhook from connector should have a 200 response Create a Refund ```sh curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_1GzDDtw7u8wOD5LgwtaSVe9S6ycpAy73s9BPr72X3mCpSLmE1oA1bWmQgDUjfmGx' \ --data '{ "payment_id": "pay_cK62pqa8F4P32DqPGwf1", "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }' ``` Response ``` { "refund_id": "ref_OIrC7kZAkOw8f98fIau7", "payment_id": "pay_hesMmqr4ErioGWSfQ6Yu", "amount": 30030, "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-09-17T09:54:52.906Z", "updated_at": "2025-09-17T09:54:54.027Z", "connector": "nuvei", "profile_id": "pro_Y0YKlaXCpv5VLrjGwNLm", "merchant_connector_id": "mca_Hv2lKARGaUwIrhXxAXH8", "split_refunds": null, "issuer_error_code": null, "issuer_error_message": null } ``` Check for successful response to the web hook </details> ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [ ] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. External Connector Integration** - `crates/hyperswitch_connectors/src/connectors/nuvei.rs` - `crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs` **Code Patterns Applied:** - Define new data structures (2 changes) - Implement new functions (8 changes) - Extend existing types with new fields (92 changes) - Add conditional logic for feature flags or filtering (2 changes) **Detailed Identifier Changes:** Commit 9654d18d: Files to modify: **crates/hyperswitch_connectors/src/connectors/nuvei.rs** Remove: - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Nuvei Add: - function: private::handle_response - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Nuvei **crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs** Remove: - function: private::from - enum: pub::PaymentTransactionType - impl: impl clone() - impl: impl From<&NuveiWebhook> for NuveiWebhookTransactionId Add: - function: private::from - function: pub::map_dispute_notification_to_event - function: private::from - struct: pub::ChargebackData - struct: pub::ChargebackTransactionDetails - enum: pub::NuveiPaymentSyncResponse - enum: pub::DisputeUnifiedStatusCode - enum: pub::ChargebackType - enum: pub::ChargebackStatusCategory - enum: pub::DmnApiTransactionStatus - impl: impl From<NuveiPaymentSyncResponse> for NuveiTransactionSyncResponse - impl: impl From<DisputeUnifiedStatusCode> for common_enums::DisputeStage
{"pr_number": 9378, "pr_title": "fix(connectors): [Nuvei] payments, refunds and chargeback webhooks", "merged_at": "2025-09-19T12:17:17Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nuvei.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs"]}, "change_types": {"structs_added": 2, "functions_added": 8, "enums_added": 5, "fields_added": 92, "imports_added": 1, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
feat: include response body for create_user_authentication_method #9643 ## Type of Change <!-- Put an `x` in the boxes that apply --> - [ ] Bugfix - [ ] New feature - [x] Enhancement - [ ] Refactoring - [ ] Dependency updates - [ ] Documentation - [ ] CI/CD ## Description Currently the API Call to the /user/auth endpoint displays only a 200::OK response code without providing a proper response body containing the authentication details for proper debugging.This PR Introduces a Response body of type CreateUserAuthenticationMethodReponse which contains members to be displayed in response to the API call to /user/auth.Modified the create_user_authentication_method as well to include the response body in addition to response code. ### 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 This change is an enhancement over the current implementation since it also provides additional information like authentication id that api users might need for debugging purposes. ## How we tested Request:- curl --location 'localhost:8080/user/auth' \ --header 'Content-Type: application/json' \ --header 'api-key: <admin-api-key>' \ --data ' { "owner_type": "organization", "owner_id": "test11awb", "auth_method": { "auth_type": "open_id_connect", "private_config": { "base_url": "new-hello1.com", "client_id": "new_client_id1", "client_secret": "new_client_secret21", "private_key": "new_private_key23" }, "public_config": { "name": "okta" } }, "allow_signup": true, "email_domain": "None" }' Response:- { "id": "258aa1d7-df39-43aa-a7f5-8b6cfff02ee4", "auth_id": "66fb9262-daf1-491d-b5df-ec479247b92c", "owner_id": "test11awb", "owner_type": "organization", "auth_type": "open_id_connect", "email_domain": "None", "allow_signup": true } ## Checklist <!-- Put an `x` in the boxes that apply --> - [x] I formatted the code `cargo +nightly fmt --all` - [x] I addressed lints thrown by `cargo clippy` - [x] I reviewed the submitted code - [ ] I added unit tests for my changes where possible
To implement this **search_filter** feature, you'll need to modify these architectural layers: **1. API Request/Response Models** - `crates/api_models/src/events/user.rs` - `crates/api_models/src/user.rs` **2. Core Business Logic** - `crates/router/src/core/user.rs` **Code Patterns Applied:** - Define new data structures (1 changes) - Extend existing types with new fields (14 changes) - Add conditional logic for feature flags or filtering (1 changes) **Detailed Identifier Changes:** Commit bebffa97: Files to modify: **crates/api_models/src/events/user.rs** Modify existing code **crates/api_models/src/user.rs** Add: - struct: pub::CreateUserAuthenticationMethodResponse **crates/router/src/core/user.rs** Modify existing code
{"pr_number": 9653, "pr_title": "feat: include response body for create_user_authentication_method", "merged_at": "2025-10-15T16:19:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/user.rs", "crates/api_models/src/user.rs"], "core_business": ["crates/router/src/core/user.rs"]}, "change_types": {"structs_added": 1, "fields_added": 14, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}