prompt
stringlengths 83
247k
| response
stringlengths 121
36.1k
| metadata
stringlengths 314
42.3k
|
|---|---|---|
feat(core): Add service details field in authentication table
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] New feature
## Description
<!-- Describe your changes in detail -->
Add service details struct in payments request api_model and authentication table for storing service_details during click to pay authentication via unified_authentication_service
### Additional Changes
- [x] This PR modifies the API contract
- [x] This PR modifies the database schema
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Currently we cannot test it as the flow to invoke service details into authentication table is not yet ready, this is a micro pr for the setup
## Checklist
<!-- Put an `x` in the boxes that 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/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/authentication.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs`
**4. Core Business Logic**
- `crates/router/src/core/authentication/utils.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/operations/payment_approve.rs`
- ... and 15 more files
**5. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/openapi/src/openapi.rs`
- ... and 4 more files
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Extend existing types with new fields (29 changes)
**Detailed Identifier Changes:**
Commit e9a5615f:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::CtpServiceDetails
**crates/diesel_models/src/authentication.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs**
Add:
- struct: pub::CtpServiceDetails
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/authentication/utils.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_approve.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_cancel.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_capture.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_complete_authorize.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_post_session_tokens.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_reject.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_session.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_start.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_status.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
**crates/router/src/core/payments/operations/payments_incremental_authorization.rs**
Modify existing code
**crates/router/src/core/payments/operations/tax_calculation.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/transformers.rs**
Modify existing code
**crates/router/src/db/authentication.rs**
Modify existing code
|
{"pr_number": 6757, "pr_title": "feat(core): Add service details field in authentication table", "merged_at": "2024-12-12T12:43:58Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/authentication.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs"], "core_business": ["crates/router/src/core/authentication/utils.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_approve.rs", "crates/router/src/core/payments/operations/payment_cancel.rs", "crates/router/src/core/payments/operations/payment_capture.rs", "crates/router/src/core/payments/operations/payment_complete_authorize.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_post_session_tokens.rs", "crates/router/src/core/payments/operations/payment_reject.rs", "crates/router/src/core/payments/operations/payment_session.rs", "crates/router/src/core/payments/operations/payment_start.rs", "crates/router/src/core/payments/operations/payment_status.rs", "crates/router/src/core/payments/operations/payment_update.rs", "crates/router/src/core/payments/operations/payments_incremental_authorization.rs", "crates/router/src/core/payments/operations/tax_calculation.rs", "crates/router/src/core/unified_authentication_service.rs", "crates/router/src/core/unified_authentication_service/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/db/authentication.rs", "migrations/2024-12-05-115544_add-service-details/down.sql", "migrations/2024-12-05-115544_add-service-details/up.sql"]}, "change_types": {"structs_added": 2, "fields_added": 29}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
revert(routing): Add connectors from current active routing algorithm before adding fallback connectors
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Reverts https://github.com/juspay/hyperswitch/pull/7921
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 #8208
## How did you test 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. Payment intent create
```
curl --location 'http://localhost:8080/vs/v1/payment_intents' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'User-Agent: helloMozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36' \
--header 'api-key: dev_OCEeDmYFnj7wCLjjWlBk0AsUthfnp3B041GM6Ef0Rl*****' \
--data-urlencode 'amount=5000' \
--data-urlencode 'currency=AED' \
--data-urlencode 'confirm=true' \
--data-urlencode 'payment_method_data%5Btype%5D=card' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bnumber%5D=4456530000001096' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bexp_month%5D=12' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bexp_year%5D=2030' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bcvc%5D=123' \
--data-urlencode 'connector%5B%5D=noon' \
--data-urlencode 'capture_method=automatic' \
--data-urlencode 'customer=sahkal' \
--data-urlencode 'statementDescriptorSuffix=merchant_101' \
--data-urlencode 'metadata%5BorderId%5D=1677581650' \
--data-urlencode 'payment_method_options%5Bcard%5D%5Brequest_three_d_secure%5D=automatic' \
--data-urlencode 'description=Card Payment' \
--data-urlencode 'off_session=true' \
--data-urlencode 'mandate_data%5Bcustomer_acceptance%5D%5Bonline%5D%5Buser_agent%5D=helloMozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36' \
--data-urlencode 'mandate_data%5Bcustomer_acceptance%5D%5Bonline%5D%5Bip_address%5D=123.32.25.123' \
--data-urlencode 'mandate_data%5Bamount%5D=20877' \
--data-urlencode 'setup_future_usage=off_session' \
--data-urlencode 'mandate_data%5Bmandate_type%5D=single_use' \
--data-urlencode 'mandate_data%5Bstart_date%5D=12127864781' \
--data-urlencode 'mandate_data%5Bend_date%5D=21312434324' \
--data-urlencode 'return_url=https://juspay.in' \
--data-urlencode 'merchant_connector_details%5Bencoded_data%5D=eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0.F1IBieprH7aT7fwe7p9ZtYdOv9JgoO87iALDjScYq9Y2H2yTvVEZLJ9aYs6ShMH3iieBdvwL7PwJ5k68qINzmHzKSYZ3cp5jGpyK5FjaoJu4zUAZbLcn-z4O6ajQ5OUZBjkqfkwo4SvQfM7ceg6_dLNbVa2dj9-YBp3pNfudc5eyKxIuvxDSmNSpoXr2Hr5Y2dDV5Z-15yfmcj-IDgZNibsUSSFuwqhHHfxk87HZRLM5-9kayXyfH4i_zdYleGR-iNX_OIzpJBpDeyJ_nbADgyi1NvBiNdDYiR-xCDuS0-DZZLVoOnJkbV23Q4XGkYRQSvI8VnWHKZhvqZi3-Nev7A.s4kCZx2KOzR50uoE.kdStc4m0EQ05J3nXd4EsxFgMj9Yp6Ji4JLRB7zjHGamjsMXwIBXhpFuexx58mqIueecXTOMz6nCjasgng8XKTKNBRsDshgFAzuO690--KQVIoSjADuRVuplTVgvg6xRaZN_cgdhfqo3DYS8MSALzoL0p1ylaAZuV_LGCJOLIcrhrP56xzmTX91tGHU3Dm1md.t-2pfHjICjZdya9g9WAxvQ' \
--data-urlencode 'merchant_connector_details%5Bcreds_identifier%5D=2025-06-04T08:02:45.485Z' \
--data-urlencode 'id=1749041986' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bname%5D=sahkal' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bemail%[email protected]' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bcity%5D=siliguri' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bcountry%5D=IN' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bstate%5D=westbengal' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bline1%5D=pritilata' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bzip%5D=734006' \
--data-urlencode 'metadata%5Btxn_Id%5D=sahkal_payment' \
--data-urlencode 'metadata%5BtxnUuid%5D=94hfdmoakosdkifdhaisl' \
--data-urlencode 'metadata%5Bmerchant_id%5D=sahkal' \
--data-urlencode 'metadata%5Beuler_merchant_id%5D=global_installment' \
--data-urlencode 'connector_metadata%5Bnoon%5D%5Border_category%5D=pay' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bholder_name%5D=sahkal'
```
2. Payment Intent Sync
request
```
curl --location 'http://localhost:8080/vs/v1/payment_intents/sync' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'idempodent-key: asfdasf' \
--header 'api-key: dev_OCEeDmYFnj7wCLjjWlBk0AsUthfnp3B041GM6Ef0RlN*****' \
--data-urlencode 'connector%5B%5D=noon' \
--data-urlencode 'merchant_connector_details%5Bencoded_data%5D=eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0.F1IBieprH7aT7fwe7p9ZtYdOv9JgoO87iALDjScYq9Y2H2yTvVEZLJ9aYs6ShMH3iieBdvwL7PwJ5k68qINzmHzKSYZ3cp5jGpyK5FjaoJu4zUAZbLcn-z4O6ajQ5OUZBjkqfkwo4SvQfM7ceg6_dLNbVa2dj9-YBp3pNfudc5eyKxIuvxDSmNSpoXr2Hr5Y2dDV5Z-15yfmcj-IDgZNibsUSSFuwqhHHfxk87HZRLM5-9kayXyfH4i_zdYleGR-iNX_OIzpJBpDeyJ_nbADgyi1NvBiNdDYiR-xCDuS0-DZZLVoOnJkbV23Q4XGkYRQSvI8VnWHKZhvqZi3-Nev7A.s4kCZx2KOzR50uoE.kdStc4m0EQ05J3nXd4EsxFgMj9Yp6Ji4JLRB7zjHGamjsMXwIBXhpFuexx58mqIueecXTOMz6nCjasgng8XKTKNBRsDshgFAzuO690--KQVIoSjADuRVuplTVgvg6xRaZN_cgdhfqo3DYS8MSALzoL0p1ylaAZuV_LGCJOLIcrhrP56xzmTX91tGHU3Dm1md.t-2pfHjICjZdya9g9WAxvQ' \
--data-urlencode 'payment_id=1749033737' \
--data-urlencode 'force_sync=true' \
--data-urlencode 'merchant_connector_details%5Bcreds_identifier%5D=2025-06-04T10:43:22.768Z'
```
response
```
{
"id": "1749033737",
"object": "payment_intent",
"amount": 5000,
"amount_received": 5000,
"amount_capturable": 0,
"currency": "aed",
"status": "succeeded",
"client_secret": "1749033737_secret_Peeso0sEVtUFnjSjN29z",
"created": 1749033737,
"customer": "sahkal",
"refunds": null,
"mandate": null,
"metadata": {
"txn_Id": "sahkal_payment",
"orderId": "1677581650",
"txnUuid": "94hfdmoakosdkifdhaisl",
"merchant_id": "sahkal",
"euler_merchant_id": "global_installment"
},
"charges": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "http://placeholder"
},
"connector": "noon",
"description": "Card Payment",
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": true,
"authentication_type": "no_three_ds",
"next_action": null,
"cancellation_reason": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1096",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "445653",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "2030",
"card_holder_name": "sahkal",
"payment_checks": null,
"authentication_data": null
}
},
"shipping": null,
"billing": {
"address": {
"city": "siliguri",
"country": "IN",
"line1": "pritilata",
"line2": null,
"line3": null,
"zip": null,
"state": "westbengal",
"first_name": null,
"last_name": null
},
"phone": {
"number": null,
"country_code": "IN"
},
"email": "[email protected]"
},
"capture_on": null,
"payment_token": null,
"email": null,
"phone": null,
"statement_descriptor_suffix": null,
"statement_descriptor_name": null,
"capture_method": "automatic",
"name": null,
"last_payment_error": null,
"connector_transaction_id": "613939750950"
}
```
---
Apple Pay payments
request
```
curl --location 'http://localhost:3030/vs/v1/payment_intents' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'User-Agent: EULER' \
--header 'api-key: dev_y2wL6fotKxvIj7dUjOrkGqEV7zLUzzINbc0BkK1J0Vmx4****' \
--data-urlencode 'amount=1000' \
--data-urlencode 'currency=AED' \
--data-urlencode 'confirm=true' \
--data-urlencode 'payment_method_data%5Btype%5D=wallet' \
--data-urlencode 'connector%5B%5D=noon' \
--data-urlencode 'capture_method=automatic' \
--data-urlencode 'customer=sahkal' \
--data-urlencode 'statementDescriptorSuffix=merchant_101' \
--data-urlencode 'metadata%5BorderId%5D=1677581650' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bname%5D=sahkal' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bemail%[email protected]' \
--data-urlencode 'description=card Payment' \
--data-urlencode 'off_session=true' \
--data-urlencode 'merchant_connector_details%5Bencoded_data%5D=eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0.F1IBieprH7aT7fwe7p9ZtYdOv9JgoO87iALDjScYq9Y2H2yTvVEZLJ9aYs6ShMH3iieBdvwL7PwJ5k68qINzmHzKSYZ3cp5jGpyK5FjaoJu4zUAZbLcn-z4O6ajQ5OUZBjkqfkwo4SvQfM7ceg6_dLNbVa2dj9-YBp3pNfudc5eyKxIuvxDSmNSpoXr2Hr5Y2dDV5Z-15yfmcj-IDgZNibsUSSFuwqhHHfxk87HZRLM5-9kayXyfH4i_zdYleGR-iNX_OIzpJBpDeyJ_nbADgyi1NvBiNdDYiR-xCDuS0-DZZLVoOnJkbV23Q4XGkYRQSvI8VnWHKZhvqZi3-Nev7A.s4kCZx2KOzR50uoE.kdStc4m0EQ05J3nXd4EsxFgMj9Yp6Ji4JLRB7zjHGamjsMXwIBXhpFuexx58mqIueecXTOMz6nCjasgng8XKTKNBRsDshgFAzuO690--KQVIoSjADuRVuplTVgvg6xRaZN_cgdhfqo3DYS8MSALzoL0p1ylaAZuV_LGCJOLIcrhrP56xzmTX91tGHU3Dm1md.t-2pfHjICjZdya9g9WAxvQ' \
--data-urlencode 'merchant_connector_details%5Bcreds_identifier%5D=EulerTest' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_data%5D=eyJkYXRhIjoiUnZRZytEMEVsTElTREpqdFpkbXAxa05QVW9zdWY5ODk1ZDVUK0cvb1pNckRaY2ZXNXdkb1Y0SVBwWHdrRnJaS25LYlhNUktXVVJiNHJua3lZV01UKzRJL01Sc0tNaSt6KzFWbjFGYitQeldVUFErZlNsSUNUMWhTWkxkTDlnOEZGb091S2xQMW8rT0xhSjAyYWlVTVpXYnpFRDlVTVY5ckllWlU5M1pIa3g4Vm1Vdmxkd0hoSEFBVzRBUkFzNDAyaXRReTRYNHNIeEIxWG8xWUtTWUZOWlR1cEFDYnBrQk5QT3JFK1k4OStxdUhDVGtTbDJxL1hVL3hNcUJYcXR1MjJFQTdGMWRHQzBVVDZLV0FvcGpsSUFtMHdHZ1FGRUYvTlJseFlUVFBkd1NKOUV1SHlhbmtrYkZib2VBWk5vdUFtNHplYmw1czlyWG5ZZ3BjT0ZWckxzQjN0OW1tdmhEZEdNYkZJc21oY2o2Ni9OWEplRkR6alM4NG0wK3NVVXZGbWlxMWZ5ZGt0TW9xS1dmbGpnPT0iLCJzaWduYXR1cmUiOiJNSUFHQ1NxR1NJYjNEUUVIQXFDQU1JQUNBUUV4RFRBTEJnbGdoa2dCWlFNRUFnRXdnQVlKS29aSWh2Y05BUWNCQUFDZ2dEQ0NBK013Z2dPSW9BTUNBUUlDQ0V3d1FVbFJuVlEyTUFvR0NDcUdTTTQ5QkFNQ01Ib3hMakFzQmdOVkJBTU1KVUZ3Y0d4bElFRndjR3hwWTJGMGFXOXVJRWx1ZEdWbmNtRjBhVzl1SUVOQklDMGdSek14SmpBa0JnTlZCQXNNSFVGd2NHeGxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1STXdFUVlEVlFRS0RBcEJjSEJzWlNCSmJtTXVNUXN3Q1FZRFZRUUdFd0pWVXpBZUZ3MHhPVEExTVRnd01UTXlOVGRhRncweU5EQTFNVFl3TVRNeU5UZGFNRjh4SlRBakJnTlZCQU1NSEdWall5MXpiWEF0WW5KdmEyVnlMWE5wWjI1ZlZVTTBMVkJTVDBReEZEQVNCZ05WQkFzTUMybFBVeUJUZVhOMFpXMXpNUk13RVFZRFZRUUtEQXBCY0hCc1pTQkpibU11TVFzd0NRWURWUVFHRXdKVlV6QlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDlBd0VIQTBJQUJNSVZkKzNyMXNleUlZOW8zWENRb1NHTng3QzlieXdvUFlSZ2xkbEs5S1ZCRzROQ0R0Z1I4MEIrZ3pNZkhGVEQ5K3N5SU5hNjFkVHY5SktKaVQ1OER4T2pnZ0lSTUlJQ0RUQU1CZ05WSFJNQkFmOEVBakFBTUI4R0ExVWRJd1FZTUJhQUZDUHlTY1JQaytUdkorYkU5aWhzUDZLNy9TNUxNRVVHQ0NzR0FRVUZCd0VCQkRrd056QTFCZ2dyQmdFRkJRY3dBWVlwYUhSMGNEb3ZMMjlqYzNBdVlYQndiR1V1WTI5dEwyOWpjM0F3TkMxaGNIQnNaV0ZwWTJFek1ESXdnZ0VkQmdOVkhTQUVnZ0VVTUlJQkVEQ0NBUXdHQ1NxR1NJYjNZMlFGQVRDQi9qQ0J3d1lJS3dZQkJRVUhBZ0l3Z2JZTWdiTlNaV3hwWVc1alpTQnZiaUIwYUdseklHTmxjblJwWm1sallYUmxJR0o1SUdGdWVTQndZWEowZVNCaGMzTjFiV1Z6SUdGalkyVndkR0Z1WTJVZ2IyWWdkR2hsSUhSb1pXNGdZWEJ3YkdsallXSnNaU0J6ZEdGdVpHRnlaQ0IwWlhKdGN5QmhibVFnWTI5dVpHbDBhVzl1Y3lCdlppQjFjMlVzSUdObGNuUnBabWxqWVhSbElIQnZiR2xqZVNCaGJtUWdZMlZ5ZEdsbWFXTmhkR2x2YmlCd2NtRmpkR2xqWlNCemRHRjBaVzFsYm5SekxqQTJCZ2dyQmdFRkJRY0NBUllxYUhSMGNEb3ZMM2QzZHk1aGNIQnNaUzVqYjIwdlkyVnlkR2xtYVdOaGRHVmhkWFJvYjNKcGRIa3ZNRFFHQTFVZEh3UXRNQ3N3S2FBbm9DV0dJMmgwZEhBNkx5OWpjbXd1WVhCd2JHVXVZMjl0TDJGd2NHeGxZV2xqWVRNdVkzSnNNQjBHQTFVZERnUVdCQlNVVjl0djFYU0Job21KZGk5K1Y0VUg1NXRZSkRBT0JnTlZIUThCQWY4RUJBTUNCNEF3RHdZSktvWklodmRqWkFZZEJBSUZBREFLQmdncWhrak9QUVFEQWdOSkFEQkdBaUVBdmdsWEgrY2VIbk5iVmVXdnJMVEhMK3RFWHpBWVVpTEhKUkFDdGg2OWIxVUNJUURSaXpVS1hkYmRickYwWURXeEhyTE9oOCtqNXE5c3ZZT0FpUTNJTE4ycVl6Q0NBdTR3Z2dKMW9BTUNBUUlDQ0VsdEw3ODZtTnFYTUFvR0NDcUdTTTQ5QkFNQ01HY3hHekFaQmdOVkJBTU1Fa0Z3Y0d4bElGSnZiM1FnUTBFZ0xTQkhNekVtTUNRR0ExVUVDd3dkUVhCd2JHVWdRMlZ5ZEdsbWFXTmhkR2x2YmlCQmRYUm9iM0pwZEhreEV6QVJCZ05WQkFvTUNrRndjR3hsSUVsdVl5NHhDekFKQmdOVkJBWVRBbFZUTUI0WERURTBNRFV3TmpJek5EWXpNRm9YRFRJNU1EVXdOakl6TkRZek1Gb3dlakV1TUN3R0ExVUVBd3dsUVhCd2JHVWdRWEJ3YkdsallYUnBiMjRnU1c1MFpXZHlZWFJwYjI0Z1EwRWdMU0JITXpFbU1DUUdBMVVFQ3d3ZFFYQndiR1VnUTJWeWRHbG1hV05oZEdsdmJpQkJkWFJvYjNKcGRIa3hFekFSQmdOVkJBb01Da0Z3Y0d4bElFbHVZeTR4Q3pBSkJnTlZCQVlUQWxWVE1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRThCY1JoQm5YWklYVkdsNGxnUWQyNklDaTc5NTdyazNnamZ4TGsrRXpWdFZtV3pXdUl0Q1hkZzBpVG51NkNQMTJGODZJeTNhN1puQyt5T2dwaFA5VVJhT0I5ekNCOURCR0JnZ3JCZ0VGQlFjQkFRUTZNRGd3TmdZSUt3WUJCUVVITUFHR0ttaDBkSEE2THk5dlkzTndMbUZ3Y0d4bExtTnZiUzl2WTNOd01EUXRZWEJ3YkdWeWIyOTBZMkZuTXpBZEJnTlZIUTRFRmdRVUkvSkp4RStUNU84bjVzVDJLR3cvb3J2OUxrc3dEd1lEVlIwVEFRSC9CQVV3QXdFQi96QWZCZ05WSFNNRUdEQVdnQlM3c042aFdET0ltcVNLbWQ2K3ZldXYyc3NrcXpBM0JnTlZIUjhFTURBdU1DeWdLcUFvaGlab2RIUndPaTh2WTNKc0xtRndjR3hsTG1OdmJTOWhjSEJzWlhKdmIzUmpZV2N6TG1OeWJEQU9CZ05WSFE4QkFmOEVCQU1DQVFZd0VBWUtLb1pJaHZkalpBWUNEZ1FDQlFBd0NnWUlLb1pJemowRUF3SURad0F3WkFJd09zOXlnMUVXbWJHRyt6WERWc3Bpdi9RWDdka1BkVTJpanI3eG5JRmVRcmVKK0pqM20xbWZtTlZCRFkrZDZjTCtBakF5TGRWRUliQ2pCWGRzWGZNNE81Qm4vUmQ4TENGdGxrL0djbW1DRW05VStIcDlHNW5MbXdtSklXRUdtUThKa2gwQUFER0NBWWd3Z2dHRUFnRUJNSUdHTUhveExqQXNCZ05WQkFNTUpVRndjR3hsSUVGd2NHeHBZMkYwYVc5dUlFbHVkR1ZuY21GMGFXOXVJRU5CSUMwZ1J6TXhKakFrQmdOVkJBc01IVUZ3Y0d4bElFTmxjblJwWm1sallYUnBiMjRnUVhWMGFHOXlhWFI1TVJNd0VRWURWUVFLREFwQmNIQnNaU0JKYm1NdU1Rc3dDUVlEVlFRR0V3SlZVd0lJVERCQlNWR2RWRFl3Q3dZSllJWklBV1VEQkFJQm9JR1RNQmdHQ1NxR1NJYjNEUUVKQXpFTEJna3Foa2lHOXcwQkJ3RXdIQVlKS29aSWh2Y05BUWtGTVE4WERUSXpNRFV4T1RFeU5UUXpNVm93S0FZSktvWklodmNOQVFrME1Sc3dHVEFMQmdsZ2hrZ0JaUU1FQWdHaENnWUlLb1pJemowRUF3SXdMd1lKS29aSWh2Y05BUWtFTVNJRUlIYmttRnArVC8zeVhJczl5Y0hmdzJvZy9sdk0vY0hrd2xaeFZEc2NUV3NLTUFvR0NDcUdTTTQ5QkFNQ0JFY3dSUUlnZk1DK1N0TmVxWW1GV2hUY1oxVmluMHF1bEk0UkZoenoreTlSQjFLSjRONENJUURsSk42V1VqS25sTjVKaks3bUYxMGR4WW40WFZpcjFvcC9VWWFBVkRsdmJnQUFBQUFBQUE9PSIsImhlYWRlciI6eyJwdWJsaWNLZXlIYXNoIjoibncwNDN0SFRhSjhTRWc0R1F1aFhvYzUwcWxCdlM2M2Y2L1d3dmlhZFFUaz0iLCJlcGhlbWVyYWxQdWJsaWNLZXkiOiJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVrWW1PbWtSZGtac2w2QkFSZ2l0T043bTZFdlBER3FLWjZjRTB5elFJQ0kwUGdmc212Z2dveisvcnU5MGlTNklNeVBmN01Jek1mYUJId295ODRPOWtkZz09IiwidHJhbnNhY3Rpb25JZCI6IjU0OWJiOWEwNThmYjUxNGFiMWQ0ODZjNWMwZmU4NjlmZTlkYjg3MWUxNWY5M2Q3MWE3YTIwMzQxZjU1OTY0ZjQifSwidmVyc2lvbiI6IkVDX3YxIn0=' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_method%5D%5Bdisplay_name%5D=MasterCard 0049' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_method%5D%5Bnetwork%5D=MasterCard ' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_method%5D%5Btype%5D=credit' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Btransaction_identifier%5D=549BB9A058FB514AB1D486C5C0FE869FE9DB871E15F93D71A7A20341F55964F4' \
--data-urlencode 'id=1749052094' \
--data-urlencode 'payment_method_types=apple_pay' \
--data-urlencode 'connector_metadata%5Bnoon%5D%5Border_category%5D=pay'
```
response
```
{
"id": "1749051940",
"object": "payment_intent",
"amount": 1000,
"amount_received": null,
"amount_capturable": 0,
"currency": "aed",
"status": "canceled",
"client_secret": "1749051940_secret_0sTFsA7eoUGpFgclZWsg",
"created": 1749051940,
"customer": "sahkal",
"refunds": null,
"mandate": null,
"metadata": {
"orderId": "1677581650"
},
"charges": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "http://placeholder"
},
"connector": "noon",
"description": "card Payment",
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"authentication_type": "no_three_ds",
"next_action": null,
"cancellation_reason": null,
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "0049",
"card_network": "MasterCard ",
"type": "credit"
}
}
},
"shipping": null,
"billing": {
"address": null,
"phone": null,
"email": "[email protected]"
},
"capture_on": null,
"payment_token": null,
"email": null,
"phone": null,
"statement_descriptor_suffix": null,
"statement_descriptor_name": null,
"capture_method": "automatic",
"name": null,
"last_payment_error": {
"charge": null,
"code": "16200",
"decline_code": null,
"message": "Request data is not valid.",
"param": null,
"payment_method": {
"id": "place_holder_id",
"object": "payment_method",
"card": null,
"created": 1749051941,
"type": "card",
"livemode": false
},
"type": "16200"
},
"connector_transaction_id": null
}
```
apple pay for noon cannot be tested since we need to raise query to their support. But we are able to go to the connector without raising any core error.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments.rs`
**Detailed Identifier Changes:**
Commit e902d6d9:
Files to modify:
**crates/router/src/core/payments.rs**
Modify existing code
|
{"pr_number": 8207, "pr_title": "revert(routing): Add connectors from current active routing algorithm before adding fallback connectors", "merged_at": "2025-06-04T16:36:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(address): change address to domain address in application
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Refactoring
## Description
<!-- Describe your changes in detail -->
A new type has been added to the domain models called `Address`. This type has been used in the application everywhere where we use address.
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
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 by passing the billing and shipping address
```bash
curl --location 'http://localhost:8080/v2/payments/create-intent' \
--header 'api-key: dev_WnAruI89ADcHyYBIs7qWS0DHCkpfcfBma1ubv4mWLK9CoaUCKaVbYvAQUEKycCO0' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_U0hvw0D9plClPdsoS1Gj' \
--data-raw '{
"amount_details": {
"order_amount": 100,
"currency": "USD"
},
"billing": {
"address": {
"first_name": "John",
"last_name": "Dough"
},
"email": "[email protected]"
},
"shipping": {
"address": {
"first_name": "John",
"last_name": "Dough",
"city": "Karwar",
"zip": "581301",
"state": "Karnataka"
},
"email": "[email protected]"
}
}'
```
```json
{
"id": "12345_pay_01936eb3d8f27892b0fc10f02351516c",
"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_01936eb3d8f27892b0fc10f02351516c_secret_01936eb3d8f379e3ab40edeedf17445d",
"profile_id": "pro_U0hvw0D9plClPdsoS1Gj",
"merchant_reference_id": null,
"routing_algorithm_id": null,
"capture_method": "automatic",
"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": "[email protected]"
},
"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": "[email protected]"
},
"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-27T17:53:20.531Z",
"frm_metadata": null,
"request_external_three_ds_authentication": "Skip"
}
```
- Ensure that the billing address and shipping address are returned as expected
- confirm the payment with payment method billing address
```bash
curl --location 'http://localhost:8080/v2/payments/12345_pay_01936ecc441b75819e855e842cc399fc/confirm-intent' \
--header 'x-client-secret: 12345_pay_01936ecc441b75819e855e842cc399fc_secret_01936ecc441c7c03a3cd39377ec07227' \
--header 'x-profile-id: pro_6Kx6DNIEgnKROYJ8ja9j' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_d088fde71ce44ae3b8deb6786c6a747e' \
--data '{
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "01",
"card_exp_year": "25",
"card_holder_name": "John Doe",
"card_cvc": "100"
},
"billing": {
"address": {
"first_name": "John"
}
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit"
}'
```
```json
{
"id": "12345_pay_01936ecc441b75819e855e842cc399fc",
"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": null
},
"connector": "stripe",
"client_secret": "12345_pay_01936ecc441b75819e855e842cc399fc_secret_01936ecc441c7c03a3cd39377ec07227",
"created": "2024-11-27T18:05:00.828Z",
"payment_method_data": {
"billing": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"line3": null,
"zip": null,
"state": null,
"first_name": "John",
"last_name": null
},
"phone": null,
"email": null
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"next_action": null,
"connector_transaction_id": "pi_3QPpbrD5R7gDAGff0I2xElva",
"connector_reference_id": null,
"merchant_connector_id": "mca_UNBvyDd9IHGPWPC3ORf5",
"browser_info": null,
"error": null
}
```
- Ensure that the payment method billing address are returned as sent in the request
- Retrieve the payment
```bash
curl --location 'http://localhost:8080/v2/payments/12345_pay_01936ecc441b75819e855e842cc399fc' \
--header 'x-profile-id: pro_6Kx6DNIEgnKROYJ8ja9j' \
--header 'api-key: dev_NoVyI0VIpxPwRC3NgYzQ7PFkhxex0bWSXrgDLHZZwu1seej1jhoNs22s0QDJBflS' \
--data ''
```
```json
{
"id": "12345_pay_01936ecc441b75819e855e842cc399fc",
"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": null
},
"connector": "stripe",
"client_secret": "12345_pay_01936ecc441b75819e855e842cc399fc_secret_01936ecc441c7c03a3cd39377ec07227",
"created": "2024-11-27T18:05:00.828Z",
"payment_method_data": {
"billing": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"line3": null,
"zip": null,
"state": null,
"first_name": "John",
"last_name": null
},
"phone": null,
"email": null
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector_transaction_id": "pi_3QPpbrD5R7gDAGff0I2xElva",
"connector_reference_id": null,
"merchant_connector_id": "mca_UNBvyDd9IHGPWPC3ORf5",
"browser_info": null,
"error": null,
"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": "[email protected]"
},
"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": "[email protected]"
}
}
```
- Check the billing and shipping details on the stripe dashboard
<img width="606" alt="Screenshot 2024-11-28 at 11 39 26 AM" src="https://github.com/user-attachments/assets/55b05679-d00f-4d07-a5b2-7ae6cbade3fc">
![Uploading Screenshot 2024-11-28 at 11.40.59 AM.png…]()
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/address.rs`
- `crates/hyperswitch_domain_models/src/payment_address.rs`
- `crates/hyperswitch_domain_models/src/payments.rs`
- ... and 3 more files
**3. Core Business Logic**
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/authentication/transformers.rs`
- `crates/router/src/core/payment_methods.rs`
- ... and 15 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs`
- ... and 36 more files
**5. Type Definitions**
- `crates/router/src/compatibility/stripe/payment_intents/types.rs`
- `crates/router/src/types.rs`
- `crates/router/src/types/transformers.rs`
**6. Other**
- `api-reference-v2/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
**Code Patterns Applied:**
- Implement new functions (34 changes)
- Extend existing types with new fields (92 changes)
**Detailed Identifier Changes:**
Commit 938b2a89:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/address.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_address.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/authentication.rs**
Modify existing code
**crates/router/src/compatibility/stripe/payment_intents/types.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
**crates/router/src/connector/bankofamerica/transformers.rs**
Modify existing code
**crates/router/src/connector/bluesnap/transformers.rs**
Modify existing code
**crates/router/src/connector/cybersource/transformers.rs**
Modify existing code
**crates/router/src/connector/gocardless/transformers.rs**
Modify existing code
**crates/router/src/connector/klarna/transformers.rs**
Modify existing code
**crates/router/src/connector/netcetera/netcetera_types.rs**
Modify existing code
**crates/router/src/connector/paypal/transformers.rs**
Modify existing code
**crates/router/src/connector/riskified/transformers/api.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Modify existing code
**crates/router/src/connector/wellsfargo/transformers.rs**
Modify existing code
**crates/router/src/connector/wise/transformers.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/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/surcharge_decision_configs.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Remove:
- function: private::get_capture_method
- function: private::get_optional_payment_attempt
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_get.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/tax_calculation.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Modify existing code
**crates/router/src/core/payments/tokenization.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Remove:
- function: pub::construct_payment_router_data
**crates/router/src/core/payout_link.rs**
Modify existing code
**crates/router/src/core/payouts.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/types.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/tests/connectors/aci.rs**
Modify existing code
**crates/router/tests/connectors/adyen.rs**
Modify existing code
**crates/router/tests/connectors/airwallex.rs**
Modify existing code
**crates/router/tests/connectors/bitpay.rs**
Modify existing code
**crates/router/tests/connectors/bluesnap.rs**
Modify existing code
**crates/router/tests/connectors/cashtocode.rs**
Modify existing code
**crates/router/tests/connectors/coinbase.rs**
Modify existing code
**crates/router/tests/connectors/cryptopay.rs**
Modify existing code
**crates/router/tests/connectors/cybersource.rs**
Modify existing code
**crates/router/tests/connectors/dlocal.rs**
Modify existing code
**crates/router/tests/connectors/forte.rs**
Modify existing code
**crates/router/tests/connectors/globalpay.rs**
Modify existing code
**crates/router/tests/connectors/iatapay.rs**
Modify existing code
**crates/router/tests/connectors/multisafepay.rs**
Modify existing code
**crates/router/tests/connectors/opennode.rs**
Modify existing code
**crates/router/tests/connectors/payeezy.rs**
Modify existing code
**crates/router/tests/connectors/payme.rs**
Modify existing code
**crates/router/tests/connectors/trustpay.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
**crates/router/tests/connectors/wise.rs**
Modify existing code
**crates/router/tests/connectors/worldline.rs**
Modify existing code
|
{"pr_number": 6608, "pr_title": "refactor(address): change address to domain address in application", "merged_at": "2024-12-04T10:10:37Z", "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/address.rs", "crates/hyperswitch_domain_models/src/payment_address.rs", "crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_request_types/authentication.rs"], "core_business": ["crates/router/src/core/authentication.rs", "crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/surcharge_decision_configs.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_get.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/tax_calculation.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/payments/tokenization.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/payout_link.rs", "crates/router/src/core/payouts.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/incoming_v2.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs", "crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/adyen/transformers.rs", "crates/router/src/connector/bankofamerica/transformers.rs", "crates/router/src/connector/bluesnap/transformers.rs", "crates/router/src/connector/cybersource/transformers.rs", "crates/router/src/connector/gocardless/transformers.rs", "crates/router/src/connector/klarna/transformers.rs", "crates/router/src/connector/netcetera/netcetera_types.rs", "crates/router/src/connector/paypal/transformers.rs", "crates/router/src/connector/riskified/transformers/api.rs", "crates/router/src/connector/utils.rs", "crates/router/src/connector/wellsfargo/transformers.rs", "crates/router/src/connector/wise/transformers.rs", "crates/router/tests/connectors/aci.rs", "crates/router/tests/connectors/adyen.rs", "crates/router/tests/connectors/airwallex.rs", "crates/router/tests/connectors/bitpay.rs", "crates/router/tests/connectors/bluesnap.rs", "crates/router/tests/connectors/cashtocode.rs", "crates/router/tests/connectors/coinbase.rs", "crates/router/tests/connectors/cryptopay.rs", "crates/router/tests/connectors/cybersource.rs", "crates/router/tests/connectors/dlocal.rs", "crates/router/tests/connectors/forte.rs", "crates/router/tests/connectors/globalpay.rs", "crates/router/tests/connectors/iatapay.rs", "crates/router/tests/connectors/multisafepay.rs", "crates/router/tests/connectors/opennode.rs", "crates/router/tests/connectors/payeezy.rs", "crates/router/tests/connectors/payme.rs", "crates/router/tests/connectors/trustpay.rs", "crates/router/tests/connectors/utils.rs", "crates/router/tests/connectors/wise.rs", "crates/router/tests/connectors/worldline.rs"], "types": ["crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/types.rs", "crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "crates/common_enums/src/enums.rs"]}, "change_types": {"functions_added": 34, "fields_added": 92, "imports_added": 29}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(relay): add trait based implementation for relay
## 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 refactors the relay flow to add trait based implementation for it.
Changes made:-
1. `relay_flow_decider` decides the relay flow based on the relay types
2. Introduced `RelayInterface` trait that consists the methods required for different relay types
a. `validate_relay_request` validates the relay requests for different type of relay types. It also provides default
implementation, if a new relay type does not have specific type.
b. `get_domain_models` to convert the relay request form api models to domain models
c. `process_relay` that consists the core functionality for every relay type
d. `generate_response` relay type specific response
3. `Validate` trait provides the generic validation. This trait can be implemented for any type, that requires validation.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies 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)?
-->
-> Make a relay payment
```
curl --location 'http://localhost:8080/relay' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_Zv50p4TBhOIRJFnynXL7' \
--header 'api-key: <api-key>' \
--data '{
"connector_id": "mca_5dVmrsd0IwgQAsu3uiUo",
"connector_resource_id": "pi_3Qs0CqEOqOywnAIx0QJ1vo67",
"data": {
"refund": {
"amount": 1,
"currency": "USD"
}
},
"type": "refund"
}'
```
```
{
"id": "relay_5nS1Mr5DHgWCkadiEVwY",
"status": "success",
"connector_resource_id": "pi_3Qs0CqEOqOywnAIx0QJ1vo67",
"error": null,
"connector_reference_id": "re_3Qs0CqEOqOywnAIx07ZIvgZ1",
"connector_id": "mca_5dVmrsd0IwgQAsu3uiUo",
"profile_id": "pro_Zv50p4TBhOIRJFnynXL7",
"type": "refund",
"data": {
"refund": {
"amount": 1,
"currency": "USD",
"reason": null
}
}
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/relay.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/merchant_connector_account.rs`
- `crates/hyperswitch_domain_models/src/relay.rs`
**3. Core Business Logic**
- `crates/router/src/core/relay.rs`
**4. Other**
- `api-reference/openapi_spec.json`
- `crates/openapi/src/openapi.rs`
- `crates/router/src/routes/relay.rs`
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (17 changes)
- Extend existing types with new fields (63 changes)
**Detailed Identifier Changes:**
Commit cdfbb82f:
Files to modify:
**crates/api_models/src/relay.rs**
Remove:
- struct: pub::RelayRefundRequest
Add:
- struct: pub::RelayRefundRequestData
**crates/hyperswitch_domain_models/src/merchant_connector_account.rs**
Add:
- function: pub::get_connector_name_as_string
- function: pub::get_connector_name_as_string
**crates/hyperswitch_domain_models/src/relay.rs**
Add:
- function: private::from
- function: private::from
- impl: impl From<api_models::relay::RelayRefundRequestData> for RelayRefundData
- impl: impl From<RelayData> for api_models::relay::RelayData
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/router/src/core/relay.rs**
Remove:
- function: pub::relay_refund
- function: pub::validate_relay_refund_request
- function: pub::validate_relay_refund_data
Add:
- function: private::validate
- function: private::validate_relay_request
- function: pub::from_relay_request
- function: private::get_domain_models
- function: private::process_relay
- function: private::generate_response
- function: pub::relay_flow_decider
- struct: pub::RelayRequestInner
- struct: pub::RelayRefund
- trait: pub::Validate
- trait: pub::RelayInterface
- impl: impl Validate for relay_api_models::RelayRefundRequestData
- impl: impl RelayRequestInner<RelayRefund>
- impl: impl RelayInterface for RelayRefund
**crates/router/src/routes/relay.rs**
Modify existing code
|
{"pr_number": 7264, "pr_title": "refactor(relay): add trait based implementation for relay", "merged_at": "2025-03-03T07:59:12Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "refund", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/relay.rs"], "domain": ["crates/hyperswitch_domain_models/src/merchant_connector_account.rs", "crates/hyperswitch_domain_models/src/relay.rs"], "core_business": ["crates/router/src/core/relay.rs"], "other": ["api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/router/src/routes/relay.rs"]}, "change_types": {"structs_added": 3, "functions_added": 17, "fields_added": 63, "imports_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): fix iatapay upi payments
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Fixed the IataPay Cypress test cases as UPI_Collect payments were failing due to an invalid billing.address.country.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Cypress test cases were failing
## How did you test it?
Cypress
Before

After

Adyen
<img width="723" alt="image" src="https://github.com/user-attachments/assets/c411d896-a9b6-42a1-828f-3d0e54820606" />
Bluesnap
<img width="799" alt="image" src="https://github.com/user-attachments/assets/9f7adb21-0dfd-4bab-af1a-92e22733b526" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Iatapay.js`
- `cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js`
**Code Patterns Applied:**
- Extend existing types with new fields (11 changes)
- Add conditional logic for feature flags or filtering (1 changes)
|
{"pr_number": 7698, "pr_title": "ci(cypress): fix iatapay upi payments", "merged_at": "2025-04-03T06:47:38Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Iatapay.js", "cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js"]}, "change_types": {"fields_added": 11, "conditionals_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix: correct error for env not found
## 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 -->
PR : #[8238](https://github.com/juspay/hyperswitch/pull/8238) calls for a env variable before the .env file is sourced in the scripts/setup.sh file.
This PR fixes the above mentioned issue and handles the health checks using flags instead of exit codes, enabling the script to proceed further without getting terminated.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies application configuration/environment variables
- [ ] This PR modifies the database schema
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
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. Run `scripts/setup.sh`.
2. If it prompts `ports already in use`, enter `y` to proceed.
3. Choose `1) Standard Setup` in setup options.
4. If setup is successful, you will get this final output:
<img width="575" alt="Screenshot 2025-06-16 at 5 18 19 PM" src="https://github.com/user-attachments/assets/8e6dda80-dc56-45f4-8579-f49a0582464d" />
5. Try signing in to `control center` using the default credentials provided.
## 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
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **Chores**
- Improved the setup process to ensure environment variables are loaded after configuration is updated.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Other**
- `scripts/setup.sh`
**Code Patterns Applied:**
- Add conditional logic for feature flags or filtering (1 changes)
|
{"pr_number": 8320, "pr_title": "fix: correct error for env not found", "merged_at": "2025-06-16T13:09:15Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"other": ["scripts/setup.sh"]}, "change_types": {"conditionals_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(router): add capability to force challenge for 3DS Payments through Netcetera and send few optional fields
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
add capability to force challenge for 3DS Payments through Netcetera and send few optional fields
1. Profile level enablement `force_3ds_challenge` which would request netcetera for challenge flow
2. Send few optional fields like trans_type, which can potentially be required on PROD (Because docs says, it maybe required in some markets)
Note: hotfix pr against https://github.com/juspay/hyperswitch/pull/7429
### Additional Changes
- [x] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
4. `crates/router/src/configs`
5. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested Manually
Perform a External 3DS payment by enabling force_3ds_challenge at profile level, and observe ThreeDSRequestorChallengeInd being sent "04" to netcetera connector
CURL
```
curl --location '{{BASE_URL}}/payments/{{PAYMENT_ID}}/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{PUBLISHABLE_KEY}}' \
--data '{
"client_secret": "pay_SiyzAZBqOJgLShX0Kjxw_secret_vEfMKRmj8ovnvxVYJdqK",
"device_channel": "BRW",
"threeds_method_comp_ind": "Y"
}'
```
Response
```
{
"trans_status": "C",
"acs_url": "https://ndm-prev.3dss-non-prod.cloud.netcetera.com/acs/challenge",
"challenge_request": "eyJtZXNzYWdlVHlwZSI6IkNSZXEiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjRjY2M5ZGRkLWMxZGMtNGMyNy04YzAyLTg5NmE2MzI5MWMzZCIsImFjc1RyYW5zSUQiOiI5MWM0MWZjOS0zZDI1LTQ0OGItODA4MS1mMDkxOTg3NmM1ZTQiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMy4xIn0",
"acs_reference_number": "3DS_LOA_ACS_201_13579",
"acs_trans_id": "91c41fc9-3d25-448b-8081-f0919876c5e4",
"three_dsserver_trans_id": "4ccc9ddd-c1dc-4c27-8c02-896a63291c3d",
"acs_signed_content": null,
"three_ds_requestor_url": "https://google.com/"
}
```
<img width="1728" alt="image" src="https://github.com/user-attachments/assets/f564f79c-9604-429a-9acb-b8e68fb33f44" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/admin.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
- `crates/hyperswitch_domain_models/src/router_request_types/authentication.rs`
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/authentication/transformers.rs`
- ... and 1 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
- `crates/router/src/connector/netcetera/netcetera_types.rs`
- `crates/router/src/connector/netcetera/transformers.rs`
**6. Type Definitions**
- `crates/common_utils/src/types.rs`
- `crates/router/src/types/api/admin.rs`
**7. Other**
- `migrations/2025-03-04-105454_add_force_3ds_challenge_column_to_business_profile/down.sql`
- `migrations/2025-03-04-105454_add_force_3ds_challenge_column_to_business_profile/up.sql`
**Code Patterns Applied:**
- Implement new functions (4 changes)
- Extend existing types with new fields (56 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit ec0718f3:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/common_utils/src/types.rs**
Add:
- function: pub::get_minor
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/authentication.rs**
Modify existing code
**crates/router/src/connector/netcetera/netcetera_types.rs**
Remove:
- function: private::from
- impl: impl From<Option<common_enums::ScaExemptionType>> for ThreeDSRequestor
Add:
- function: private::get_version_checked
- function: pub::new
- function: private::try_from
- enum: pub::SchemeId
- impl: impl SingleOrListElement<T>
- impl: impl ThreeDSRequestor
- impl: impl TryFrom<common_enums::CardNetwork> for SchemeId
**crates/router/src/connector/netcetera/transformers.rs**
Remove:
- function: private::try_from
- enum: pub::SchemeId
- impl: impl TryFrom<common_enums::CardNetwork> for SchemeId
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/authentication.rs**
Modify existing code
**crates/router/src/core/authentication/transformers.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code
|
{"pr_number": 7449, "pr_title": "feat(router): add capability to force challenge for 3DS Payments through Netcetera and send few optional fields ", "merged_at": "2025-03-06T14:29:40Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs"], "database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/router_request_types/authentication.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/authentication.rs", "crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/payments.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/router/src/connector/netcetera/netcetera_types.rs", "crates/router/src/connector/netcetera/transformers.rs"], "types": ["crates/common_utils/src/types.rs", "crates/router/src/types/api/admin.rs"], "other": ["migrations/2025-03-04-105454_add_force_3ds_challenge_column_to_business_profile/down.sql", "migrations/2025-03-04-105454_add_force_3ds_challenge_column_to_business_profile/up.sql"]}, "change_types": {"functions_added": 4, "enums_added": 1, "fields_added": 56, "imports_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(constraint_graph): handle PML for cases where setup_future_usage is not passed in payments
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This will handel the cases for constraint_graph for PML where setup_future_usage is not passed in payments.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
This can be tested in the following way:
1. Connector create (Fiuu)
```
curl --location 'http://127.0.0.1:8080/account/merchant_1733312955/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "fiuu",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": ".....",
"key1": "......",
"api_secret": "......"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "online_banking_fpx",
"payment_experience": null,
"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": ".....",
"additional_secret": null
}
}'
```
2. Payment (no setup_future_usage)
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Cookie;' \
--header 'api-key: .....' \
--data-raw '{
"amount": 6540,
// "setup_future_usage": "off_session",
"currency": "EUR",
"confirm": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"customer_id": "uiuiuiui",
"email": "[email protected]",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "NL",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IN",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
3. List payment methods (`setup_future_usage` = null)
```
curl --location 'http://localhost:8080/account/payment_methods?client_secret=......' \
--header 'Accept: application/json' \
--header 'api-key: .....' \
--data ''
```
Response
```
{
"redirect_url": "https://google.com/success",
"currency": "MYR",
"payment_methods": [
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "online_banking_fpx",
"payment_experience": null,
"card_networks": null,
"bank_names": [
{
"bank_name": [
"affin_bank",
"bank_islam",
"rhb_bank",
"bank_of_china",
"bank_simpanan_nasional",
"bank_muamalat",
"bank_rakyat",
"maybank",
"public_bank",
"uob_bank",
"hong_leong_bank",
"hsbc_bank",
"ocbc_bank",
"alliance_bank",
"agro_bank",
"cimb_bank",
"kuwait_finance_house",
"am_bank",
"standard_chartered_bank"
],
"eligible_connectors": [
"fiuu"
]
}
],
"bank_debits": null,
"bank_transfers": null,
"required_fields": null,
"surcharge_details": null,
"pm_auth_connector": null
}
]
}
],
"mandate_payment": null,
"merchant_name": "Prajjwal",
"show_surcharge_breakup_screen": false,
"payment_type": "normal",
"request_external_three_ds_authentication": false,
"collect_shipping_details_from_wallets": false,
"collect_billing_details_from_wallets": false,
"is_tax_calculation_enabled": false
}
```
4. `setup_future_usage` = `on_session`
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: xxxxxx' \
--data '{
"amount": 1000,
"currency": "MYR",
"amount_to_capture": 1000,
"confirm": false,
"payment_link" : true,
"capture_method": "automatic",
"payment_method": "bank_redirect",
"setup_future_usage": "on_session",
"payment_method_type": "online_banking_fpx",
"return_url": "https://google.com",
"payment_method_data": {
"bank_redirect": {
"online_banking_fpx": {
"issuer": "bank_islam"
}
}
}
}'
```
List PM response:
```
{
"redirect_url": "https://google.com/success",
"currency": "MYR",
"payment_methods": [
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "online_banking_fpx",
"payment_experience": null,
"card_networks": null,
"bank_names": [
{
"bank_name": [
"ocbc_bank",
"uob_bank",
"kuwait_finance_house",
"standard_chartered_bank",
"cimb_bank",
"bank_simpanan_nasional",
"hsbc_bank",
"bank_rakyat",
"alliance_bank",
"am_bank",
"public_bank",
"rhb_bank",
"agro_bank",
"hong_leong_bank",
"bank_of_china",
"maybank",
"affin_bank",
"bank_muamalat",
"bank_islam"
],
"eligible_connectors": [
"fiuu"
]
}
],
"bank_debits": null,
"bank_transfers": null,
"required_fields": null,
"surcharge_details": null,
"pm_auth_connector": null
}
]
}
],
"mandate_payment": null,
"merchant_name": "Prajjwal",
"show_surcharge_breakup_screen": false,
"payment_type": "normal",
"request_external_three_ds_authentication": false,
"collect_shipping_details_from_wallets": false,
"collect_billing_details_from_wallets": false,
"is_tax_calculation_enabled": false
}
```
5. `setup_future_usage` = off_session
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: xxxxx' \
--data '{
"amount": 1000,
"currency": "MYR",
"amount_to_capture": 1000,
"confirm": false,
"payment_link" : true,
"capture_method": "automatic",
"payment_method": "bank_redirect",
"setup_future_usage": "off_session",
"payment_method_type": "online_banking_fpx",
"return_url": "https://google.com",
"payment_method_data": {
"bank_redirect": {
"online_banking_fpx": {
"issuer": "bank_islam"
}
}
}
}'
```
List PM response:
```
{
"redirect_url": "https://google.com/success",
"currency": "MYR",
"payment_methods": [],
"mandate_payment": null,
"merchant_name": "Prajjwal",
"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. Core Business Logic**
- `crates/router/src/core/payment_methods/cards.rs`
**Detailed Identifier Changes:**
Commit e8bfd0e2:
Files to modify:
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
|
{"pr_number": 6810, "pr_title": "refactor(constraint_graph): handle PML for cases where setup_future_usage is not passed in payments", "merged_at": "2024-12-17T11:45:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payment_methods/cards.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): Add testcases for unified error code and message
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Added the testcases for unified error code and error message for stripe and adyen connector. And added failure payments testcases.
## How did you test it?
Stripe
<img width="729" alt="Screenshot 2024-12-10 at 7 58 49 PM" src="https://github.com/user-attachments/assets/1b7cc860-4d07-4891-b839-08749bb850d0">
Adyen
<img width="730" alt="Screenshot 2024-12-10 at 8 01 29 PM" src="https://github.com/user-attachments/assets/4c72db4f-206f-4467-9af2-b31a149e3c07">
## 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/PaymentTest/00022-Variations.cy.js`
- `cypress-tests/cypress/e2e/PaymentUtils/Adyen.js`
- `cypress-tests/cypress/e2e/PaymentUtils/Commons.js`
- ... and 1 more files
**Code Patterns Applied:**
- Extend existing types with new fields (50 changes)
- Add conditional logic for feature flags or filtering (3 changes)
|
{"pr_number": 6796, "pr_title": "ci(cypress): Add testcases for unified error code and message", "merged_at": "2024-12-13T08:25:47Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/PaymentTest/00022-Variations.cy.js", "cypress-tests/cypress/e2e/PaymentUtils/Adyen.js", "cypress-tests/cypress/e2e/PaymentUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentUtils/Stripe.js"]}, "change_types": {"fields_added": 50, "conditionals_added": 3}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(connector): [AdyenPlatform] update required fields
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR removes any non mandatory fields from AdyenPlatform connector for card and SEPA payouts.
New list
- Card payouts
[payout_method_data.card.card_number](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-payout-method-data-card-card-number)
[payout_method_data.card.expiry_month](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-payout-method-data-card-expiry-month)
[payout_method_data.card.expiry_year](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-payout-method-data-card-expiry-year)
[payout_method_data.card.card_holder_name](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-payout-method-data-card-card-holder-name)
[billing.address.line1](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-billing-address-line1)
[billing.address.line2](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-billing-address-line2)
[billing.address.city](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-billing-address-city)
[billing.address.country](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-billing-address-country)
- Bank payouts
Along with the payout method data depending on the bank (https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-payout-method-data-bank)
[billing.address.line1](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-billing-address-line1)
[billing.address.line2](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-billing-address-line2)
[billing.address.city](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-billing-address-city)
[billing.address.country](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-billing-address-country)
[billing.address.first_name](https://api-reference.hyperswitch.io/v1/payouts/payouts--create#body-billing-address-first-name)
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
This PR removes any mandatory fields that were needed for processing payouts via Adyenplatform
## How did you test it?
Tested locally
<details>
<summary>[Negative] 1. Create SEPA payout with missing billing details</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_Rko4ofOnDKpn3Dbs0ZUz8PQ1qdIDgT183ONTPiY0dUFAJcv4eyDrzIzEnd6iFc0j' \
--data '{"amount":1,"currency":"EUR","customer_id":"cus_5SyQoohBVj6cdUfmqLLK","description":"Its my first payout request","payout_type":"bank","priority":"instant","payout_method_data":{"bank":{"iban":"NL06INGB5632579034"}},"connector":["adyenplatform"],"entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true,"profile_id":"pro_AiAxQKHVhrQ8xdFAllu5"}'
Response
{
"error": {
"type": "invalid_request",
"message": "Missing required param: address",
"code": "IR_04"
}
}
</details>
<details>
<summary>[Negative] 2. Create Card payout with missing billing details</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_Rko4ofOnDKpn3Dbs0ZUz8PQ1qdIDgT183ONTPiY0dUFAJcv4eyDrzIzEnd6iFc0j' \
--data '{"amount":100,"currency":"EUR","profile_id":"pro_AiAxQKHVhrQ8xdFAllu5","customer_id":"cus_5SyQoohBVj6cdUfmqLLK","connector":["adyenplatform"],"description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111111111111111","expiry_month":"03","expiry_year":"2030","card_holder_name":"John Doe"}},"recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}'
Response
{
"error": {
"type": "invalid_request",
"message": "Missing required param: address",
"code": "IR_04"
}
}
</details>
<details>
<summary>3. Create a SEPA payout with mandatory fields</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_Rko4ofOnDKpn3Dbs0ZUz8PQ1qdIDgT183ONTPiY0dUFAJcv4eyDrzIzEnd6iFc0j' \
--data '{"amount":1,"currency":"EUR","customer_id":"cus_5SyQoohBVj6cdUfmqLLK","description":"Its my first payout request","payout_type":"bank","priority":"instant","payout_method_data":{"bank":{"iban":"NL06INGB5632579034"}},"connector":["adyenplatform"],"billing":{"address":{"line1":"Raadhuisplein","line2":"92","city":"Hoogeveen","country":"NL","first_name":"John"}},"entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true,"profile_id":"pro_AiAxQKHVhrQ8xdFAllu5"}'
Response
{"payout_id":"payout_rBKFN2yzDxmULDYFUApY","merchant_id":"merchant_1755587924","merchant_order_reference_id":null,"amount":1,"currency":"EUR","connector":"adyenplatform","payout_type":"bank","payout_method_data":{"bank":{"iban":"NL06I********79034","bank_name":null,"bank_country_code":null,"bank_city":null,"bic":null}},"billing":{"address":{"city":"Hoogeveen","country":"NL","line1":"Raadhuisplein","line2":"92","line3":null,"zip":null,"state":null,"first_name":"John","last_name":null,"origin_zip":null},"phone":null,"email":null},"auto_fulfill":true,"customer_id":"cus_5SyQoohBVj6cdUfmqLLK","customer":{"id":"cus_5SyQoohBVj6cdUfmqLLK","name":"John Nether","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_rBKFN2yzDxmULDYFUApY_secret_3G01mWdnAttOAfeC2wa8","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_KrzAoNCxtUDCf6kAzESd","status":"initiated","error_message":null,"error_code":null,"profile_id":"pro_AiAxQKHVhrQ8xdFAllu5","created":"2025-08-19T09:31:28.239Z","connector_transaction_id":"38EBH16813GN2MVG","priority":"instant","payout_link":null,"email":null,"name":"John Nether","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_jod7TuYT46i6dCHkGmev"}
</details>
<details>
<summary>4. Card payout with required fields</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_Rko4ofOnDKpn3Dbs0ZUz8PQ1qdIDgT183ONTPiY0dUFAJcv4eyDrzIzEnd6iFc0j' \
--data '{"amount":100,"currency":"EUR","profile_id":"pro_AiAxQKHVhrQ8xdFAllu5","customer_id":"cus_5SyQoohBVj6cdUfmqLLK","connector":["adyenplatform"],"description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111111111111111","expiry_month":"03","expiry_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","city":"San Fransico","country":"FR"}},"recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}'
Response
{"payout_id":"payout_Lg2UYU0m2wQQC23NIGSD","merchant_id":"merchant_1755587924","merchant_order_reference_id":null,"amount":100,"currency":"EUR","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":null,"card_network":null,"card_type":null,"card_issuing_country":null,"bank_code":null,"last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"city":"San Fransico","country":"FR","line1":"1467","line2":"Harrison Street","line3":null,"zip":null,"state":null,"first_name":null,"last_name":null,"origin_zip":null},"phone":null,"email":null},"auto_fulfill":true,"customer_id":"cus_5SyQoohBVj6cdUfmqLLK","customer":{"id":"cus_5SyQoohBVj6cdUfmqLLK","name":"John Nether","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_Lg2UYU0m2wQQC23NIGSD_secret_52k9WAGvV9OkAbfIZ4t4","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_KrzAoNCxtUDCf6kAzESd","status":"initiated","error_message":null,"error_code":null,"profile_id":"pro_AiAxQKHVhrQ8xdFAllu5","created":"2025-08-19T09:32:26.497Z","connector_transaction_id":"38EBH66813GZBWSE","priority":null,"payout_link":null,"email":null,"name":"John Nether","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_sKZq1HLWSxrszfZGuubX"}
</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/adyenplatform/transformers/payouts.rs`
**2. Configuration Files**
- `crates/router/src/configs/defaults/payout_required_fields.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (41 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 72eb25f0:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs**
Remove:
- impl: impl TryFrom<(&types::PayoutsRouterData<F>, enums::PayoutType)> for AdyenAccountHolder
Add:
- impl: impl TryFrom<(&PayoutsRouterData<F>, &payouts::CardPayout)> for AdyenAccountHolder
**crates/router/src/configs/defaults/payout_required_fields.rs**
Add:
- function: private::get_billing_details_for_payment_method
|
{"pr_number": 8990, "pr_title": "refactor(connector): [AdyenPlatform] update required fields", "merged_at": "2025-08-19T11:08:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "merchant", "order"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs"], "config": ["crates/router/src/configs/defaults/payout_required_fields.rs"]}, "change_types": {"functions_added": 2, "fields_added": 41, "imports_added": 2, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Wise] Add webhook source verification
## 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 RSA SHA 256 source verification for webhook in Wise
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<img width="1545" height="138" alt="image" src="https://github.com/user-attachments/assets/88011eba-cd3c-4a1a-9f01-0272f360cd7f" />
Tested through Postman:
- Add webhook secret in MCA (Wise):
- Setup webhook Url in Wise Dashboard:
- Create a payout
- Should receive a webhook status update on merchant's end
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/wise.rs`
**Code Patterns Applied:**
- Implement new functions (4 changes)
- Extend existing types with new fields (4 changes)
|
{"pr_number": 9100, "pr_title": "feat(connector): [Wise] Add webhook source verification", "merged_at": "2025-08-29T13:57:04Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "webhook"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/wise.rs"]}, "change_types": {"functions_added": 4, "fields_added": 4}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(security): add XSS and sqli validation for dashboard metadata fields
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Added comprehensive XSS (Cross-Site Scripting) and SQLi protection to dashboard metadata fields. Implemented a new `SafeString` type wrapper that validates input against XSS attacks during JSON deserialization.
**Dependencies Added**
- `ammonia = "3.3"` - HTML sanitization library
- `urlencoding = "2.1.3"` - URL decoding for encoded 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
- XSS vulnerability in dashboard metadata fields (`legal_business_name`, `description`, etc.)
- Malicious JavaScript payloads were being persistently stored and executed
## How did you test it?
## Testing
### XSS Test Cases Validated
**All malicious payloads return 400 Bad Request with validation error:**
```
{
"error": {
"error_type": "invalid_request",
"message": "Json deserialize error: Input contains potentially malicious content at line 5 column 62",
"code": "IR_06"
}
}
```
#### 1. Basic Script Tags
```json
{
"ProdIntent": {
"legal_business_name": "<script>alert('xss')</script>"
}
}
```
#### 2. Event Handlers
```json
{
"ProdIntent": {
"comments": "onload=alert('xss') onclick=alert('xss') onmouseover=alert('xss')"
}
}
```
#### 3. Data URLs
```json
{
"ProdIntent": {
"business_website": "data:text/html,<script>alert('xss')</script>"
}
}
```
#### 4. Dangerous Tags (iframe, svg, object, embed)
```json
{
"ProdIntent": {
"legal_business_name": "<iframe src=javascript:alert('xss')></iframe>"
}
}
```
#### 5. SVG with Script
```json
{
"ProdIntent": {
"legal_business_name": "<svg><script>alert('xss')</script></svg>"
}
}
```
#### 6. Object/Embed Tags
```json
{
"ProdIntent": {
"legal_business_name": "<object data=javascript:alert('xss')></object>"
}
}
```
#### 7. Mixed Case and Encoded Payloads
```json
{
"ProdIntent": {
"legal_business_name": "<ScRiPt>alert('xss')</ScRiPt>"
}
}
```
#### 8. Multiple Fields with XSS
```json
{
"ProdIntent": {
"legal_business_name": "<script>alert('xss1')</script>",
"business_website": "javascript:alert('xss2')",
"comments": "onload=alert('xss3')"
}
}
```
#### 9. Edge Cases
```json
{
"ProdIntent": {
"legal_business_name": "Test<script>alert('xss')</script>Company"
}
}
```
#### 10. Math/Embedded Objects
```json
{
"ProdIntent": {
"legal_business_name": "<math><script>alert('xss')</script></math>"
}
}
```
#### 11. Basic Tautology Injection
```json
{
"ProdIntent": {
"legal_business_name": "' OR '1'='1"
}
}
```
#### 12. Blind SQL Injection (time-based)
```json
{
"ProdIntent": {
"legal_business_name": "' OR SLEEP(5) --"
}
}
```
#### 13. Encoded SQL Injection (percent encoding)
```json
{
"ProdIntent": {
"legal_business_name": "%27%20OR%20%271%27%3D%271"
}
}
```
### Valid Data Test Case
#### 1. Legitimate Business Data
```json
{
"ProdIntent": {
"poc_email": "[email protected]",
"is_completed": true,
"legal_business_name": "My Test Company Ltd.",
"business_location": "IN",
"business_website": "https://example.com",
"poc_name": "Kanika Bansal",
"business_country_name": "India",
"product_type": "orchestration",
"comments": "This is a legitimate business comment with no malicious content."
}
}
```
**200 OK**
## 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/user/dashboard_metadata.rs`
**2. Core Business Logic**
- `crates/router/src/core/user/dashboard_metadata.rs`
**3. Type Definitions**
- `crates/common_types/src/primitive_wrappers.rs`
- `crates/router/src/services/email/types.rs`
**4. Utils**
- `crates/common_utils/Cargo.toml`
- `crates/common_utils/src/validation.rs`
- `crates/router/src/utils/user/dashboard_metadata.rs`
**5. Other**
- `Cargo.lock`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (28 changes)
- Extend existing types with new fields (45 changes)
- Add conditional logic for feature flags or filtering (6 changes)
**Detailed Identifier Changes:**
Commit cba489ff:
Files to modify:
**crates/api_models/src/user/dashboard_metadata.rs**
Modify existing code
**crates/common_types/src/primitive_wrappers.rs**
Add:
- function: pub::new
- function: pub::from_string_slice
- function: pub::as_str
- function: pub::into_inner
- function: pub::is_empty
- function: pub::len
- function: private::deref
- function: private::serialize
- function: private::deserialize
- function: private::to_sql
- function: private::from_sql
- struct: pub::SafeString
- impl: impl SafeString
- impl: impl Deref for SafeString
- impl: impl Serialize for SafeString
- impl: impl Deserialize<'de> for SafeString
- impl: impl SerializableSecret for SafeString
- impl: impl diesel::serialize::ToSql<diesel::sql_types::Text, DB> for SafeString
- impl: impl diesel::deserialize::FromSql<diesel::sql_types::Text, DB> for SafeString
- mod: private::safe_string
**crates/common_utils/src/validation.rs**
Add:
- function: pub::contains_potential_xss_or_sqli
- function: private::detects_basic_script_tags
- function: private::detects_event_handlers
- function: private::detects_data_url_payload
- function: private::detects_iframe_javascript_src
- function: private::detects_svg_with_script
- function: private::detects_object_with_js
- function: private::detects_mixed_case_tags
- function: private::detects_embedded_script_in_text
- function: private::detects_math_with_script
- function: private::detects_basic_sql_tautology
- function: private::detects_time_based_sqli
- function: private::detects_percent_encoded_sqli
- function: private::detects_benign_html_as_suspicious
- function: private::allows_legitimate_plain_text
- function: private::allows_normal_url
- function: private::allows_percent_char_without_encoding
**crates/router/src/core/user/dashboard_metadata.rs**
Modify existing code
**crates/router/src/services/email/types.rs**
Modify existing code
**crates/router/src/utils/user/dashboard_metadata.rs**
Modify existing code
|
{"pr_number": 9104, "pr_title": "feat(security): add XSS and sqli validation for dashboard metadata fields", "merged_at": "2025-10-01T08:31:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"api_models": ["crates/api_models/src/user/dashboard_metadata.rs"], "core_business": ["crates/router/src/core/user/dashboard_metadata.rs"], "types": ["crates/common_types/src/primitive_wrappers.rs", "crates/router/src/services/email/types.rs"], "utils": ["crates/common_utils/Cargo.toml", "crates/common_utils/src/validation.rs", "crates/router/src/utils/user/dashboard_metadata.rs"], "other": ["Cargo.lock"]}, "change_types": {"structs_added": 1, "functions_added": 28, "fields_added": 45, "imports_added": 8, "conditionals_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [Cybersource] send type selection indicator for co-batch cards
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Hotfix for https://github.com/juspay/hyperswitch/pull/7828
Authentication with Netcetera was successful, but authorization with Cybersource failed with the below error:
Declined - The request is missing one or more fields, detailed_error_information: paymentInformation.card.typeSelectionIndicator : MISSING_FIELD
Need to send card.typeSelectionIndicator as 1, for all co-badged cards txns with Cybersource (authorization).
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
This can be tested with below payments call:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_4KJPCRL8DJ8dAo0l8hF7TnL7j8TKkbreziz4Zebyv23PtZJOptiK5vpAZjh7eESn' \
--data-raw '{
"amount": 499,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"customer_id": "test_rec7",
"email": "[email protected]",
"customer_acceptance": {
"acceptance_type": "online"
},
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4010061700000021",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"billing": {
"address": {
"city": "test",
"country": "NL",
"line1": "here is some \n there is some \n none is some? \n ",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "CA",
"first_name": "Sakil",
"last_name": "Mostak"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "[email protected]"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
}
}'
```
Cargo clippy:
<img width="1728" alt="Screenshot 2025-04-17 at 1 57 25 PM" src="https://github.com/user-attachments/assets/1c30fce3-13f0-48f4-80ef-890f3cda6f71" />
## Checklist
<!-- Put 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/cybersource/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit 6cee28c8:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
|
{"pr_number": 7840, "pr_title": "fix(connector): [Cybersource] send type selection indicator for co-batch cards", "merged_at": "2025-04-17T11:32:15Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [nmi] webhook source verification
## 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 problem is that we previously extracted `nonce` instead of `signature` and entire regex match instead of `nonce`. this pr fixes webhook source verification for nmi connector by properly extracting `signature` (`2`) and `nonce` (`1`) values.
check attached issue for detailed explanation.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
webhook source verification must not be `false` unless connector does not support it. in this case, it was a mistake from our end where we parsed wrong values.
closes https://github.com/juspay/hyperswitch/issues/8945
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<details>
<summary>Setup webhooks for NMI connector and also the signature verification</summary>
<img width="1212" height="130" alt="image" src="https://github.com/user-attachments/assets/3759cb84-57f6-441e-845e-d6c53868764a" />
<img width="385" height="30" alt="image" src="https://github.com/user-attachments/assets/2df31bc8-54a4-4779-b112-433526318be3" />
<img width="193" height="55" alt="image" src="https://github.com/user-attachments/assets/eeb4287f-e309-49b0-9943-19334a8c7994" />
</details>
<details>
<summary>Make a Payment</summary>
```curl
curl --location 'https://pix-mbp.orthrus-monster.ts.net/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_A3aKSnvxEuazXkjOdUMlrNTSpmIlH9MlaWJj9Ax9xEpFqGN4aVBUGINJjkjSlRdz' \
--data-raw '{
"amount": 60159,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 60159,
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```json
{
"payment_id": "pay_46yfYfNcSmMZ847bso0p",
"merchant_id": "postman_merchant_GHAction_1755093166",
"status": "succeeded",
"amount": 15429,
"net_amount": 15429,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 15429,
"connector": "nmi",
"client_secret": "pay_46yfYfNcSmMZ847bso0p_secret_55lzxYdXlKlBI80u1Y8w",
"created": "2025-08-13T14:25:56.929Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1111",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "JP Morgan",
"card_issuing_country": "INDIA",
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_0k7Cgt2Xh8LXsZAxF3gz",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null,
"origin_zip": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null,
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1755095156,
"expires": 1755098756,
"secret": "epk_12014a82ba5c4c97980e8e0ff9a64b7a"
},
"manual_retry_allowed": false,
"connector_transaction_id": "11025492335",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": "pay_46yfYfNcSmMZ847bso0p_1",
"payment_link": null,
"profile_id": "pro_9TabQmBmCO93BbyuDbqZ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_kMejAtGh3Rsbobtc3dOq",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-13T14:40:56.929Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-08-13T14:25:58.919Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null
}
```
</details>
<details>
<summary>In logs, source verified should be true</summary>
```log
2025-08-13T14:25:59.722386Z INFO router::core::webhooks::incoming: source_verified: true
at crates/router/src/core/webhooks/incoming.rs:597
in router::core::webhooks::incoming::incoming_webhooks_core
in router::services::api::server_wrap_util with flow: IncomingWebhookReceive, lock_action: NotApplicable, merchant_id: "postman_merchant_GHAction_1755093166"
in router::services::api::server_wrap with flow: IncomingWebhookReceive, lock_action: NotApplicable, request_method: "POST", request_url_path: "/webhooks/postman_merchant_GHAction_1755093166/nmi"
in router::routes::webhooks::receive_incoming_webhook with flow: IncomingWebhookReceive
in router::middleware::ROOT_SPAN with flow: "UNKNOWN"
```
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `just clippy && just clippy_v2`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/nmi.rs`
**Code Patterns Applied:**
**Detailed Identifier Changes:**
Commit a0a4b923:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/nmi.rs**
Modify existing code
|
{"pr_number": 8946, "pr_title": "fix(connector): [nmi] webhook source verification", "merged_at": "2025-08-13T15:58:58Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nmi.rs"]}, "change_types": {"imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Paybox] Add mandates Flow for Paybox
## 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 -->
1)Added Mandate flow for Paybox
2) Added a new field `additional_payment_method_data` in PaymentsAuthorizeData type
3) Added `connector_mandate_request_reference_id` in RouterData
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
1)Paybox requires the expiration year, month, and mandate ID in our request, added `additional_payment_method` to fetch card info.
2)Paybox also needs a unique ID(`connector_mandate_request_reference_id`) from us during CIT, which they'll return with their own ID for MIT payments.
## How did you test it?
CIT Flow
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:' \
--data-raw '{
"amount": 501,
"currency": "EUR",
"confirm": true,
"capture_method": "manual",
"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"
}
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at":"1963-05-03T04:07:52.723Z",
"online": {
"ip_address":"127.0.0.1",
"user_agent": "amet irure esse"
}
},
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "5200000000000007",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "John T",
"card_cvc": "123"
}
},
"customer_id":"test_mit1",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"email": "[email protected]",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"setup_future_usage": "off_session"
}'
```
**Response**
```
{
"payment_id": "pay_Z5EjX2drsMwJOJW9c4cD",
"merchant_id": "postman_merchant_GHAction_3a560136-e947-4667-bb84-2f015fcc1196",
"status": "requires_capture",
"amount": 501,
"net_amount": 501,
"shipping_cost": null,
"amount_capturable": 501,
"amount_received": null,
"connector": "paybox",
"client_secret": "pay_Z5EjX2drsMwJOJW9c4cD_secret_jRlKLOkmGQDyMJYv5Vos",
"created": "2024-10-29T17:40:15.214Z",
"currency": "EUR",
"customer_id": "test_mit1",
"customer": {
"id": "test_mit1",
"name": "Joseph Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0007",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_WtS8M0HJRumgDi8wlOtH",
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "test_mit1",
"created_at": 1730223615,
"expires": 1730227215,
"secret": "epk_0d91d25b351049e09b6a554232df82c7"
},
"manual_retry_allowed": false,
"connector_transaction_id": "0080031896",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_hl5seUYAuPOk5MN8bSGO",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_DsQkwRcnsQVWJ7jbsSZl",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-29T17:55:15.214Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_SFHEomDxVxWQg81PB0KU",
"payment_method_status": "active",
"updated": "2024-10-29T17:40:17.064Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "SM@LpCp@L@C"
}
```
MIT
Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_wmCOQW4LM2BHYugFWaU8crmipDtmGDsq0iozaQhe17CtM59tqCHSAtD8w646AkZU' \
--data-raw '{
"amount": 7100,
"currency": "EUR",
"confirm": true,
"customer_id": "test_mit1",
"email": "[email protected]",
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "pm_SFHEomDxVxWQg81PB0KU"
},
"payment_method": "card",
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "[email protected]"
}
}'
```
Response
```
{
"payment_id": "pay_i2b2h2D3OygZcX6xhllE",
"merchant_id": "postman_merchant_GHAction_3a560136-e947-4667-bb84-2f015fcc1196",
"status": "succeeded",
"amount": 7100,
"net_amount": 7100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 7100,
"connector": "paybox",
"client_secret": "pay_i2b2h2D3OygZcX6xhllE_secret_3F2pXPqmDmDl7aOu0zpx",
"created": "2024-10-29T17:41:52.979Z",
"currency": "EUR",
"customer_id": "test_mit1",
"customer": {
"id": "test_mit1",
"name": "Joseph Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0007",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "John T",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "[email protected]"
},
"order_details": null,
"email": "[email protected]",
"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": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "test_mit1",
"created_at": 1730223712,
"expires": 1730227312,
"secret": "epk_d5ce670fd4f44281b90228c5f480816a"
},
"manual_retry_allowed": false,
"connector_transaction_id": "0080031906",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_hl5seUYAuPOk5MN8bSGO",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_DsQkwRcnsQVWJ7jbsSZl",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-29T17:56:52.979Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_SFHEomDxVxWQg81PB0KU",
"payment_method_status": "active",
"updated": "2024-10-29T17:41:54.740Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "SM@LpCp@L@C"
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/router_data.rs`
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
- ... and 1 more files
**4. Core Business Logic**
- `crates/router/src/core/authentication/transformers.rs`
- `crates/router/src/core/fraud_check/flows/checkout_flow.rs`
- `crates/router/src/core/fraud_check/flows/fulfillment_flow.rs`
- ... and 14 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs`
- ... and 24 more files
**6. Type Definitions**
- `crates/router/src/types.rs`
- `crates/router/src/types/storage/payment_method.rs`
**7. Utils**
- `crates/common_utils/src/lib.rs`
**8. Other**
- `crates/router/src/consts.rs`
- `crates/router/src/services/conversion_impls.rs`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (18 changes)
- Extend existing types with new fields (152 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 37513e0f:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- function: pub::new
- function: pub::get_connector_mandate_id
- function: pub::get_payment_method_id
- function: pub::get_mandate_metadata
- function: pub::get_connector_mandate_request_reference_id
- function: pub::update
- impl: impl ConnectorMandateReferenceId
**crates/common_utils/src/lib.rs**
Add:
- function: pub::generate_id_with_len
**crates/diesel_models/src/payment_attempt.rs**
Add:
- function: pub::get_connector_mandate_request_reference_id
- impl: impl ConnectorMandateReferenceId
**crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Modify existing code
**crates/router/src/connector/aci/transformers.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
**crates/router/src/connector/authorizedotnet/transformers.rs**
Modify existing code
**crates/router/src/connector/bamboraapac/transformers.rs**
Modify existing code
**crates/router/src/connector/bankofamerica/transformers.rs**
Modify existing code
**crates/router/src/connector/braintree/transformers.rs**
Modify existing code
**crates/router/src/connector/cybersource/transformers.rs**
Modify existing code
**crates/router/src/connector/globalpay/transformers.rs**
Modify existing code
**crates/router/src/connector/gocardless/transformers.rs**
Modify existing code
**crates/router/src/connector/multisafepay/transformers.rs**
Modify existing code
**crates/router/src/connector/noon/transformers.rs**
Modify existing code
**crates/router/src/connector/nuvei/transformers.rs**
Modify existing code
**crates/router/src/connector/paybox.rs**
Add:
- function: private::build_request
- function: private::validate_mandate_payment
**crates/router/src/connector/paybox/transformers.rs**
Add:
- struct: pub::CardMandateInfo
**crates/router/src/connector/payme/transformers.rs**
Modify existing code
**crates/router/src/connector/stripe/transformers.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Add:
- function: private::get_connector_mandate_request_reference_id
- function: private::get_connector_mandate_request_reference_id
**crates/router/src/connector/wellsfargo/transformers.rs**
Modify existing code
**crates/router/src/consts.rs**
Modify existing code
**crates/router/src/core/authentication/transformers.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/checkout_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/fulfillment_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/record_return.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/sale_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/transaction_flow.rs**
Modify existing code
**crates/router/src/core/mandate/utils.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
**crates/router/src/core/payments/tokenization.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Modify existing code
**crates/router/src/core/webhooks/utils.rs**
Modify existing code
**crates/router/src/services/conversion_impls.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/src/types/storage/payment_method.rs**
Modify existing code
**crates/router/tests/connectors/aci.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
|
{"pr_number": 6378, "pr_title": "feat(connector): [Paybox] Add mandates Flow for Paybox", "merged_at": "2024-10-30T16:38:12Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/fraud_check/flows/checkout_flow.rs", "crates/router/src/core/fraud_check/flows/fulfillment_flow.rs", "crates/router/src/core/fraud_check/flows/record_return.rs", "crates/router/src/core/fraud_check/flows/sale_flow.rs", "crates/router/src/core/fraud_check/flows/transaction_flow.rs", "crates/router/src/core/mandate/utils.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/payment_update.rs", "crates/router/src/core/payments/tokenization.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs", "crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/aci/transformers.rs", "crates/router/src/connector/adyen/transformers.rs", "crates/router/src/connector/authorizedotnet/transformers.rs", "crates/router/src/connector/bamboraapac/transformers.rs", "crates/router/src/connector/bankofamerica/transformers.rs", "crates/router/src/connector/braintree/transformers.rs", "crates/router/src/connector/cybersource/transformers.rs", "crates/router/src/connector/globalpay/transformers.rs", "crates/router/src/connector/gocardless/transformers.rs", "crates/router/src/connector/multisafepay/transformers.rs", "crates/router/src/connector/noon/transformers.rs", "crates/router/src/connector/nuvei/transformers.rs", "crates/router/src/connector/paybox.rs", "crates/router/src/connector/paybox/transformers.rs", "crates/router/src/connector/payme/transformers.rs", "crates/router/src/connector/stripe/transformers.rs", "crates/router/src/connector/utils.rs", "crates/router/src/connector/wellsfargo/transformers.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/aci.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/router/src/types.rs", "crates/router/src/types/storage/payment_method.rs"], "utils": ["crates/common_utils/src/lib.rs"], "other": ["crates/router/src/consts.rs", "crates/router/src/services/conversion_impls.rs"]}, "change_types": {"structs_added": 2, "functions_added": 18, "fields_added": 152, "imports_added": 6, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(samsung_pay): collect customer address details form Samsung Pay based on business profile config and connector required fields
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This pull request includes changes to enhance the handling of billing and shipping address requirements for Samsung Pay and Google Pay session tokens. The most important changes include adding new fields to the `SamsungPaySessionTokenResponse` struct, updating the `create_samsung_pay_session_token` function to include these new fields, and refactoring the code to use helper functions for determining address requirements.
Enhancements to session token handling:
* Added `billing_address_required` and `shipping_address_required` fields to the `SamsungPaySessionTokenResponse` struct.
* Updated the `create_samsung_pay_session_token` function to include the new address requirement fields and refactored the logic to use helper functions for determining if billing and shipping addresses are required.
Refactoring for address requirement determination:
* Introduced the `is_billing_address_required_to_be_collected_from_wallet` and `is_shipping_address_required_to_be_collected_form_wallet` functions to encapsulate the logic for determining address requirements based on business profile settings and connector fields.
* Refactored the `create_gpay_session_token` function to use the new helper functions for determining billing and shipping address requirements.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Collect the customer's address details from Samsung Pay during payment to enhance the customer experience
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
-> Create a merchant connector account with the samsung pay enabled for it
-> Create a payment with confirm false
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api-key' \
--data-raw '{
"amount": 6100,
"currency": "USD",
"confirm": false,
"business_country": "US",
"business_label": "default",
"amount_to_capture": 6100,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"return_url": "https://google.com",
"email": "[email protected]",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"customer_id": "1739970997",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
}
}'
```
```
{
"payment_id": "pay_2B9WMNGYhzpVoUHGxvpS",
"merchant_id": "merchant_1739965434",
"status": "requires_payment_method",
"amount": 6100,
"net_amount": 6100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_2B9WMNGYhzpVoUHGxvpS_secret_vQZZ2vDYnZJOUi8JDVdL",
"created": "2025-02-19T13:16:04.153Z",
"currency": "USD",
"customer_id": "1739970964",
"customer": {
"id": "1739970964",
"name": "Joseph Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": null,
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "1739970964",
"created_at": 1739970964,
"expires": 1739974564,
"secret": "epk_40529c632d7946338b7ad09430a613e6"
},
"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_2STAgRa16ISVgMLO11F2",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-19T13:31:04.153Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-19T13:16:04.173Z",
"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
}
```
-> Set the below profile configuration
```
curl --location 'http://localhost:8080/account/merchant_1739965434/business_profile/pro_2STAgRa16ISVgMLO11F2' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api-key' \
--data '{
"collect_billing_details_from_wallet_connector": false,
"collect_shipping_details_from_wallet_connector": false,
"always_collect_shipping_details_from_wallet_connector": true,
"always_collect_billing_details_from_wallet_connector": true,
}'
```
```
{
"merchant_id": "merchant_1739965434",
"profile_id": "pro_2STAgRa16ISVgMLO11F2",
"profile_name": "US_default",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "0txdls9EorK9Gzx1OYRGV0X9xS87pn5sUxfFHFlfq9endVIs7S1iqV5TnCsZUYD7",
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": null,
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"metadata": null,
"routing_algorithm": null,
"intent_fulfillment_time": 900,
"frm_routing_algorithm": null,
"payout_routing_algorithm": null,
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"extended_card_info_config": null,
"collect_shipping_details_from_wallet_connector": false,
"collect_billing_details_from_wallet_connector": false,
"always_collect_shipping_details_from_wallet_connector": true,
"always_collect_billing_details_from_wallet_connector": true,
"is_connector_agnostic_mit_enabled": true,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null,
"tax_connector_id": null,
"is_tax_connector_enabled": false,
"is_network_tokenization_enabled": false,
"is_auto_retries_enabled": false,
"max_auto_retries_enabled": null,
"always_request_extended_authorization": null,
"is_click_to_pay_enabled": false,
"authentication_product_ids": null
}
```
-> For this profile configuration the `shipping_address_required` and `billing_address_required` be true in the session resposne
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: api-key' \
--data '{
"payment_id": "pay_2B9WMNGYhzpVoUHGxvpS",
"wallets": [],
"client_secret": "pay_2B9WMNGYhzpVoUHGxvpS_secret_vQZZ2vDYnZJOUi8JDVdL"
}'
```
```
{
"payment_id": "pay_2B9WMNGYhzpVoUHGxvpS",
"client_secret": "pay_2B9WMNGYhzpVoUHGxvpS_secret_vQZZ2vDYnZJOUi8JDVdL",
"session_token": [
{
"wallet_name": "google_pay",
"merchant_info": {
"merchant_name": "Stripe"
},
"shipping_address_required": true,
"email_required": true,
"shipping_address_parameters": {
"phone_number_required": true
},
"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": true,
"billing_address_parameters": {
"phone_number_required": true,
"format": "FULL"
}
},
"tokenization_specification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "stripe",
"stripe:version": "2018-10-31",
"stripe:publishableKey": "pk_test_51Msk2GAGHc77EJXX78h549SX2uaOnEkUYqBfjcoD05PIpAnDkYxMn8nQ4d19im85NQuX4Z6WDyHaUw2fFTPBWsIY00Wa7oNerO"
}
}
}
],
"transaction_info": {
"country_code": "US",
"currency_code": "USD",
"total_price_status": "Final",
"total_price": "61.00"
},
"delayed_session_token": false,
"connector": "cybersource",
"sdk_next_action": {
"next_action": "confirm"
},
"secrets": null
},
{
"wallet_name": "samsung_pay",
"version": "2",
"service_id": "49400558c67f4a97b3925f",
"order_number": "pay-2B9WMNGYhzpVoUHGxvpS",
"merchant": {
"name": "Hyperswitch",
"url": null,
"country_code": "IN"
},
"amount": {
"option": "FORMAT_TOTAL_PRICE_ONLY",
"currency_code": "USD",
"total": "61.00"
},
"protocol": "PROTOCOL3DS",
"allowed_brands": [
"visa",
"masterCard",
"amex",
"discover"
],
"billing_address_required": true,
"shipping_address_required": true
},
{
"wallet_name": "apple_pay",
"session_token_data": {},
"payment_request_data": {
"country_code": "AU",
"currency_code": "USD",
"total": {
"label": "applepay",
"type": "final",
"amount": "61.00"
},
"merchant_capabilities": [
"supports3DS"
],
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_identifier": "merchant.sandbox.hyperswitch",
"required_billing_contact_fields": [
"postalAddress"
],
"required_shipping_contact_fields": [
"postalAddress",
"phone",
"email"
]
},
"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
}
]
}
```
-> Set the below profile configuration
```
curl --location 'http://localhost:8080/account/merchant_1739965434/business_profile/pro_2STAgRa16ISVgMLO11F2' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api-key' \
--data '{
"collect_billing_details_from_wallet_connector": true,
"collect_shipping_details_from_wallet_connector": true,
"always_collect_shipping_details_from_wallet_connector": false,
"always_collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": true
}'
```
```
{
"merchant_id": "merchant_1739965434",
"profile_id": "pro_2STAgRa16ISVgMLO11F2",
"profile_name": "US_default",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "0txdls9EorK9Gzx1OYRGV0X9xS87pn5sUxfFHFlfq9endVIs7S1iqV5TnCsZUYD7",
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": null,
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"metadata": null,
"routing_algorithm": null,
"intent_fulfillment_time": 900,
"frm_routing_algorithm": null,
"payout_routing_algorithm": null,
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"extended_card_info_config": null,
"collect_shipping_details_from_wallet_connector": true,
"collect_billing_details_from_wallet_connector": true,
"always_collect_shipping_details_from_wallet_connector": false,
"always_collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": true,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null,
"tax_connector_id": null,
"is_tax_connector_enabled": false,
"is_network_tokenization_enabled": false,
"is_auto_retries_enabled": false,
"max_auto_retries_enabled": null,
"always_request_extended_authorization": null,
"is_click_to_pay_enabled": false,
"authentication_product_ids": null
}
```
-> As per the above profile configuration the the `billing_address_required` will be `true` as the cybersource requires billing derails to be passed and `shipping_address_required` will be `false` as shipping details are not required by cybserourec.
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: api-key' \
--data '{
"payment_id": "pay_2B9WMNGYhzpVoUHGxvpS",
"wallets": [],
"client_secret": "pay_2B9WMNGYhzpVoUHGxvpS_secret_vQZZ2vDYnZJOUi8JDVdL"
}'
```
```
{
"payment_id": "pay_2B9WMNGYhzpVoUHGxvpS",
"client_secret": "pay_2B9WMNGYhzpVoUHGxvpS_secret_vQZZ2vDYnZJOUi8JDVdL",
"session_token": [
{
"wallet_name": "google_pay",
"merchant_info": {
"merchant_name": "Stripe"
},
"shipping_address_required": false,
"email_required": true,
"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": true,
"billing_address_parameters": {
"phone_number_required": true,
"format": "FULL"
}
},
"tokenization_specification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "stripe",
"stripe:version": "2018-10-31",
"stripe:publishableKey": "pk_test_51Msk2GAGHc77EJXX78h549SX2uaOnEkUYqBfjcoD05PIpAnDkYxMn8nQ4d19im85NQuX4Z6WDyHaUw2fFTPBWsIY00Wa7oNerO"
}
}
}
],
"transaction_info": {
"country_code": "US",
"currency_code": "USD",
"total_price_status": "Final",
"total_price": "61.00"
},
"delayed_session_token": false,
"connector": "cybersource",
"sdk_next_action": {
"next_action": "confirm"
},
"secrets": null
},
{
"wallet_name": "samsung_pay",
"version": "2",
"service_id": "49400558c67f4a97b3925f",
"order_number": "pay-2B9WMNGYhzpVoUHGxvpS",
"merchant": {
"name": "Hyperswitch",
"url": null,
"country_code": "IN"
},
"amount": {
"option": "FORMAT_TOTAL_PRICE_ONLY",
"currency_code": "USD",
"total": "61.00"
},
"protocol": "PROTOCOL3DS",
"allowed_brands": [
"visa",
"masterCard",
"amex",
"discover"
],
"billing_address_required": true,
"shipping_address_required": false
},
{
"wallet_name": "apple_pay",
"session_token_data": {},
"payment_request_data": {
"country_code": "AU",
"currency_code": "USD",
"total": {
"label": "applepay",
"type": "final",
"amount": "61.00"
},
"merchant_capabilities": [
"supports3DS"
],
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_identifier": "merchant.sandbox.hyperswitch",
"required_billing_contact_fields": [
"postalAddress"
],
"required_shipping_contact_fields": [
"phone",
"email"
]
},
"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:**
- Implement new functions (3 changes)
- Extend existing types with new fields (13 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit c14519eb:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/router/src/core/payments/flows/session_flow.rs**
Add:
- function: private::is_billing_address_required_to_be_collected_from_wallet
- function: private::is_shipping_address_required_to_be_collected_form_wallet
|
{"pr_number": 7320, "pr_title": "feat(samsung_pay): collect customer address details form Samsung Pay based on business profile config and connector required fields", "merged_at": "2025-02-22T08:38:20Z", "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": {"functions_added": 3, "fields_added": 13, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [tesouro] apple pay
## 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 apple pay hyperswitch decryption flow (simplified and manual) and predecrypt flow to tesouro connector.
connector does not support connector decryption flow. so, we throw an error in that case stating decrypted data is missing.
tesouro does not have any required fields. neither do they have mentioned the supported countries and currencies on their website.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
apple pay implementation for tesouro.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<details>
<summary>Payment Initiate</summary>
```bash
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_hKUjE6W7xfZ67kfdf8AWPhxxcwvfnjE4i44ZlWKg99tN8cgLZKEmH2B3kjiSfC86' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": false,
"business_country": "US",
"business_label": "default",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```json
{
"payment_id": "pay_8U1u9AScGkdqId2cw90j",
"merchant_id": "postman_merchant_GHAction_1759343566",
"status": "requires_payment_method",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_8U1u9AScGkdqId2cw90j_secret_RJ0E2vpWdVEFOw8qCG75",
"created": "2025-10-01T18:41:45.936Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1759344105,
"expires": 1759347705,
"secret": "epk_2c9e687b5cb04ed9a24331dba7ea46e4"
},
"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_ygYiPJT37sDESMdrJARc",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-01T18:56:45.936Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-01T18:41:45.966Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
</details>
<details>
<summary>Session Call</summary>
```bash
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_ab34d6e61c124a7c90553f1a03895e7f' \
--data '{
"payment_id": "pay_8U1u9AScGkdqId2cw90j",
"wallets": [],
"client_secret": "pay_8U1u9AScGkdqId2cw90j_secret_RJ0E2vpWdVEFOw8qCG75"
}'
```
```json
{
"payment_id": "pay_8U1u9AScGkdqId2cw90j",
"client_secret": "pay_8U1u9AScGkdqId2cw90j_secret_RJ0E2vpWdVEFOw8qCG75",
"session_token": [
{
"wallet_name": "apple_pay",
"session_token_data": {
"epoch_timestamp": 1759344108289,
"expires_at": 1759347708289,
"merchant_session_identifier": "SS...F9",
"nonce": "11fd4a9e",
"merchant_identifier": "8C...1C4",
"domain_name": "hyperswitch.app",
"display_name": "apple pay",
"signature": "30...00",
"operational_analytics_identifier": "apple pay:8C...C4",
"retries": 0,
"psp_id": "8C...C4"
},
"payment_request_data": {
"country_code": "US",
"currency_code": "USD",
"total": {
"label": "applepay",
"type": "final",
"amount": "10.00"
},
"merchant_capabilities": [
"supports3DS"
],
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_identifier": "merchant.lol"
},
"connector": "tesouro",
"delayed_session_token": false,
"sdk_next_action": {
"next_action": "confirm"
},
"connector_reference_id": null,
"connector_sdk_public_key": null,
"connector_merchant_id": null
}
]
}
```
</details>
<details>
<summary>Confirm (encrypted)</summary>
```bash
curl --location 'http://localhost:8080/payments/pay_8U1u9AScGkdqId2cw90j/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_hKUjE6W7xfZ67kfdf8AWPhxxcwvfnjE4i44ZlWKg99tN8cgLZKEmH2B3kjiSfC86' \
--data '{
"confirm": true,
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "eyJ...0=",
"payment_method": {
"display_name": "Visa 4228",
"network": "Visa",
"type": "debit"
},
"transaction_identifier": "a0...4a"
}
},
"billing": null
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
}
}'
```
```json
{
"payment_id": "pay_8U1u9AScGkdqId2cw90j",
"merchant_id": "postman_merchant_GHAction_1759343566",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "tesouro",
"client_secret": "pay_8U1u9AScGkdqId2cw90j_secret_RJ0E2vpWdVEFOw8qCG75",
"created": "2025-10-01T18:41:45.936Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "4228",
"card_network": "Visa",
"type": "debit"
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "apple_pay",
"connector_label": "tesouro_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "51f7dc0d-9ef6-11f0-9688-dcdaa6fb1c39",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_ygYiPJT37sDESMdrJARc",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_k7pfQpgEkVycrW3tJENd",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-01T18:56:45.936Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"referer": null,
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"os_version": null,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"device_model": null,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"accept_language": "en",
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-01T18:42:02.385Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
</details>
<details>
<summary>Confirm (decrypted)</summary>
```bash
curl --location 'http://localhost:8080/payments/pay_HFpibksuPOgO38jcnbBo/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_hKUjE6W7xfZ67kfdf8AWPhxxcwvfnjE4i44ZlWKg99tN8cgLZKEmH2B3kjiSfC86' \
--data '{
"confirm": true,
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": {
"application_primary_account_number": "5204245253050839",
"application_expiration_month": "01",
"application_expiration_year": "2030",
"payment_data": {
"online_payment_cryptogram": "A...A=",
"eci_indicator": "1"
}
},
"payment_method": {
"display_name": "Visa 4228",
"network": "Mastercard",
"type": "debit"
},
"transaction_identifier": "a0...4a"
}
},
"billing": null
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
}
}'
```
```json
{
"payment_id": "pay_HFpibksuPOgO38jcnbBo",
"merchant_id": "postman_merchant_GHAction_1759343566",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "tesouro",
"client_secret": "pay_HFpibksuPOgO38jcnbBo_secret_pMGALR8i7bktY13BeCTk",
"created": "2025-10-01T19:20:30.669Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "4228",
"card_network": "Mastercard",
"type": "debit"
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "apple_pay",
"connector_label": "tesouro_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "b42f1ccf-9efb-11f0-a1f6-231a9dfdbf4e",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_ygYiPJT37sDESMdrJARc",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_k7pfQpgEkVycrW3tJENd",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-01T19:35:30.669Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"referer": null,
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"os_version": null,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"device_model": null,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"accept_language": "en",
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-01T19:20:34.613Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
</details>
<details>
<summary>Refunds</summary>
```bash
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_hKUjE6W7xfZ67kfdf8AWPhxxcwvfnjE4i44ZlWKg99tN8cgLZKEmH2B3kjiSfC86' \
--data '{
"payment_id": "pay_HFpibksuPOgO38jcnbBo",
"amount": 600,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```json
{
"refund_id": "ref_IV3ODttiHN4xLH4uc42T",
"payment_id": "pay_HFpibksuPOgO38jcnbBo",
"amount": 600,
"currency": "USD",
"status": "succeeded",
"reason": "Customer returned product",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"error_message": null,
"error_code": null,
"unified_code": null,
"unified_message": null,
"created_at": "2025-10-01T19:21:30.966Z",
"updated_at": "2025-10-01T19:21:31.446Z",
"connector": "tesouro",
"profile_id": "pro_ygYiPJT37sDESMdrJARc",
"merchant_connector_id": "mca_k7pfQpgEkVycrW3tJENd",
"split_refunds": null,
"issuer_error_code": null,
"issuer_error_message": null
}
```
</details>
<details>
<summary>Wasm and Dashboard</summary>
wasm:
<img width="616" height="636" alt="image" src="https://github.com/user-attachments/assets/b8d14f7b-f9fe-4d7c-8ed6-6ab3b137df1c" />
dashboard
dashboard changes yet to be made from frontend guys. post that it should work
<img width="1192" height="603" alt="image" src="https://github.com/user-attachments/assets/3dc33239-f8ba-4e90-a5fe-7427739d2058" />
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `just clippy && just clippy_v2`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
- ... and 2 more files
**2. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**3. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (2 changes)
- Extend existing types with new fields (19 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 8375629c:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/tesouro.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs**
Add:
- function: private::get_apple_pay_data
- function: private::try_from
- struct: pub::TesouroNetworkTokenPassThroughDetails
- enum: pub::TesouroWalletType
- impl: impl TryFrom<(&ApplePayWalletData, Option<&PaymentMethodToken>)> for TesouroPaymentMethodDetails
|
{"pr_number": 9648, "pr_title": "feat(connector): [tesouro] apple pay", "merged_at": "2025-10-07T08:22:58Z", "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/tesouro.rs", "crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 2, "functions_added": 2, "enums_added": 1, "fields_added": 19, "imports_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(analytics): add `customer_id` as filter for payment intents
## 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 `customer_id` as a filter for payment intents
- Added `payment_processed_amount` metric for `payment_intents` table
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Filter out payments for a particular customer through the `customer_id`
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Hit the curl:
Metric data would be obtained based on the customer_id filter applied.
```bash
curl --location 'http://localhost:8080/analytics/v2/org/metrics/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'QueryType: SingleStatTimeseries' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTcyOTI0ODM1MCwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSJ9.TQD6wYkiTXlTvPW3-mH8FzEP1d7hXw9SmWgjVMH7flk' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-09-11T00:00:00Z",
"endTime": "2024-10-26T09:22:30Z"
},
"filters": {
"customer_id": ["StripeCustomer"]
},
"mode": "ORDER",
"source": "BATCH",
"metrics": [
"payment_processed_amount"
]
}
]'
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/analytics/payment_intents.rs`
**2. Database Layer (Queries & Schema)**
- `crates/analytics/src/query.rs`
**3. Core Business Logic**
- `crates/analytics/src/payment_intents/core.rs`
**4. Type Definitions**
- `crates/analytics/src/payment_intents/types.rs`
**5. Other**
- `crates/analytics/src/payment_intents/filters.rs`
- `crates/analytics/src/payment_intents/metrics.rs`
- `crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (22 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit d697def0:
Files to modify:
**crates/analytics/src/payment_intents/core.rs**
Modify existing code
**crates/analytics/src/payment_intents/filters.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics.rs**
Add:
- mod: private::payment_processed_amount
**crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs**
Add:
- function: private::load_metrics
- struct: pub::PaymentProcessedAmount
- impl: impl super::PaymentIntentMetric<T> for PaymentProcessedAmount
**crates/analytics/src/payment_intents/types.rs**
Modify existing code
**crates/analytics/src/query.rs**
Add:
- function: private::to_sql
- impl: impl ToSql<T> for common_utils::id_type::CustomerId
**crates/analytics/src/sqlx.rs**
Modify existing code
**crates/api_models/src/analytics/payment_intents.rs**
Modify existing code
|
{"pr_number": 6344, "pr_title": "feat(analytics): add `customer_id` as filter for payment intents", "merged_at": "2024-10-30T10:11:12Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics/payment_intents.rs"], "database": ["crates/analytics/src/query.rs"], "core_business": ["crates/analytics/src/payment_intents/core.rs"], "types": ["crates/analytics/src/payment_intents/types.rs"], "other": ["crates/analytics/src/payment_intents/filters.rs", "crates/analytics/src/payment_intents/metrics.rs", "crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs", "crates/analytics/src/sqlx.rs"]}, "change_types": {"functions_added": 2, "fields_added": 22, "imports_added": 9, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(cypress): add multiple creds and flags support
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR introduces 2 new features:
- Multiple credentials for a connector
- Configuration flags
closes #6645 (check this issue for detailed documentation / flow / explanation)
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 need to run tests against multiple connector api keys for a single connector
- We also need configuration flag support to selectively grant a test certain features / options
## How did you test 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 Cybersource with `multiple creds` (takes only from first `connector_1`):
<img width="594" alt="image" src="https://github.com/user-attachments/assets/7c05742c-6331-417a-8699-731285463560">
Cybersource with `multiple creds` (along with `incremental auth`):
<img width="554" alt="image" src="https://github.com/user-attachments/assets/664defa0-2fa4-4189-82f1-987421a48374">
(incremental auth fails from the connector's end and hence 4 failures)
Stripe:
<img width="676" alt="image" src="https://github.com/user-attachments/assets/cc1f2c16-bc9d-417e-94da-18870d9399cd">
Wise:
<img width="567" alt="image" src="https://github.com/user-attachments/assets/512e8bbc-c979-4791-8263-3253e61e193c">
PML:
<img width="549" alt="image" src="https://github.com/user-attachments/assets/e53a72e0-fddc-4351-8557-07058e223be8">
have disabled incremental auth from executing:
<img width="680" alt="image" src="https://github.com/user-attachments/assets/e2cd2e96-326e-422a-a9c4-21bd5a2b86c2">
trustpay refunds (multiple creds):
<img width="675" alt="image" src="https://github.com/user-attachments/assets/7fcb908f-de34-4d28-ac10-e4082ad3d54c">
i commented iDEAL redirections to check, error is being thrown from connector's end and there's nothing much i can do:
<img width="607" alt="image" src="https://github.com/user-attachments/assets/689979c8-d044-4b5f-a5a8-9ea8e15860e1">
<img width="1364" alt="image" src="https://github.com/user-attachments/assets/b0261af6-68c7-445f-af79-5e9d16bdc7fa">
<img width="555" alt="image" src="https://github.com/user-attachments/assets/fae0d997-695b-4db2-8f3e-0afad44c9c3e">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `prettier . --write`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Utils**
- `cypress-tests/cypress/utils/featureFlags.js`
**2. Tests**
- `.github/workflows/cypress-tests-runner.yml`
- `cypress-tests/.gitignore`
- `cypress-tests/.prettierrc`
- ... and 64 more files
**Code Patterns Applied:**
- Extend existing types with new fields (795 changes)
- Add conditional logic for feature flags or filtering (400 changes)
|
{"pr_number": 6588, "pr_title": "feat(cypress): add multiple creds and flags support", "merged_at": "2024-12-03T11:39:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "refund", "connector"]}, "hierarchy": {"utils": ["cypress-tests/cypress/utils/featureFlags.js"], "tests": [".github/workflows/cypress-tests-runner.yml", "cypress-tests/.gitignore", "cypress-tests/.prettierrc", "cypress-tests/.prettierrc.json", "cypress-tests/cypress.config.js", "cypress-tests/cypress.env.json", "cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js", "cypress-tests/cypress/e2e/PaymentMethodListUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentMethodListUtils/Stripe.js", "cypress-tests/cypress/e2e/PaymentMethodListUtils/Utils.js", "cypress-tests/cypress/e2e/PaymentTest/00001-AccountCreate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00003-ConnectorCreate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00004-NoThreeDSAutoCapture.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00005-ThreeDSAutoCapture.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00006-NoThreeDSManualCapture.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00007-VoidPayment.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00008-SyncPayment.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00009-RefundPayment.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00010-SyncRefund.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00011-CreateSingleuseMandate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00012-CreateMultiuseMandate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00013-ListAndRevokeMandate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00014-SaveCardFlow.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00015-ZeroAuthMandate.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00016-ThreeDSManualCapture.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00017-BankTransfers.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00018-BankRedirect.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00019-MandatesUsingPMID.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00020-MandatesUsingNTID.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00021-UPI.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00022-Variations.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00023-PaymentMethods.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00024-ConnectorAgnostic.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00025-ConfigTest.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00026-IncrementalAuth.cy.js", "cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js", "cypress-tests/cypress/e2e/PaymentUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js", "cypress-tests/cypress/e2e/PaymentUtils/Elavon.js", "cypress-tests/cypress/e2e/PaymentUtils/Fiuu.js", "cypress-tests/cypress/e2e/PaymentUtils/Nexixpay.js", "cypress-tests/cypress/e2e/PaymentUtils/Nmi.js", "cypress-tests/cypress/e2e/PaymentUtils/Noon.js", "cypress-tests/cypress/e2e/PaymentUtils/Novalnet.js", "cypress-tests/cypress/e2e/PaymentUtils/Paybox.js", "cypress-tests/cypress/e2e/PaymentUtils/Paypal.js", "cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js", "cypress-tests/cypress/e2e/PaymentUtils/Utils.js", "cypress-tests/cypress/e2e/PaymentUtils/WellsFargo.js", "cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js", "cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js", "cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js", "cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js", "cypress-tests/cypress/e2e/PayoutUtils/Commons.js", "cypress-tests/cypress/e2e/PayoutUtils/Utils.js", "cypress-tests/cypress/e2e/RoutingTest/00000-PriorityRouting.cy.js", "cypress-tests/cypress/e2e/RoutingTest/00001-VolumeBasedRouting.cy.js", "cypress-tests/cypress/e2e/RoutingTest/00002-RuleBasedRouting.cy.js", "cypress-tests/cypress/e2e/RoutingTest/00003-Retries.cy.js", "cypress-tests/cypress/e2e/RoutingUtils/Commons.js", "cypress-tests/cypress/e2e/RoutingUtils/Utils.js", "cypress-tests/cypress/fixtures/create-ntid-mit.json", "cypress-tests/cypress/support/commands.js", "cypress-tests/cypress/support/redirectionHandler.js", "cypress-tests/eslint.config.js", "cypress-tests/package-lock.json", "cypress-tests/package.json"]}, "change_types": {"fields_added": 795, "conditionals_added": 400}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(connector): [AIRWALLEX] Update production endpoint
## 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 -->
Update production endpoint for connector Airwallex (https://api.airwallex.com/)
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
https://github.com/juspay/hyperswitch/issues/6633
## How did you test 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 config changes hence no testing required
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Configuration Files**
- `config/deployments/production.toml`
|
{"pr_number": 6632, "pr_title": "feat(connector): [AIRWALLEX] Update production endpoint", "merged_at": "2024-11-21T21:06:12Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"config": ["config/deployments/production.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(router): Return psp_tokenization_enabled in Customer PML
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Added `psp_tokenization_enabled` field to `CustomerPaymentMethod` that denotes whether `psp_tokenization` is enabled for a saved payment method
### 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 #7518
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
- Create a Payment Method Session
NOTE: `psp_tokenization` field is required to generate token (Set `psp_tokenization_enabled` to `true`). Its value can either be `multi_use` or `single_use`.
```
curl --location 'http://localhost:8080/v2/payment-methods-session' \
--header 'x-profile-id: pro_piGRXWnlda2RVykbLnUU' \
--header 'Authorization: api-key=dev_m7AYHTfChsNPrDsCJodKhqKiRVwgW5dzawo2T3lHGrmkrfkesXVvI3LExORXwRcW' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_m7AYHTfChsNPrDsCJodKhqKiRVwgW5dzawo2T3lHGrmkrfkesXVvI3LExORXwRcW' \
--data-raw '{
"customer_id": "12345_cus_0195ae660fb270e28ea754519806b702",
"billing": {
"address": {
"first_name": "John",
"last_name": "Dough"
},
"email": "[email protected]"
},
"psp_tokenization": {
"tokenization_type": "multi_use"
}
}'
```
- Confirm the Payment Method Session
```
curl --location 'http://localhost:8080/v2/payment-methods-session/12345_pms_0195ae661bbc7d60a35f95ab5d29fe52/confirm' \
--header 'x-profile-id: pro_piGRXWnlda2RVykbLnUU' \
--header 'Authorization: publishable-key=pk_dev_04fccc9893564ead968e58bff3b8068b,client-secret=cs_0195ae661bbd70e39efd4f332f062b35' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_m7AYHTfChsNPrDsCJodKhqKiRVwgW5dzawo2T3lHGrmkrfkesXVvI3LExORXwRcW' \
--data '{
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "05",
"card_exp_year": "25",
"card_holder_name": "John Doe",
"card_cvc": "100"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit"
}'
```
Response:
```json
{
"id": "12345_pms_0195ae661bbc7d60a35f95ab5d29fe52",
"customer_id": "12345_cus_0195ae660fb270e28ea754519806b702",
"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": "[email protected]"
},
"psp_tokenization": {
"tokenization_type": "multi_use",
"connector_id": null
},
"network_tokenization": null,
"expires_at": "2025-03-19T12:49:42.237Z",
"client_secret": "CLIENT_SECRET_REDACTED",
"return_url": null,
"next_action": null,
"authentication_details": {
"status": "succeeded",
"error": null
},
"associated_payment_methods": null
}
```
- Retrieve Payment Method:
```
curl --location 'http://localhost:8080/v2/payment-methods/12345_pm_0195ae669d8476d1bdcb54a3b266b5a6' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_piGRXWnlda2RVykbLnUU' \
--header 'X-Resource-Type: payment_method' \
--header 'api-key: dev_m7AYHTfChsNPrDsCJodKhqKiRVwgW5dzawo2T3lHGrmkrfkesXVvI3LExORXwRcW' \
--header 'Authorization: api-key=dev_m7AYHTfChsNPrDsCJodKhqKiRVwgW5dzawo2T3lHGrmkrfkesXVvI3LExORXwRcW'
```
Response:
```json
{
"id": "12345_pm_0195ae669d8476d1bdcb54a3b266b5a6",
"merchant_id": "cloth_seller_ofmnd07CcVEfqVvCSgAJ",
"customer_id": "12345_cus_0195ae660fb270e28ea754519806b702",
"payment_method_type": "card",
"payment_method_subtype": "credit",
"recurring_enabled": false,
"created": "2025-03-19T12:35:15.461Z",
"last_used_at": "2025-03-19T12:35:15.461Z",
"payment_method_data": {
"card": {
"issuer_country": null,
"last4_digits": "4242",
"expiry_month": "05",
"expiry_year": "25",
"card_holder_name": "John Doe",
"card_fingerprint": null,
"nick_name": null,
"card_network": null,
"card_isin": null,
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
}
},
"connector_tokens": [
{
"connector_id": "mca_8nVPkBONTcH6HgSf3u2W",
"token_type": "multi_use",
"status": "active",
"connector_token_request_reference_id": "jRkI9KrD9ndJsl4YUi",
"original_payment_authorized_amount": 0,
"original_payment_authorized_currency": "USD",
"metadata": null,
"token": "pm_1R4Lq4D5R7gDAGffpqWfb9lx"
}
],
"network_token": null
}
```
Customer Payment Methods List:
```
curl --location 'http://localhost:8080/v2/customers/12345_cus_0195ae660fb270e28ea754519806b702/saved-payment-methods' \
--header 'api-key: dev_m7AYHTfChsNPrDsCJodKhqKiRVwgW5dzawo2T3lHGrmkrfkesXVvI3LExORXwRcW' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_piGRXWnlda2RVykbLnUU' \
--header 'Authorization: api-key=dev_m7AYHTfChsNPrDsCJodKhqKiRVwgW5dzawo2T3lHGrmkrfkesXVvI3LExORXwRcW'
```
Response:
```json
{
"customer_payment_methods": [
{
"id": "12345_pm_0195ae669d8476d1bdcb54a3b266b5a6",
"customer_id": "12345_cus_0195ae660fb270e28ea754519806b702",
"payment_method_type": "card",
"payment_method_subtype": "credit",
"recurring_enabled": true,
"payment_method_data": {
"card": {
"issuer_country": null,
"last4_digits": "4242",
"expiry_month": "05",
"expiry_year": "25",
"card_holder_name": "John 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-03-19T12:35:15.461Z",
"requires_cvv": true,
"last_used_at": "2025-03-19T12:35:15.461Z",
"is_default": false,
"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": "[email protected]"
},
"network_tokenization": null,
"psp_tokenization_enabled": 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/admin.rs`
- `crates/api_models/src/payment_methods.rs`
**2. Core Business Logic**
- `crates/router/src/core/payment_methods/transformers.rs`
**3. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/openapi/src/openapi.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit a341e82d:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payment_methods.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/openapi/src/routes/payment_method.rs**
Modify existing code
**crates/router/src/core/payment_methods/transformers.rs**
Modify existing code
|
{"pr_number": 7519, "pr_title": "feat(router): Return psp_tokenization_enabled in Customer PML", "merged_at": "2025-03-20T10:04:56Z", "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/payment_methods/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes/payment_method.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(feature_matrix): add feature matrix for both paytm and phonepe
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [X] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Add Phonepe, Paytm supported payment methods, currencies and countries in feature matrix.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
Feature API Call
Request
```
curl --location 'http://localhost:8080/feature_matrix' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ____'
```
Response
```
{
"name": "PAYTM",
"display_name": "PAYTM",
"description": "Paytm is an Indian multinational fintech company specializing in digital payments and financial services. Initially known for its mobile wallet, it has expanded to include a payment bank, e-commerce, ticketing, and wealth management services.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "upi",
"payment_method_type": "upi_intent",
"payment_method_type_display_name": "UPI Intent",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"IND"
],
"supported_currencies": [
"INR"
]
},
{
"payment_method": "upi",
"payment_method_type": "upi_collect",
"payment_method_type_display_name": "UPI Collect",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"IND"
],
"supported_currencies": [
"INR"
]
}
],
"supported_webhook_flows": []
},
{
"name": "PAYU",
"display_name": "Payu",
"description": "PayU is a global fintech company providing online payment solutions, including card processing, UPI, wallets, and BNPL services across multiple markets ",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_type_display_name": "Debit Card",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "supported",
"no_three_ds": "not_supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"Interac",
"AmericanExpress",
"JCB",
"DinersClub",
"Discover",
"CartesBancaires",
"UnionPay"
],
"supported_countries": [
"WSM",
"BWA",
"MAR",
"TWN",
"TJK",
"KAZ",
"LAO",
"MEX",
"LBR",
"OMN",
"CRI",
"JPN",
"MDA",
"JOR",
"CMR",
"VNM",
"TZA",
"ROU",
"PYF",
"COL",
"ISL",
"AUS",
"ARG",
"GEO",
"SAU",
"CHL",
"CYM",
"GMB",
"ZWE",
"ZAF",
"URY",
"BHR",
"DJI",
"MWI",
"COM",
"UGA",
"AFG",
"MRT",
"CAN",
"SRB",
"GIB",
"GHA",
"GIN",
"SWZ",
"COD",
"SOM",
"ARM",
"SHN",
"BVT",
"PNG",
"PER",
"SYC",
"AZE",
"ETH",
"RWA",
"BIH",
"BHS",
"PAN",
"KOR",
"CPV",
"SUR",
"AND",
"ISR",
"EGY",
"TKM",
"NAM",
"TUN",
"GTM",
"NIC",
"POL",
"SGP",
"SLV",
"BEN",
"DNK",
"CZE",
"SLB",
"TTO",
"HTI",
"COK",
"BDI",
"GUY",
"LBN",
"FJI",
"AGO",
"KWT",
"LIE",
"LSO",
"BRA",
"HKG",
"MAC",
"MKD",
"HUN",
"HRV",
"FLK",
"VEN",
"BOL",
"ARE",
"ALB",
"ABW",
"BRN",
"THA",
"YEM",
"MOZ",
"GGY",
"TON",
"BMU",
"MYS",
"KGZ",
"MDV",
"BGR",
"BLZ",
"TUR",
"DOM",
"IDN",
"QAT",
"MNG",
"KHM",
"JAM",
"ZMB",
"CUW",
"UZB",
"VUT",
"SWE",
"NGA",
"ASM",
"HND",
"DZA",
"AIA",
"MDG",
"CHN",
"IRQ",
"BLR",
"PRY",
"BRB"
],
"supported_currencies": [
"MRU",
"TRY",
"RSD",
"SVC",
"CZK",
"EGP",
"WST",
"AOA",
"NAD",
"MVR",
"PEN",
"KHR",
"FKP",
"EUR",
"BOB",
"UYU",
"HKD",
"TMT",
"BGN",
"ISK",
"LRD",
"DZD",
"MWK",
"GYD",
"NZD",
"IQD",
"DJF",
"PLN",
"BYN",
"BBD",
"MKD",
"MXN",
"MYR",
"NIO",
"CRC",
"LSL",
"TWD",
"VND",
"ALL",
"MZN",
"VUV",
"XAF",
"NGN",
"KMF",
"AUD",
"TJS",
"HRK",
"AZN",
"GTQ",
"VES",
"IDR",
"CDF",
"CHF",
"ANG",
"BIF",
"NOK",
"YER",
"RWF",
"JMD",
"KWD",
"ILS",
"CVE",
"LBP",
"ZMW",
"MNT",
"SBD",
"GHS",
"PAB",
"AFN",
"GIP",
"USD",
"LAK",
"PGK",
"RON",
"AED",
"MAD",
"SEK",
"UZS",
"ZAR",
"TTD",
"KZT",
"AWG",
"FJD",
"HTG",
"JPY",
"ZWL",
"COP",
"CNY",
"PYG",
"ETB",
"SGD",
"BSD",
"UGX",
"XOF",
"CLP",
"JOD",
"DOP",
"SRD",
"BND",
"SZL",
"SCR",
"SHP",
"BHD",
"BZD",
"BMD",
"XPF",
"HNL",
"BWP",
"THB",
"TOP",
"DKK",
"MDL",
"KRW",
"BAM",
"BRL",
"ARS",
"KYD",
"TND",
"SOS",
"MGA",
"XCD",
"GNF",
"KGS",
"QAR",
"SAR",
"HUF",
"MOP",
"TZS",
"CAD",
"OMR",
"GBP",
"AMD",
"GEL",
"GMD"
]
},
{
"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": "not_supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"Interac",
"AmericanExpress",
"JCB",
"DinersClub",
"Discover",
"CartesBancaires",
"UnionPay"
],
"supported_countries": [
"VNM",
"KHM",
"ETH",
"SRB",
"QAT",
"BHR",
"NGA",
"HND",
"IRQ",
"UGA",
"NIC",
"PYF",
"JPN",
"ISL",
"ZWE",
"TWN",
"SAU",
"GGY",
"PNG",
"VEN",
"FLK",
"MWI",
"BMU",
"GUY",
"PER",
"MEX",
"AZE",
"TTO",
"LBN",
"AIA",
"GTM",
"RWA",
"MDV",
"ARM",
"BRN",
"COM",
"COK",
"SLV",
"SWE",
"COL",
"CUW",
"BHS",
"ISR",
"MDG",
"EGY",
"TUN",
"JOR",
"ALB",
"BRB",
"LAO",
"CYM",
"MDA",
"THA",
"YEM",
"MRT",
"SWZ",
"ARG",
"AFG",
"TZA",
"ABW",
"HRV",
"BGR",
"ROU",
"PAN",
"LIE",
"BIH",
"CHL",
"VUT",
"SGP",
"HUN",
"ZMB",
"CHN",
"BLR",
"SLB",
"BRA",
"HKG",
"CAN",
"DZA",
"CZE",
"WSM",
"OMN",
"GIN",
"KWT",
"MAR",
"AUS",
"KAZ",
"ASM",
"TON",
"SUR",
"BOL",
"DNK",
"UZB",
"MAC",
"GHA",
"HTI",
"SHN",
"MKD",
"CMR",
"BDI",
"DOM",
"TKM",
"SOM",
"FJI",
"POL",
"KGZ",
"SYC",
"BWA",
"TJK",
"AGO",
"BVT",
"NAM",
"AND",
"ARE",
"CPV",
"MOZ",
"MYS",
"BEN",
"COD",
"LSO",
"PRY",
"GEO",
"GIB",
"MNG",
"DJI",
"CRI",
"GMB",
"URY",
"TUR",
"IDN",
"JAM",
"KOR",
"LBR",
"BLZ",
"ZAF"
],
"supported_currencies": [
"SVC",
"SHP",
"PLN",
"CRC",
"JOD",
"PAB",
"RWF",
"SOS",
"TOP",
"WST",
"VND",
"BND",
"EUR",
"MYR",
"DJF",
"TRY",
"HTG",
"CHF",
"EGP",
"KMF",
"MWK",
"GTQ",
"AUD",
"BHD",
"UYU",
"BWP",
"FJD",
"MZN",
"LSL",
"ANG",
"BMD",
"CZK",
"DZD",
"SEK",
"BGN",
"BRL",
"DKK",
"HNL",
"SAR",
"SCR",
"MXN",
"GIP",
"MDL",
"BAM",
"TWD",
"ZAR",
"OMR",
"SZL",
"KGS",
"RSD",
"CVE",
"GMD",
"VUV",
"BSD",
"ISK",
"HUF",
"BOB",
"TZS",
"USD",
"AZN",
"KWD",
"FKP",
"COP",
"BIF",
"ILS",
"IDR",
"ALL",
"MGA",
"KYD",
"KHR",
"KRW",
"PEN",
"TND",
"XOF",
"NAD",
"HKD",
"NGN",
"THB",
"XPF",
"CNY",
"GYD",
"UGX",
"AOA",
"LAK",
"NIO",
"NOK",
"ARS",
"QAR",
"TMT",
"MAD",
"JPY",
"YER",
"SGD",
"GBP",
"KZT",
"NZD",
"MVR",
"ZWL",
"ZMW",
"AMD",
"DOP",
"LBP",
"XCD",
"HRK",
"BBD",
"BZD",
"JMD",
"MNT",
"GEL",
"LRD",
"UZS",
"MKD",
"AWG",
"GHS",
"CLP",
"CAD",
"ETB",
"PGK",
"RON",
"AED",
"TJS",
"TTD",
"XAF",
"BYN",
"CDF",
"SBD",
"GNF",
"IQD",
"PYG",
"MRU",
"MOP",
"SRD",
"VES",
"AFN"
]
},
{
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_type_display_name": "Apple Pay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": null,
"supported_currencies": null
},
{
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_type_display_name": "Google Pay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"CZE",
"JOR",
"AUS",
"MEX",
"PER",
"JPN",
"VNM",
"OMN",
"SWE",
"LBN",
"ROU",
"DNK",
"BRA",
"CAN",
"THA",
"DZA",
"HKG",
"BHR",
"IND",
"QAT",
"ARE",
"TUR",
"EGY",
"AGO",
"COL",
"IDN",
"SGP",
"KAZ",
"TWN",
"PAN",
"ALB",
"ARG",
"ISR",
"HRV",
"DOM",
"HUN",
"ASM",
"AZE",
"BLR",
"MYS",
"SAU",
"BGR",
"URY",
"KWT",
"CHL",
"POL"
],
"supported_currencies": [
"AED",
"ILS",
"ALL",
"KWD",
"ARS",
"DKK",
"SGD",
"TRY",
"BHD",
"VND",
"JOD",
"XCD",
"AUD",
"NOK",
"CLP",
"DOP",
"EGP",
"MYR",
"PLN",
"EUR",
"COP",
"BYN",
"HKD",
"KZT",
"HUF",
"PAB",
"SAR",
"CHF",
"IDR",
"TWD",
"PEN",
"UYU",
"ZAR",
"USD",
"BGN",
"MXN",
"AOA",
"NZD",
"SEK",
"CZK",
"BRL",
"CAD",
"UAH",
"INR",
"GBP",
"JPY",
"LBP",
"THB",
"AZN",
"DZD",
"RON",
"QAR",
"OMR"
]
}
],
"supported_webhook_flows": []
},
{
"name": "PHONEPE",
"display_name": "PHONEPE",
"description": "PhonePe is a digital payments and financial services platform built on the UPI system. It allows users to make instant payments, recharge mobiles, pay bills, and access financial services like investments and insurance.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "upi",
"payment_method_type": "upi_collect",
"payment_method_type_display_name": "UPI Collect",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"IND"
],
"supported_currencies": [
"INR"
]
},
{
"payment_method": "upi",
"payment_method_type": "upi_intent",
"payment_method_type_display_name": "UPI Intent",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"IND"
],
"supported_currencies": [
"INR"
]
}
],
"supported_webhook_flows": []
},
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/paytm.rs`
- `crates/hyperswitch_connectors/src/connectors/phonepe.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (20 changes)
**Detailed Identifier Changes:**
Commit cf5737f4:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/paytm.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/phonepe.rs**
Modify existing code
|
{"pr_number": 8822, "pr_title": "feat(feature_matrix): add feature matrix for both paytm and phonepe", "merged_at": "2025-08-04T07:49:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "refund"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/paytm.rs", "crates/hyperswitch_connectors/src/connectors/phonepe.rs"]}, "change_types": {"fields_added": 20, "imports_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): Add RedirectInsidePopup response redirection URL
## 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) Add Response Redirection URL for PopupURL Next Action
2) Accept Empty Metadata for Adyen
3) Fix Coinbase Connector 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)?
-->
Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:' \
--data-raw '{
"amount": 6500,
"is_iframe_redirection_enabled": true,
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 6500
}
],
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"authentication_type": "three_ds",
"setup_future_usage": "on_session",
"request_external_three_ds_authentication": false,
"email": "[email protected]",
"description": "Hello this is description",
"shipping": {
"address": {
"state": "California",
"city": "Banglore",
"country": "US",
"line1": "sdsdfsdf",
"line2": "hsgdbhd",
"line3": "alsksoe",
"zip": "571201",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"connector_metadata": {
"noon": {
"order_category": "applepay"
}
},
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5200000000000007",
"card_exp_month": "06",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"customer_id": "hyperswitch_sdk_demo_id"
}'
```
Response
```
{
"payment_id": "pay_lMRlE5gjKjVs5jFxGn7J",
"merchant_id": "merchant_1749469354",
"status": "requires_customer_action",
"amount": 6500,
"net_amount": 6500,
"shipping_cost": null,
"amount_capturable": 6500,
"amount_received": 0,
"connector": "stripe",
"client_secret": "pay_lMRlE5gjKjVs5jFxGn7J_secret_p9Ynj2ZlmbRYEF2UWn19",
"created": "2025-06-09T11:43:27.759Z",
"currency": "USD",
"customer_id": "hyperswitch_sdk_demo_id",
"customer": {
"id": "hyperswitch_sdk_demo_id",
"name": null,
"email": "[email protected]",
"phone": null,
"phone_country_code": null
},
"description": "Hello this is description",
"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": "0007",
"card_type": "CREDIT",
"card_network": "Mastercard",
"card_issuer": "PUBLICBANKBERHAD",
"card_issuing_country": "MALAYSIA",
"card_isin": "520000",
"card_extended_bin": null,
"card_exp_month": "06",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "Banglore",
"country": "US",
"line1": "sdsdfsdf",
"line2": "hsgdbhd",
"line3": "alsksoe",
"zip": "571201",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": [
{
"brand": null,
"amount": 6500,
"category": null,
"quantity": 1,
"tax_rate": null,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"total_tax_amount": null,
"requires_shipping": null
}
],
"email": "[email protected]",
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_inside_popup",
"popup_url": "http://localhost:8080/payments/redirect/pay_lMRlE5gjKjVs5jFxGn7J/merchant_1749469354/pay_lMRlE5gjKjVs5jFxGn7J_1",
"redirect_response_url": "http://localhost:8080/payments/pay_lMRlE5gjKjVs5jFxGn7J/merchant_1749469354/redirect/response/stripe"
},
"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": "hyperswitch_sdk_demo_id",
"created_at": 1749469407,
"expires": 1749473007,
"secret": "epk_c9c2dc4779214d6c8a45a85a2e6ed1cf"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pi_3RY46uD5R7gDAGff0GtL6CFl",
"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": "applepay"
},
"braintree": null,
"adyen": null
},
"feature_metadata": null,
"reference_id": "pi_3RY46uD5R7gDAGff0GtL6CFl",
"payment_link": null,
"profile_id": "pro_HTada4p21JA0JQkuFiGE",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_koFLKwJ6ZEBRoTjcZs6n",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-09T11:58:27.759Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-06-09T11:43:28.541Z",
"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": true,
"whole_connector_response": null
}
```
---------------------------------------------
Adyen MCA Without passing metadata
```
curl --location 'http://localhost:8080/account/merchant_1749469805/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_5EpBpRde3TyZUU1E9p6QwIfrJpJOEjtqEf0T7QsMWUIWdAZ2vmNFw4cHQraYTJgG' \
--data '{
"connector_name": "adyen",
"connector_type": "payment_processor",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "",
"key1":"21"
},
"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,
"recurring_enabled":false,
"installment_payment_enabled":false,
"maximum_amount": 68607706,
"accepted_countries": {
"type": "disable_only",
"list": [
"HK"
]
},
"accepted_currencies": {
"type": "enable_only",
"list": [
"USD",
"GBP",
"INR"
]
}
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled":false,
"installment_payment_enabled":false,
"accepted_countries": {
"type": "disable_only",
"list": [
"HK"
]
},
"accepted_currencies": {
"type": "enable_only",
"list": [
"USD",
"GBP",
"INR"
]
}
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": false,
"installment_payment_enabled": false
}
]
}
],
"connector_webhook_details": {
"merchant_secret": "MyWebhookSecret"
},
"business_country": "US",
"business_label": "default",
"connector_label": "stripe_US_default"
}'
```
Response
```
{
"connector_type": "payment_processor",
"connector_name": "adyen",
"connector_label": "stripe_US_default",
"merchant_connector_id": "mca_0H98wDSMmueBwNF8KiT1",
"profile_id": "pro_tsatyOkdkxfBcLm50TVL",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "***",
"key1": "**"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": {
"type": "enable_only",
"list": [
"USD",
"GBP",
"INR"
]
},
"accepted_countries": {
"type": "disable_only",
"list": [
"HK"
]
},
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": false,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": {
"type": "enable_only",
"list": [
"USD",
"GBP",
"INR"
]
},
"accepted_countries": {
"type": "disable_only",
"list": [
"HK"
]
},
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": false,
"installment_payment_enabled": false
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": false,
"installment_payment_enabled": false
}
]
}
],
"connector_webhook_details": {
"merchant_secret": "MyWebhookSecret",
"additional_secret": null
},
"metadata": {
"tenant_id": "232",
"platform_url": "32121"
},
"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
}
```
---------------------------------------------
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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.rs`
- `crates/router/src/core/payments/transformers.rs`
**3. External Connector Integration**
- `crates/connector_configs/src/connector.rs`
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
**4. Type Definitions**
- `crates/router/src/compatibility/stripe/payment_intents/types.rs`
- `crates/router/src/compatibility/stripe/setup_intents/types.rs`
**5. Other**
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Extend existing types with new fields (3 changes)
**Detailed Identifier Changes:**
Commit df34ff43:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
**crates/router/src/compatibility/stripe/payment_intents/types.rs**
Modify existing code
**crates/router/src/compatibility/stripe/setup_intents/types.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
|
{"pr_number": 8257, "pr_title": "fix(connector): Add RedirectInsidePopup response redirection URL", "merged_at": "2025-06-10T17:51:53Z", "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.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/connector_configs/src/connector.rs", "crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs"], "types": ["crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs"], "other": ["api-reference/openapi_spec.json"]}, "change_types": {"fields_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
Ci(Cypress): Add PML test and Dynamic Fields Test for Novalnet
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [X] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Added PML test for Novalnet
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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/pull/6463#issuecomment-2464635862
## How did you test 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 Cypress Test locally:
**PaymentMethodListTests**
<img width="774" alt="Screenshot 2025-01-02 at 15 38 46" src="https://github.com/user-attachments/assets/2c3d2239-ca83-46cc-bf6b-3c5e1150c2aa" />
**DynamicFields**
<img width="774" alt="Screenshot 2025-01-02 at 16 20 43" src="https://github.com/user-attachments/assets/0935e146-0b68-4a4c-b68e-b5027d93a51f" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [X] I formatted the code `cargo +nightly fmt --all`
- [X] I addressed lints thrown by `cargo clippy`
- [X] I reviewed the submitted code
- [ ] 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/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js`
- `cypress-tests/cypress/e2e/PaymentMethodListUtils/Commons.js`
- `cypress-tests/cypress/e2e/PaymentMethodListUtils/Stripe.js`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (100 changes)
|
{"pr_number": 6544, "pr_title": "Ci(Cypress): Add PML test and Dynamic Fields Test for Novalnet", "merged_at": "2025-01-06T07:27:36Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js", "cypress-tests/cypress/e2e/PaymentMethodListUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentMethodListUtils/Stripe.js", "cypress-tests/cypress/e2e/PaymentMethodListUtils/Utils.js", "cypress-tests/cypress/e2e/PaymentUtils/Novalnet.js"]}, "change_types": {"fields_added": 100}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(connector): [Tokenex] add template code
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
template for Tokenex integration
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
No Testing Required
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/connector_endpoints.rs`
**2. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 12 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 (165 changes)
**Detailed Identifier Changes:**
Commit 40357ae2:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::tokenex
**crates/hyperswitch_connectors/src/connectors/tokenex.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::Tokenex
- impl: impl Tokenex
- impl: impl api::Payment for Tokenex
- impl: impl api::PaymentSession for Tokenex
- impl: impl api::ConnectorAccessToken for Tokenex
- impl: impl api::MandateSetup for Tokenex
- impl: impl api::PaymentAuthorize for Tokenex
- impl: impl api::PaymentSync for Tokenex
- impl: impl api::PaymentCapture for Tokenex
- impl: impl api::PaymentVoid for Tokenex
- impl: impl api::Refund for Tokenex
- impl: impl api::RefundExecute for Tokenex
- impl: impl api::RefundSync for Tokenex
- impl: impl api::PaymentToken for Tokenex
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Tokenex
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Tokenex
- impl: impl ConnectorCommon for Tokenex
- impl: impl ConnectorValidation for Tokenex
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Tokenex
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Tokenex
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Tokenex
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Tokenex
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tokenex
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Tokenex
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Tokenex
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Tokenex
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Tokenex
- impl: impl webhooks::IncomingWebhook for Tokenex
- impl: impl ConnectorSpecifications for Tokenex
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/tokenex/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::TokenexRouterData
- struct: pub::TokenexPaymentsRequest
- struct: pub::TokenexCard
- struct: pub::TokenexAuthType
- struct: pub::TokenexPaymentsResponse
- struct: pub::TokenexRefundRequest
- struct: pub::RefundResponse
- struct: pub::TokenexErrorResponse
- enum: pub::TokenexPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for TokenexRouterData<T>
- impl: impl TryFrom<&TokenexRouterData<&PaymentsAuthorizeRouterData>> for TokenexPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for TokenexAuthType
- impl: impl From<TokenexPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, TokenexPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&TokenexRouterData<&RefundsRouterData<F>>> for TokenexRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
- impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/connector_endpoints.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::tokenex
**crates/router/tests/connectors/tokenex.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::TokenexTest
- impl: impl ConnectorActions for TokenexTest
- impl: impl utils::Connector for TokenexTest
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 9416, "pr_title": "feat(connector): [Tokenex] add template code", "merged_at": "2025-09-22T10:01:50Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["token"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/connector_endpoints.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/tokenex.rs", "crates/hyperswitch_connectors/src/connectors/tokenex/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector.rs", "crates/router/tests/connectors/main.rs", "crates/router/tests/connectors/tokenex.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": 165, "imports_added": 22}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [silverflow] template code
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Connector template code for new connector silverflow.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
This is a template PR for Silverflow, just checked for compilation. Nothing else to test.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/configs.rs`
**2. 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 c322eb9c:
Files to modify:
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::silverflow
**crates/hyperswitch_connectors/src/connectors/silverflow.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::Silverflow
- impl: impl Silverflow
- impl: impl api::Payment for Silverflow
- impl: impl api::PaymentSession for Silverflow
- impl: impl api::ConnectorAccessToken for Silverflow
- impl: impl api::MandateSetup for Silverflow
- impl: impl api::PaymentAuthorize for Silverflow
- impl: impl api::PaymentSync for Silverflow
- impl: impl api::PaymentCapture for Silverflow
- impl: impl api::PaymentVoid for Silverflow
- impl: impl api::Refund for Silverflow
- impl: impl api::RefundExecute for Silverflow
- impl: impl api::RefundSync for Silverflow
- impl: impl api::PaymentToken for Silverflow
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Silverflow
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Silverflow
- impl: impl ConnectorCommon for Silverflow
- impl: impl ConnectorValidation for Silverflow
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Silverflow
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Silverflow
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Silverflow
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Silverflow
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Silverflow
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Silverflow
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Silverflow
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Silverflow
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Silverflow
- impl: impl webhooks::IncomingWebhook for Silverflow
- impl: impl ConnectorSpecifications for Silverflow
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/silverflow/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::SilverflowRouterData
- struct: pub::SilverflowPaymentsRequest
- struct: pub::SilverflowCard
- struct: pub::SilverflowAuthType
- struct: pub::SilverflowPaymentsResponse
- struct: pub::SilverflowRefundRequest
- struct: pub::RefundResponse
- struct: pub::SilverflowErrorResponse
- enum: pub::SilverflowPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for SilverflowRouterData<T>
- impl: impl TryFrom<&SilverflowRouterData<&PaymentsAuthorizeRouterData>> for SilverflowPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for SilverflowAuthType
- impl: impl From<SilverflowPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, SilverflowPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&SilverflowRouterData<&RefundsRouterData<F>>> for SilverflowRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
- impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/configs.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::silverflow
**crates/router/tests/connectors/silverflow.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::SilverflowTest
- impl: impl ConnectorActions for SilverflowTest
- impl: impl utils::Connector for SilverflowTest
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 8553, "pr_title": "feat(connector): [silverflow] template code", "merged_at": "2025-07-08T08:39:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/configs.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/silverflow.rs", "crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector.rs", "crates/router/tests/connectors/main.rs", "crates/router/tests/connectors/silverflow.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"}
|
fix(webhooks): move webhook acknowledge config to cover early deserialization errors
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for https://github.com/juspay/hyperswitch/pull/9508
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/webhooks/incoming.rs`
**Detailed Identifier Changes:**
Commit 3cb44a58:
Files to modify:
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
|
{"pr_number": 9530, "pr_title": "fix(webhooks): move webhook acknowledge config to cover early deserialization errors", "merged_at": "2025-09-24T05:41:00Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/webhooks/incoming.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): [Cybersource] add PLN to the currency 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 -->
Add PLN to the currency config of card, googlepay and applepay via Cybersource.
## Test Case
1) Do a googlepay payment via PLN cybersource
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_0GGWV59O1lNRZ09AZbD3Kro4CFqhkWBlUSC8QBd072jy4E7T4rsi0Bp07CawLE1N' \
--data-raw '{
"amount": 10000,
"currency": "PLN",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "CustomerX",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay": {
"type": "CARD",
"description": "Visa •••• 1111",
"info": {
"card_network": "VISA",
"card_details": "1111"
},
"tokenization_data": {
"type": "PAYMENT_GATEWAY",
"token": "{\"signature\":\"Mz\"}"
}
}
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Dubai",
"zip": "94122",
"country": "AE",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+97"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS"
,
"mandate_data": {
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "125.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"multi_use": {
"amount": 1000,
"currency": "USD",
"start_date": "2023-04-21T00:00:00Z",
"end_date": "2023-05-21T00:00:00Z",
"metadata": {
"frequency": "13"
}
}
}
},
"setup_future_usage": "off_session"
}'
```
Response
```
{
"payment_id": "pay_2EwINOXkho0LWNH3nXmJ",
"merchant_id": "merchant_1732193622",
"status": "succeeded",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10000,
"connector": "cybersource",
"client_secret": "pay_2EwINOXkho0LWNH3nXmJ_secret_LvsitK5yYVopwl6jK6dF",
"created": "2024-11-21T12:55:19.435Z",
"currency": "PLN",
"customer_id": "CustomerX",
"customer": {
"id": "CustomerX",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": "man_P74lcNfYDTBEdpbxgKER",
"mandate_data": {
"update_mandate_id": null,
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "125.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"multi_use": {
"amount": 1000,
"currency": "USD",
"start_date": "2023-04-21T00:00:00.000Z",
"end_date": "2023-05-21T00:00:00.000Z",
"metadata": {
"frequency": "13"
}
}
}
},
"setup_future_usage": "off_session",
"off_session": 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": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AE",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Dubai",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+97"
},
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "google_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "CustomerX",
"created_at": 1732193719,
"expires": 1732197319,
"secret": "epk_8b6d16dd3fd14d09a3271f748f2073c7"
},
"manual_retry_allowed": false,
"connector_transaction_id": "7321937196376524304953",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_2EwINOXkho0LWNH3nXmJ_1",
"payment_link": null,
"profile_id": "pro_9Lg7G2CtmwcsBHGPmFxJ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_T01hal3cEXdTRdvr6aL7",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-21T13:10:19.435Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_6aPLImPeEEFrHcMC4ZTI",
"payment_method_status": null,
"updated": "2024-11-21T12:55:21.942Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
1) Do a card payment via PLN cybersource
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_0GGWV59O1lNRZ09AZbD3Kro4CFqhkWBlUSC8QBd072jy4E7T4rsi0Bp07CawLE1N' \
--data-raw '{
"amount": 1404,
"currency": "PLN",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "CustomerX",
"email": "[email protected]",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "12",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "029"
}
},
"billing": {
"address": {
"line1": "cq",
"city": "dshcvjhdw",
"state": "whecvjkcdv",
"zip": "46205",
"country": "MW",
"first_name": "joseph",
"last_name": "doe"
},
"phone": {
"number": "12345",
"country_code": "+93"
}
},
"metadata": {
"count_tickets": 1,
"transaction_number": "5590043"
},
"business_label": "food",
"business_country": "US"
}'
```
Respone
```
{
"payment_id": "pay_XHu3qy854hdtYGEtI21A",
"merchant_id": "merchant_1732193622",
"status": "succeeded",
"amount": 1404,
"net_amount": 1404,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1404,
"connector": "cybersource",
"client_secret": "pay_XHu3qy854hdtYGEtI21A_secret_YdyQwjtFTdkrbUsNQsFj",
"created": "2024-11-21T12:57:03.858Z",
"currency": "PLN",
"customer_id": "CustomerX",
"customer": {
"id": "CustomerX",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1111",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "30",
"card_holder_name": null,
"payment_checks": {
"avs_response": {
"code": "Y",
"codeRaw": "Y"
},
"card_verification": null
},
"authentication_data": null
},
"billing": null
},
"payment_token": "token_nECUY6AS4l2bqpKF5ZC5",
"shipping": null,
"billing": {
"address": {
"city": "dshcvjhdw",
"country": "MW",
"line1": "cq",
"line2": null,
"line3": null,
"zip": "46205",
"state": "whecvjkcdv",
"first_name": "joseph",
"last_name": "doe"
},
"phone": {
"number": "12345",
"country_code": "+93"
},
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": 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": "cybersource_US_food_default",
"business_country": "US",
"business_label": "food",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "CustomerX",
"created_at": 1732193823,
"expires": 1732197423,
"secret": "epk_a7cf79e303944fe3887a0db8a9b94aaf"
},
"manual_retry_allowed": false,
"connector_transaction_id": "7321938248516770104953",
"frm_message": null,
"metadata": {
"count_tickets": 1,
"transaction_number": "5590043"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_XHu3qy854hdtYGEtI21A_1",
"payment_link": null,
"profile_id": "pro_9Lg7G2CtmwcsBHGPmFxJ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_T01hal3cEXdTRdvr6aL7",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-21T13:12:03.858Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-11-21T12:57:05.696Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Tests**
- `config/deployments/integration_test.toml`
**2. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
|
{"pr_number": 6628, "pr_title": "feat(router): [Cybersource] add PLN to the currency config", "merged_at": "2024-11-26T12:02:00Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"tests": ["config/deployments/integration_test.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(authentication): changed required value for juspayThreedsserver config
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
## Description
<!-- Describe your changes in detail -->
Changed required value for juspayThreedsserver config
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<img width="948" height="175" alt="Screenshot 2025-08-11 at 12 18 19 PM" src="https://github.com/user-attachments/assets/e94890ad-72a4-4bb8-87bb-d441d7ee05eb" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I 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. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
|
{"pr_number": 8890, "pr_title": "fix(authentication): changed required value for juspayThreedsserver config", "merged_at": "2025-08-20T09:49:22Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): [CYBERSOURCE] change ucaf_collection_indicator for mastercard payments via netcetera
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for [PR](https://github.com/juspay/hyperswitch/pull/7623)
`cargo clippy output`
<img width="1098" alt="Screenshot 2025-03-25 at 4 24 55 PM" src="https://github.com/user-attachments/assets/7bfec754-cafb-4e58-b21c-05a96542eb95" />
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
**Detailed Identifier Changes:**
Commit 117108ed:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
|
{"pr_number": 7625, "pr_title": "fix(connector): [CYBERSOURCE] change ucaf_collection_indicator for mastercard payments via netcetera", "merged_at": "2025-03-25T11:20:23Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(authentication): flattened paymentData in authentication trait functions
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Refactoring
## Description
<!-- Describe your changes in detail -->
flattened paymentData in authentication trait functions
#### 1. __Core Refactoring - Payment Data Flattening__
- __Main Goal__: Flattened `paymentData` structure in authentication trait functions to remove dependencies on payment context
- This refactoring makes authentication services more modular and independent from payment-specific data structures
#### 2. __Authentication Service Architecture__
- Enhanced the unified authentication service module
- Improved separation of concerns between authentication and payment flows
- Modified authentication trait functions to work with flattened data structures instead of nested payment data
#### 3. __Database Schema Updates__
- Added new database migrations for authentication table modifications:
- Made connector item optional in authentication table
- Added authentication client secret field
- Added force 3DS challenge support
- Added PSD2 SCA exemption type field
#### 4. __API Contract Changes__
- Updated API models for authentication endpoints
- Modified OpenAPI specifications to reflect the new authentication structure
- Changed authentication APIs to v1 endpoints
- Added comprehensive OpenAPI specs for authentication services
#### 5. __Core Integration Updates__
- Modified payment confirmation flows to work with the new authentication structure
- Updated Kafka event handling for authentication and payment attempts
- Enhanced webhook processing to support the new authentication data flow
- Updated routing and application configuration
#### 6. __Click-to-Pay Integration__
- Added support for Click-to-Pay (CTP) authentication flow
- Integrated with CTP Mastercard connector
- Added merchant configuration for authentication service eligibility
- Enhanced browser info handling for authentication flows
#### 7. __Code Quality Improvements__
- Fixed various clippy warnings and linting issues
- Improved error handling in authentication flows
- Enhanced type safety with better ID type management
- Updated utility functions for better modularity
### Technical Impact:
__Benefits of the Refactoring:__
- __Modularity__: Authentication services are now less coupled to payment-specific data
- __Reusability__: Authentication functions can be used in contexts outside of payments
- __Maintainability__: Cleaner separation of concerns makes the code easier to maintain
- __Extensibility__: Easier to add new authentication methods and flows
__Testing Instructions Provided:__ The PR includes comprehensive testing instructions for:
- Setting up merchant eligibility for authentication service
- Creating merchant connector accounts for CTP Mastercard
- Configuring business profiles with authentication products
- Testing the complete payment flow with authentication
This refactoring represents a significant architectural improvement to make the authentication system more modular and independent, while maintaining backward compatibility with existing payment 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)?
-->
Test click to pay flow
Add config to make the merchant eligible for authentication service
```shell
curl --location 'http://localhost:8080/configs/' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"key": "merchants_eligible_for_authentication_service",
"value": "[\"sahkal\", \"cewqcewc\", \"dqwdwljildwduoqwhduwqcqwjd\"]"
}'
```
Create merchant connector account for Ctp_mastercard
```shell
curl --location 'http://localhost:8080/account/dqwdwljildwduoqwhduwqcqwjd/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '
{
"connector_type": "authentication_processor",
"connector_name": "ctp_mastercard",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "API-KEY"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"business_country": "US",
"business_label": "default",
"metadata": {
"dpa_id": "b6e06cc6-3018-4c4c-bbf5-9fb232615090",
"dpa_name": "TestMerchant",
"locale": "en_AU",
"card_brands": ["mastercard", "visa"],
"acquirer_bin": "545301",
"acquirer_merchant_id": "SRC3DS",
"merchant_category_code": "0001",
"merchant_country_code": "US"
}
}
'
```
Adyen
```shell
curl --location 'http://localhost:8080/account/dqwdwljildwduoqwhduwqcqwjd/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '
{
"connector_type": "payment_processor",
"connector_name": "cybersource",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_secret": "bypQ0ZszfbHTyNgLEQx+Txvs3qqYc14LVKS+QmwX/88=",
"api_key": "538e4ded-cef5-4438-a153-5a02566a34fd",
"key1": "juspay_us_sandbox"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"AmericanExpress"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"city": "NY",
"unit": "245",
"live_endpoint_prefix": "vsfbjh"
},
"connector_webhook_details": {
"merchant_secret": "556B655EBE2F2F0912F6DBC893C23C8A30F5F5293746B80114844AB30549E2AB"
}
// "business_country": "US",
// "business_label": "default"
}
'
```
update business profile with ctp_mastercard mca_id
```shell
curl --location 'http://localhost:8080/account/dqwdwljildwduoqwhduwqcqwjd/business_profile/pro_KCTRv8sFQfC0r65CZxrn' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"is_click_to_pay_enabled": true,
"authentication_product_ids": {"click_to_pay": "mca_XAXUpel8ABbpoGNF8lGz"}
}'
```
do payments create
```shell
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_fQsdc9JbERQ7CWvmguo84XDROuXOD1oK9sdfCJXOko3SossoI4zdxpJkOIPmojwn' \
--data '{
"amount": 1130,
"currency": "USD",
"confirm": false,
"return_url": "https://hyperswitch.io"
}
'
```
do payments confirm
```shell
curl --location 'http://localhost:8080/payments/pay_Ft9Ke5Lun924OCJa7yll/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_1f712ac5fd7f4d8c91da6a627862a4f0' \
--data '
{
"payment_method": "card",
"payment_method_type": "debit",
"client_secret": "pay_Ft9Ke5Lun924OCJa7yll_secret_po1FVW5adQWFolWJUhMb",
"ctp_service_details" : {
"merchant_transaction_id": "0a4e0d3.34f4a04b.803eb38b0a56f082296538d4a70c064a6b320639",
"correlation_id": "34f4a04b.bcd1ac39-e0f3-479e-b3ee-703ade0c66dc",
"x_src_flow_id" : "34f4a04b.bcd1ac39-e0f3-479e-b3ee-703ade0c66dc.1727438793"
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"color_depth": 24,
"java_enabled":true,
"java_script_enabled": true,
"language": "en-GB",
"screen_height": 1440,
"screen_width": 2560,
"time_zone": -330,
"user_agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36"
}
}'
```
Expected Response
```shell
{
"payment_id": "pay_uExtVlV6ueNkLeUPiXZg",
"merchant_id": "sahkal",
"status": "succeeded",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 100,
"connector": "cybersource",
"client_secret": "pay_uExtVlV6ueNkLeUPiXZg_secret_mU8Au3Lupz6KXgHzW5z4",
"created": "2025-05-13T15:50:46.759Z",
"currency": "USD",
"customer_id": null,
"customer": {
"id": null,
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "sahkal",
"last_name": "poddar"
},
"phone": null,
"email": null
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "7471514619636683503812",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_uExtVlV6ueNkLeUPiXZg_1",
"payment_link": null,
"profile_id": "pro_Img0GLzvnKEFzGRdsqdF",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_3TGQxhtgz4WtNjlj17fn",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": {
"authentication_flow": null,
"electronic_commerce_indicator": "06",
"status": "success",
"ds_transaction_id": null,
"version": null,
"error_code": null,
"error_message": null
},
"external_3ds_authentication_attempted": false,
"expires_on": "2025-05-13T16:05:46.759Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": "en-GB",
"time_zone": -330,
"ip_address": "::1",
"os_version": null,
"user_agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36",
"color_depth": 24,
"device_model": null,
"java_enabled": true,
"screen_width": 2560,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1440,
"accept_language": "en",
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-05-13T15:51:03.564Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "click_to_pay",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/authentication.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/operations/payment_confirm.rs`
- `crates/router/src/core/unified_authentication_service.rs`
- ... and 2 more files
**3. Other**
- `migrations/2025-05-19-130655_authentication_table_refactor/down.sql`
**Code Patterns Applied:**
- Extend existing types with new fields (68 changes)
**Detailed Identifier Changes:**
Commit 18a779f9:
Files to modify:
**crates/api_models/src/authentication.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/types.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/utils.rs**
Modify existing code
|
{"pr_number": 8365, "pr_title": "refactor(authentication): flattened paymentData in authentication trait functions", "merged_at": "2025-07-01T13:52:12Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/authentication.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/unified_authentication_service.rs", "crates/router/src/core/unified_authentication_service/types.rs", "crates/router/src/core/unified_authentication_service/utils.rs"], "other": ["migrations/2025-05-19-130655_authentication_table_refactor/down.sql"]}, "change_types": {"fields_added": 68}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(authentication): moved cavv storing from table to temp locker
Reverts
[juspay/hyperswitch#8005](https://github.com/juspay/hyperswitch/pull/7978)
|
To implement this **unknown** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/authentication.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types/authentication.rs`
- `crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs`
- `crates/hyperswitch_domain_models/src/router_response_types.rs`
**3. Core Business Logic**
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/authentication/utils.rs`
- `crates/router/src/core/payments.rs`
- ... and 7 more files
**4. External Connector Integration**
- `crates/router/src/connector/gpayments/gpayments_types.rs`
- `crates/router/src/connector/netcetera/transformers.rs`
- `crates/router/src/connector/threedsecureio/transformers.rs`
**5. Type Definitions**
- `crates/router/src/types/api/authentication.rs`
- `crates/router/src/types/domain.rs`
- `crates/router/src/types/transformers.rs`
**6. Other**
- `crates/hyperswitch_interfaces/src/authentication.rs`
**Code Patterns Applied:**
- Implement new functions (8 changes)
- Extend existing types with new fields (23 changes)
- Add conditional logic for feature flags or filtering (5 changes)
**Detailed Identifier Changes:**
Commit 996fc981:
Files to modify:
**crates/diesel_models/src/authentication.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/authentication.rs**
Remove:
- struct: pub::AuthenticationStore
**crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/authentication.rs**
Modify existing code
**crates/router/src/connector/gpayments/gpayments_types.rs**
Modify existing code
**crates/router/src/connector/netcetera/transformers.rs**
Modify existing code
**crates/router/src/connector/threedsecureio/transformers.rs**
Modify existing code
**crates/router/src/core/authentication.rs**
Modify existing code
**crates/router/src/core/authentication/utils.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_status.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/payments/types.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/utils.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/types/api/authentication.rs**
Modify existing code
**crates/router/src/types/domain.rs**
Remove:
- mod: pub::authentication
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 8021, "pr_title": "refactor(authentication): moved cavv storing from table to temp locker", "merged_at": "2025-05-14T07:50:11Z", "intent": {"feature_type": "unknown", "action": "unknown", "entities": []}, "hierarchy": {"database": ["crates/diesel_models/src/authentication.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types/authentication.rs", "crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/authentication.rs", "crates/router/src/core/authentication/utils.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/payment_status.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/payments/types.rs", "crates/router/src/core/unified_authentication_service/utils.rs", "crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/router/src/connector/gpayments/gpayments_types.rs", "crates/router/src/connector/netcetera/transformers.rs", "crates/router/src/connector/threedsecureio/transformers.rs"], "types": ["crates/router/src/types/api/authentication.rs", "crates/router/src/types/domain.rs", "crates/router/src/types/transformers.rs"], "other": ["crates/hyperswitch_interfaces/src/authentication.rs"]}, "change_types": {"functions_added": 8, "fields_added": 23, "imports_added": 2, "conditionals_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connectors): [worldpayvantiv] replace sandbox url with pre-live url and fix typo
## 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 -->
Replace their vantiv's open sandbox url `: https://www.testvantivcnp.com/sandbox/communicator/online` with pre-live url
`https://payments.vantivprelive.com/vap/communicator/online` and fix typo
## How did you test 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 **payment** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs`
**2. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**3. Configuration Files**
- `config/config.example.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
- ... and 1 more files
**Detailed Identifier Changes:**
Commit 67a42f0c:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs**
Modify existing code
|
{"pr_number": 8286, "pr_title": "refactor(connectors): [worldpayvantiv] replace sandbox url with pre-live url and fix typo", "merged_at": "2025-06-10T12:44:54Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(routing): update configs on updation of mca
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This pull request introduces a new helper function to update the default fallback connector configuration whenever a merchant connector account (MCA) is updated. This ensures that changes to connector status (such as disabling or enabling) are accurately reflected in both merchant and profile configurations. The changes also include necessary imports and function calls to integrate this logic into the connector update flow.
**Connector fallback configuration updates:**
* Added the `update_default_fallback_on_mca_update` function in `routing/helpers.rs` to update merchant and profile default connector configurations based on the status of the updated MCA. The function ensures that disabled or inactive connectors are removed from the defaults, and enabled connectors are added if not already present.
* Integrated the new helper into the `update_connector` flow in `admin.rs`, so it is triggered automatically after connector updates.
**Imports and code organization:**
* Added necessary imports for `update_default_fallback_on_mca_update` and related types in `admin.rs` and `helpers.rs` to support the new logic. [[1]](diffhunk://#diff-7e1b4a44fadc4de1af2a6abeb318b3ddf044177c44ba00731c33dbf4cdce92b7R25-R28) [[2]](diffhunk://#diff-ea48d33e52b2cb7edbbba1d236b55f946fdb2c178f8c76f4226818b3630c4658R6)
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Create two connectors namely adyen and wise
2. check configs table
```
SELECT key, config
FROM configs
WHERE key = 'routing_default_po_pro_RTMoW14AvhG5cjmcpcNb';
```
```
SELECT key, config
FROM configs
WHERE key = 'routing_default_po_merchant_id';
```
3. disable one of them
4. check configs table again for above query, this time the disabled shouldn't be present.
5. Re-enable the disabled connector, then query the table for the connector to be added back.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/routing.rs`
- `crates/router/src/core/routing/helpers.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (10 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 286e18b2:
Files to modify:
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/routing.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Add:
- function: pub::redact_routing_cache
- function: pub::update_default_fallback_on_mca_update
|
{"pr_number": 9659, "pr_title": "refactor(routing): update configs on updation of mca", "merged_at": "2025-10-07T16:53:24Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/routing.rs", "crates/router/src/core/routing/helpers.rs"]}, "change_types": {"functions_added": 2, "fields_added": 10, "imports_added": 2, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(debit_routing): filter debit networks based on merchant connector account configuration
## 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 -->
Once the open router call is completed for the co-badged card lookup in a debit routing flow, it returns all the debit networks eligible for the card. These networks must be validated against the merchant-enabled debit networks for each merchant connector account.
This PR adds the necessary filtering logic to enforce this validation.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
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 profile and enable debit routing
```
curl --location 'http://localhost:8080/account/merchant_1748851578/business_profile/pro_gEwS6ve9KVqywWL0hmAq' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ' \
--data '{
"is_debit_routing_enabled": true
}'
```
```
{
"merchant_id": "merchant_1748851578",
"profile_id": "pro_gEwS6ve9KVqywWL0hmAq",
"profile_name": "US_default",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "ksFwEBEmzqH60K5XvD60le6J3S742RIcTLKHyZF3O8TwniOm7ldxztuZvFet7Zpb",
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": null,
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"metadata": null,
"routing_algorithm": null,
"intent_fulfillment_time": 900,
"frm_routing_algorithm": null,
"payout_routing_algorithm": null,
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"extended_card_info_config": null,
"collect_shipping_details_from_wallet_connector": false,
"collect_billing_details_from_wallet_connector": false,
"always_collect_shipping_details_from_wallet_connector": false,
"always_collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": false,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null,
"tax_connector_id": null,
"is_tax_connector_enabled": false,
"is_network_tokenization_enabled": false,
"is_auto_retries_enabled": false,
"max_auto_retries_enabled": null,
"always_request_extended_authorization": null,
"is_click_to_pay_enabled": false,
"authentication_product_ids": null,
"card_testing_guard_config": {
"card_ip_blocking_status": "disabled",
"card_ip_blocking_threshold": 3,
"guest_user_card_blocking_status": "disabled",
"guest_user_card_blocking_threshold": 10,
"customer_id_blocking_status": "disabled",
"customer_id_blocking_threshold": 5,
"card_testing_guard_expiry": 3600
},
"is_clear_pan_retries_enabled": false,
"force_3ds_challenge": false,
"is_debit_routing_enabled": true,
"merchant_business_country": null,
"is_pre_network_tokenization_enabled": false
}
```
-> Create a mca with local debit networks enabled
```
{
"payment_method_type": "debit",
"card_networks": [
"Nyce",
"Star",
"Accel"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
```
```
{
"connector_type": "payment_processor",
"connector_name": "adyen",
"connector_label": "adyen_US_default",
"merchant_connector_id": "mca_zMyPaKk9qUVauLL7wFrV",
"profile_id": "pro_gEwS6ve9KVqywWL0hmAq",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "AQ*************************************************************************************************************************************************7$",
"key1": "Ju********OM",
"api_secret": "AQ**********************************************************************************************************************************************************eb"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard",
"Discover"
],
"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": [
"Nyce",
"Star",
"Accel"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "paypal",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "samsung_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
}
]
}
],
"connector_webhook_details": null,
"test_mode": false,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null
}
```
-> 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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"customer_id": "cu_1748852614",
"return_url": "http://127.0.0.1:4040",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4000033003300335",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX",
"last_name": "ss"
},
"email": "[email protected]"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "125.0.0.1"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```
{
"payment_id": "pay_Q769H87jQ58yIcQC73sv",
"merchant_id": "merchant_1748851578",
"status": "succeeded",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10000,
"connector": "adyen",
"client_secret": "pay_Q769H87jQ58yIcQC73sv_secret_WiHYRmir48iHRQKZ4lEl",
"created": "2025-06-02T08:14:21.393Z",
"currency": "USD",
"customer_id": "cu_1748852061",
"customer": {
"id": "cu_1748852061",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0335",
"card_type": "DEBIT",
"card_network": "Nyce",
"card_issuer": "VISA U.S.A. INC.",
"card_issuing_country": "UNITEDSTATES",
"card_isin": "400003",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": "ss"
},
"phone": null,
"email": "[email protected]"
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "http://127.0.0.1:4040/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cu_1748852061",
"created_at": 1748852061,
"expires": 1748855661,
"secret": "epk_da558f5301a24518abd1a5199f29b516"
},
"manual_retry_allowed": false,
"connector_transaction_id": "LZ57WXZRDMJFMZ65",
"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_Q769H87jQ58yIcQC73sv_1",
"payment_link": null,
"profile_id": "pro_gEwS6ve9KVqywWL0hmAq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_zMyPaKk9qUVauLL7wFrV",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-02T08:29:21.393Z",
"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-02T08:14:22.686Z",
"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
}
```
For the above payment the eligible connector is visa, pulse and nyce. Since nyce is the cheapest network for the payment the payment went through it.
-> Now in order to test the filtering logic update the mca my removing nyce
```
{
"payment_method_type": "debit",
"card_networks": [
"Star",
"Accel"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
```
-> 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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"customer_id": "cu_1748852960",
"return_url": "http://127.0.0.1:4040",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4000033003300335",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX",
"last_name": "ss"
},
"email": "[email protected]"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "125.0.0.1"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```
{
"payment_id": "pay_wJSrmVAbpj6s9YpaH6oo",
"merchant_id": "merchant_1748851578",
"status": "succeeded",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10000,
"connector": "adyen",
"client_secret": "pay_wJSrmVAbpj6s9YpaH6oo_secret_ddu0dC5yz2jePhmhRXwU",
"created": "2025-06-02T08:29:13.189Z",
"currency": "USD",
"customer_id": "cu_1748852953",
"customer": {
"id": "cu_1748852953",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0335",
"card_type": "DEBIT",
"card_network": "Visa",
"card_issuer": "VISA U.S.A. INC.",
"card_issuing_country": "UNITEDSTATES",
"card_isin": "400003",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": "ss"
},
"phone": null,
"email": "[email protected]"
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "http://127.0.0.1:4040/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cu_1748852953",
"created_at": 1748852953,
"expires": 1748856553,
"secret": "epk_d82b5b921478431fb6739e549f75a175"
},
"manual_retry_allowed": false,
"connector_transaction_id": "ZPGN742WSN32HF75",
"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_wJSrmVAbpj6s9YpaH6oo_1",
"payment_link": null,
"profile_id": "pro_gEwS6ve9KVqywWL0hmAq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_zMyPaKk9qUVauLL7wFrV",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-02T08:44:13.189Z",
"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-02T08:29:15.270Z",
"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
}
```
Since nyce and pulse is not enabled for a mca payment was processed with visa.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --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
- **Refactor**
- Enhanced debit routing to be profile- and merchant-aware, improving connector and network selection accuracy.
- Enforced US local network presence requirement for debit routing compliance.
- Improved error handling and logging for better diagnostics.
- **Bug Fixes**
- Resolved network selection issues by filtering connectors and networks based on merchant account eligibility.
<!-- 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. Core Business Logic**
- `crates/router/src/core/debit_routing.rs`
**Code Patterns Applied:**
- Implement new functions (7 changes)
- Extend existing types with new fields (26 changes)
- Add conditional logic for feature flags or filtering (10 changes)
- Modify database queries (3 changes)
**Detailed Identifier Changes:**
Commit 5f97b7bc:
Files to modify:
**crates/router/src/core/debit_routing.rs**
Remove:
- function: private::check_connector_support_for_network
- function: private::build_connector_routing_data
|
{"pr_number": 8175, "pr_title": "refactor(debit_routing): filter debit networks based on merchant connector account configuration", "merged_at": "2025-06-12T13:15:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/debit_routing.rs"]}, "change_types": {"functions_added": 7, "fields_added": 26, "imports_added": 1, "conditionals_added": 10, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(users): modify query to list only v1 merchant_accounts for list v1 merchant accounts API
## 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 -->
Modified the v1 merchant list query to list only v1 merchant accounts, v2 merchants cannot deserialize in v1 application code.
This change is required, since now, both v1 and v2 merchant accounts are stored in the same schema.
This will affect the following flows:
- list merchant accounts for user in org
- list merchant accounts (admin API)
- get single merchant id (during sign-in, to create JWT token)
- switch org for user
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Fix the deserialization issues when listing merchant accounts using v1 routes.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Hit the following curls after creating a v1 merchant account and a v2 merchant account in the same organization.
The following APIs should only return v1 merchant accounts in the organization (and not the v2 merchant accounts).
#### List Merchant Accounts for User in Org:
```bash
curl --location 'http://localhost:8080/user/list/merchant' \
--header 'x-feature: integ-custom' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMGVkNzFkOTktYjhiMS00ODI3LWEyMDgtOTUyZjY1NDNmMDY3IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQ0MjI1Njc2Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0NDM5ODQ5Mywib3JnX2lkIjoib3JnX0dYbXNobWtubDlrMGFuOXAzc3A3IiwicHJvZmlsZV9pZCI6InByb19JOUZVMTlSdWp0NzI4SFp0ODB4MyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.q9-E0Wb8IXrwUvQyw5A2-bvgwkXqUeZrKsRi_rTHnaE'
```
#### Sign in and Terminate 2fa: (while sign-in, to create the jwt user-info token):
- Sign-in:
```bash
curl --location 'http://localhost:8080/user/v2/signin' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "Hyperswitch@123"
}'
```
- Terminate 2fa:
```bash
curl --location 'http://localhost:8080/user/2fa/terminate?skip_two_factor_auth=true' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMGVkNzFkOTktYjhiMS00ODI3LWEyMDgtOTUyZjY1NDNmMDY3IiwicHVycG9zZSI6InRvdHAiLCJvcmlnaW4iOiJzaWduX3VwIiwicGF0aCI6W10sImV4cCI6MTc0NDM5ODQ3NiwidGVuYW50X2lkIjoicHVibGljIn0.1p4cqrxgCDvPde5vq7nuuvApXQkaeoZX7ThvMFeiqFU' \
--header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMGVkNzFkOTktYjhiMS00ODI3LWEyMDgtOTUyZjY1NDNmMDY3IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQ0MjI1Njc2Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0NDM5ODQ5Mywib3JnX2lkIjoib3JnX0dYbXNobWtubDlrMGFuOXAzc3A3IiwicHJvZmlsZV9pZCI6InByb19JOUZVMTlSdWp0NzI4SFp0ODB4MyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.q9-E0Wb8IXrwUvQyw5A2-bvgwkXqUeZrKsRi_rTHnaE'
```
#### Switch Org for User (for tenant level):
```bash
curl --location 'https://integ-api.hyperswitch.io/user/switch/org' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMGVkNzFkOTktYjhiMS00ODI3LWEyMDgtOTUyZjY1NDNmMDY3IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQ0MjI1Njc2Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0NDM5ODQ5Mywib3JnX2lkIjoib3JnX0dYbXNobWtubDlrMGFuOXAzc3A3IiwicHJvZmlsZV9pZCI6InByb19JOUZVMTlSdWp0NzI4SFp0ODB4MyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.q9-E0Wb8IXrwUvQyw5A2-bvgwkXqUeZrKsRi_rTHnaE' \
--data '{
"org_id": "some_org_id"
}'
```
#### List Merchant Accounts (Admin API):
```bash
curl --location 'https://integ.hyperswitch.io/api/accounts/list?organization_id=org_pEDRnaMediEZaJcU888G' \
--header 'api-key: <admin-api-key>'
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/merchant_account.rs`
**Code Patterns Applied:**
- Modify database queries (3 changes)
**Detailed Identifier Changes:**
Commit 203ae3e9:
Files to modify:
**crates/diesel_models/src/query/merchant_account.rs**
Modify existing code
|
{"pr_number": 7782, "pr_title": "refactor(users): modify query to list only v1 merchant_accounts for list v1 merchant accounts API", "merged_at": "2025-04-10T10:14:36Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "token"]}, "hierarchy": {"database": ["crates/diesel_models/src/query/merchant_account.rs"]}, "change_types": {"imports_added": 2, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Add click to pay support in hyperswitch
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] New feature
## Description
<!-- Describe your changes in detail -->
Add click to pay and unified authentication service integration in core
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
check payments sanity
#1 : Create Business profile with `"is_click_to_pay_enabled": true`
```
curl --location 'http://localhost:8080/account/cewqcewc/business_profile' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"profile_name": "cewqcewc",
"payment_link_config": {
"business_specific_configs": {
"key1": {
"theme": "#3B845E",
"logo": "https://i.pinimg.com/736x/4d/83/5c/4d835ca8aafbbb15f84d07d926fda473.jpg",
"seller_name": "sahkal",
"display_sdk_only": true
},
"key2": {
"theme": "#B202FF",
"logo": "https://i.pinimg.com/736x/4d/83/5c/4d835ca8aafbbb15f84d07d926fda473.jpg",
"seller_name": "sahkal",
"enable_saved_payment_method":true
}
}
},
"is_click_to_pay_enabled": true
}'
```
#2: Create Merchant connector account for mastercard click to pay and adyen (if authorisation supported by adyen only)
Ctp MCA
```
curl --location 'http://localhost:8080/account/cewqcewc/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '
{
"connector_type": "authentication_processor",
"connector_name": "ctp_mastercard",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "MASTERCARD-API-KEY"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"city": "NY",
"unit": "245",
"live_endpoint_prefix": "vsfbjh"
},
"business_country": "US",
"business_label": "default"
}
'
```
#3 : Do payments Create with `confirm=false`
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_07eZpksxjV2V4SeM7X70PfZiQtsp27ygyhooXVjdV7mVIRxVKlELWwOrtVJ7XGRo' \
--data '{
"amount": 1130,
"currency": "USD",
"confirm": false,
"customer_id": "sahkal12",
"return_url": "https://hyperswitch.io"
}'
```
#4. Get the client secret and do a confirm call
```
curl --location 'http://localhost:8080/payments/pay_VjKiaXwRYsaw8p5gLY2k/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_10d1a8db20d74c1b941685208ecd6a46' \
--data '
{
"payment_method": "card",
"payment_method_type": "debit",
"client_secret": "pay_VjKiaXwRYsaw8p5gLY2k_secret_1QGBIB0svvM5xCMGA1my",
"ctp_service_details" : {
"merchant_transaction_id": "0a4e0d3.34f4a04b.803eb38b0a56f082296538d4a70c064a6b320639",
"correlation_id": "34f4a04b.bcd1ac39-e0f3-479e-b3ee-703ade0c66dc",
"x_src_flow_id" : "34f4a04b.bcd1ac39-e0f3-479e-b3ee-703ade0c66dc.1727438793"
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"color_depth": 24,
"java_enabled":true,
"java_script_enabled": true,
"language": "en-GB",
"screen_height": 1440,
"screen_width": 2560,
"time_zone": -330,
"user_agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36"
}
}'
```
# Logs
PreAuthentication via Uas
<img width="1718" alt="Screenshot 2024-12-13 at 9 00 05 PM" src="https://github.com/user-attachments/assets/6b8f12ad-de0c-44eb-8219-c8f1c569998c" />
PostAuthentication via Uas
<img width="1725" alt="Screenshot 2024-12-13 at 9 00 35 PM" src="https://github.com/user-attachments/assets/c1ddcb11-c12f-4070-905b-7184728fc5a2" />
Authorization Request to adyen with connector token received from uas
<img width="1728" alt="Screenshot 2024-12-13 at 9 01 20 PM" src="https://github.com/user-attachments/assets/5181d236-ac68-4dc5-9190-d7534168177f" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I 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/connector_enums.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types/unified_authentication_service.rs`
- ... and 2 more files
**3. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payment_methods/network_tokenization.rs`
- ... and 12 more files
**4. External Connector Integration**
- `crates/connector_configs/src/connector.rs`
- `crates/hyperswitch_connectors/src/connectors.rs`
- `crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs`
- ... and 7 more files
**5. Type Definitions**
- `crates/hyperswitch_interfaces/src/types.rs`
- `crates/router/src/types/api.rs`
- `crates/router/src/types/api/authentication.rs`
- ... and 3 more files
**6. Tests**
- `cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js`
- `cypress-tests/cypress/e2e/PaymentUtils/Commons.js`
- `cypress-tests/cypress/e2e/PaymentUtils/Paybox.js`
- ... and 2 more files
**7. Configuration Files**
- `.typos.toml`
- `crates/hyperswitch_interfaces/src/configs.rs`
**8. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (24 changes)
- Implement new functions (11 changes)
- Extend existing types with new fields (253 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 165ead61:
Files to modify:
**crates/api_models/src/connector_enums.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::ctp_mastercard
**crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs**
Add:
- function: private::build_headers
- function: private::id
- function: private::base_url
- function: private::get_webhook_object_reference_id
- function: private::get_webhook_event_type
- function: private::get_webhook_resource_object
- struct: pub::CtpMastercard
- impl: impl api::Payment for CtpMastercard
- impl: impl api::PaymentSession for CtpMastercard
- impl: impl api::ConnectorAccessToken for CtpMastercard
- impl: impl api::MandateSetup for CtpMastercard
- impl: impl api::PaymentAuthorize for CtpMastercard
- impl: impl api::PaymentSync for CtpMastercard
- impl: impl api::PaymentCapture for CtpMastercard
- impl: impl api::PaymentVoid for CtpMastercard
- impl: impl api::Refund for CtpMastercard
- impl: impl api::RefundExecute for CtpMastercard
- impl: impl api::RefundSync for CtpMastercard
- impl: impl api::PaymentToken for CtpMastercard
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorCommonExt<Flow, Request, Response> for CtpMastercard
- impl: impl ConnectorCommon for CtpMastercard
- impl: impl ConnectorValidation for CtpMastercard
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for CtpMastercard
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for CtpMastercard
- impl: impl webhooks::IncomingWebhook for CtpMastercard
**crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs**
Remove:
- function: private::get_auth_header
- function: private::get_headers
- function: private::get_content_type
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for unified_authentication_service::UnifiedAuthenticationServicePaymentsRequest::try_from(
req: &PaymentsAuthorizeRouterData,
.url(&types::PaymentsAuthorizeType::get_url(
.headers(types::PaymentsAuthorizeType::get_headers(
.set_body(types::PaymentsAuthorizeType::get_request_body(
data: &PaymentsAuthorizeRouterData,
) -> CustomResult<PaymentsAuthorizeRouterData, errors::ConnectorError> {
let response: unified_authentication_service::UnifiedAuthenticationServicePaymentsResponse =
.parse_struct("UnifiedAuthenticationService PaymentsAuthorizeResponse")
impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData>
for UnifiedAuthenticationService
req: &PaymentsSyncRouterData,
_req: &PaymentsSyncRouterData,
_connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
}
fn build_request(
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
Ok(Some(
RequestBuilder::new()
.method(Method::Get)
.url(&types::PaymentsSyncType::get_url(self, req, connectors)?)
.attach_default_headers()
.headers(types::PaymentsSyncType::get_headers(self, req, connectors)?)
.build(),
))
}
fn handle_response(
&self,
data: &PaymentsSyncRouterData,
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<PaymentsSyncRouterData, errors::ConnectorError> {
let response: unified_authentication_service::UnifiedAuthenticationServicePaymentsResponse =
res.response
.parse_struct("unified_authentication_service PaymentsSyncResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
RouterData::try_from(ResponseRouterData {
response,
data: data.clone(),
http_code: res.status_code,
})
}
fn get_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError>
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for UnifiedAuthenticationService
Add:
- impl: impl api::UnifiedAuthenticationService for UnifiedAuthenticationService
- impl: impl api::UasPreAuthentication for UnifiedAuthenticationService
- impl: impl api::UasPostAuthentication for UnifiedAuthenticationService
**crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs**
Remove:
- function: private::from
- function: private::from
- struct: pub::UnifiedAuthenticationServicePaymentsRequest
- struct: pub::UnifiedAuthenticationServicePaymentsResponse
- enum: pub::UnifiedAuthenticationServicePaymentStatus
- impl: impl From<(StringMinorUnit, T)> for UnifiedAuthenticationServiceRouterData<T>
- impl: impl From<UnifiedAuthenticationServicePaymentStatus> for common_enums::AttemptStatus
Add:
- struct: pub::UnifiedAuthenticationServicePreAuthenticateRequest
- struct: pub::PaymentDetails
- struct: pub::TransactionDetails
- struct: pub::ThreeDSData
- struct: pub::Acquirer
- struct: pub::BrowserInfo
- struct: pub::AuthenticationInfo
- struct: pub::CtpServiceDetails
- struct: pub::ServiceSessionIds
- struct: pub::MerchantDetails
- struct: pub::Address
- enum: pub::AuthType
**crates/hyperswitch_connectors/src/constants.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_flow_types.rs**
Add:
- mod: pub::unified_authentication_service
**crates/hyperswitch_domain_models/src/router_flow_types/unified_authentication_service.rs**
Add:
- struct: pub::PreAuthenticate
- struct: pub::PostAuthenticate
**crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs**
Remove:
- struct: pub::UasPostAuthenticationRequestData
Add:
- struct: pub::UasPostAuthenticationRequestData
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api.rs**
Add:
- trait: pub::UnifiedAuthenticationService
- trait: pub::UasPreAuthentication
- trait: pub::UasPostAuthentication
- trait: pub::UnifiedAuthenticationServiceV2
- trait: pub::UasPreAuthenticationV2
- trait: pub::UasPostAuthenticationV2
**crates/hyperswitch_interfaces/src/configs.rs**
Add:
- function: pub::validate
- struct: pub::NoParams
- impl: impl NoParams
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Remove:
- function: private::get_optional_shopper_email
Add:
- function: private::try_from
- function: private::try_from
- impl: impl TryFrom<(&domain::NetworkTokenData, Option<Secret<String>>)> for AdyenPaymentMethod<'_>
- impl: impl TryFrom<(
&AdyenRouterData<&types::PaymentsAuthorizeRouterData>,
&domain::NetworkTokenData,
)> for AdyenPaymentRequest<'_>
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/network_tokenization.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/connector_integration_v2_impls.rs**
Remove:
- impl: impl api::UasPreAuthenticationV2 for $connector
- impl: impl api::UasPostAuthenticationV2 for $connector
Add:
- impl: impl UasPreAuthenticationV2 for $connector
- impl: impl UasPostAuthenticationV2 for $connector
**crates/router/src/core/payments/flows.rs**
Remove:
- impl: impl api::UnifiedAuthenticationService for connector::DummyConnector<T>
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_complete_authorize.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/transformers.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/types.rs**
Modify existing code
**crates/router/src/types/api.rs**
Remove:
- mod: pub::unified_authentication_service
- mod: pub::unified_authentication_service_v2
**crates/router/src/types/api/authentication.rs**
Modify existing code
**crates/router/src/types/api/unified_authentication_service.rs**
Remove:
- struct: pub::PreAuthenticate
- struct: pub::PostAuthenticate
- trait: pub::UnifiedAuthenticationService
- trait: pub::UasPreAuthentication
- trait: pub::UasPostAuthentication
**crates/router/src/types/api/unified_authentication_service_v2.rs**
Remove:
- trait: pub::UnifiedAuthenticationServiceV2
- trait: pub::UasPreAuthenticationV2
- trait: pub::UasPostAuthenticationV2
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 6769, "pr_title": "feat(core): Add click to pay support in hyperswitch", "merged_at": "2024-12-16T14:25:44Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/connector_enums.rs"], "domain": ["crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/router_flow_types.rs", "crates/hyperswitch_domain_models/src/router_flow_types/unified_authentication_service.rs", "crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs", "crates/hyperswitch_domain_models/src/types.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/network_tokenization.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/connector_integration_v2_impls.rs", "crates/router/src/core/payments/flows.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_complete_authorize.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_update.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/unified_authentication_service.rs", "crates/router/src/core/unified_authentication_service/transformers.rs", "crates/router/src/core/unified_authentication_service/types.rs"], "connectors": ["crates/connector_configs/src/connector.rs", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs", "crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs", "crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs", "crates/hyperswitch_connectors/src/constants.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector.rs", "crates/router/src/connector/adyen/transformers.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs", "crates/router/src/types/api.rs", "crates/router/src/types/api/authentication.rs", "crates/router/src/types/api/unified_authentication_service.rs", "crates/router/src/types/api/unified_authentication_service_v2.rs", "crates/router/src/types/transformers.rs"], "tests": ["cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js", "cypress-tests/cypress/e2e/PaymentUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentUtils/Paybox.js", "postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js", "postman/collection-dir/paypal/Flow Testcases/Variation Cases/Scenario2-Confirming the payment without PMD/Payments - Confirm/event.test.js"], "config": [".typos.toml", "crates/hyperswitch_interfaces/src/configs.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/hyperswitch_interfaces/src/api.rs", "postman/collection-json/checkout.postman_collection.json", "postman/collection-json/paypal.postman_collection.json"]}, "change_types": {"structs_added": 24, "functions_added": 11, "enums_added": 2, "fields_added": 253, "imports_added": 14, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add payment method display name to feature matrix response
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR
1. Adds payment method display name to feature matrix response
2. Replace the 2 digit country codes into 3 digit country codes
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
List the feature matrix and ensure it contains the payment_method_type_dsplay_name field and the country code is 3 digits long.
```
curl --location 'http://localhost:8080/feature_matrix' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'
```
Response
```
{
"connector_count": 28,
"connectors": [
{
"name": "BAMBORA",
"display_name": "Bambora",
"description": "Bambora is a leading online payment provider in Canada and United States.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "credit",
"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": [
"Visa",
"Mastercard",
"AmericanExpress",
"Discover",
"JCB",
"DinersClub"
],
"supported_countries": [
"USA",
"CAN"
],
"supported_currencies": [
"USD"
]
}
],
"supported_webhook_flows": []
},
{
"name": "BAMBORAAPAC",
"display_name": "Bambora Asia-Pacific",
"description": "Bambora Asia-Pacific, provides comprehensive payment solutions, offering merchants smart and smooth payment processing capabilities.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_type_display_name": "Debit Card",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"DinersClub"
],
"supported_countries": [
"KIR",
"SWE",
"MUS",
"COL",
"USA",
"EST",
"LIE",
"WSM",
"IND",
"NLD",
"COD",
"SOM",
"FRA",
"UKR",
"KEN",
"TJK",
"CPV",
"MRT",
"SSD",
"CAN",
"NOR",
"HND",
"GBR",
"AUT",
"SUR",
"MDA",
"DEU",
"MDV",
"PAK",
"LSO",
"ARG",
"JOR",
"SMR",
"LKA",
"SRB",
"TGO",
"DMA",
"ZWE",
"RWA",
"LAO",
"EGY",
"PRT",
"BEN",
"PNG",
"ETH",
"BHR",
"NAM",
"TKM",
"PER",
"AUS",
"MEX",
"BWA",
"ECU",
"UGA",
"TUN",
"JAM",
"GNQ",
"CZE",
"BIH",
"ISR",
"CHL",
"BGR",
"KAZ",
"BOL",
"POL",
"BDI",
"AZE",
"MNE",
"GIN",
"ZAF",
"TZA",
"URY",
"SYC",
"DZA",
"ROU",
"IRL",
"OMN",
"NZL",
"MWI",
"BRA",
"CAF",
"PSE",
"BTN",
"GGY",
"MCO",
"SWZ",
"NIC",
"JPN",
"CRI",
"AND",
"NER",
"SLE",
"SEN",
"ERI",
"LUX",
"NPL",
"TTO",
"SAU",
"BRB",
"BLZ",
"PHL",
"DOM",
"MLT",
"TUV",
"TON",
"FJI",
"KNA",
"CIV",
"MYS",
"TLS",
"MDG",
"CYP",
"MMR",
"PRY",
"GUY",
"VNM",
"BHS",
"NGA",
"ZMB",
"VEN",
"SGP",
"TCD",
"GAB",
"GNB",
"DJI",
"TUR",
"CHN",
"KWT",
"LTU",
"AGO",
"GTM",
"SVN",
"UZB",
"CMR",
"SLB",
"ARM",
"FSM",
"STP",
"DNK",
"GRD",
"ISL",
"NRU",
"IDN",
"LCA",
"HTI",
"CHE",
"ALB",
"MKD",
"KGZ",
"MNG",
"BEL",
"MAR",
"GMB",
"VAT",
"VCT",
"LVA",
"PAN",
"MHL",
"QAT",
"BGD",
"ITA",
"GEO",
"MOZ",
"COG",
"ESP",
"LBR",
"HRV",
"LBN",
"ATG",
"GRC",
"BRN",
"MLI",
"BLR",
"ARE",
"SLV",
"FIN",
"PLW",
"HUN",
"GHA",
"VUT",
"KOR",
"SVK",
"KHM",
"COM",
"THA"
],
"supported_currencies": [
"RUB",
"ILS",
"ZMW",
"KZT",
"MOP",
"MAD",
"EGP",
"SCR",
"SLL",
"CHF",
"LAK",
"MMK",
"SEK",
"RWF",
"MDL",
"DKK",
"QAR",
"UAH",
"MXN",
"INR",
"IQD",
"CZK",
"BGN",
"NAD",
"USD",
"MWK",
"BRL",
"RSD",
"BOB",
"CAD",
"KRW",
"IDR",
"NZD",
"BDT",
"SGD",
"XOF",
"THB",
"NOK",
"GHS",
"NPR",
"KWD",
"UGX",
"ZAR",
"BND",
"HUF",
"GEL",
"PEN",
"JPY",
"MZN",
"UYU",
"EUR",
"TRY",
"COP",
"LKR",
"HRK",
"CNY",
"NGN",
"KES",
"XAF",
"TZS",
"VND",
"PLN",
"GBP",
"ISK",
"AED",
"BWP",
"HKD",
"TWD",
"PHP",
"RON",
"MYR",
"SAR",
"AUD",
"IRR",
"PKR",
"FJD"
]
},
{
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_type_display_name": "Credit Card",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"DinersClub"
],
"supported_countries": [
"VEN",
"JOR",
"EST",
"PLW",
"VNM",
"KEN",
"ROU",
"NER",
"VCT",
"KHM",
"IRL",
"NPL",
"GTM",
"BRB",
"CHE",
"DNK",
"TJK",
"PAN",
"CIV",
"PRT",
"PER",
"JPN",
"KIR",
"SAU",
"MAR",
"QAT",
"HUN",
"DMA",
"CMR",
"URY",
"ETH",
"MDG",
"VAT",
"TZA",
"SLB",
"ARE",
"HRV",
"FSM",
"MLT",
"ZWE",
"AUT",
"COM",
"IDN",
"LCA",
"GGY",
"ESP",
"TKM",
"GNQ",
"NGA",
"AND",
"LAO",
"LKA",
"SLV",
"FJI",
"USA",
"BRA",
"LUX",
"SGP",
"JAM",
"GBR",
"NAM",
"PHL",
"GIN",
"LIE",
"ISL",
"GMB",
"DEU",
"AUS",
"KWT",
"SOM",
"BTN",
"SYC",
"FIN",
"BLR",
"UZB",
"MMR",
"POL",
"MNE",
"BWA",
"PRY",
"BGR",
"CRI",
"SMR",
"MLI",
"SSD",
"TLS",
"GRD",
"SVK",
"KOR",
"MDV",
"ZMB",
"BHR",
"MHL",
"NZL",
"IND",
"MNG",
"MDA",
"GRC",
"VUT",
"LVA",
"GHA",
"CHL",
"CPV",
"CAN",
"CAF",
"ISR",
"DZA",
"MCO",
"TUN",
"MUS",
"BEN",
"CHN",
"BEL",
"EGY",
"PNG",
"UGA",
"DJI",
"ECU",
"ATG",
"SEN",
"LBN",
"ERI",
"BHS",
"KNA",
"THA",
"MEX",
"WSM",
"SUR",
"TUR",
"SLE",
"ARM",
"NOR",
"MWI",
"AZE",
"FRA",
"AGO",
"NLD",
"ALB",
"HND",
"LTU",
"RWA",
"KGZ",
"DOM",
"TTO",
"BRN",
"KAZ",
"COL",
"BIH",
"NRU",
"CYP",
"ZAF",
"LSO",
"OMN",
"TON",
"GNB",
"MRT",
"ARG",
"GEO",
"COG",
"GAB",
"BGD",
"TCD",
"TUV",
"MKD",
"SVN",
"BLZ",
"SRB",
"LBR",
"BDI",
"SWZ",
"ITA",
"PSE",
"COD",
"STP",
"PAK",
"NIC",
"TGO",
"CZE",
"UKR",
"HTI",
"SWE",
"BOL",
"GUY",
"MOZ",
"MYS"
],
"supported_currencies": [
"QAR",
"MZN",
"ILS",
"NPR",
"RON",
"CHF",
"LKR",
"ISK",
"NAD",
"RWF",
"DKK",
"UYU",
"VND",
"IRR",
"XAF",
"KWD",
"MWK",
"MAD",
"RSD",
"MMK",
"HUF",
"CZK",
"BGN",
"THB",
"PKR",
"IDR",
"LAK",
"BRL",
"GBP",
"MOP",
"NGN",
"SCR",
"SLL",
"ZMW",
"INR",
"MYR",
"IQD",
"GEL",
"RUB",
"NZD",
"JPY",
"EGP",
"AED",
"SEK",
"XOF",
"FJD",
"GHS",
"PHP",
"TZS",
"NOK",
"CAD",
"TRY",
"MXN",
"PEN",
"CNY",
"KRW",
"MDL",
"SGD",
"BDT",
"AUD",
"UGX",
"USD",
"ZAR",
"UAH",
"HKD",
"BND",
"BOB",
"COP",
"HRK",
"TWD",
"PLN",
"BWP",
"SAR",
"KZT",
"KES",
"EUR"
]
}
],
"supported_webhook_flows": []
},
{
"name": "BILLWERK",
"display_name": "Billwerk",
"description": "Billwerk+ Pay is an acquirer independent payment gateway that's easy to setup with more than 50 recurring and non-recurring payment methods.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "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",
"AmericanExpress",
"Discover",
"JCB",
"UnionPay",
"DinersClub",
"Interac",
"CartesBancaires"
],
"supported_countries": [
"SWE",
"FRA",
"DNK",
"DEU"
],
"supported_currencies": [
"DKK",
"NOK"
]
},
{
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_type_display_name": "Debit Card",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Mastercard",
"Visa",
"AmericanExpress",
"Discover",
"JCB",
"UnionPay",
"DinersClub",
"Interac",
"CartesBancaires"
],
"supported_countries": [
"DNK",
"FRA",
"SWE",
"DEU"
],
"supported_currencies": [
"DKK",
"NOK"
]
}
],
"supported_webhook_flows": []
}
]}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/feature_matrix.rs`
**2. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (15 changes)
**Detailed Identifier Changes:**
Commit e8afec2f:
Files to modify:
**crates/api_models/src/feature_matrix.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- function: pub::to_display_name
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/routes/feature_matrix.rs**
Modify existing code
|
{"pr_number": 7639, "pr_title": "feat(router): add payment method display name to feature matrix response", "merged_at": "2025-04-01T12:15:42Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "merchant", "refund"]}, "hierarchy": {"api_models": ["crates/api_models/src/feature_matrix.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/routes/feature_matrix.rs"]}, "change_types": {"functions_added": 1, "fields_added": 15}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Loonio] implement payouts
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
implement payouts for Loonio
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
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 Loonio Payout
```
curl --location 'http://localhost:8080/account/merchant_1759832187/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_sCP4vFLQ6aoU7Hi1kFSxUfGZXKkYrRBBlaykRucf8qtPDgCz34JI7EJ7x7ZOt0Up' \
--data '{
"connector_type": "payout_processor",
"connector_name": "loonio",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "_",
"key1": "_"
},
"test_mode": false,
"disabled": false
}'
```
Create a interac Payout
```
curl --location 'http://localhost:8080/payouts/create' \
--header 'x-feature: integ-custom' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_sCP4vFLQ6aoU7Hi1kFSxUfGZXKkYrRBBlaykRucf8qtPDgCz34JI7EJ7x7ZOt0Up' \
--data-raw '{
"amount": 1,
"currency": "CAD",
"customer_id": "cus_T1nIsYGhYLX9gpGLk5A1",
"email": "[email protected]",
"name": "Doest John",
"phone": "6168205366",
"phone_country_code": "+1",
"description": "Its my first payout request",
"payout_type": "bank_redirect",
"payout_method_data": {
"bank_redirect": {
"interac": {
"email": "[email protected]"
}
}
},
"connector": [
"loonio"
],
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "CA",
"zip": "94122",
"country": "US",
"first_name": "Doest",
"last_name": "John"
},
"phone": {
"number": "6168205366",
"country_code": "1"
}
},
"entity_type": "Individual",
"recurring": false,
"confirm": true,
"auto_fulfill": true
}'
```
Response
```
{
"payout_id": "payout_Wo7WSccu3gsj3nHjAceu",
"merchant_id": "merchant_1759832187",
"merchant_order_reference_id": null,
"amount": 1,
"currency": "CAD",
"connector": "loonio",
"payout_type": "bank_redirect",
"payout_method_data": {
"bank_redirect": {
"email": "ex*****@example.com"
}
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "CA",
"first_name": "Doest",
"last_name": "John",
"origin_zip": null
},
"phone": {
"number": "6168205366",
"country_code": "1"
},
"email": null
},
"auto_fulfill": true,
"customer_id": "cus_T1nIsYGhYLX9gpGLk5A1",
"customer": {
"id": "cus_T1nIsYGhYLX9gpGLk5A1",
"name": "John Doe",
"email": "[email protected]",
"phone": "6168205366",
"phone_country_code": "+1"
},
"client_secret": "payout_payout_Wo7WSccu3gsj3nHjAceu_secret_R0cRg0Ghrp3E1p111dyu",
"return_url": null,
"business_country": null,
"business_label": null,
"description": "Its my first payout request",
"entity_type": "Individual",
"recurring": false,
"metadata": {},
"merchant_connector_id": "mca_CAgv5aZcOkJDxFyidjhp",
"status": "initiated",
"error_message": null,
"error_code": null,
"profile_id": "pro_1NTfzZKyGXpM6RZZna3r",
"created": "2025-10-07T11:16:00.091Z",
"connector_transaction_id": "payout_Wo7WSccu3gsj3nHjAceu_1",
"priority": null,
"payout_link": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "6168205366",
"phone_country_code": "+1",
"unified_code": null,
"unified_message": null,
"payout_method_id": null
}
```
Do sync
```
curl --location 'http://localhost:8080/payouts/payout_Wo7WSccu3gsj3nHjAceu?force_sync=true' \
--header 'api-key: dev_sCP4vFLQ6aoU7Hi1kFSxUfGZXKkYrRBBlaykRucf8qtPDgCz34JI7EJ7x7ZOt0Up'
```
Response
```
{
"payout_id": "payout_Wo7WSccu3gsj3nHjAceu",
"merchant_id": "merchant_1759832187",
"merchant_order_reference_id": null,
"amount": 1,
"currency": "CAD",
"connector": "loonio",
"payout_type": "bank_redirect",
"payout_method_data": {
"bank_redirect": {
"email": "ex*****@example.com"
}
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "CA",
"first_name": "Doest",
"last_name": "John",
"origin_zip": null
},
"phone": {
"number": "6168205366",
"country_code": "1"
},
"email": null
},
"auto_fulfill": true,
"customer_id": "cus_T1nIsYGhYLX9gpGLk5A1",
"customer": {
"id": "cus_T1nIsYGhYLX9gpGLk5A1",
"name": "John Doe",
"email": "[email protected]",
"phone": "6168205366",
"phone_country_code": "+1"
},
"client_secret": "payout_payout_Wo7WSccu3gsj3nHjAceu_secret_R0cRg0Ghrp3E1p111dyu",
"return_url": null,
"business_country": null,
"business_label": null,
"description": "Its my first payout request",
"entity_type": "Individual",
"recurring": false,
"metadata": {},
"merchant_connector_id": "mca_CAgv5aZcOkJDxFyidjhp",
"status": "pending",
"error_message": null,
"error_code": null,
"profile_id": "pro_1NTfzZKyGXpM6RZZna3r",
"created": "2025-10-07T11:16:00.091Z",
"connector_transaction_id": "payout_Wo7WSccu3gsj3nHjAceu_1",
"priority": null,
"payout_link": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "6168205366",
"phone_country_code": "+1",
"unified_code": null,
"unified_message": null,
"payout_method_id": null
}
```
We will get pending status, as per doc in sbx we can not fullfill the payouts.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/enums.rs`
- `crates/api_models/src/payouts.rs`
**2. Core Business Logic**
- `crates/router/src/core/payment_methods/cards.rs`
- `crates/router/src/core/payment_methods/vault.rs`
- `crates/router/src/core/payouts/helpers.rs`
**3. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 15 more files
**4. Type Definitions**
- `crates/router/src/types/api/payouts.rs`
- `crates/router/src/types/transformers.rs`
**5. Utils**
- `crates/common_utils/src/payout_method_utils.rs`
**6. Tests**
- `config/deployments/integration_test.toml`
**7. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 3 more files
**8. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/common_enums/src/enums.rs`
- ... and 5 more files
**Code Patterns Applied:**
- Define new data structures (7 changes)
- Implement new functions (23 changes)
- Extend existing types with new fields (124 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit abcc70be:
Files to modify:
**crates/api_models/src/enums.rs**
Modify existing code
**crates/api_models/src/payouts.rs**
Add:
- struct: pub::Interac
- enum: pub::BankRedirect
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_utils/src/payout_method_utils.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/euclid/src/enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/loonio.rs**
Add:
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_url
- function: private::get_headers
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- impl: impl api::Payouts for Loonio
- impl: impl api::PayoutFulfill for Loonio
- impl: impl api::PayoutSync for Loonio
- impl: impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Loonio
- impl: impl ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> for Loonio
**crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs**
Add:
- function: private::try_from
- function: private::from
- function: private::try_from
- function: private::try_from
- struct: pub::LoonioPayoutFulfillRequest
- struct: pub::LoonioPayoutFulfillResponse
- struct: pub::LoonioPayoutSyncResponse
- enum: pub::LoonioPayoutStatus
- impl: impl TryFrom<&LoonioRouterData<&PayoutsRouterData<PoFulfill>>> for LoonioPayoutFulfillRequest
- impl: impl From<LoonioPayoutStatus> for enums::PayoutStatus
- impl: impl TryFrom<PayoutsResponseRouterData<F, LoonioPayoutFulfillResponse>> for PayoutsRouterData<F>
- impl: impl TryFrom<PayoutsResponseRouterData<F, LoonioPayoutSyncResponse>> for PayoutsRouterData<F>
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payone/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripe/transformers/connect.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/wise/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/configs/defaults/payout_required_fields.rs**
Modify existing code
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
**crates/router/src/core/payment_methods/vault.rs**
Add:
- function: private::get_value2
- function: private::from_values
- struct: pub::TokenizedBankRedirectSensitiveValues
- struct: pub::TokenizedBankRedirectInsensitiveValues
**crates/router/src/core/payouts/helpers.rs**
Modify existing code
**crates/router/src/types/api/payouts.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/tests/connectors/adyen.rs**
Modify existing code
|
{"pr_number": 9718, "pr_title": "feat(connector): [Loonio] implement payouts", "merged_at": "2025-10-08T16:47:56Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "merchant", "order"]}, "hierarchy": {"api_models": ["crates/api_models/src/enums.rs", "crates/api_models/src/payouts.rs"], "core_business": ["crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/payouts/helpers.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/adyen.rs", "crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs", "crates/hyperswitch_connectors/src/connectors/loonio.rs", "crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payone/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers/connect.rs", "crates/hyperswitch_connectors/src/connectors/wise/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/router/tests/connectors/adyen.rs"], "types": ["crates/router/src/types/api/payouts.rs", "crates/router/src/types/transformers.rs"], "utils": ["crates/common_utils/src/payout_method_utils.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/defaults/payout_required_fields.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/common_enums/src/enums.rs", "crates/euclid/src/enums.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "migrations/2025-10-07-100547-0000_add_bank_redirect_in/down.sql", "migrations/2025-10-07-100547-0000_add_bank_redirect_in/up.sql"]}, "change_types": {"structs_added": 7, "functions_added": 23, "enums_added": 3, "fields_added": 124, "imports_added": 5, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Novalnet] Add supported currencies
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [X] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
1. Added supported currencies for novalnet
2. Removed browser info from required fields for novalnet
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
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 for currency EUR for cards and wallets
PR containing test screenshots for cards
https://github.com/juspay/hyperswitch/pull/5726
PR containing testing info for wallets
https://github.com/juspay/hyperswitch/pull/6370
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [X] I formatted the code `cargo +nightly fmt --all`
- [X] I addressed lints thrown by `cargo clippy`
- [X] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/enums.rs`
**2. External Connector Integration**
- `crates/router/src/configs/defaults/payment_connector_required_fields.rs`
**3. Tests**
- `config/deployments/integration_test.toml`
**4. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**5. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Detailed Identifier Changes:**
Commit a35a4f31:
Files to modify:
**crates/api_models/src/enums.rs**
Modify existing code
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Modify existing code
|
{"pr_number": 6547, "pr_title": "feat(connector): [Novalnet] Add supported currencies", "merged_at": "2024-11-14T11:45:12Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["card"]}, "hierarchy": {"api_models": ["crates/api_models/src/enums.rs"], "connectors": ["crates/router/src/configs/defaults/payment_connector_required_fields.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"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): payment links - add support for custom background image and layout in details section
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR introduces UI revamps to the payment links by including below changes - (described in #6711)
- Introduce `branding_visibility` in business profile's payment link config
- Introduce `details_layout` and `background_image` in both business profile and payments create API
- Consume these values in payment link's template
There are two additional changes which are mentioned below
- Always use SDK's top redirection in payment links
- Update connector_list ENV config for `network_transaction_id_supported_connectors`
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Helps configure details section for payment links, and fixes a few existing bugs around logos.
## How did you test it?
<details>
<summary>Overview</summary>
Things to test and verify -
1. Background image in details section
- Provision for background images is added in the details section of the payment links
- Below configs are provided for configuring the image
- Image URL
- Image width
- Image positioning
2. Feasibility of rectangular images as logo
- Images with rectagular dimenstions can be used as merchant logo
3. Branding visibility
- HyperSwitch branding toggle in the payment links
4. Layouts for details section
- Multiple layouts for details section
- Layout1
- Layout2
</details>
<details>
<summary>Steps for testing</summary>
*Details layout*
- Provision for configuring `details_layout` is at both profile level and at payments API level
<details>
<summary>1. Default layout (layout1) </summary>
- Create a default payment link (without configuring `details_layout`)
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CWKVSn8Qjyb1Qjt6AGNmivVRPm3mgmoS9GDhKPvTB7vVVAbktxV6wPnX3QcJNstt' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_rFGS1qK0MTSxdj0m5aqo","profile_id":"pro_r48ZhNBTND9A4PAc5rHT","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":"[email protected]","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."}}'
<img width="1728" alt="Screenshot 2024-12-06 at 11 37 58 AM" src="https://github.com/user-attachments/assets/2a8c02a7-6083-44d2-9fda-26fd15e1fc7d">
- Set `layout1` in business profile config
cURL
curl --location --request POST 'http://localhost:8080/account/merchant_1733294735/business_profile/pro_r48ZhNBTND9A4PAc5rHT' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{"payment_link_config":{"allowed_domains":["*"],"enabled_saved_payment_method":true,"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico","details_layout":"layout1"}}'
- Create a payment link after configuring `details_layout` in business profile
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CWKVSn8Qjyb1Qjt6AGNmivVRPm3mgmoS9GDhKPvTB7vVVAbktxV6wPnX3QcJNstt' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_rFGS1qK0MTSxdj0m5aqo","profile_id":"pro_r48ZhNBTND9A4PAc5rHT","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":"[email protected]","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."}}'
<img width="1728" alt="Screenshot 2024-12-06 at 11 39 37 AM" src="https://github.com/user-attachments/assets/3b022c0b-a163-4651-9595-f39c46388684">
- Create a payment link using `layout1` in the payments API
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CWKVSn8Qjyb1Qjt6AGNmivVRPm3mgmoS9GDhKPvTB7vVVAbktxV6wPnX3QcJNstt' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_rFGS1qK0MTSxdj0m5aqo","profile_id":"pro_r48ZhNBTND9A4PAc5rHT","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":"[email protected]","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.","details_layout":"layout1"}}'
<img width="1728" alt="Screenshot 2024-12-06 at 11 43 33 AM" src="https://github.com/user-attachments/assets/05d8a6d0-e77d-414b-b67f-87ad0919f3f1">
</details>
<details>
<summary>2. Layout 2 </summary>
- Set `layout2` in business profile config
cURL
curl --location --request POST 'http://localhost:8080/account/merchant_1733294735/business_profile/pro_r48ZhNBTND9A4PAc5rHT' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{"payment_link_config":{"allowed_domains":["*"],"enabled_saved_payment_method":true,"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico","details_layout":"layout2","business_specific_configs":{"style1":{"enabled_saved_payment_method":true,"theme":"#FEFEFE","logo":"https://hyperswitch.io/favicon.ico"},"style2":{"enabled_saved_payment_method":true,"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico"}}}}'
- Create a payment link after configuring `details_layout` in business profile
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CWKVSn8Qjyb1Qjt6AGNmivVRPm3mgmoS9GDhKPvTB7vVVAbktxV6wPnX3QcJNstt' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_rFGS1qK0MTSxdj0m5aqo","profile_id":"pro_r48ZhNBTND9A4PAc5rHT","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":"[email protected]","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."}}'
<img width="1728" alt="Screenshot 2024-12-06 at 11 45 45 AM" src="https://github.com/user-attachments/assets/f00b60a4-1313-40d8-8337-4d02a045b3d0">
- Create a payment link using `layout2` in the payments API
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CWKVSn8Qjyb1Qjt6AGNmivVRPm3mgmoS9GDhKPvTB7vVVAbktxV6wPnX3QcJNstt' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_rFGS1qK0MTSxdj0m5aqo","profile_id":"pro_r48ZhNBTND9A4PAc5rHT","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":"[email protected]","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.","details_layout":"layout2"}}'
<img width="1728" alt="Screenshot 2024-12-06 at 11 46 53 AM" src="https://github.com/user-attachments/assets/2ab30fdb-de31-413f-a414-aa137e1189a5">
</details>
*Branding visibility*
- Provision for toggling branding visibility is at profile level
<details>
<summary>1. Default visibility</summary>
- Create a payment link
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CWKVSn8Qjyb1Qjt6AGNmivVRPm3mgmoS9GDhKPvTB7vVVAbktxV6wPnX3QcJNstt' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_rFGS1qK0MTSxdj0m5aqo","profile_id":"pro_r48ZhNBTND9A4PAc5rHT","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":"[email protected]","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.","details_layout":"layout2"}}'
<img width="1727" alt="Screenshot 2024-12-06 at 12 27 30 PM" src="https://github.com/user-attachments/assets/d89d6f4c-3280-4918-848a-f79bf35a96ef">
</details>
<details>
<summary>2. Hidden visibility</summary>
- Set `branding_visibility` to true in business profile config
cURL
curl --location --request POST 'http://localhost:8080/account/merchant_1733294735/business_profile/pro_r48ZhNBTND9A4PAc5rHT' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{"payment_link_config":{"allowed_domains":["*"],"enabled_saved_payment_method":true,"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico","branding_visibility":false,"business_specific_configs":{"style1":{"enabled_saved_payment_method":true,"theme":"#FEFEFE","logo":"https://hyperswitch.io/favicon.ico"},"style2":{"enabled_saved_payment_method":true,"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico"}}}}'
- Create a payment link
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CWKVSn8Qjyb1Qjt6AGNmivVRPm3mgmoS9GDhKPvTB7vVVAbktxV6wPnX3QcJNstt' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_rFGS1qK0MTSxdj0m5aqo","profile_id":"pro_r48ZhNBTND9A4PAc5rHT","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":"[email protected]","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.","details_layout":"layout2"}}'
<img width="1728" alt="Screenshot 2024-12-06 at 12 26 01 PM" src="https://github.com/user-attachments/assets/54d98c99-3218-43a1-ab04-51fcfc8041f8">
</details>
*Background image*
- Provision for setting background image is at both profile and payments API level
<details>
<summary>1. Background images in business profile</summary>
- Set background image in business profile (url and size)
cURL
curl --location --request POST 'http://localhost:8080/account/merchant_1733294735/business_profile/pro_r48ZhNBTND9A4PAc5rHT' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{"payment_link_config":{"allowed_domains":["*"],"enabled_saved_payment_method":true,"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico","background_image":{"url":"https://img.freepik.com/free-photo/hand-painted-watercolor-background-with-sky-clouds-shape_24972-1095.jpg","size":"cover"},"business_specific_configs":{"style1":{"enabled_saved_payment_method":true,"theme":"#FEFEFE","logo":"https://hyperswitch.io/favicon.ico"},"style2":{"enabled_saved_payment_method":true,"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico"}}}}'
- Create a payment link
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CWKVSn8Qjyb1Qjt6AGNmivVRPm3mgmoS9GDhKPvTB7vVVAbktxV6wPnX3QcJNstt' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_rFGS1qK0MTSxdj0m5aqo","profile_id":"pro_r48ZhNBTND9A4PAc5rHT","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":"[email protected]","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.","details_layout":"layout2"}}'
</details>
<details>
<summary>2. Background images in payments API</summary>
- Send the background image in the payments API
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CWKVSn8Qjyb1Qjt6AGNmivVRPm3mgmoS9GDhKPvTB7vVVAbktxV6wPnX3QcJNstt' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_rFGS1qK0MTSxdj0m5aqo","profile_id":"pro_r48ZhNBTND9A4PAc5rHT","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":"[email protected]","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.","details_layout":"layout2","background_image":{"url":"https://img.freepik.com/free-photo/abstract-blue-geometric-shapes-background_24972-1841.jpg","size":"cover"}}}'
<img width="1728" alt="Screenshot 2024-12-06 at 1 36 15 PM" src="https://github.com/user-attachments/assets/17bbcb56-1efa-48f8-b05d-19c3ed137d0c">
</details>
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. 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.css`
- `crates/router/src/core/payment_link/payment_link_initiate/payment_link.html`
- ... and 3 more files
**5. Type Definitions**
- `crates/router/src/types/transformers.rs`
**6. Configuration Files**
- `config/deployments/production.toml`
**7. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (64 changes)
- Add conditional logic for feature flags or filtering (18 changes)
**Detailed Identifier Changes:**
Commit d11d8740:
Files to modify:
**crates/api_models/src/admin.rs**
Add:
- struct: pub::PaymentLinkBackgroundImageConfig
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- mod: private::ui
**crates/common_enums/src/enums/ui.rs**
Add:
- function: private::deserialize
- function: private::expecting
- function: private::visit_str
- function: private::serialize
- struct: private::ElementSizeVisitor
- enum: pub::ElementPosition
- enum: pub::ElementSize
- enum: pub::SizeVariants
- enum: pub::PaymentLinkDetailsLayout
- impl: impl Deserialize<'de> for ElementSize
- impl: impl Visitor<'_> for ElementSizeVisitor
- impl: impl Serialize for ElementSize
**crates/diesel_models/src/business_profile.rs**
Add:
- struct: pub::PaymentLinkBackgroundImageConfig
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- function: private::convert_from
- function: private::convert_back
- impl: impl ApiModelToDieselModelConvertor<api_models::admin::PaymentLinkBackgroundImageConfig> for diesel_models::business_profile::PaymentLinkBackgroundImageConfig
**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/types/transformers.rs**
Add:
- function: private::foreign_from
- impl: impl ForeignFrom<diesel_models::business_profile::PaymentLinkBackgroundImageConfig> for api_models::admin::PaymentLinkBackgroundImageConfig
|
{"pr_number": 6725, "pr_title": "feat(core): payment links - add support for custom background image and layout in details section", "merged_at": "2024-12-12T15:48:18Z", "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.css", "crates/router/src/core/payment_link/payment_link_initiate/payment_link.html", "crates/router/src/core/payment_link/payment_link_initiate/payment_link.js", "crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router/src/types/transformers.rs"], "config": ["config/deployments/production.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/common_enums/src/enums/ui.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 3, "functions_added": 8, "enums_added": 4, "fields_added": 64, "imports_added": 4, "conditionals_added": 18}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): Add Validation Check for Amount in Capture Flow
## 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/9432)
## Description
<!-- Describe your changes in detail -->
Added validation check for amount in capture flow.
Fixed WASM for Peachpayments
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Postman Test
Payments - Capture
Request:
```
curl --location 'http://localhost:8080/payments/pay_wiEii3CAAWM0vJdiSxT4/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ClYBYyzQ6dQf7CFDM4xJc7dJqnRKVKIAzwTe8jTWmWudRHgifkuuRqZrlO9dJcJM' \
--data '{
"amount_to_capture": -100,
"statement_descriptor_name": "Joseph",
"statement_descriptor_suffix": "JS"
}'
```
Response:
```
{
"error": {
"type": "invalid_request",
"message": "amount contains invalid data. Expected format is positive integer",
"code": "IR_05"
}
}
```
Dashboard WASM
<img width="1309" height="1028" alt="Screenshot 2025-09-18 at 9 49 59 PM" src="https://github.com/user-attachments/assets/7f716cb8-ff72-45ad-9000-5897bd9c30b8" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/helpers.rs`
**2. External Connector Integration**
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- ... and 1 more files
**Code Patterns Applied:**
- Extend existing types with new fields (7 changes)
**Detailed Identifier Changes:**
Commit 87fc0066:
Files to modify:
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
|
{"pr_number": 9434, "pr_title": "fix(core): Add Validation Check for Amount in Capture Flow", "merged_at": "2025-09-19T07:35:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/helpers.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"]}, "change_types": {"fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(authentication): moved cavv storing from table to temp locker
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
## Description
<!-- Describe your changes in detail -->
main PR
https://github.com/juspay/hyperswitch/pull/7978
https://github.com/juspay/hyperswitch/pull/8035
## How did you test 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 **connector_integration** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/authentication.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types/authentication.rs`
- `crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs`
- `crates/hyperswitch_domain_models/src/router_response_types.rs`
**3. Core Business Logic**
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/authentication/utils.rs`
- `crates/router/src/core/payments.rs`
- ... and 7 more files
**4. External Connector Integration**
- `crates/router/src/connector/gpayments/gpayments_types.rs`
- `crates/router/src/connector/netcetera/transformers.rs`
- `crates/router/src/connector/threedsecureio/transformers.rs`
**5. Type Definitions**
- `crates/router/src/types/api/authentication.rs`
- `crates/router/src/types/domain.rs`
- `crates/router/src/types/transformers.rs`
**6. Other**
- `crates/hyperswitch_interfaces/src/authentication.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (32 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit 1d45b589:
Files to modify:
**crates/diesel_models/src/authentication.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/authentication.rs**
Add:
- struct: pub::AuthenticationStore
**crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/authentication.rs**
Modify existing code
**crates/router/src/connector/gpayments/gpayments_types.rs**
Modify existing code
**crates/router/src/connector/netcetera/transformers.rs**
Modify existing code
**crates/router/src/connector/threedsecureio/transformers.rs**
Modify existing code
**crates/router/src/core/authentication.rs**
Modify existing code
**crates/router/src/core/authentication/utils.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_status.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/payments/types.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/utils.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/types/api/authentication.rs**
Modify existing code
**crates/router/src/types/domain.rs**
Add:
- mod: pub::authentication
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 8043, "pr_title": "refactor(authentication): moved cavv storing from table to temp locker", "merged_at": "2025-05-15T13:07:06Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": []}, "hierarchy": {"database": ["crates/diesel_models/src/authentication.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types/authentication.rs", "crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/authentication.rs", "crates/router/src/core/authentication/utils.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/payment_status.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/payments/types.rs", "crates/router/src/core/unified_authentication_service/utils.rs", "crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/router/src/connector/gpayments/gpayments_types.rs", "crates/router/src/connector/netcetera/transformers.rs", "crates/router/src/connector/threedsecureio/transformers.rs"], "types": ["crates/router/src/types/api/authentication.rs", "crates/router/src/types/domain.rs", "crates/router/src/types/transformers.rs"], "other": ["crates/hyperswitch_interfaces/src/authentication.rs"]}, "change_types": {"structs_added": 1, "functions_added": 8, "fields_added": 32, "imports_added": 5, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Chargebee] Add record back support for chargebee [V2]
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Add support for record back flow for chargebee.
**What is record back flow ?**
After payment is retried by revenue recovery, we need to update the billing processor invoice.
Chargebee flow
We record the transaction in chargebee created by internal system. This transaction will automatically update the invoice status in chargebee system.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
This cannot be tested, Since proxy was not implemented to actually do retries. Tested this PR locally.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs`
**2. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payments/flows.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/chargebee.rs`
- `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs`
- `crates/hyperswitch_connectors/src/default_implementations.rs`
**4. Other**
- `crates/hyperswitch_interfaces/src/api/revenue_recovery.rs`
- `crates/router/src/services/conversion_impls.rs`
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (14 changes)
- Extend existing types with new fields (51 changes)
**Detailed Identifier Changes:**
Commit e77bb71c:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/chargebee.rs**
Add:
- function: private::get_headers
- function: private::get_url
- function: private::get_content_type
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- impl: impl api::revenue_recovery::RevenueRecoveryRecordBack for Chargebee
- impl: impl ConnectorIntegration<
RecoveryRecordBack,
RevenueRecoveryRecordBackRequest,
RevenueRecoveryRecordBackResponse,
> for Chargebee
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Add:
- function: private::from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- struct: pub::ChargebeeMetadata
- struct: pub::ChargebeeRecordPaymentRequest
- struct: pub::ChargebeeRecordbackResponse
- struct: pub::ChargebeeRecordbackInvoice
- enum: pub::ChargebeeRecordPaymentMethod
- enum: pub::ChargebeeRecordStatus
- impl: impl TryFrom<&ChargebeeRouterData<&RevenueRecoveryRecordBackRouterData>> for ChargebeeRecordPaymentRequest
- impl: impl TryFrom<enums::AttemptStatus> for ChargebeeRecordStatus
- impl: impl TryFrom<
ResponseRouterData<
RecoveryRecordBack,
ChargebeeRecordbackResponse,
RevenueRecoveryRecordBackRequest,
RevenueRecoveryRecordBackResponse,
>,
> for RevenueRecoveryRecordBackRouterData
**crates/hyperswitch_connectors/src/default_implementations.rs**
Remove:
- impl: impl RevenueRecovery for $connector
**crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/revenue_recovery.rs**
Add:
- trait: pub::RevenueRecovery
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Remove:
- impl: impl api::RevenueRecovery for connector::DummyConnector<T>
Add:
- impl: impl api::RevenueRecovery for connector::DummyConnector<T>
**crates/router/src/services/conversion_impls.rs**
Add:
- function: private::from_old_router_data
- function: private::to_old_router_data
- impl: impl RouterDataConversion<T, Req, Resp> for RevenueRecoveryRecordBackData
|
{"pr_number": 7505, "pr_title": "feat(connector): [Chargebee] Add record back support for chargebee [V2]", "merged_at": "2025-03-18T13:16:25Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "transaction"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/chargebee.rs", "crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs"], "other": ["crates/hyperswitch_interfaces/src/api/revenue_recovery.rs", "crates/router/src/services/conversion_impls.rs"]}, "change_types": {"structs_added": 4, "functions_added": 14, "enums_added": 2, "fields_added": 51, "imports_added": 10}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(redis): add support for fetching multiple keys for redis cluster
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
added support for fetching multiple keys for redis cluster.
Earlier, we were using `mget` to fetch multiple keys. While this works fine for standalone redis, it would fail for redis cluster(it won't work if redis keys are stored in multiple hash slots).
So, introduced a new redis interface function to use `mget` for standalone redis and parallel `get` calls for cluster redis.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
test cases same as this PR: https://github.com/juspay/hyperswitch/pull/8887
Tested in an internal environment with redis cluster setup enabled.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/redis_interface/src/commands.rs`
- `crates/redis_interface/src/lib.rs`
**Code Patterns Applied:**
- Implement new functions (4 changes)
- Extend existing types with new fields (8 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit cc44831c:
Files to modify:
**crates/redis_interface/src/commands.rs**
Add:
- function: private::get_multiple_keys_with_mget
- function: private::get_keys_by_mode
**crates/redis_interface/src/lib.rs**
Modify existing code
|
{"pr_number": 9019, "pr_title": "fix(redis): add support for fetching multiple keys for redis cluster", "merged_at": "2025-08-22T14:07:12Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["crates/redis_interface/src/commands.rs", "crates/redis_interface/src/lib.rs"]}, "change_types": {"functions_added": 4, "fields_added": 8, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(ucs): add event logging for UCS operations
## 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 comprehensive event logging for UCS operations to improve debugging and monitoring. The changes wrap UCS calls with structured logging that captures request/response data, timing, and errors across all payment flows.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
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 UCS
```
curl --location 'http://localhost:8080/configs/' \
--header 'api-key: test_admin' \
--header 'Content-Type: application/json' \
--data '
{
"key": "ucs_enabled",
"value": "true"
}'
```
Enable UCS authorize
```curl --location 'http://localhost:8080/configs/' \
--header 'api-key: test_admin' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_ya18hWOxWbhNjQWEacOVLAFiqOuhSsU3k53o5iyEK6IcxQohWPAMpCWGURyRSRYc' \
--data '{
"key": "ucs_rollout_config_merchant_1756126931_razorpay_upi_Authorize",
"value": "1.0"
}'
```
Payments - Create
```curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_Qaanra9EEOfvCZtfveDCXQbYgnzJF7vgwIqBiERdn510eGS9M49jmIZweYS5zC7y' \
--data-raw '{
"amount": 100,
"currency": "INR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "IatapayCustomer",
"email": "[[email protected]](mailto:[email protected])",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com/",
"payment_method": "upi",
"payment_method_type": "upi_collect",
"payment_method_data": {
"upi": {
"upi_collect": {
"vpa_id": "success@razorpay"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IN",
"first_name": "Swangi",
"last_name": "Kumari"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[[email protected]](mailto:[email protected])"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IN",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "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"
},
"all_keys_required": true
}'
```
Logs (Success)
<img width="1253" height="411" alt="Screenshot 2025-08-28 at 2 46 00 PM" src="https://github.com/user-attachments/assets/4fff5e2e-233a-4e42-a3f9-e13c66594808" />
Logs(Failure)
<img width="1207" height="503" alt="Screenshot 2025-08-25 at 6 37 32 PM" src="https://github.com/user-attachments/assets/6b6f8596-a879-41d4-98ea-2e945376cbe2" />
## Checklist
<!-- Put 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/authorize_flow.rs`
- `crates/router/src/core/payments/flows/external_proxy_flow.rs`
- `crates/router/src/core/payments/flows/psync_flow.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (11 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 10cf161d:
Files to modify:
**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/unified_connector_service.rs**
Add:
- function: pub::ucs_logging_wrapper
|
{"pr_number": 9058, "pr_title": "feat(ucs): add event logging for UCS operations", "merged_at": "2025-09-02T08:13:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["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/unified_connector_service.rs"]}, "change_types": {"functions_added": 1, "fields_added": 11, "imports_added": 2, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat: core changes for extended authorization
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This is continuation on this PR.
https://github.com/juspay/hyperswitch/pull/6607
Changes in this PR:
In this PR, I've added support for sending the request_extended_authorization flag to the connector module from core. And handling the response from the connector and updating the same in DB.
Flow:
1. Merchant can set `always_request_extended_authorization` as true in BusinessProfile.
2. Merchant can also send the `request_extended_authorization` in PaymentsCreate Call(payment_intent).
3. In case `always_request_extended_authorization` or `request_extended_authorization` is true, we will see if the selected connector supports extended authorization for the selected payment_method and payment_method_type, If yes, then we will populate `request_extended_authorization` in payment_attempt in update_trackers and send the flag to the connector.
4. Once we get the response from the connector, the rseponse will be updated in post_update_trackers().
This PR does not add support for extended authorization for any connector. This will be taken up in a separate PR.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
5. `crates/router/src/configs`
6. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Checked if the code compiled successfully.
1. Create a Payment by sending request_extended_authorization as `true` or `false`. This should be updated in PaymentIntent in DB.
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n0yinmHL62dcWfLXyn7PklNfYHXCMejfcB6IrdKlKx79iy66bS688IZfExFYn9pk' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"request_extended_authorization": false,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
Response:
```
{
"payment_id": "pay_BSkKUBPpJR08FN9e9gqs",
"merchant_id": "merchant_1741779028",
"status": "requires_confirmation",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_BSkKUBPpJR08FN9e9gqs_secret_CR5GmmTg1J7kUtnE03Al",
"created": "2025-03-12T11:36:36.998Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_0e0HS3bHyOmiMGtgCGwC",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "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": 1741779396,
"expires": 1741782996,
"secret": "epk_4e184fe499d44961b2523b269de7b8de"
},
"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_UlYviCppovU6XyJRqzHR",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-12T11:51:36.998Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-12T11:36:37.093Z",
"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
}
```
DB query:
```
select request_extended_authorization from payment_intent
where payment_id = '<payment_id>';
```
cannot be tested with a connector since currently no connector supports extended authorization.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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`
- `crates/api_models/src/payments/trait_impls.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/payment_intent.rs`
- ... and 1 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
- `crates/hyperswitch_domain_models/src/payments.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- ... and 2 more files
**4. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/operations.rs`
- `crates/router/src/core/payments/operations/payment_confirm.rs`
- ... and 4 more files
**5. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
- `crates/router/src/types/api/verify_connector.rs`
- ... and 1 more files
**6. Type Definitions**
- `crates/common_types/src/lib.rs`
- `crates/common_types/src/primitive_wrappers.rs`
- `crates/router/src/types.rs`
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (17 changes)
- Extend existing types with new fields (85 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit c3c4f50f:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/api_models/src/payments/trait_impls.rs**
Modify existing code
**crates/common_enums/src/connector_enums.rs**
Add:
- function: pub::get_payment_methods_supporting_extended_authorization
- function: pub::get_payment_method_types_supporting_extended_authorization
**crates/common_types/src/lib.rs**
Add:
- mod: pub::primitive_wrappers
**crates/common_types/src/primitive_wrappers.rs**
Add:
- function: private::deref
- function: private::from
- function: private::to_sql
- function: private::from_sql
- function: private::deref
- function: private::from
- function: pub::is_true
- function: private::to_sql
- function: private::from_sql
- function: private::deref
- function: private::to_sql
- function: private::from_sql
- struct: pub::ExtendedAuthorizationAppliedBool
- struct: pub::RequestExtendedAuthorizationBool
- struct: pub::AlwaysRequestExtendedAuthorization
- impl: impl Deref for ExtendedAuthorizationAppliedBool
- impl: impl From<bool> for ExtendedAuthorizationAppliedBool
- impl: impl diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for ExtendedAuthorizationAppliedBool
- impl: impl diesel::deserialize::FromSql<diesel::sql_types::Bool, DB> for ExtendedAuthorizationAppliedBool
- impl: impl Deref for RequestExtendedAuthorizationBool
- impl: impl From<bool> for RequestExtendedAuthorizationBool
- impl: impl RequestExtendedAuthorizationBool
- impl: impl diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for RequestExtendedAuthorizationBool
- impl: impl diesel::deserialize::FromSql<diesel::sql_types::Bool, DB> for RequestExtendedAuthorizationBool
- impl: impl Deref for AlwaysRequestExtendedAuthorization
- impl: impl diesel::serialize::ToSql<diesel::sql_types::Bool, DB> for AlwaysRequestExtendedAuthorization
- impl: impl diesel::deserialize::FromSql<diesel::sql_types::Bool, DB> for AlwaysRequestExtendedAuthorization
- mod: private::bool_wrappers
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/diesel_models/src/user/sample_data.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments.rs**
Add:
- function: pub::get_request_extended_authorization_bool_if_connector_supports
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Add:
- function: pub::get_extended_authorization_response_data
- struct: pub::ExtendedAuthorizationResponseData
**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/operations.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/retry.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
|
{"pr_number": 6766, "pr_title": "feat: core changes for extended authorization", "merged_at": "2025-03-21T12:57:19Z", "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", "crates/api_models/src/payments/trait_impls.rs"], "database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/user/sample_data.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/common_types/src/lib.rs", "crates/common_types/src/primitive_wrappers.rs", "crates/router/src/types.rs"]}, "change_types": {"structs_added": 4, "functions_added": 17, "fields_added": 85, "imports_added": 19, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Add template code for breadpay
## 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 -->
Connector template code for new connector breadpay.
### 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)?
-->
This is a template PR for Breadpay, just checked for compilation. Nothing else to test.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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 b2ab9277:
Files to modify:
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::breadpay
**crates/hyperswitch_connectors/src/connectors/breadpay.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::Breadpay
- impl: impl Breadpay
- impl: impl api::Payment for Breadpay
- impl: impl api::PaymentSession for Breadpay
- impl: impl api::ConnectorAccessToken for Breadpay
- impl: impl api::MandateSetup for Breadpay
- impl: impl api::PaymentAuthorize for Breadpay
- impl: impl api::PaymentSync for Breadpay
- impl: impl api::PaymentCapture for Breadpay
- impl: impl api::PaymentVoid for Breadpay
- impl: impl api::Refund for Breadpay
- impl: impl api::RefundExecute for Breadpay
- impl: impl api::RefundSync for Breadpay
- impl: impl api::PaymentToken for Breadpay
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Breadpay
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Breadpay
- impl: impl ConnectorCommon for Breadpay
- impl: impl ConnectorValidation for Breadpay
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Breadpay
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Breadpay
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Breadpay
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Breadpay
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Breadpay
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Breadpay
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Breadpay
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Breadpay
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Breadpay
- impl: impl webhooks::IncomingWebhook for Breadpay
- impl: impl ConnectorSpecifications for Breadpay
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/breadpay/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::BreadpayRouterData
- struct: pub::BreadpayPaymentsRequest
- struct: pub::BreadpayCard
- struct: pub::BreadpayAuthType
- struct: pub::BreadpayPaymentsResponse
- struct: pub::BreadpayRefundRequest
- struct: pub::RefundResponse
- struct: pub::BreadpayErrorResponse
- enum: pub::BreadpayPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for BreadpayRouterData<T>
- impl: impl TryFrom<&BreadpayRouterData<&PaymentsAuthorizeRouterData>> for BreadpayPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for BreadpayAuthType
- impl: impl From<BreadpayPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, BreadpayPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&BreadpayRouterData<&RefundsRouterData<F>>> for BreadpayRefundRequest
- 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/breadpay.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::BreadpayTest
- impl: impl ConnectorActions for BreadpayTest
- impl: impl utils::Connector for BreadpayTest
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::breadpay
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 8655, "pr_title": "feat(connector): Add template code for breadpay", "merged_at": "2025-07-22T08:52:52Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "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/breadpay.rs", "crates/hyperswitch_connectors/src/connectors/breadpay/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/breadpay.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"}
|
fix(connector): [CYBERSOURCE] Passing pares_status for MasterCard & Visa and transaction_type field
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Hotfix for [PR](https://github.com/juspay/hyperswitch/pull/8518)
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (8 changes)
- Add conditional logic for feature flags or filtering (5 changes)
**Detailed Identifier Changes:**
Commit a3b76003:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Add:
- enum: pub::CybersourceParesStatus
|
{"pr_number": 8541, "pr_title": "fix(connector): [CYBERSOURCE] Passing pares_status for MasterCard & Visa and transaction_type field", "merged_at": "2025-07-03T10:34:09Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs"]}, "change_types": {"enums_added": 1, "fields_added": 8, "conditionals_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [NEXIXPAY] Add Validation Checks for Request Fields
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
The OrderId field in Nexixpay request is limited to 18 characters in size.
Along with that added validation checks for fields inside shipping and billing addresses.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
https://developer.nexi.it/en/api/post-orders-3steps-payment
[
<img width="899" alt="Screenshot 2025-06-13 at 5 01 28 PM" src="https://github.com/user-attachments/assets/376481c6-bad5-424c-932b-4d99a9528ae0" />
](url)
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Nexixpay Payments - Create
1. When `payment_id` is not passed in req (doesn't throw any error but creates a new string to map it with `orderId` because when HS creates `payment_id` it is always > 18 characters) :
cURL:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_1j0NkPcENkwRgoYqQzrOiEsU38uMF5Q9ckG2grssx6Rz3gZy7Boqo4u5wP4usVkZ' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
"amount": 3545,
"currency": "EUR",
"connector": ["nexixpay"],
"amount_to_capture": 3545,
"confirm": true,
"profile_id": null,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"phone_country_code": "+1",
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4349940199004549",
"card_exp_month": "12",
"card_exp_year": "30",
"card_cvc": "396"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "12222",
"country": "US",
"first_name": "joseph",
"last_name": "jj"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "11111",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 3545,
"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
}'
```
Upon confirming the payment and doing a PSync, we get this
Response:
```
{
"payment_id": "pay_5rAXYi0YnHbwqmEUAPnU",
"merchant_id": "merchant_1750312579",
"status": "succeeded",
"amount": 3545,
"net_amount": 3545,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 3545,
"connector": "nexixpay",
"client_secret": "pay_5rAXYi0YnHbwqmEUAPnU_secret_YG2cKfDeVWnQTmuS37iq",
"created": "2025-06-19T12:37:09.192Z",
"currency": "EUR",
"customer_id": null,
"customer": {
"id": null,
"name": null,
"email": null,
"phone": null,
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"attempts": [
{
"attempt_id": "pay_5rAXYi0YnHbwqmEUAPnU_1",
"status": "charged",
"amount": 3545,
"order_tax_amount": null,
"currency": "EUR",
"connector": "nexixpay",
"error_message": null,
"payment_method": "card",
"connector_transaction_id": "OsJjcWfpZx42t4RSAQ",
"capture_method": "automatic",
"authentication_type": "three_ds",
"created_at": "2025-06-19T12:37:09.193Z",
"modified_at": "2025-06-19T12:39:00.328Z",
"cancellation_reason": null,
"mandate_id": null,
"error_code": null,
"payment_token": "token_ZZGaUsS5keturYQU7bZw",
"connector_metadata": {
"psyncFlow": "Authorize",
"cancelOperationId": null,
"threeDSAuthResult": {
"authenticationValue": "AAcABWCEUQAAAA3Zl4FwdQAAAAA="
},
"captureOperationId": "634632012033451709",
"threeDSAuthResponse": "notneeded",
"authorizationOperationId": "634632012033451709"
},
"payment_experience": null,
"payment_method_type": "credit",
"reference_id": "OsJjcWfpZx42t4RSAQ",
"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": "4549",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "434994",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "30",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_ZZGaUsS5keturYQU7bZw",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "11111",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "12222",
"state": "California",
"first_name": "joseph",
"last_name": "jj"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"order_details": [
{
"brand": null,
"amount": 3545,
"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": null,
"name": null,
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "OsJjcWfpZx42t4RSAQ",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": {
"order_category": "pay"
},
"braintree": null,
"adyen": null
},
"feature_metadata": null,
"reference_id": "OsJjcWfpZx42t4RSAQ",
"payment_link": null,
"profile_id": "pro_5ISBXpW5YSlAJEOrV1ZB",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_cd2dkyRmkFqrGVTgwuB8",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-19T12:52:09.192Z",
"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-06-19T12:39:00.329Z",
"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",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
2. When `payment_id` is passed in req but more than 18 characters long
cURL:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_1j0NkPcENkwRgoYqQzrOiEsU38uMF5Q9ckG2grssx6Rz3gZy7Boqo4u5wP4usVkZ' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
"amount": 3545,
"currency": "EUR",
"payment_id": "vfehfbjhbejfbjhrbfjhbgubh",
"connector": ["nexixpay"],
"amount_to_capture": 3545,
"confirm": true,
"profile_id": null,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"phone_country_code": "+1",
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4349940199004549",
"card_exp_month": "12",
"card_exp_year": "30",
"card_cvc": "396"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "12222",
"country": "US",
"first_name": "joseph",
"last_name": "jj"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "11111",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 3545,
"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:
```
{
"error": {
"type": "invalid_request",
"message": "Connector 'Nexixpay' rejected field 'payment_id': length 25 exceeds maximum of 18",
"code": "IR_47",
"connector": "Nexixpay"
}
}
```
3. When `payment_id` is passed in req but <=18 characters
cURL:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_1j0NkPcENkwRgoYqQzrOiEsU38uMF5Q9ckG2grssx6Rz3gZy7Boqo4u5wP4usVkZ' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
"amount": 3545,
"currency": "EUR",
"payment_id": "bfjfbjbfb",
"connector": ["nexixpay"],
"amount_to_capture": 3545,
"confirm": true,
"profile_id": null,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"phone_country_code": "+1",
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4349940199004549",
"card_exp_month": "12",
"card_exp_year": "30",
"card_cvc": "396"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "12222",
"country": "US",
"first_name": "joseph",
"last_name": "jj"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "11111",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 3545,
"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": "bfjfbjbfb",
"merchant_id": "merchant_1750312579",
"status": "succeeded",
"amount": 3545,
"net_amount": 3545,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 3545,
"connector": "nexixpay",
"client_secret": "bfjfbjbfb_secret_PcQel6k4KypGVCWRV5yI",
"created": "2025-06-19T12:41:07.955Z",
"currency": "EUR",
"customer_id": null,
"customer": {
"id": null,
"name": null,
"email": null,
"phone": null,
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"attempts": [
{
"attempt_id": "bfjfbjbfb_1",
"status": "charged",
"amount": 3545,
"order_tax_amount": null,
"currency": "EUR",
"connector": "nexixpay",
"error_message": null,
"payment_method": "card",
"connector_transaction_id": "bfjfbjbfb",
"capture_method": "automatic",
"authentication_type": "three_ds",
"created_at": "2025-06-19T12:41:07.955Z",
"modified_at": "2025-06-19T12:42:05.311Z",
"cancellation_reason": null,
"mandate_id": null,
"error_code": null,
"payment_token": "token_Uxmz4D5Ic6wgrem8RA3o",
"connector_metadata": {
"psyncFlow": "Authorize",
"cancelOperationId": null,
"threeDSAuthResult": {
"authenticationValue": "AAcACYdiRwAAAA3Zl4FwdQAAAAA="
},
"captureOperationId": "394270169463351709",
"threeDSAuthResponse": "notneeded",
"authorizationOperationId": "394270169463351709"
},
"payment_experience": null,
"payment_method_type": "credit",
"reference_id": "bfjfbjbfb",
"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": "4549",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "434994",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "30",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_Uxmz4D5Ic6wgrem8RA3o",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "11111",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "12222",
"state": "California",
"first_name": "joseph",
"last_name": "jj"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"order_details": [
{
"brand": null,
"amount": 3545,
"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": null,
"name": null,
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "bfjfbjbfb",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": {
"order_category": "pay"
},
"braintree": null,
"adyen": null
},
"feature_metadata": null,
"reference_id": "bfjfbjbfb",
"payment_link": null,
"profile_id": "pro_5ISBXpW5YSlAJEOrV1ZB",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_cd2dkyRmkFqrGVTgwuB8",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-19T12:56:07.955Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "128.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-06-19T12:42:05.311Z",
"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",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
4. If any of these fields cross the max character count in NexiXpay - `name/description/cardHolderName/address` anything
cURL:
(Made `zip` code more than 16 characters long)
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_mvLFyyA12S0xyM9HuE5yadwP4wiDas1Upq1C39wZXXHEqhiq538nbRA3O6OVbokW' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
"amount": 3545,
"payment_id": "jfjessjjfbjkbf",
"currency": "EUR",
"connector": ["nexixpay"],
"amount_to_capture": 3545,
"confirm": true,
"profile_id": null,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"phone_country_code": "+1",
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4349940199004549",
"card_exp_month": "12",
"card_exp_year": "30",
"card_cvc": "396"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "12222",
"country": "US",
"first_name": "joseph",
"last_name": "jj"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "777788888888888888888888888888",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 3545,
"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:
```
{
"error": {
"type": "invalid_request",
"message": "Connector 'Nexixpay' rejected field 'shipping.address.zip': length 30 exceeds maximum of 16",
"code": "IR_47",
"connector": "Nexixpay"
}
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/errors/api_error_response.rs`
**2. Core Business Logic**
- `crates/router/src/core/errors/utils.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs`
**4. Other**
- `crates/hyperswitch_interfaces/src/errors.rs`
- `crates/router/src/compatibility/stripe/errors.rs`
- `crates/storage_impl/src/errors.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (7 changes)
- Extend existing types with new fields (68 changes)
- Add conditional logic for feature flags or filtering (13 changes)
**Detailed Identifier Changes:**
Commit 6fd7626c:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs**
Add:
- function: private::get_random_string
- function: private::new
- function: private::new
- function: private::get_validated_address_details_generic
- function: private::get_validated_shipping_address
- function: private::get_validated_billing_address
- enum: private::AddressKind
- trait: private::AddressConstructor
- impl: impl AddressConstructor for BillingAddress
- impl: impl AddressConstructor for ShippingAddress
**crates/hyperswitch_domain_models/src/errors/api_error_response.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/errors.rs**
Modify existing code
**crates/router/src/compatibility/stripe/errors.rs**
Modify existing code
**crates/router/src/core/errors/utils.rs**
Modify existing code
**crates/storage_impl/src/errors.rs**
Modify existing code
|
{"pr_number": 8345, "pr_title": "fix(connector): [NEXIXPAY] Add Validation Checks for Request Fields", "merged_at": "2025-06-23T10:09:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/errors/api_error_response.rs"], "core_business": ["crates/router/src/core/errors/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs"], "other": ["crates/hyperswitch_interfaces/src/errors.rs", "crates/router/src/compatibility/stripe/errors.rs", "crates/storage_impl/src/errors.rs"]}, "change_types": {"structs_added": 1, "functions_added": 7, "enums_added": 1, "fields_added": 68, "imports_added": 1, "conditionals_added": 13}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [CYBERSOURCE] Fix transaction_type for Googlepay payments
…payments
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [X] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
`payment_information.tokenized_card.transaction_type` should be 3 for GPay, APay and SamsungPay MIT payments via Cybersource, and 1 for all other cases.
Some parts of the Cybersource transformer file were missing this logic. This PR fixes those gaps.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<details>
<summary>Test Googlepay via Cybersource</summary>
Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jEdNDCtQGso72keWEtypBWmXAKaYNLmAcTTsutLbPwa8CY4p2I36w4wVkZziDTuK' \
--data-raw '{
"amount": 100,
"currency": "EUR",
"connector": [
"cybersource"
],
"confirm": true,
"payment_link": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 100,
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay": {
"description": "Visa •••• 1111",
"tokenization_data": {
"token": "{\"signature\":\"MEUCIQCKJHF69egUbtGbYv2HiJYeuvKAkbfeZxu+z3N8cxgTswIgDvHUMg1XAQYebHfTYGJnYoHmWFygpvcKmLhaM5Fh3lw\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"+6XsyLnM6rjzpWmkGRqP2NLL7KVgbr6zvIaxG+RpQ/InLPuE6mg4p8bd+1vJva5MDAW6yfN6YallS+1Wzp1/8cB3ULLXcmKTqcQgpogEEDLUef4J8yx2TRqtcEf6loUSx0qCEuI4OhC6dlQaHNABiNZfJcyLfO4+cY61IPbUUCHs6nH8ZykrnUDCXSgUN3X6Br4wHKPaNq09IyvkObGZTAEb0OHnSRmVVoqHDiz3SKq+4TJyWpeVUe/W8zcFgXCEtRN+zuu2opMtEn7yHita5zhZkl++28KA1RZ0Ykny9fXOb4At0YSz12mjUQ18HuprgqG9Y48dvHx1rnQDlF0KnYXjwuqAit2aTH5+TOLPq+f9fT86cyTBIupNkrMmIPOKQhHZ9Bcd2TmraBnu3Wxncgb/Mq7m5n/8LmwTIbKIXGjY\\\",\\\"ephemeralPublicKey\\\":\\\"BI4G68iCuuG/YctcX88c+8UWcL4Gp6Rlw0uOeJzhvf3ttLU8fX0eOlh8MphMqAxrxs1EQP7pyiGitCI/npbxKso\\\\u003d\\\",\\\"tag\\\":\\\"mlIMlJNoaTHGNAdc2FhntbT/fbRyqhkCBvmYJs24m8o\\\\u003d\\\"}\"}",
"type": "PAYMENT_GATEWAY"
},
"type": "CARD",
"info": {
"card_network": "VISA",
"card_details": "1111"
}
}
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "12345",
"country": "DE",
"first_name": "Max",
"last_name": "Mustermann"
},
"email": "[email protected]",
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "Musterstr",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "94122",
"country": "DE",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"ip_address": "103.77.139.95",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
Response
```
{"payment_id":"pay_9Kj7AUc4rhwb4asSII71","merchant_id":"merchant_1756212829","status":"succeeded","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":100,"connector":"cybersource","client_secret":"pay_9Kj7AUc4rhwb4asSII71_secret_xJ07Kzfp6Memjvqplmp5","created":"2025-08-26T13:22:28.607Z","currency":"EUR","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":"John Doe","email":"[email protected]","phone":"999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"wallet","payment_method_data":{"wallet":{"google_pay":{"last4":"1111","card_network":"VISA","type":"CARD"}},"billing":null},"payment_token":null,"shipping":{"address":{"city":"Musterhausen","country":"DE","line1":"Musterstr","line2":"CA","line3":"CA","zip":"94122","state":"California","first_name":"joseph","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"billing":{"address":{"city":"Musterhausen","country":"DE","line1":"1467","line2":"CA","line3":"CA","zip":"12345","state":"California","first_name":"Max","last_name":"Mustermann","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"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":1756214548,"expires":1756218148,"secret":"epk_ec2dd7b868ee49cfac60a2bd996d25c4"},"manual_retry_allowed":false,"connector_transaction_id":"7562145487796826904806","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":{"redirect_response":null,"search_tags":null,"apple_pay_recurring_details":null,"gateway_system":"direct"},"reference_id":"pay_9Kj7AUc4rhwb4asSII71_1","payment_link":null,"profile_id":"pro_LDyaQED9dZ5fgu7cmTQ0","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_xal1vas6DVUdGb6LDbro","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-26T13:37:28.607Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"103.77.139.95","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":"123456789619999","payment_method_status":null,"updated":"2025-08-26T13:22:29.366Z","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}
```
Please note - transaction_type is being sent as 1 as seen in logs, since it is not a MIT payment
<img width="1728" height="211" alt="Screenshot 2025-08-27 at 12 03 20 PM" src="https://github.com/user-attachments/assets/cb5fa777-f4d3-4ea8-8bc7-611f965f12ac" />
</details>
<details>
<summary>Test Googlepay CIT, MIT for setup mandates via Cybersource</summary>
Create Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jEdNDCtQGso72keWEtypBWmXAKaYNLmAcTTsutLbPwa8CY4p2I36w4wVkZziDTuK' \
--data-raw '{
"amount": 0,
"currency": "EUR",
"confirm": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"return_url": "https://google.com",
"email": "[email protected]",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"setup_future_usage": "off_session",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "2024-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"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"
}
}
}'
```
Confirm Request
```
curl --location 'http://localhost:8080/payments/pay_VJtgZ0tMu6UoLnQp1h9g/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jEdNDCtQGso72keWEtypBWmXAKaYNLmAcTTsutLbPwa8CY4p2I36w4wVkZziDTuK' \
--data '{
"confirm": true,
"payment_type": "setup_mandate",
"payment_method": "wallet",
"payment_method_type": "google_pay",
"customer_id": "StripeCustomer",
"payment_method_data": {
"wallet": {
"google_pay": {
"description": "Visa •••• 1111",
"tokenization_data": {
"token": "{\"signature\":\"MEUCIQCKJHF69egUbtGbYv2HiJYeuvKAkbfeZxu+z3N8cxgTswIgDvHUMg1XAQYebHfTYGJnYoHmWFygpvcKmLhaM5Fh3lw\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"+6XsyLnM6rjzpWmkGRqP2NLL7KVgbr6zvIaxG+RpQ/InLPuE6mg4p8bd+1vJva5MDAW6yfN6YallS+1Wzp1/8cB3ULLXcmKTqcQgpogEEDLUef4J8yx2TRqtcEf6loUSx0qCEuI4OhC6dlQaHNABiNZfJcyLfO4+cY61IPbUUCHs6nH8ZykrnUDCXSgUN3X6Br4wHKPaNq09IyvkObGZTAEb0OHnSRmVVoqHDiz3SKq+4TJyWpeVUe/W8zcFgXCEtRN+zuu2opMtEn7yHita5zhZkl++28KA1RZ0Ykny9fXOb4At0YSz12mjUQ18HuprgqG9Y48dvHx1rnQDlF0KnYXjwuqAit2aTH5+TOLPq+f9fT86cyTBIupNkrMmIPOKQhHZ9Bcd2TmraBnu3Wxncgb/Mq7m5n/8LmwTIbKIXGjY\\\",\\\"ephemeralPublicKey\\\":\\\"BI4G68iCuuG/YctcX88c+8UWcL4Gp6Rlw0uOeJzhvf3ttLU8fX0eOlh8MphMqAxrxs1EQP7pyiGitCI/npbxKso\\\\u003d\\\",\\\"tag\\\":\\\"mlIMlJNoaTHGNAdc2FhntbT/fbRyqhkCBvmYJs24m8o\\\\u003d\\\"}\"}",
"type": "PAYMENT_GATEWAY"
},
"type": "CARD",
"info": {
"card_network": "VISA",
"card_details": "1111"
}
}
}
}
}'
```
Response
```
{"payment_id":"pay_VJtgZ0tMu6UoLnQp1h9g","merchant_id":"merchant_1756212829","status":"succeeded","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"cybersource","client_secret":"pay_VJtgZ0tMu6UoLnQp1h9g_secret_ovy4sOaYLm2HAS6BeMNF","created":"2025-08-27T06:37:45.811Z","currency":"EUR","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":"John Doe","email":"[email protected]","phone":"999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","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":"joseph","last_name":"Doe","origin_zip":null},"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","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"google_pay","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"7562766743256508303814","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_VJtgZ0tMu6UoLnQp1h9g_1","payment_link":null,"profile_id":"pro_LDyaQED9dZ5fgu7cmTQ0","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_xal1vas6DVUdGb6LDbro","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-27T06:52:45.811Z","fingerprint":null,"browser_info":{"os_type":null,"language":null,"time_zone":null,"ip_address":"::1","os_version":null,"user_agent":null,"color_depth":null,"device_model":null,"java_enabled":null,"screen_width":null,"accept_header":null,"screen_height":null,"accept_language":"en","java_script_enabled":null},"payment_channel":null,"payment_method_id":"pm_ypCUJWCUTs8xlzonWsXq","network_transaction_id":"123456789000000","payment_method_status":"active","updated":"2025-08-27T06:37:55.029Z","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":"3D53F9E7BCF52B5DE063A2598D0A37D3","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}
```
Please note - transaction_type is being sent as 1 as seen in logs since it is a CIT payment
<img width="1728" height="211" alt="Screenshot 2025-08-27 at 12 08 27 PM" src="https://github.com/user-attachments/assets/dd837b6d-ed43-424c-9663-5aec60436593" />
MIT Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jEdNDCtQGso72keWEtypBWmXAKaYNLmAcTTsutLbPwa8CY4p2I36w4wVkZziDTuK' \
--data-raw '{
"recurring_details": {
"type": "payment_method_id",
"data": "pm_ypCUJWCUTs8xlzonWsXq"
},
"customer": {
"id": "StripeCustomer",
"email": "[email protected]"
},
"description": "This is the test payment made through Mule API",
"currency": "EUR",
"amount": 126,
"confirm": true,
"capture_method": "automatic",
"off_session": true,
"metadata": {
"businessUnit": "ZG_GL_Group",
"country": "US",
"clientId": "N/A",
"productName": "Travel insurance",
"orderReference": "order-040724-001"
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"ip_address": "103.77.139.95",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true
}
}'
```
Response
```
{"payment_id":"pay_JKKC64a10rngr7YQmODg","merchant_id":"merchant_1756212829","status":"succeeded","amount":126,"net_amount":126,"shipping_cost":null,"amount_capturable":0,"amount_received":126,"connector":"cybersource","client_secret":"pay_JKKC64a10rngr7YQmODg_secret_DaSLeZeuTfvSoypuZOwe","created":"2025-08-27T07:00:03.152Z","currency":"EUR","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":"John Doe","email":"[email protected]","phone":"999999999","phone_country_code":"+1"},"description":"This is the test payment made through Mule API","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":"wallet","payment_method_data":{"wallet":{"google_pay":{"last4":"1111","card_network":"VISA","type":"CARD"}},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"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":1756278003,"expires":1756281603,"secret":"epk_ec6301db2539499d882c7b42a7e114e4"},"manual_retry_allowed":false,"connector_transaction_id":"7562780045016762303812","frm_message":null,"metadata":{"country":"US","clientId":"N/A","productName":"Travel insurance","businessUnit":"ZG_GL_Group","orderReference":"order-040724-001"},"connector_metadata":null,"feature_metadata":{"redirect_response":null,"search_tags":null,"apple_pay_recurring_details":null,"gateway_system":"direct"},"reference_id":"pay_JKKC64a10rngr7YQmODg_1","payment_link":null,"profile_id":"pro_LDyaQED9dZ5fgu7cmTQ0","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_xal1vas6DVUdGb6LDbro","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-27T07:15:03.152Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"103.77.139.95","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":"pm_ypCUJWCUTs8xlzonWsXq","network_transaction_id":"123456789619999","payment_method_status":"active","updated":"2025-08-27T07:00:04.971Z","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":"3D53F9E7BBC12B5DE063A2598D0A37D3","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}
```
Please note - transaction_type is being sent as 3 as seen in logs since it's a MIT payment
<img width="1728" height="240" alt="Screenshot 2025-08-27 at 12 30 20 PM" src="https://github.com/user-attachments/assets/f4fa7b7a-1d32-42f9-8504-32ea5ac274f1" />
</details>
<details>
<summary>Test Googlepay CIT, MIT for mandates via Cybersource</summary>
Create Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jEdNDCtQGso72keWEtypBWmXAKaYNLmAcTTsutLbPwa8CY4p2I36w4wVkZziDTuK' \
--data-raw '{
"amount": 20000,
"currency": "EUR",
"confirm": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"return_url": "https://google.com",
"email": "[email protected]",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"setup_future_usage": "off_session",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "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"
}
}
}'
```
Confirm Request
```
curl --location 'http://localhost:8080/payments/pay_q1WdTJwh3JElMgWVJU8u/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jEdNDCtQGso72keWEtypBWmXAKaYNLmAcTTsutLbPwa8CY4p2I36w4wVkZziDTuK' \
--data '{
"confirm": true,
"customer_id": "StripeCustomer",
"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"
}
},
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "2024-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"setup_future_usage": "off_session",
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay": {
"description": "Visa •••• 1111",
"tokenization_data": {
"token": "{\"signature\":\"MEUCIQCKJHF69egUbtGbYv2HiJYeuvKAkbfeZxu+z3N8cxgTswIgDvHUMg1XAQYebHfTYGJnYoHmWFygpvcKmLhaM5Fh3lw\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"+6XsyLnM6rjzpWmkGRqP2NLL7KVgbr6zvIaxG+RpQ/InLPuE6mg4p8bd+1vJva5MDAW6yfN6YallS+1Wzp1/8cB3ULLXcmKTqcQgpogEEDLUef4J8yx2TRqtcEf6loUSx0qCEuI4OhC6dlQaHNABiNZfJcyLfO4+cY61IPbUUCHs6nH8ZykrnUDCXSgUN3X6Br4wHKPaNq09IyvkObGZTAEb0OHnSRmVVoqHDiz3SKq+4TJyWpeVUe/W8zcFgXCEtRN+zuu2opMtEn7yHita5zhZkl++28KA1RZ0Ykny9fXOb4At0YSz12mjUQ18HuprgqG9Y48dvHx1rnQDlF0KnYXjwuqAit2aTH5+TOLPq+f9fT86cyTBIupNkrMmIPOKQhHZ9Bcd2TmraBnu3Wxncgb/Mq7m5n/8LmwTIbKIXGjY\\\",\\\"ephemeralPublicKey\\\":\\\"BI4G68iCuuG/YctcX88c+8UWcL4Gp6Rlw0uOeJzhvf3ttLU8fX0eOlh8MphMqAxrxs1EQP7pyiGitCI/npbxKso\\\\u003d\\\",\\\"tag\\\":\\\"mlIMlJNoaTHGNAdc2FhntbT/fbRyqhkCBvmYJs24m8o\\\\u003d\\\"}\"}",
"type": "PAYMENT_GATEWAY"
},
"type": "CARD",
"info": {
"card_network": "VISA",
"card_details": "1111"
}
}
}
}
}'
```
Response
```
{"payment_id":"pay_2ES4hiWVSAtA8nvvMOEX","merchant_id":"merchant_1756212829","status":"succeeded","amount":20000,"net_amount":20000,"shipping_cost":null,"amount_capturable":0,"amount_received":20000,"connector":"cybersource","client_secret":"pay_2ES4hiWVSAtA8nvvMOEX_secret_mbgLqSOobJIauvNTU4WD","created":"2025-08-27T07:03:31.377Z","currency":"EUR","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":"John Doe","email":"[email protected]","phone":"999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","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":"joseph","last_name":"Doe","origin_zip":null},"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","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":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":null,"manual_retry_allowed":false,"connector_transaction_id":"7562782562786699103813","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_2ES4hiWVSAtA8nvvMOEX_1","payment_link":null,"profile_id":"pro_LDyaQED9dZ5fgu7cmTQ0","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_xal1vas6DVUdGb6LDbro","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-27T07:18:31.377Z","fingerprint":null,"browser_info":{"os_type":null,"language":null,"time_zone":null,"ip_address":"::1","os_version":null,"user_agent":null,"color_depth":null,"device_model":null,"java_enabled":null,"screen_width":null,"accept_header":null,"screen_height":null,"accept_language":"en","java_script_enabled":null},"payment_channel":null,"payment_method_id":"pm_ypCUJWCUTs8xlzonWsXq","network_transaction_id":"123456789619999","payment_method_status":"active","updated":"2025-08-27T07:04:17.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":"3D54559DC955870BE063A2598D0AAC6C","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}
```
Please note - transaction_type is being sent as 1 as seen in logs since it's a CIT payment
<img width="1728" height="192" alt="Screenshot 2025-08-27 at 12 40 17 PM" src="https://github.com/user-attachments/assets/50015fdd-8502-4f2e-95e5-19ed8a612417" />
MIT Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jEdNDCtQGso72keWEtypBWmXAKaYNLmAcTTsutLbPwa8CY4p2I36w4wVkZziDTuK' \
--data-raw '{
"recurring_details": {
"type": "payment_method_id",
"data": "pm_ypCUJWCUTs8xlzonWsXq"
},
"customer": {
"id": "StripeCustomer",
"email": "[email protected]"
},
"description": "This is the test payment made through Mule API",
"currency": "EUR",
"amount": 126,
"confirm": true,
"capture_method": "automatic",
"off_session": true,
"metadata": {
"businessUnit": "ZG_GL_Group",
"country": "US",
"clientId": "N/A",
"productName": "Travel insurance",
"orderReference": "order-040724-001"
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"ip_address": "103.77.139.95",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true
}
}'
```
Response
```
{"payment_id":"pay_ioaxSmhPXZeI3NyPPIya","merchant_id":"merchant_1756212829","status":"succeeded","amount":126,"net_amount":126,"shipping_cost":null,"amount_capturable":0,"amount_received":126,"connector":"cybersource","client_secret":"pay_ioaxSmhPXZeI3NyPPIya_secret_yvI6i0DBIEwtUFz3poUX","created":"2025-08-27T07:05:46.124Z","currency":"EUR","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":"John Doe","email":"[email protected]","phone":"999999999","phone_country_code":"+1"},"description":"This is the test payment made through Mule API","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":"wallet","payment_method_data":{"wallet":{"google_pay":{"last4":"1111","card_network":"VISA","type":"CARD"}},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"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":1756278346,"expires":1756281946,"secret":"epk_c1f664826b1f4115ab0f2237122ba004"},"manual_retry_allowed":false,"connector_transaction_id":"7562783464206782103813","frm_message":null,"metadata":{"country":"US","clientId":"N/A","productName":"Travel insurance","businessUnit":"ZG_GL_Group","orderReference":"order-040724-001"},"connector_metadata":null,"feature_metadata":{"redirect_response":null,"search_tags":null,"apple_pay_recurring_details":null,"gateway_system":"direct"},"reference_id":"pay_ioaxSmhPXZeI3NyPPIya_1","payment_link":null,"profile_id":"pro_LDyaQED9dZ5fgu7cmTQ0","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_xal1vas6DVUdGb6LDbro","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-27T07:20:46.124Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"103.77.139.95","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":"pm_ypCUJWCUTs8xlzonWsXq","network_transaction_id":"123456789619999","payment_method_status":"active","updated":"2025-08-27T07:05:46.763Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":"3D53F9E7BBC12B5DE063A2598D0A37D3","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}
```
Please note - transaction_type is being sent as 3 as seen in logs since it's a MIT payment
<img width="1728" height="240" alt="Screenshot 2025-08-27 at 12 36 02 PM" src="https://github.com/user-attachments/assets/2074d6ba-5fa2-4da5-9d8c-3ec7f4f9e9f4" />
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Extend existing types with new fields (10 changes)
**Detailed Identifier Changes:**
Commit 47f68859:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Add:
- struct: pub::MandatePaymentTokenizedCard
- struct: pub::GooglePayTokenizedCard
|
{"pr_number": 9071, "pr_title": "fix(connector): [CYBERSOURCE] Fix transaction_type for Googlepay payments", "merged_at": "2025-08-28T12:39:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs"]}, "change_types": {"structs_added": 2, "fields_added": 10}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment-method): create payment_token for session confirm call
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
- create a temporary payment_token for session confirm call and pass it in the response
- the payment_token is created against the payment_method_id and is saved in redis
- payment can be done using the payment_token generated by session confirm for the payment_method_data
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Locally tested
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payment_methods.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_methods_session.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payment_methods.rs`
**4. Core Business Logic**
- `crates/router/src/core/payment_methods.rs`
**5. Other**
- `crates/external_services/src/http_client/client.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (16 changes)
- Add conditional logic for feature flags or filtering (1 changes)
|
{"pr_number": 8391, "pr_title": "feat(payment-method): create payment_token for session confirm call", "merged_at": "2025-06-19T13:53:36Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "session", "token"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "database": ["crates/diesel_models/src/payment_methods_session.rs"], "domain": ["crates/hyperswitch_domain_models/src/payment_methods.rs"], "core_business": ["crates/router/src/core/payment_methods.rs"], "other": ["crates/external_services/src/http_client/client.rs"]}, "change_types": {"fields_added": 16, "conditionals_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(router): add feature_metadata for merchant_connector_account create v2 flow
## 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 -->
Data poi
nt related to Revenue Recovery
- There is a maximum limit on how much time we can do a retry, this limit is fixed by card network.
- What will be the maximum limit for other payment methods?
- `max_retry_count_by_network` refers to maximum limit.
- where can we store this? Env
- There is a maximum limit how much time we can do a retry which is fixed by merchant for each `billing connector`
- `max_retry_count` refers to maximum limit set by merchant.
- `billing_connector_retry_threshold`: maximum `billing connector` retries before revenue recovery can start executing retries.
- Merchant configured their payment processor accounts in `billing connector` where they process payment, these accounts are identified as `AccountReferenceId`.
- In Revenue Recovery service also merchants needs to config payment processor accounts, these accounts are identified as `Hyperswitch Merchant Connector Account Id` and they need to provide the mapping between these accounts for every `billing connector`.
- These data is added as `recovery_metadata` in `feature_metadata`.
```json
"feature_metadata": {
"revenue_recovery": {
"max_retry_count": 15,
"billing_connector_retry_threshold": 5,
"billing_account_reference": {
"mca_stripe1234": "chargebee_stripe_123"
}
}
}
```
We need recovery metadata to validate and process retries, there are two places we can add recovery metadata
- Merchant connector account
- Profiles
There are 2 scenarios we need this recovery metadata
- while receiving the webhooks
- while triggering update to invoice
#### While receiving the webhooks
While receiving webhooks, we always have access to both profiles and billing connector accounts, because the webhooks path holds this information. Add path
#### While triggering update to invoice
While triggering any update to invoice, where `invoice` is represented in the recovery service as `payment_intent`, we have `profile` and `billing connector` identifiers in `payment_intent`.
#### Why are we adding this in billing MCA not in profile level?
We can get `Account Reference Id’s`(payment connector in billing connector end) from respective billing connector accounts,
The data is very closely related to billing connectors rather than profiles, and one billing connector information cannot be shared to another billing connector. So we are currently storing in MCA since there is no shared behaviour and we can get recovery metadata in all flows using billing mca id.
Note: Will add the connector type as billing processor in chargebee integration PR and allow adding recovery feature metadata only for billing processor .https://github.com/juspay/hyperswitch/pull/7110.
### 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)?
-->
Update MCA request :
```
curl --location --request PUT 'http://localhost:8080/v2/connector-accounts/mca_PzQ3S9Dhk7k7zX2vt8kR' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"feature_metadata" : {
"revenue_recovery" : {
"max_retry_count" : 27,
"billing_connector_retry_threshold" : 16,
"billing_account_reference" :{
"asdf" : "asdfas"
}
}
},
"merchant_id": "cloth_seller_uaUPtKycNopuMS8lb4si"
}'
```
response :
```
{
"connector_type": "payment_processor",
"connector_name": "stripe",
"connector_label": "stripe_business",
"id": "mca_PzQ3S9Dhk7k7zX2vt8kR",
"profile_id": "pro_lMm6W4ObT5TUyvRMkBxp",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "sk*******************************************************************************************************5b"
},
"payment_methods_enabled": null,
"connector_webhook_details": null,
"metadata": null,
"disabled": false,
"frm_configs": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null,
"feature_metadata": {
"revenue_recovery": {
"max_retry_count": 27,
"billing_connector_retry_threshold": 16,
"billing_account_reference": {
"asdf": "asdfas"
}
}
}
}
```
2) Same should be done with duplicate account reference id, This should throw an error
request :
```
{
"connector_type": "payment_processor",
"feature_metadata" : {
"revenue_recovery" : {
"max_retry_count" : 27,
"billing_connector_retry_threshold" : 16,
"billing_account_reference" :{
"mca1" : "charge_123",
"mca2" : "charge_123"
}
}
},
"merchant_id": "{{merchant_id}}"
}
```
response :
```
{
"error": {
"type": "invalid_request",
"message": "Duplicate account reference IDs found in Recovery feature metadata. Each account reference ID must be unique.",
"code": "IR_06"
}
}
```
3) The same should be done for create mca
```
{
"connector_type": "payment_processor",
"connector_name": "adyen",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "asdfa",
"api_secret": "asdfasd",
"key1": "asdfasdf"
},
"payment_methods_enabled": [
{
"payment_method_type": "card_redirect",
"payment_method_subtypes": [
{
"payment_method_subtype": "card_redirect",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "card",
"payment_method_subtypes": [
{
"payment_method_subtype": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "wallet",
"payment_method_subtypes": [
{
"payment_method_subtype": "google_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "apple_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "we_chat_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "ali_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "paypal",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "mb_way",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "pay_later",
"payment_method_subtypes": [
{
"payment_method_subtype": "klarna",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "affirm",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "walley",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_redirect",
"payment_method_subtypes": [
{
"payment_method_subtype": "giropay",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "ideal",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "eps",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bancontact_card",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "przelewy24",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sofort",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "blik",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "trustly",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "online_banking_finland",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "online_banking_poland",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_transfer",
"payment_method_subtypes": [
{
"payment_method_subtype": "ach",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sepa",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bacs",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_debit",
"payment_method_subtypes": [
{
"payment_method_subtype": "ach",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sepa",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bacs",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "becs",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay",
"account_name": "transaction_processing",
"pricing_type": "fixed_price",
"acquirer_bin": "438309",
"acquirer_merchant_id": "00002000000"
},
"frm_configs": null,
"connector_webhook_details": {
"merchant_secret": ""
},
"feature_metadata" : {
"revenue_recovery" : {
"max_retry_count" : 27,
"billing_connector_retry_threshold" : 16,
"billing_account_reference" :{
"mca1" : "charge_123",
"mca2" : "charge_124"
}
}
},
"profile_id": "{{profile_id}}"
}
```
response :
```
{
"connector_type": "payment_processor",
"connector_name": "adyen",
"connector_label": "adyen_business",
"id": "mca_u2uSjWuMdWfWmJPZ9WhQ",
"profile_id": "pro_eOM51fGaNFolB3jefbQb",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "as*fa",
"key1": "as****df",
"api_secret": "as***sd"
},
"payment_methods_enabled": [
{
"payment_method_type": "card_redirect",
"payment_method_subtypes": [
{
"payment_method_subtype": "card_redirect",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "card",
"payment_method_subtypes": [
{
"payment_method_subtype": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "wallet",
"payment_method_subtypes": [
{
"payment_method_subtype": "google_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "apple_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "we_chat_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "ali_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "paypal",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "mb_way",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "pay_later",
"payment_method_subtypes": [
{
"payment_method_subtype": "klarna",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "affirm",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "walley",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_redirect",
"payment_method_subtypes": [
{
"payment_method_subtype": "giropay",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "ideal",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "eps",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bancontact_card",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "przelewy24",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sofort",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "blik",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "trustly",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "online_banking_finland",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "online_banking_poland",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_transfer",
"payment_method_subtypes": [
{
"payment_method_subtype": "ach",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sepa",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bacs",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_debit",
"payment_method_subtypes": [
{
"payment_method_subtype": "ach",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sepa",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bacs",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "becs",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"connector_webhook_details": {
"merchant_secret": "",
"additional_secret": null
},
"metadata": {
"status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay",
"account_name": "transaction_processing",
"acquirer_bin": "438309",
"pricing_type": "fixed_price",
"acquirer_merchant_id": "00002000000"
},
"disabled": false,
"frm_configs": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null,
"feature_metadata": {
"revenue_recovery": {
"max_retry_count": 27,
"billing_connector_retry_threshold": 16,
"billing_account_reference": {
"mca1": "charge_123",
"mca2": "charge_124"
}
}
}
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/admin.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/merchant_connector_account.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/merchant_connector_account.rs`
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/connector_onboarding/paypal.rs`
- `crates/router/src/core/verification/utils.rs`
**5. External Connector Integration**
- `crates/router/src/db/merchant_connector_account.rs`
- `v2_migrations/2025-01-29-103844_add_feature_metadata_in_merchant_connector_account/down.sql`
- `v2_migrations/2025-01-29-103844_add_feature_metadata_in_merchant_connector_account/up.sql`
**6. Type Definitions**
- `crates/router/src/types.rs`
- `crates/router/src/types/transformers.rs`
**7. Other**
- `api-reference-v2/openapi_spec.json`
- `crates/openapi/src/openapi_v2.rs`
**Code Patterns Applied:**
- Define new data structures (8 changes)
- Implement new functions (6 changes)
- Extend existing types with new fields (52 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 647e1631:
Files to modify:
**crates/api_models/src/admin.rs**
Add:
- struct: pub::MerchantConnectorAccountFeatureMetadata
- struct: pub::RevenueRecoveryMetadata
**crates/diesel_models/src/merchant_connector_account.rs**
Add:
- struct: pub::MerchantConnectorAccountFeatureMetadata
- struct: pub::RevenueRecoveryMetadata
- struct: pub::BillingAccountReference
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/merchant_connector_account.rs**
Add:
- function: pub::new
- function: private::validate
- function: private::from
- function: private::from
- struct: pub::MerchantConnectorAccountFeatureMetadata
- struct: pub::RevenueRecoveryMetadata
- struct: pub::AccountReferenceMap
- impl: impl AccountReferenceMap
- impl: impl From<MerchantConnectorAccountFeatureMetadata> for DieselMerchantConnectorAccountFeatureMetadata
- impl: impl From<DieselMerchantConnectorAccountFeatureMetadata> for MerchantConnectorAccountFeatureMetadata
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/connector_onboarding/paypal.rs**
Modify existing code
**crates/router/src/core/verification/utils.rs**
Modify existing code
**crates/router/src/db/merchant_connector_account.rs**
Modify existing code
**crates/router/src/types.rs**
Add:
- function: private::foreign_from
- function: private::foreign_try_from
- impl: impl ForeignFrom<&domain::MerchantConnectorAccountFeatureMetadata> for api_models::admin::MerchantConnectorAccountFeatureMetadata
- impl: impl ForeignTryFrom<&api_models::admin::MerchantConnectorAccountFeatureMetadata> for domain::MerchantConnectorAccountFeatureMetadata
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 7144, "pr_title": "refactor(router): add feature_metadata for merchant_connector_account create v2 flow", "merged_at": "2025-02-10T12:55:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs"], "database": ["crates/diesel_models/src/merchant_connector_account.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/merchant_connector_account.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/connector_onboarding/paypal.rs", "crates/router/src/core/verification/utils.rs"], "connectors": ["crates/router/src/db/merchant_connector_account.rs", "v2_migrations/2025-01-29-103844_add_feature_metadata_in_merchant_connector_account/down.sql", "v2_migrations/2025-01-29-103844_add_feature_metadata_in_merchant_connector_account/up.sql"], "types": ["crates/router/src/types.rs", "crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 8, "functions_added": 6, "fields_added": 52, "imports_added": 9, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(tokenio): Add Template PR
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Template PR for TOkenio
### 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 testing required
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/configs.rs`
**2. Core Business Logic**
- `crates/router/src/core/admin.rs`
**3. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/hyperswitch_connectors/src/connectors.rs`
- ... and 9 more files
**4. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/transformers.rs`
**5. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**6. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (78 changes)
- Extend existing types with new fields (157 changes)
**Detailed Identifier Changes:**
Commit 9f9fef49:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::tokenio
**crates/hyperswitch_connectors/src/connectors/tokenio.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::Tokenio
- impl: impl Tokenio
- impl: impl api::Payment for Tokenio
- impl: impl api::PaymentSession for Tokenio
- impl: impl api::ConnectorAccessToken for Tokenio
- impl: impl api::MandateSetup for Tokenio
- impl: impl api::PaymentAuthorize for Tokenio
- impl: impl api::PaymentSync for Tokenio
- impl: impl api::PaymentCapture for Tokenio
- impl: impl api::PaymentVoid for Tokenio
- impl: impl api::Refund for Tokenio
- impl: impl api::RefundExecute for Tokenio
- impl: impl api::RefundSync for Tokenio
- impl: impl api::PaymentToken for Tokenio
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Tokenio
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Tokenio
- impl: impl ConnectorCommon for Tokenio
- impl: impl ConnectorValidation for Tokenio
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Tokenio
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Tokenio
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Tokenio
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Tokenio
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tokenio
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Tokenio
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Tokenio
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Tokenio
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Tokenio
- impl: impl webhooks::IncomingWebhook for Tokenio
- impl: impl ConnectorSpecifications for Tokenio
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/tokenio/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::TokenioRouterData
- struct: pub::TokenioPaymentsRequest
- struct: pub::TokenioCard
- struct: pub::TokenioAuthType
- struct: pub::TokenioPaymentsResponse
- struct: pub::TokenioRefundRequest
- struct: pub::RefundResponse
- struct: pub::TokenioErrorResponse
- enum: pub::TokenioPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for TokenioRouterData<T>
- impl: impl TryFrom<&TokenioRouterData<&PaymentsAuthorizeRouterData>> for TokenioPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for TokenioAuthType
- impl: impl From<TokenioPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, TokenioPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&TokenioRouterData<&RefundsRouterData<F>>> for TokenioRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
- impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/configs.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::tokenio
**crates/router/tests/connectors/tokenio.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::TokenioTest
- impl: impl ConnectorActions for TokenioTest
- impl: impl utils::Connector for TokenioTest
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 8095, "pr_title": "feat(tokenio): Add Template PR", "merged_at": "2025-05-23T09:40:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["token"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/configs.rs"], "core_business": ["crates/router/src/core/admin.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/tokenio.rs", "crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector.rs", "crates/router/tests/connectors/main.rs", "crates/router/tests/connectors/tokenio.rs", "crates/test_utils/src/connector_auth.rs", "scripts/add_connector.sh"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 10, "functions_added": 78, "enums_added": 2, "fields_added": 157, "imports_added": 20}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
revert: fix(connector): [noon] address `next_action_url` being `null` for cards in 3ds payment
Reverts juspay/hyperswitch#7832
|
To implement this **unknown** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/noon.rs`
- `crates/hyperswitch_connectors/src/connectors/noon/transformers.rs`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (31 changes)
**Detailed Identifier Changes:**
Commit c89a4121:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/noon.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/noon/transformers.rs**
Add:
- function: private::try_from
- struct: pub::NoonPaypalResponse
- struct: pub::NoonPaypalResponseResult
- enum: pub::NoonAuthPaymentResponse
- impl: impl TryFrom<ResponseRouterData<F, NoonPaypalResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
|
{"pr_number": 7859, "pr_title": "revert: fix(connector): [noon] address `next_action_url` being `null` for cards in 3ds payment", "merged_at": "2025-04-21T17:24:14Z", "intent": {"feature_type": "unknown", "action": "unknown", "entities": []}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/noon.rs", "crates/hyperswitch_connectors/src/connectors/noon/transformers.rs"]}, "change_types": {"structs_added": 2, "functions_added": 1, "enums_added": 1, "fields_added": 31}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(gitattributes): enforce LF for `.patch` files to avoid CRLF parsing errors on Windows
## 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 adds the following rule to `.gitattributes` to ensure `.patch` files always use LF line endings, regardless of developer OS:
```gitattributes
*.patch text eol=lf
```
This rule overrides Windows’ default `core.autocrlf` behavior and prevents errors during migration when Diesel’s patch parser encounters CRLF line endings.
**Additionally**: For developers who have already cloned the repository and whose `.patch` files may still have CRLF endings, a workaround :
```bash
git checkout -- crates/diesel_models/drop_id.patch
```
This ensures the `.patch` file is re-checked-out with the correct LF line endings, without requiring a full reclone.
Closes: #9120
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Diesel’s migration runner fails on Windows because CRLF line endings corrupt the patch file format (e.g., `diff --git a/file.rs b/file.rs\r\n`), causing “invalid char in unquoted filename” parsing errors. By forcing LF endings for patch files via `.gitattributes`, this PR ensures cross-platform consistency and prevents migration failures.
Issue: #9120
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
* Applied the change on a Windows environment with `core.autocrlf=true` and confirmed `.patch` files now use `\n` instead of `\r\n`.
* Ran `scripts/setup.sh` and verified that the migration runner no longer exits with code 1.
* Provided the `git checkout -- <patch>` fix to confirm re-checkout resets line endings to LF without recloning.
## 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
### Additional Context
**CRLF vs LF Line Endings Explained**
* **LF (Line Feed)** – used by Unix/Linux/macOS; represented by `\n`
* **CRLF (Carriage Return + Line Feed)** – used by Windows; represented by `\r\n`
Git’s `core.autocrlf=true` (Windows default) can introduce CRLF line endings on checkout and convert them back to LF on commit. Explicit `.gitattributes` configuration (`*.patch text eol=lf`) guarantees LF regardless of platform, preventing CRLF-related parsing issues.
---
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Other**
- `.gitattributes`
|
{"pr_number": 9333, "pr_title": "fix(gitattributes): enforce LF for `.patch` files to avoid CRLF parsing errors on Windows", "merged_at": "2025-09-17T10:03:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": [".gitattributes"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): [Novalnet] handle refund failure response in novalnet
## 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 -->
Need to make unused fields in novalnet refund response as optional. This will prevent the deserialization errors.
It's a configuration done on Novalnet side, only available in prod. Cannot test this specific case in sandbox. cc: @kashif-m
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Few fields which are not mandatory in response were made mandatory in the types defined which were causing deserialization when parsing connector refund response.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Curl to test:
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_LGJYQwEIgppbYvbIuwmQYyHGtMLquJJUujSrP34trbI4k1nnTs1ZyqkG1aI6Nx5N' \
--data '{
"payment_id": "pay_ahzKGIpLrLjWUsalTs0D",
"amount": 10000,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit ae00ef9c:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs**
Modify existing code
|
{"pr_number": 7721, "pr_title": "fix(connector): [Novalnet] handle refund failure response in novalnet", "merged_at": "2025-04-06T12:25:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "refund"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): Fix wellsfargo test
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Fixed the wellsfargo cypress test
## How did you test it?
<img width="482" alt="Screenshot 2025-07-01 at 7 26 17 PM" src="https://github.com/user-attachments/assets/863ea827-7e79-438d-9e64-ffd485241b1b" />
Failure Reason:
3ds payments silently falling back to no-3ds(Should throw validation)
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Utils.js`
- `cypress-tests/cypress/e2e/configs/Payment/WellsFargo.js`
**Code Patterns Applied:**
- Extend existing types with new fields (120 changes)
|
{"pr_number": 8513, "pr_title": "ci(cypress): Fix wellsfargo test", "merged_at": "2025-07-02T10:33:27Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/configs/Payment/WellsFargo.js"]}, "change_types": {"fields_added": 120}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
chore: update production endpoint url for globalPay
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR updates the production endpoint url environment value for GlobalPay while fixing minor inconsistencies
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
At present, the production endpoint URL points to sandbox endpoint URL which is not intended.
Closes #7587
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
NA.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/globalpay.rs`
**2. Configuration Files**
- `config/deployments/production.toml`
**3. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Implement new functions (1 changes)
**Detailed Identifier Changes:**
Commit 74090f6c:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/globalpay.rs**
Modify existing code
|
{"pr_number": 7588, "pr_title": "chore: update production endpoint url for globalPay", "merged_at": "2025-03-24T08:11:04Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/globalpay.rs"], "config": ["config/deployments/production.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"functions_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Hyperswitch <|> UCS Integration
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
The payment flow starts in call_connector_service()
**1. Determining Unified Connector Service Eligibility:**
The flow starts with `should_call_unified_connector_service()` which determines if a payment should be routed through the unified connector service.
The function:
- Gets the merchant ID and connector name
- Constructs a config key using `merchant_id`, `connector_name`, `payment_method`, and `flow_name`
- Checks the database for a rollout configuration using this key
- If a config exists, it parses the rollout percentage
- Generates a random value and compares it with the rollout percentage
- If the random value is less than the rollout percentage, it attempts to connect to the unified connector service
- Returns either a connected client or None
**2. Calling Unified Connector Service:**
If the service is eligible, the `call_unified_connector_service()` function is invoked:
The function:
- Constructs the authorization request using `construct_ucs_authorize_request()`
- Creates a new gRPC request
- Adds metadata to the request using `construct_ucs_request_metadata()`
- Makes the gRPC call to authorize the payment
- Processes the response using `construct_router_data_from_ucs_authorize_response()`
**3. Request Metadata Construction:**
The `construct_ucs_request_metadata()` function adds necessary metadata to the request:
The function:
- Extracts the connector authentication type
- Gets the connector name
- Adds the connector name to metadata
- Adds authentication headers based on the auth type (e.g., header key)
**4. Post-Processing and Tracker Updates:**
After the unified connector service call:
- If needed, adds a task to the process tracker
- Updates payment trackers with the latest information
- Records timing information for monitoring
### 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).
-->
Unified Connector Service (UCS) is an open source, stateless merchant payments abstraction service (built using gRPC) that enables developers to integrate with a wide variety of payment processors using a unified contract. It offers the following capabilities.
- Unified contract across multiple payment processors
- Establishing and accepting connections to numerous remote endpoints of payment processors like Stripe/Adyen/Razorpay
- Supports all payment payment life-cycle management operations like including authorization, capture, refunds, status and chargebacks across processors
- Client-SDKs in multiple programming languages (Java, Python, Go, Rust, PHP) for rapid integration.
The goal is to integrate Hyperswitch with Unified Connector Service (UCS), such that Hyperswitch can start routing traffic through the Unified Connector Service (UCS), depending on config based staggering.
## How did you test 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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://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": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://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": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://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": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": "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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://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": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": "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
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Introduced integration with a unified connector service (UCS) for payment authorization, including rollout configuration and gRPC communication.
- Added new configuration options for the unified connector service.
- Enhanced payment flows to support UCS-based routing and response handling.
- **Refactor**
- Modularized payment connector service logic for improved maintainability and preparation steps.
- Streamlined retry and connector invocation flows to accommodate UCS integration.
- **Chores**
- Updated dependencies and workflow steps to support new UCS features and gRPC client requirements.
<!-- 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. Core Business Logic**
- `crates/router/src/core.rs`
- `crates/router/src/core/fraud_check/flows/checkout_flow.rs`
- `crates/router/src/core/fraud_check/flows/record_return.rs`
- ... and 21 more files
**2. External Connector Integration**
- `crates/external_services/src/grpc_client/unified_connector_service.rs`
**3. Utils**
- `crates/common_utils/src/consts.rs`
**4. Tests**
- `.github/workflows/cypress-tests-runner.yml`
**5. Configuration Files**
- `config/config.example.toml`
- `config/deployments/env_specific.toml`
- `config/development.toml`
- ... and 2 more files
**6. Other**
- `Cargo.lock`
- `crates/external_services/src/grpc_client.rs`
- `crates/external_services/src/lib.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (25 changes)
- Extend existing types with new fields (208 changes)
- Add conditional logic for feature flags or filtering (10 changes)
- Modify database queries (3 changes)
**Detailed Identifier Changes:**
Commit f6574b78:
Files to modify:
**crates/common_utils/src/consts.rs**
Modify existing code
**crates/external_services/src/grpc_client.rs**
Add:
- mod: pub::unified_connector_service
**crates/external_services/src/grpc_client/unified_connector_service.rs**
Add:
- function: pub::build_connections
- function: pub::payment_authorize
- function: pub::build_unified_connector_service_grpc_headers
- struct: pub::UnifiedConnectorServiceClient
- struct: pub::UnifiedConnectorServiceClientConfig
- struct: pub::ConnectorAuthMetadata
- enum: pub::UnifiedConnectorServiceError
- impl: impl UnifiedConnectorServiceClient
**crates/external_services/src/lib.rs**
Modify existing code
**crates/router/src/consts.rs**
Modify existing code
**crates/router/src/core.rs**
Add:
- mod: pub::unified_connector_service
**crates/router/src/core/fraud_check/flows/checkout_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/fraud_check/flows/record_return.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/fraud_check/flows/sale_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/fraud_check/flows/transaction_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Add:
- function: private::call_unified_connector_service
**crates/router/src/core/payments/flows/approve_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/authorize_flow.rs**
Add:
- function: private::call_unified_connector_service
**crates/router/src/core/payments/flows/cancel_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/capture_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/complete_authorize_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/incremental_authorization_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/post_session_tokens_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/psync_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/reject_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/session_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/session_update_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/setup_mandate_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/flows/update_metadata_flow.rs**
Remove:
- function: private::get_merchant_recipient_data
**crates/router/src/core/payments/helpers.rs**
Add:
- function: pub::should_execute_based_on_rollout
**crates/router/src/core/payments/retry.rs**
Modify existing code
**crates/router/src/core/unified_connector_service.rs**
Add:
- function: pub::should_call_unified_connector_service
- function: pub::build_unified_connector_service_payment_method
- function: pub::build_unified_connector_service_auth_metadata
- function: pub::handle_unified_connector_service_response_for_payment_authorize
- mod: private::transformers
**crates/router/src/core/unified_connector_service/transformers.rs**
Add:
- function: private::foreign_try_from
- function: private::foreign_try_from
- function: private::foreign_try_from
- function: private::foreign_try_from
- function: private::foreign_try_from
- function: private::foreign_try_from
- function: private::foreign_try_from
- function: private::foreign_try_from
- function: private::foreign_try_from
- function: private::foreign_try_from
- function: private::foreign_try_from
- impl: impl ForeignTryFrom<&RouterData<Authorize, PaymentsAuthorizeData, PaymentsResponseData>> for payments_grpc::PaymentServiceAuthorizeRequest
- impl: impl ForeignTryFrom<common_enums::Currency> for payments_grpc::Currency
- impl: impl ForeignTryFrom<common_enums::CardNetwork> for payments_grpc::CardNetwork
- impl: impl ForeignTryFrom<hyperswitch_domain_models::payment_address::PaymentAddress> for payments_grpc::PaymentAddress
- impl: impl ForeignTryFrom<AuthenticationType> for payments_grpc::AuthenticationType
- impl: impl ForeignTryFrom<hyperswitch_domain_models::router_request_types::BrowserInformation> for payments_grpc::BrowserInformation
- impl: impl ForeignTryFrom<storage_enums::CaptureMethod> for payments_grpc::CaptureMethod
- impl: impl ForeignTryFrom<AuthenticationData> for payments_grpc::AuthenticationData
- impl: impl ForeignTryFrom<payments_grpc::PaymentStatus> for AttemptStatus
- impl: impl ForeignTryFrom<payments_grpc::RedirectForm> for RedirectForm
- impl: impl ForeignTryFrom<payments_grpc::HttpMethod> for Method
|
{"pr_number": 8280, "pr_title": "feat(core): Hyperswitch <|> UCS Integration", "merged_at": "2025-07-04T17:42:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core.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/flows/update_metadata_flow.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/retry.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"], "utils": ["crates/common_utils/src/consts.rs"], "tests": [".github/workflows/cypress-tests-runner.yml"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/development.toml", "crates/external_services/Cargo.toml", "crates/router/Cargo.toml"], "other": ["Cargo.lock", "crates/external_services/src/grpc_client.rs", "crates/external_services/src/lib.rs", "crates/router/src/consts.rs"]}, "change_types": {"structs_added": 3, "functions_added": 25, "enums_added": 1, "fields_added": 208, "imports_added": 33, "conditionals_added": 10, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Paysafe] add connector template code
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Add connector template code for Paysafe
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
No test required as it is template PR
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. 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 (165 changes)
**Detailed Identifier Changes:**
Commit ce0159b6:
Files to modify:
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::paysafe
**crates/hyperswitch_connectors/src/connectors/paysafe.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::Paysafe
- impl: impl Paysafe
- impl: impl api::Payment for Paysafe
- impl: impl api::PaymentSession for Paysafe
- impl: impl api::ConnectorAccessToken for Paysafe
- impl: impl api::MandateSetup for Paysafe
- impl: impl api::PaymentAuthorize for Paysafe
- impl: impl api::PaymentSync for Paysafe
- impl: impl api::PaymentCapture for Paysafe
- impl: impl api::PaymentVoid for Paysafe
- impl: impl api::Refund for Paysafe
- impl: impl api::RefundExecute for Paysafe
- impl: impl api::RefundSync for Paysafe
- impl: impl api::PaymentToken for Paysafe
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Paysafe
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Paysafe
- impl: impl ConnectorCommon for Paysafe
- impl: impl ConnectorValidation for Paysafe
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Paysafe
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Paysafe
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Paysafe
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Paysafe
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Paysafe
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Paysafe
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Paysafe
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Paysafe
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Paysafe
- impl: impl webhooks::IncomingWebhook for Paysafe
- impl: impl ConnectorSpecifications for Paysafe
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/paysafe/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::PaysafeRouterData
- struct: pub::PaysafePaymentsRequest
- struct: pub::PaysafeCard
- struct: pub::PaysafeAuthType
- struct: pub::PaysafePaymentsResponse
- struct: pub::PaysafeRefundRequest
- struct: pub::RefundResponse
- struct: pub::PaysafeErrorResponse
- enum: pub::PaysafePaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for PaysafeRouterData<T>
- impl: impl TryFrom<&PaysafeRouterData<&PaymentsAuthorizeRouterData>> for PaysafePaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for PaysafeAuthType
- impl: impl From<PaysafePaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, PaysafePaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&PaysafeRouterData<&RefundsRouterData<F>>> for PaysafeRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
- impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/connector_endpoints.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::paysafe
**crates/router/tests/connectors/paysafe.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::PaysafeTest
- impl: impl ConnectorActions for PaysafeTest
- impl: impl utils::Connector for PaysafeTest
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 9011, "pr_title": "feat(connector): [Paysafe] add connector template code", "merged_at": "2025-08-26T07:01:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "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/paysafe.rs", "crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector.rs", "crates/router/tests/connectors/main.rs", "crates/router/tests/connectors/paysafe.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": 165, "imports_added": 22}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(customer): refactor customer db with storage utils and move trait to domain_models and impl to storage_model
## 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 -->
1. Move the Customer db to storage_impl and its interface to hyperswitch_domain_model
2. Added resource handling implementations in KVRouterStore, RouterStore, With this support all the resource handlers can now directly call these generic functions instead of handling the merchant storage scheme manually
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies 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).
-->
As part of Payment method crate seperation, customer DB is required in payment methods so moving it out from router
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Start router service with `cargo r`
### With KV disabled for the merchant
1. Create Merchant Account, Create API Key
<details>
<summary>2. Create Customer</summary>
Request
curl --location 'http://localhost:8080/customers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_gu3raVGqNAtULFRrZ8y503nu1tVIxsZQWTupJcl5xsTLDz37kvLxTfaq6ZCVfb0e' \
--data-raw '{
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
Response
{
"customer_id": "cus_LcqiGN9t81YjqIyMgKWt",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"address": null,
"created_at": "2025-03-27T09:06:56.214Z",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"default_payment_method_id": null
}
</details>
<details>
<summary>3. Retrieve Customer</summary>
Request
curl --location 'http://localhost:8080/customers/cus_LcqiGN9t81YjqIyMgKWt' \
--header 'Accept: application/json' \
--header 'api-key: dev_gu3raVGqNAtULFRrZ8y503nu1tVIxsZQWTupJcl5xsTLDz37kvLxTfaq6ZCVfb0e'
Response
{
"customer_id": "cus_LcqiGN9t81YjqIyMgKWt",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"address": null,
"created_at": "2025-03-27T09:06:56.214Z",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"default_payment_method_id": null
}
</details>
<details>
<summary>4. Update Customer</summary>
Request
curl --location 'http://localhost:8080/customers/cus_LcqiGN9t81YjqIyMgKWt' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_gu3raVGqNAtULFRrZ8y503nu1tVIxsZQWTupJcl5xsTLDz37kvLxTfaq6ZCVfb0e' \
--data-raw '{
"email": "[email protected]",
"name": "John Test",
"phone_country_code": "+65",
"phone": "888888888",
"description": "First customer",
"metadata": {
"city": "NY",
"unit": "245"
}
}'
Response
{
"customer_id": "cus_LcqiGN9t81YjqIyMgKWt",
"name": "John Test",
"email": "[email protected]",
"phone": "888888888",
"phone_country_code": "+65",
"description": "First customer",
"address": null,
"created_at": "2025-03-27T09:06:56.214Z",
"metadata": {
"city": "NY",
"unit": "245"
},
"default_payment_method_id": null
}
</details>
<details>
<summary>5. Delete Customer</summary>
Request
curl --location --request DELETE 'http://localhost:8080/customers/cus_LcqiGN9t81YjqIyMgKWt' \
--header 'Accept: application/json' \
--header 'api-key: dev_gu3raVGqNAtULFRrZ8y503nu1tVIxsZQWTupJcl5xsTLDz37kvLxTfaq6ZCVfb0e'
{
"customer_id": "cus_LcqiGN9t81YjqIyMgKWt",
"customer_deleted": true,
"address_deleted": true,
"payment_methods_deleted": true
}
Response
{
"customer_id": "cus_LcqiGN9t81YjqIyMgKWt",
"customer_deleted": true,
"address_deleted": true,
"payment_methods_deleted": true
}
</details>
### With KV enabled for a merchant
1. Create Merchant Account, Create API Key, Do not start Drainer
<details>
<summary>2. Enable KV for the merchant</summary>
Request
curl --location 'http://localhost:8080/accounts/merchant_1743066953/kv' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"kv_enabled": true
}'
Response
{
"merchant_id": "merchant_1743066953",
"kv_enabled": true
}
</details>
<details>
<summary>3. Create Customer</summary>
Request
curl --location 'http://localhost:8080/customers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_f3M5W0ZyHHsCUekQ6z1mPraNzaUzrb73No6SPnlDbFGUygPOJtOOfCIyyHUGXmwL' \
--data-raw '{
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
Response
{
"customer_id": "cus_hS8uA0hvtVdbBa8ecYOw",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"address": null,
"created_at": "2025-03-27T09:19:49.092Z",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"default_payment_method_id": null
}
</details>
<details>
<summary>4. Retrieve Customer</summary>
Request
curl --location 'http://localhost:8080/customers/cus_hS8uA0hvtVdbBa8ecYOw' \
--header 'Accept: application/json' \
--header 'api-key: dev_f3M5W0ZyHHsCUekQ6z1mPraNzaUzrb73No6SPnlDbFGUygPOJtOOfCIyyHUGXmwL'
Response
{
"customer_id": "cus_hS8uA0hvtVdbBa8ecYOw",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"address": null,
"created_at": "2025-03-27T09:19:49.092Z",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"default_payment_method_id": null
}
</details>
<details>
<summary>5. Update Customer</summary>
Request
curl --location 'http://localhost:8080/customers/cus_hS8uA0hvtVdbBa8ecYOw' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_f3M5W0ZyHHsCUekQ6z1mPraNzaUzrb73No6SPnlDbFGUygPOJtOOfCIyyHUGXmwL' \
--data-raw '{
"email": "[email protected]",
"name": "John Test",
"phone_country_code": "+65",
"phone": "888888888",
"description": "First customer",
"metadata": {
"city": "NY",
"unit": "245"
}
}'
Response
{
"customer_id": "cus_hS8uA0hvtVdbBa8ecYOw",
"name": "John Test",
"email": "[email protected]",
"phone": "888888888",
"phone_country_code": "+65",
"description": "First customer",
"address": null,
"created_at": "2025-03-27T09:19:49.092Z",
"metadata": {
"city": "NY",
"unit": "245"
},
"default_payment_method_id": null
}
</details>
<details>
<summary>6. Delete Customer</summary>
Request
curl --location --request DELETE 'http://localhost:8080/customers/cus_hS8uA0hvtVdbBa8ecYOw' \
--header 'Accept: application/json' \
--header 'api-key: dev_f3M5W0ZyHHsCUekQ6z1mPraNzaUzrb73No6SPnlDbFGUygPOJtOOfCIyyHUGXmwL'
Response
{
"customer_id": "cus_hS8uA0hvtVdbBa8ecYOw",
"customer_deleted": true,
"address_deleted": true,
"payment_methods_deleted": true
}
</details>
<details>
<summary>7. Retrieve Customer</summary>
Request
curl --location 'http://localhost:8080/customers/cus_hS8uA0hvtVdbBa8ecYOw' \
--header 'Accept: application/json' \
--header 'api-key: dev_f3M5W0ZyHHsCUekQ6z1mPraNzaUzrb73No6SPnlDbFGUygPOJtOOfCIyyHUGXmwL'
Response
{
"customer_id": "cus_hS8uA0hvtVdbBa8ecYOw",
"name": "Redacted",
"email": "Redacted",
"phone": "Redacted",
"phone_country_code": "Redacted",
"description": "Redacted",
"address": null,
"created_at": "2025-03-27T09:19:49.092Z",
"metadata": {
"city": "NY",
"unit": "245"
},
"default_payment_method_id": null
}
</details>
## Start Drainer
After adding drainer, the KV created customer will be added into db by drainer, so read, update and delete operation should work fine after starting it.
Apply below changes
```
# In config/docker_compose.toml
[master_database]
host = "host.docker.internal"
[replica_database]
host = "host.docker.internal"
[redis]
host = "host.docker.internal"
```
In docker-compose.yml change drainer as below
```
hyperswitch-drainer:
image: juspaydotin/hyperswitch-drainer:standalone
pull_policy: always
command: /local/bin/drainer -f /local/config/docker_compose.toml
deploy:
replicas: ${DRAINER_INSTANCE_COUNT:-1}
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- router_net
profiles:
- full_kv
volumes:
- ./config:/local/config
restart: unless-stopped
labels:
logs: "promtail"
```
Run the drainer with `docker-compose up hyperswitch-drainer`
### With KV disabled for the same merchant
<details>
<summary>1. Disable KV for the same merchant</summary>
Request
curl --location 'http://localhost:8080/accounts/merchant_1743066953/kv' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"kv_enabled": false
}'
Response
{
"merchant_id": "merchant_1743066953",
"kv_enabled": false
}
</details>
<details>
<summary>2. Update Customer details</summary>
Request
curl --location 'http://localhost:8080/customers/cus_hS8uA0hvtVdbBa8ecYOw' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_f3M5W0ZyHHsCUekQ6z1mPraNzaUzrb73No6SPnlDbFGUygPOJtOOfCIyyHUGXmwL' \
--data-raw '{
"email": "[email protected]",
"name": "John Test",
"phone_country_code": "+65",
"phone": "888888888",
"description": "First customer",
"metadata": {
"city": "NY",
"unit": "245"
}
}'
Response
{
"error": {
"type": "invalid_request",
"message": "Customer has already been redacted",
"code": "IR_11"
}
}
</details>
<details>
<summary>3. Get Customer</summary>
Request
curl --location 'http://localhost:8080/customers/cus_hS8uA0hvtVdbBa8ecYOw' \
--header 'Accept: application/json' \
--header 'api-key: dev_f3M5W0ZyHHsCUekQ6z1mPraNzaUzrb73No6SPnlDbFGUygPOJtOOfCIyyHUGXmwL'
Response
{
"customer_id": "cus_hS8uA0hvtVdbBa8ecYOw",
"name": "Redacted",
"email": "Redacted",
"phone": "Redacted",
"phone_country_code": "Redacted",
"description": "Redacted",
"address": null,
"created_at": "2025-03-27T09:19:49.092Z",
"metadata": {
"city": "NY",
"unit": "245"
},
"default_payment_method_id": null
}
</details>
<details>
<summary>4. Delete Customer</summary>
Request
curl --location --request DELETE 'http://localhost:8080/customers/cus_hS8uA0hvtVdbBa8ecYOw' \
--header 'Accept: application/json' \
--header 'api-key: dev_f3M5W0ZyHHsCUekQ6z1mPraNzaUzrb73No6SPnlDbFGUygPOJtOOfCIyyHUGXmwL'
Response
{
"error": {
"type": "invalid_request",
"message": "Customer has already been redacted",
"code": "IR_11"
}
}
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/customer.rs`
**2. Other**
- `crates/router/src/db.rs`
- `crates/router/src/db/customers.rs`
- `crates/router/src/db/kafka_store.rs`
- ... and 4 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (50 changes)
- Extend existing types with new fields (261 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit e8e0b5df:
Files to modify:
**crates/hyperswitch_domain_models/src/customer.rs**
Add:
- function: private::from
- struct: pub::CustomerListConstraints
- trait: pub::CustomerInterface
- impl: impl From<CustomerListConstraints> for query::CustomerListConstraints
**crates/router/src/db.rs**
Modify existing code
**crates/router/src/db/customers.rs**
Remove:
- function: private::from
- function: private::find_customer_optional_by_customer_id_merchant_id
- function: private::find_customer_optional_with_redacted_customer_details_by_customer_id_merchant_id
- function: private::find_optional_by_merchant_id_merchant_reference_id
- function: private::update_customer_by_customer_id_merchant_id
- function: private::find_customer_by_merchant_reference_id_merchant_id
- function: private::find_customer_by_customer_id_merchant_id
- function: private::list_customers_by_merchant_id
- function: private::insert_customer
- function: private::insert_customer
- function: private::delete_customer_by_customer_id_merchant_id
- function: private::find_customer_by_global_id
- function: private::update_customer_by_global_id
- function: private::find_customer_optional_by_customer_id_merchant_id
- function: private::find_customer_optional_with_redacted_customer_details_by_customer_id_merchant_id
- function: private::find_optional_by_merchant_id_merchant_reference_id
- function: private::update_customer_by_customer_id_merchant_id
- function: private::find_customer_by_customer_id_merchant_id
- function: private::find_customer_by_merchant_reference_id_merchant_id
- function: private::list_customers_by_merchant_id
- function: private::insert_customer
- function: private::delete_customer_by_customer_id_merchant_id
- function: private::update_customer_by_global_id
- function: private::find_customer_by_global_id
- function: private::find_customer_optional_by_customer_id_merchant_id
- function: private::find_customer_optional_with_redacted_customer_details_by_customer_id_merchant_id
- function: private::find_optional_by_merchant_id_merchant_reference_id
- function: private::list_customers_by_merchant_id
- function: private::update_customer_by_customer_id_merchant_id
- function: private::find_customer_by_customer_id_merchant_id
- function: private::find_customer_by_merchant_reference_id_merchant_id
- function: private::insert_customer
- function: private::delete_customer_by_customer_id_merchant_id
- function: private::update_customer_by_global_id
- function: private::find_customer_by_global_id
- struct: pub::CustomerListConstraints
- trait: pub::CustomerInterface
- impl: impl From<CustomerListConstraints> for DieselCustomerListConstraints
- impl: impl CustomerInterface for Store
- impl: impl CustomerInterface for Store
- impl: impl CustomerInterface for MockDb
- mod: private::storage
- mod: private::storage
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/storage_impl/src/customers.rs**
Remove:
- impl: impl KvStorePartition for Customer
Add:
- function: private::find_customer_optional_by_customer_id_merchant_id
- function: private::find_customer_optional_with_redacted_customer_details_by_customer_id_merchant_id
- function: private::find_optional_by_merchant_id_merchant_reference_id
- function: private::update_customer_by_customer_id_merchant_id
- function: private::find_customer_by_merchant_reference_id_merchant_id
- function: private::find_customer_by_customer_id_merchant_id
- function: private::list_customers_by_merchant_id
- function: private::insert_customer
- function: private::insert_customer
- function: private::delete_customer_by_customer_id_merchant_id
- function: private::find_customer_by_global_id
- function: private::update_customer_by_global_id
- function: private::find_customer_optional_by_customer_id_merchant_id
- function: private::find_customer_optional_with_redacted_customer_details_by_customer_id_merchant_id
- function: private::find_optional_by_merchant_id_merchant_reference_id
- function: private::update_customer_by_customer_id_merchant_id
- function: private::find_customer_by_customer_id_merchant_id
- function: private::find_customer_by_merchant_reference_id_merchant_id
- function: private::list_customers_by_merchant_id
- function: private::insert_customer
- function: private::delete_customer_by_customer_id_merchant_id
- function: private::update_customer_by_global_id
- function: private::find_customer_by_global_id
- function: private::find_customer_optional_by_customer_id_merchant_id
- function: private::find_customer_optional_with_redacted_customer_details_by_customer_id_merchant_id
- function: private::find_optional_by_merchant_id_merchant_reference_id
- function: private::list_customers_by_merchant_id
- function: private::update_customer_by_customer_id_merchant_id
- function: private::find_customer_by_customer_id_merchant_id
- function: private::find_customer_by_merchant_reference_id_merchant_id
- function: private::insert_customer
- function: private::delete_customer_by_customer_id_merchant_id
- function: private::update_customer_by_global_id
- function: private::find_customer_by_global_id
- impl: impl KvStorePartition for customers::Customer
- impl: impl domain::CustomerInterface for kv_router_store::KVRouterStore<T>
- impl: impl domain::CustomerInterface for RouterStore<T>
- impl: impl domain::CustomerInterface for MockDb
**crates/storage_impl/src/lib.rs**
Add:
- function: pub::find_optional_resource
**crates/storage_impl/src/mock_db.rs**
Modify existing code
**crates/storage_impl/src/payment_method.rs**
Modify existing code
|
{"pr_number": 7538, "pr_title": "refactor(customer): refactor customer db with storage utils and move trait to domain_models and impl to storage_model", "merged_at": "2025-04-15T07:54:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/customer.rs"], "other": ["crates/router/src/db.rs", "crates/router/src/db/customers.rs", "crates/router/src/db/kafka_store.rs", "crates/storage_impl/src/customers.rs", "crates/storage_impl/src/lib.rs", "crates/storage_impl/src/mock_db.rs", "crates/storage_impl/src/payment_method.rs"]}, "change_types": {"structs_added": 1, "functions_added": 50, "fields_added": 261, "imports_added": 11, "conditionals_added": 1, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(data-migration): add connector customer and mandate details support for multiple profiles
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for https://github.com/juspay/hyperswitch/pull/8473
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payment_methods.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/lib.rs`
- `crates/hyperswitch_domain_models/src/payment_methods.rs`
- `crates/hyperswitch_domain_models/src/transformers.rs`
**3. Core Business Logic**
- `crates/payment_methods/src/core/migration.rs`
- `crates/router/src/core/customers.rs`
**4. Type Definitions**
- `crates/router/src/types/api/payment_methods.rs`
**5. Other**
- `crates/router/src/routes/payment_methods.rs`
- `flake.nix`
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (63 changes)
- Add conditional logic for feature flags or filtering (10 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit cabfcbad:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Remove:
- function: private::from
- struct: pub::ConnectorCustomerDetails
- struct: pub::PaymentMethodCustomerMigrate
- impl: impl From<(PaymentMethodRecord, id_type::MerchantId)> for PaymentMethodCustomerMigrate
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- mod: pub::transformers
**crates/hyperswitch_domain_models/src/payment_methods.rs**
Add:
- function: private::try_from
- function: private::foreign_try_from
- struct: pub::ConnectorCustomerDetails
- struct: pub::PaymentMethodCustomerMigrate
- impl: impl TryFrom<(payment_methods::PaymentMethodRecord, id_type::MerchantId)> for PaymentMethodCustomerMigrate
- impl: impl ForeignTryFrom<(&[payment_methods::PaymentMethodRecord], id_type::MerchantId)> for Vec<PaymentMethodCustomerMigrate>
**crates/hyperswitch_domain_models/src/transformers.rs**
Add:
- trait: pub::ForeignFrom
- trait: pub::ForeignTryFrom
**crates/payment_methods/src/core/migration.rs**
Remove:
- function: pub::get_payment_method_records
Add:
- function: private::parse_comma_separated_ids
- function: private::validate_form_csv_conflicts
- function: pub::validate_and_get_payment_method_records
- struct: private::MerchantConnectorValidator
- impl: impl MerchantConnectorValidator
- impl: impl PaymentMethodsMigrateForm
**crates/router/src/core/customers.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Modify existing code
**crates/router/src/types/api/payment_methods.rs**
Modify existing code
|
{"pr_number": 8552, "pr_title": "feat(data-migration): add connector customer and mandate details support for multiple profiles", "merged_at": "2025-07-08T08:54:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "domain": ["crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/payment_methods.rs", "crates/hyperswitch_domain_models/src/transformers.rs"], "core_business": ["crates/payment_methods/src/core/migration.rs", "crates/router/src/core/customers.rs"], "types": ["crates/router/src/types/api/payment_methods.rs"], "other": ["crates/router/src/routes/payment_methods.rs", "flake.nix"]}, "change_types": {"structs_added": 3, "functions_added": 8, "fields_added": 63, "imports_added": 3, "conditionals_added": 10, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [BOA] throw unsupported error incase of 3DS cards and limit administrative area length to 20 characters
## 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 -->
Throw unsupported error incase of 3DS cards and in the BOA payment request, limit administrative area length to 20 characters .
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Create a payment with state longer than 20 characters
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_6HyqIL1RNpFa7ixYObwRhbrFnSUTfngXT0LkLcKVpabQjnUDQvKLpRmVa7N9aikJ' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "cust_no_pm",
"authentication_type": "no_three_ds",
"email": "[email protected]",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"name": "박 성 준",
"billing": {
"address": {
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"city": "Downtown Core",
"state": "Central Indiana America",
"zip": "039393",
"country": "SG",
"first_name": "박성준",
"last_name": "박성준"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"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_rp9iJKVCO0quOZT2n2WT",
"merchant_id": "postman_merchant_GHAction_38467516-1474-4975-ad33-5a875d9616d2",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "bankofamerica",
"client_secret": "pay_rp9iJKVCO0quOZT2n2WT_secret_PfwM1zJhCX1oKnuJmncp",
"created": "2025-02-04T09:11:12.704Z",
"currency": "USD",
"customer_id": "cust_no_pm",
"customer": {
"id": "cust_no_pm",
"name": "박 성 준",
"email": "[email protected]",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"payment_checks": {
"eci": null,
"cavv": null,
"eci_raw": null,
"avs_response": {
"code": "Y",
"codeRaw": "Y"
},
"approval_code": "831000",
"card_verification": null,
"consumer_authentication_response": null
},
"authentication_data": {
"acs_transaction_id": null,
"system_trace_audit_number": null,
"retrieval_reference_number": null
}
},
"billing": null
},
"payment_token": "token_I0N7vymfMgpLEfMCVhNK",
"shipping": null,
"billing": {
"address": {
"city": "Downtown Core",
"country": "SG",
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"zip": "039393",
"state": "Central Indiana America",
"first_name": "박성준",
"last_name": "박성준"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "박 성 준",
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cust_no_pm",
"created_at": 1738660272,
"expires": 1738663872,
"secret": "epk_f0fbc9e59b9e44388d3713e444d71989"
},
"manual_retry_allowed": false,
"connector_transaction_id": "7386602729516040204806",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_rp9iJKVCO0quOZT2n2WT_1",
"payment_link": null,
"profile_id": "pro_lMHkHJOsVjrm2ukgK5pZ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_LJjAfCJzvFj0PiotJqUx",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-04T09:26:12.704Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "13.232.74.226",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-04T09:11:13.934Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Create a card 3ds payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_6HyqIL1RNpFa7ixYObwRhbrFnSUTfngXT0LkLcKVpabQjnUDQvKLpRmVa7N9aikJ' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "cust_no_pm",
"authentication_type": "three_ds",
"email": "[email protected]",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"name": "박 성 준",
"billing": {
"address": {
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"city": "Downtown Core",
"state": "Central Indiana America",
"zip": "039393",
"country": "SG",
"first_name": "박성준",
"last_name": "박성준"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "13.232.74.226"
}
}'
```
Response
```
{
"error": {
"type": "invalid_request",
"message": "Payment method type not supported",
"code": "IR_19",
"reason": "Card 3DS is not supported by BankOfAmerica"
}
}
```
Cypress Test

> 1. Refund Failures: Refunds are failing because the current test case cannot handle the dual possibility of receiving either "pending" or "succeeded" statuses from the connector.
> 2. Connector Agnostic Mandates for Non-3DS MIT: This is out of the scope of this PR.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs`
**2. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js`
**Code Patterns Applied:**
- Extend existing types with new fields (16 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 6f90b93c:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs**
Modify existing code
Commit 6bbfe628:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs**
Modify existing code
|
{"pr_number": 7174, "pr_title": "fix(connector): [BOA] throw unsupported error incase of 3DS cards and limit administrative area length to 20 characters ", "merged_at": "2025-02-05T14:21:55Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js"]}, "change_types": {"fields_added": 16, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
refactor(connector): [BRAINTREE] Pass email in payment requests
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
ORIGINAL PR: https://github.com/juspay/hyperswitch/pull/7591
Pass email in payment request body of Braintree as it is mandatory field for sending receipts in braintree
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
https://github.com/juspay/hyperswitch/issues/7590
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Payment Request:
```
{
"amount": 1233,
"currency": "EUR",
"confirm": true,
"customer_id": "abcdef",
"billing": {
"email": "[email protected]"
}
"name": "John Doe",
"authentication_type": "no_three_ds",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5200000000001096",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
}
}
```
Payment Response:
```
{
"payment_id": "pay_o6SLsqlZ6J049AiPkHwW",
"merchant_id": "postman_merchant_GHAction_ec4bf644-13b4-420a-9747-5a91dc33c1b5",
"status": "requires_customer_action",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 100,
"amount_received": null,
"connector": "braintree",
"client_secret": "pay_o6SLsqlZ6J049AiPkHwW_secret_Bv6iGp8QmWWfywJd7jOO",
"created": "2025-03-21T11:15:04.414Z",
"currency": "EUR",
"customer_id": "deepanshu",
"customer": {
"id": "deepanshu",
"name": null,
"email": "[email protected]",
"phone": null,
"phone_country_code": null
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1096",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Deepanshu Bansal",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": null,
"phone": null,
"email": "[email protected]"
},
"order_details": null,
"email": "[email protected]",
"name": null,
"phone": null,
"return_url": "https://duck.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_o6SLsqlZ6J049AiPkHwW/postman_merchant_GHAction_ec4bf644-13b4-420a-9747-5a91dc33c1b5/pay_o6SLsqlZ6J049AiPkHwW_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "deepanshu",
"created_at": 1742555704,
"expires": 1742559304,
"secret": "epk_cc70c871e62f4f0a9a0fb797bb433941"
},
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_pzlYtlAD7YgNLdXLPSlq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_CSJaSjj2gRnDoaSDRndr",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-21T11:30:04.414Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_xp0BCgE81c2YO7G4Zan5",
"payment_method_status": "inactive",
"updated": "2025-03-21T11:15:06.916Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"issuer_error_code": null,
"issuer_error_message": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Extend existing types with new fields (8 changes)
**Detailed Identifier Changes:**
Commit e578f291:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs**
Add:
- struct: pub::CustomerBody
|
{"pr_number": 7617, "pr_title": "refactor(connector): [BRAINTREE] Pass email in payment requests", "merged_at": "2025-03-25T10:47:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs"]}, "change_types": {"structs_added": 1, "fields_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(mandate): move repeated code to a separate function within Mandate impl
## 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 addresses the comments which is concerned about reducing repeated code by moving them into a separate function within impl block.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
address comments that was given in [this](https://github.com/juspay/hyperswitch/pull/8616) pr.
closes https://github.com/juspay/hyperswitch/issues/8771
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
just a minor refactor. nothing to test here. however:
- ci should pass
- tested mandates by following https://github.com/juspay/hyperswitch/pull/8616
## 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`
**2. Type Definitions**
- `crates/router/src/types/api/mandates.rs`
**3. Other**
- `crates/router/src/db/mandate.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit e1c66e72:
Files to modify:
**crates/diesel_models/src/mandate.rs**
Add:
- function: pub::get_user_agent_extended
- function: pub::get_customer_user_agent_extended
- impl: impl Mandate
**crates/router/src/db/mandate.rs**
Modify existing code
**crates/router/src/types/api/mandates.rs**
Modify existing code
|
{"pr_number": 8772, "pr_title": "refactor(mandate): move repeated code to a separate function within Mandate impl", "merged_at": "2025-08-01T12:59:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"database": ["crates/diesel_models/src/mandate.rs"], "types": ["crates/router/src/types/api/mandates.rs"], "other": ["crates/router/src/db/mandate.rs"]}, "change_types": {"functions_added": 2, "fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payments): [Payment links] Add support for traditional chinese locale for payment links
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [X] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
hotfix for https://github.com/juspay/hyperswitch/pull/6745
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
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_link/locale.js`
**Code Patterns Applied:**
- Extend existing types with new fields (30 changes)
|
{"pr_number": 6765, "pr_title": "feat(payments): [Payment links] Add support for traditional chinese locale for payment links", "merged_at": "2024-12-06T11:46:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/payment_link/locale.js"]}, "change_types": {"fields_added": 30}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
ci(cypress): Address lints
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Removed the unused variable declaration from the cy.get("body").then(...) callback.
## Motivation and Context
This change is made to resolve CI check failures related to Cypress linting rules.
## How did you test it?
No additional testing was required as the CI checks passed successfully, confirming compliance with Cypress linting standards.
|
To implement this **webhook** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests/cypress/support/redirectionHandler.js`
|
{"pr_number": 8011, "pr_title": "ci(cypress): Address lints", "merged_at": "2025-05-14T18:11:47Z", "intent": {"feature_type": "webhook", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(connector): Added Supported Country and Currencies
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Updated the currency and country code for the following connectors :
[Checkout](https://www.checkout.com/docs/developer-resources/codes/currency-codes), [BlueSnap](https://support.bluesnap.com/docs/currencies), [Nuvei](https://docs.nuvei.com/documentation/additional-links/country-and-currency-codes/#currency-codes), [Rapyd](https://docs.rapyd.net/en/supported-currencies.html), [Airwallex](https://www.airwallex.com/docs/payments__supported-currencies), [Worldpay](https://developer.worldpay.com/products/access/reference/supported-countries-currencies), [Cybersource](https://developer.cybersource.com/library/documentation/dev_guides/VCO_Getting_Started/html/Topics/countries.htm), [Stripe](https://docs.stripe.com/currencies), [Adyen](https://docs.adyen.com/development-resources/currency-codes/), [Multisafepay](https://docs.multisafepay.com/docs/google-pay), [PayU](https://docs.payu.in/docs/supported-currencies-for-international-payments), [Novalnet](https://www.novalnet.com/currencies/)
Docs referred for ApplePay and GooglePay : [ApplePay](https://support.apple.com/en-us/102775) , [GooglePay](https://support.google.com/pay/india/answer/9023773?hl=en#zippy=%2Cpay-online-in-apps)
### 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).
-->
https://github.com/juspay/hyperswitch-cloud/issues/9979
## How did you test 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 config files updated for countries and currencies hence no testing required.
## Cypress test
<details>
<summary> Airwallex </summary>
Main :
<img width="633" height="908" alt="airwallex_main" src="https://github.com/user-attachments/assets/90629c1d-ea71-4ce5-a7a8-64dc8eae908b" />
current branch (currency_update) :
<img width="729" height="908" alt="airwallex_updated" src="https://github.com/user-attachments/assets/7c756223-dad4-4336-8028-429a66e96dfe" />
</details>
<details>
<summary> Nuvei </summary>
Main :
<img width="587" height="908" alt="nuvei_main" src="https://github.com/user-attachments/assets/ef1d2623-50c6-4a2d-a0c7-1a0130ecb532" />
current branch (currency_update) :
<img width="729" height="908" alt="nuvei_updated" src="https://github.com/user-attachments/assets/38707334-cebb-408d-923f-21ced1c91a91" />
</details>
<details>
<summary> Adyen </summary>
Main :
<img width="587" height="908" alt="adyen_main" src="https://github.com/user-attachments/assets/b25d22c6-6a90-4b17-9e5b-2b1e34f3593f" />
current branch (currency_update) :
<img width="729" height="908" alt="adyen_updated" src="https://github.com/user-attachments/assets/8765e414-777c-4eeb-94f9-96107e982667" />
</details>
<details>
<summary> Checkout </summary>
Main :
<img width="633" height="908" alt="checkout_main" src="https://github.com/user-attachments/assets/0e91cf6d-a542-492b-a8fb-3a9b2f537155" />
current branch (currency_update) :
<img width="729" height="908" alt="checkout_updated" src="https://github.com/user-attachments/assets/58b97f5d-e355-4612-836f-84516fba2ab8" />
</details>
<details>
<summary> Cybersource </summary>
Main :
<img width="729" height="908" alt="cybersource_main" src="https://github.com/user-attachments/assets/ac264e13-a210-4009-b38b-c70214882610" />
current branch (currency_update) :
<img width="729" height="908" alt="cybersource_updated" src="https://github.com/user-attachments/assets/ad64b88a-2649-47f4-a749-5cd5641b8763" />
</details>
<details>
<summary> Stripe </summary>
Main :
<img width="729" height="908" alt="stripe_main" src="https://github.com/user-attachments/assets/f9dae642-4373-44b7-96f8-06bf896f3cc9" />
current branch (currency_update) :
<img width="729" height="908" alt="stripe_updated" src="https://github.com/user-attachments/assets/bec80468-2dc6-49f4-b5dc-8ba06aa82a96" />
</details>
<details>
<summary> Multisafepay </summary>
Main :
<img width="721" height="908" alt="multisafepay_main" src="https://github.com/user-attachments/assets/69bffad7-23c5-4cfd-b6d0-19d0c51d6504" />
current branch (currency_update) :
<img width="729" height="908" alt="multisafepay_updated" src="https://github.com/user-attachments/assets/cb0b55a9-b79c-43b2-970a-f8f7dac0f036" />
</details>
<details>
<summary> Novalnet </summary>
Main :
<img width="721" height="908" alt="novalnet_mian" src="https://github.com/user-attachments/assets/24452145-bd84-4196-b979-1e9479e03fbe" />
current branch (currency_update) :
<img width="729" height="908" alt="novalnet_updated" src="https://github.com/user-attachments/assets/663e30d1-4597-4e0e-9dcc-89cb26640a3d" />
</details>
<details>
<summary> Payu </summary>
Main :
<img width="721" height="908" alt="payu_main" src="https://github.com/user-attachments/assets/ae9da7c9-8e98-4aa4-8f04-0c1ba8af30c8" />
current branch (currency_update) :
<img width="729" height="908" alt="payu_updated" src="https://github.com/user-attachments/assets/4cf47273-152b-4a52-b6ee-49d8d3b3df79" />
</details>
<details>
<summary> Bluesnap </summary>
Main :
<img width="729" height="908" alt="bluesnap_main" src="https://github.com/user-attachments/assets/f520c4e8-299a-41ac-b3a0-1e5836bc354c" />
current branch (currency_update) :
<img width="729" height="908" alt="bluesnap_updated" src="https://github.com/user-attachments/assets/e5ac1309-d47f-488a-a483-2d6edbb4513e" />
</details>
<details>
<summary> Worldpay </summary>
Main :
<img width="729" height="908" alt="worldpay_main" src="https://github.com/user-attachments/assets/7e5c4f24-983e-4c6e-9eae-bc968af69b68" />
current branch (currency_update) :
<img width="729" height="908" alt="worldpay_updated" src="https://github.com/user-attachments/assets/87a75ab3-b211-4ef3-b247-ada12231548b" />
</details>
<details>
<summary> Rapyd </summary>
Main :
<img width="721" height="908" alt="rapyd_main" src="https://github.com/user-attachments/assets/baacfd6e-de88-4f73-8352-d02cb39f67fc" />
current branch (currency_update) :
<img width="729" height="908" alt="rapyd_updated" src="https://github.com/user-attachments/assets/978004e6-8829-41df-a995-9b030229d11e" />
</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. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**2. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
|
{"pr_number": 8383, "pr_title": "feat(connector): Added Supported Country and Currencies", "merged_at": "2025-07-16T10:00:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(connector): implement wallet mandates for authorizedotnet
## 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 mandates support for Google Pay and Apple Pay Payment Method via `Authorize.Net` connector. It also supports Zero Auth Mandates.
### 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).
-->
First of all, it is a merchant requirement and also, `Authorize.Net` previously did not have mandates support. So we were throwing `501` every time some one tried to create a mandate payment via Google Pay or Apple Pay.
Also closes https://github.com/juspay/hyperswitch/issues/7413
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
**Google Pay (confirm: `true`)**
<details>
<summary>0. Generate Token</summary>
Generated with jsfiddle. A snippet from it has been attached below:
```js
paymentToken = paymentData.paymentMethodData.tokenizationData.token;
// Stringified payment token is passed in the request
console.log("STRINGIFIED_TOKEN: ", JSON.stringify(paymentToken));
```
</details>
**Normal Payment**
<details>
<summary>1. Google Pay Payment Create</summary>
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data-raw '{
"amount": 7000,
"currency": "USD",
"confirm": true,
"business_country":"US",
"business_label":"default",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay": {
"description": "Visa •••• 1111",
"tokenization_data": {
"type": "PAYMENT_GATEWAY",
"token": "{\"signature\":\"MEYCIQD4IOPmA38TEwyc2MydkgUkk/qVM2sMCS7EmUPNP2NpIAIhAJKXI2JdZSjQRBEAZ6LNmXVPv7j80i9iuTeAWM4+f/2Y\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"HUriM67+LViEdMAtrwfcyxiOuQIEAI9WKzJYZ6AqAh8Zx4c673vNN7ni/tddZLoID1Jv1ly1a3brPvWtvGLaoshh0BKqKRX/talksIBBQceTUbnPYVwC4vUK+PakLCGK1gOAmfaMnoHVmiKDZQs5Lnu1zJ1xww2Wm0M/YzGTx12njDmLuVsA2qU8fgkQiW6aJnPePiA+4Rx6ykDI1mDcALoU+gmSftSBkibAY9igkpmJkS6SCxTZ/5ihwXayBZTaGWBGKVIU2CrwwbECIWvaldvlWaHC0T/Iual1o4zAIsmbeqIejYa2TZtCMhiLI3kX+3FaS4LrcTn5/RyjD9ZurVXfdXJ/2XPhSMzHj14RE0Axf+ZabZsf9UxZzGVtsBw2kfCnSNZ9v2BEjPNxwGy4w3giumUHlqaQWv5RGg\\\\u003d\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BJOyfPwG44zKn/eIEAO9On1Huuo+5aiwAolhqoDObl3yX8tQrjwtMk3eTUJOfuKG+fkGs5IIgYPARlpt/SEwOos\\\\u003d\\\",\\\"tag\\\":\\\"nKgFcEDO0LGzngqIsx/myAI8+TshLBvKkNxn8HdoBCw\\\\u003d\\\"}\"}"
},
"type": "CARD",
"info": {
"card_network": "VISA",
"card_details": "1111"
}
}
}
}
}'
```
```json
{
"payment_id": "pay_Ycjdrhh70tgbCzFUovom",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 7000,
"net_amount": 7000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 7000,
"connector": "authorizedotnet",
"client_secret": "pay_Ycjdrhh70tgbCzFUovom_secret_pGJFgpSIthkYEqIryDYm",
"created": "2025-03-04T10:28:48.398Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "google_pay",
"connector_label": "authorizedotnet_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1741084128,
"expires": 1741087728,
"secret": "epk_cbc6c778677e4a1988dea5ff96be7a49"
},
"manual_retry_allowed": false,
"connector_transaction_id": "0",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "0",
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-04T10:43:48.398Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-04T10:28:50.381Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null
}
```
</details>
**Mandate Payment**
Prior to make 0 Auth mandate, make sure that the Test Mode is turned off on connector dashboard and Live mode is turned on:

If not, you'll be greeted with below mentioned error:
```log
2025-03-04T11:47:15.392668Z ERROR router::services::api: error: {"error":{"type":"invalid_request","message":"Payment failed during authorization with connector. Retry payment","code":"CE_01"}}
├╴at crates/router/src/services/api.rs:790:14
│
├─▶ {"error":{"type":"processing_error","code":"CE_01","message":"Payment failed during authorization with connector. Retry payment","data":null}}
│ ╰╴at crates/router/src/core/errors/utils.rs:418:17
│
├─▶ Failed to deserialize connector response
│ ╰╴at crates/router/src/connector/authorizedotnet.rs:199:14
│
├─▶ Failed to parse struct: AuthorizedotnetPaymentsResponse
│ ├╴at /orca/crates/common_utils/src/ext_traits.rs:175:14
│ ╰╴Unable to parse router::connector::authorizedotnet::transformers::AuthorizedotnetSetupMandateResponse from bytes b"{\"messages\":{\"resultCode\":\"Error\",\"message\":[{\"code\":\"E00009\",\"text\":\"The payment gateway account is in Test Mode. The request cannot be processed.\"}]}}"
│
╰─▶ missing field `customerPaymentProfileIdList` at line 1 column 152
╰╴at /orca/crates/common_utils/src/ext_traits.rs:175:14
```
<details>
<summary>2. 0 Auth mandate Google Pay Payment Create (CIT)</summary>
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data-raw '{
"amount": 0,
"currency": "USD",
"confirm": true,
"business_country":"US",
"business_label":"default",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"setup_future_usage": "off_session",
"mandate_data": {
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"single_use": {
"amount": 8000,
"currency": "USD"
}
}
},
"payment_type": "setup_mandate",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay": {
"description": "Visa •••• 1111",
"tokenization_data": {
"type": "PAYMENT_GATEWAY",
"token": "{\"signature\":\"MEYCIQDXSxykX6QsEf6OfbBt6JeZRV0fKMfdGqLMWW09SVTIiQIhAL1AQ4oCeX09uK//SZotBysxb1VJocA9UFjRj3E2f90+\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"j/yT6NHHmADowqcEBoC58j99OyIEqOIJc6uWFwXAV2duIjI838Rl7U+4XYjpKfSViaNhPoW9KJ8rAKy04XAVxx9iEM4sgIeP3cgZXq5T28ivWLbGiKI+iVBvgkd6TFq9OCWvo2WD+xhg0gZshkKmuq50QzELQuoNeIbmgehXQgD2QizIcxfr/1bKLWYU46DsR+nbN/I8L8of6TbbHsTlyN3A36+uq24uQGMoWloWj9A6ZEGbiPox9ljdZiYTfqXEkBd/LoRCYp8yuDPrGFOYBCCWq7tZ8TR8EBWOvAzfWpwQLMBpuFR+P22S2fM3lvbcJoHgMimsAlCRmcdS9G/knoV32KhkVLsMz3zMvqXPMRxGa9yxbHbopYSPpu8HoXZMgv867GtMHguzqNkSas0r+WFg3GAR/ZxKnwK7sQ\\\\u003d\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BAkY6NwItLszcKq2mX4tgTwqYpP1bJkSQ5nJhWPEaPE7OhlSMMNjikCwRFQqq1qEyvDJjiNopuHmEwUTMDY5GRE\\\\u003d\\\",\\\"tag\\\":\\\"yRNDiUqscYJDSzhe3NozPDftfR6MTy83iui6Hru/F3g\\\\u003d\\\"}\"}"
},
"type": "CARD",
"info": {
"card_network": "VISA",
"card_details": "1111"
}
}
}
}
}'
```
```json
{
"payment_id": "pay_mIpw378Mk8zHlAjiMMMP",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "authorizedotnet",
"client_secret": "pay_mIpw378Mk8zHlAjiMMMP_secret_ifCWgJ3idLvIOSNl3diR",
"created": "2025-03-04T11:51:57.766Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": "man_P4lMkUEfHZL1so7BT7vL",
"mandate_data": {
"update_mandate_id": null,
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"single_use": {
"amount": 8000,
"currency": "USD",
"start_date": null,
"end_date": null,
"metadata": null
}
}
},
"setup_future_usage": "off_session",
"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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "google_pay",
"connector_label": "authorizedotnet_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1741089117,
"expires": 1741092717,
"secret": "epk_14f46a89c0324250855f4ffdb66b6393"
},
"manual_retry_allowed": false,
"connector_transaction_id": null,
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-04T12:06:57.766Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_uiXIl346CEL1MNsb1Itz",
"payment_method_status": "active",
"updated": "2025-03-04T11:51:59.981Z",
"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": "929556579-928947232",
"card_discovery": null
}
```
</details>
<details>
<summary>3. 0 Auth mandate Google Pay Payment Create (MIT)</summary>
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data '{
"amount": 1000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "StripeCustomer",
"client_secret": "pay_Yjz0to0D2SWrvMnu9YYJ_secret_dww4J2IkgUS375Qp14DD",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_uiXIl346CEL1MNsb1Itz"
},
"off_session": true,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"payment_method": "wallet",
"payment_method_type": "google_pay",
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
}
}'
```
```json
{
"payment_id": "pay_Yjz0to0D2SWrvMnu9YYJ",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "authorizedotnet",
"client_secret": "pay_Yjz0to0D2SWrvMnu9YYJ_secret_dww4J2IkgUS375Qp14DD",
"created": "2025-03-04T12:41:24.421Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "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": 1741092084,
"expires": 1741095684,
"secret": "epk_33afe25ebfdb438099126de2170ac062"
},
"manual_retry_allowed": false,
"connector_transaction_id": "120058112387",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "120058112387",
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-04T12:56:24.421Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_uiXIl346CEL1MNsb1Itz",
"payment_method_status": "active",
"updated": "2025-03-04T12:41:26.065Z",
"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": "929556579-928947232",
"card_discovery": null
}
```
</details>
____
**Google Pay (confirm: `false`)**
<details>
<summary>0. Generate Token</summary>
Generated with jsfiddle. A snippet from it has been attached below:
```js
paymentToken = paymentData.paymentMethodData.tokenizationData.token;
// Stringified payment token is passed in the request
console.log("STRINGIFIED_TOKEN: ", JSON.stringify(paymentToken));
```
</details>
**Normal Payment**
<details>
<summary>1. Google Pay Payment Create</summary>
Create a payment with Google Pay as payment method:
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": false,
"business_country": "US",
"business_label": "default",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```json
{
"payment_id": "pay_bfeoigMGZuwS8e93al9S",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "requires_payment_method",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_bfeoigMGZuwS8e93al9S_secret_YSFWpewZeiZM981x31QF",
"created": "2025-03-04T16:17:55.833Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1741105075,
"expires": 1741108675,
"secret": "epk_19957b6804bd446fa6fd0e64e110bb38"
},
"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_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-04T16:32:55.833Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-04T16:17:55.849Z",
"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
}
```
Confirm the payment with the payment tokenizated data in the previous step:
```curl
curl --location 'http://Localhost:8080/payments/pay_i0kBWoWf2WhaxDmCb0Kr/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data '{
"confirm": true,
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay": {
"description": "Visa •••• 1111",
"tokenization_data": {
"type": "PAYMENT_GATEWAY",
"token": "{\"signature\":\"MEUCIQCwtiXZxhnLtPm8HSpM4nes1xsgMGUXj/mejNJdHdYSwAIgWS/Rpx42PBTsmFB0Ypw3WFiSkHhJIKfhDCZ4D1EJe2g\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"HqOYpkcOVnkNMjHAAGQnNU82ZNzREewVB6cJNusCjSK8q5C/wumXuatl+8Hs78m/GD1km10onXLCiCkLs429taWyCpMKPMdeZH2aGU5S347RCRzn+hTCxHn0Erh2RQeyUBQ4/hdekdLhg53fLZOm0ORXqc/2cz9m98c0Gdjqjc/Ladhm2+r5WL1AEIbHwGZVVnBB1bzgbL8El5aF6FhdG3iAltVDIzjCUvsX2WXP+vxCXRtwE+xtyN3iUcCxLSshoPDkWEFcmT3aTTlfk6ss9iU6b0KDo2fWDk3PAQKqbQeog0QiWNSZgACqhtTKfV21JxfozlMZ5J6Z/7hROkENHLLNstQa+NeOls0Q7g9f0AvbwkpvF401CXa+jvKgUWnwJ4QTmIt5ogfOUDihK/A54U20LLNxzHZ9Ts5kdw\\\\u003d\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BLg8yDGYj+1Iu6bNXK+gcvGdDpfha252FT/yzqrTA37WMuXgoEHoq6dOzDmbwORV5x25Z+TiwourpASRgMEDqw4\\\\u003d\\\",\\\"tag\\\":\\\"lshmH3K28uQMBSsvRlYHEeH77WZWV6cplNfdNegWEZY\\\\u003d\\\"}\"}"
},
"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"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
}
}'
```
```json
{
"payment_id": "pay_bfeoigMGZuwS8e93al9S",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "authorizedotnet",
"client_secret": "pay_bfeoigMGZuwS8e93al9S_secret_YSFWpewZeiZM981x31QF",
"created": "2025-03-04T16:17:55.833Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "google_pay",
"connector_label": "authorizedotnet_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "120058141907",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "120058141907",
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-04T16:32:55.833Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"os_version": null,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"device_model": null,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"accept_language": "en",
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-04T16:17:59.047Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null
}
```
</details>
**Mandate Payment**
<details>
<summary>2. 0 Auth mandate Google Pay Payment Create (CIT)</summary>
Create a payment with Google Pay as payment method:
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data-raw '{
"amount": 0,
"currency": "USD",
"confirm": false,
"business_country": "US",
"business_label": "default",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```json
{
"payment_id": "pay_i0kBWoWf2WhaxDmCb0Kr",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "requires_payment_method",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_i0kBWoWf2WhaxDmCb0Kr_secret_X9DDaLKrgZ3EnuGBeGVq",
"created": "2025-03-04T17:07:43.928Z",
"currency": "USD",
"customer_id": null,
"customer": {
"id": null,
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-04T17:22:43.928Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-04T17:07:43.934Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null
}
```
Confirm the payment with the payment tokenizated data in the previous step:
```curl
curl --location 'http://Localhost:8080/payments/pay_i0kBWoWf2WhaxDmCb0Kr/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data '{
"confirm": true,
"payment_type": "setup_mandate",
"setup_future_usage": "off_session",
"customer_id": "userId",
"mandate_data": {
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"single_use": {
"amount": 8000,
"currency": "USD"
}
}
},
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay": {
"description": "Visa •••• 1111",
"tokenization_data": {
"type": "PAYMENT_GATEWAY",
"token": "{\"signature\":\"MEYCIQDiQ33RYZBOIPG/gJccPcESROy/aiC1WvtTcIDd53EXeAIhAJS6t5bnsO36+RAR1vEIFAgofOjftLDdvIlRNiQILbYO\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"H9KoqlToBs0ulMI0MA4yTjYW+ha9iuwkSBnG/nvoYSJtDsAs+LiESg9gd9ucGvVYm2YO3ZBTFFIFjF+1+jeITmVGZ8H8n/zoBxHQtzAUuvxSLdPIE1hGgLYDApvX9iZBXQ/BDFbnPCWc5vza/OMHzeSbXAv3xa/5AOEFIQqcsSXymfvNGSkObHAOOl8EYbWV3+trYhs7jqUU92SMYTytqepubq6fRGH3ShaCC1wh2GiAs3wyldbVLCzAXQWwpg0D+YtUUCWIrb6/le09FTyIvZILdZZYCV8en5AzLPaeV24g8JzSq9n4iVlEIMk2Z5XOn2iQbh+czSjEaayyasBs1iwcSvmlsqwA5MjOZOeL6NLEltqX+UylpZfzozwjn6oYfJsOuRwFkW2Bu13jXIo02DS24GVuh17FErvIeQ\\\\u003d\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BJuTS/Sz6nreFjQE6KCvF8LtbKc2+jUrZZdvd1euYamxps5s+cvCdosar/uHPWRKgUFuNGrwj262aFw85gOFxNQ\\\\u003d\\\",\\\"tag\\\":\\\"vXk0kI20KevUYBEjuXFN6k1U91NEeGx/trlcXG2r3B0\\\\u003d\\\"}\"}"
},
"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"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
}
}'
```
```json
{
"payment_id": "pay_8lXtsxjVVnXyW3qYwwGL",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "authorizedotnet",
"client_secret": "pay_8lXtsxjVVnXyW3qYwwGL_secret_vV4VAArRJGYOeB1b76nx",
"created": "2025-03-04T17:04:40.633Z",
"currency": "USD",
"customer_id": "userId",
"customer": {
"id": "userId",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": "man_7Kl62g9g2ddIAmINxRdB",
"mandate_data": {
"update_mandate_id": null,
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"single_use": {
"amount": 8000,
"currency": "USD",
"start_date": null,
"end_date": null,
"metadata": null
}
}
},
"setup_future_usage": "off_session",
"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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "google_pay",
"connector_label": "authorizedotnet_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": 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_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-04T17:19:40.633Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"os_version": null,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"device_model": null,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"accept_language": "en",
"java_script_enabled": true
},
"payment_method_id": "pm_Y5eD5ietWpQzEP4acuJp",
"payment_method_status": "active",
"updated": "2025-03-04T17:04:45.377Z",
"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": "929566202-928957413",
"card_discovery": null
}
```
</details>
<details>
<summary>3. 0 Auth mandate Google Pay Payment Create (MIT)</summary>
Create + Confirm:
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data '{
"amount": 1000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "userId",
"client_secret": "pay_Gfr2ciHSGx2abiThwEeb_secret_RCNmYv7Vm6YA915Kj2fR",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_Y5eD5ietWpQzEP4acuJp"
},
"off_session": true,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"payment_method": "wallet",
"payment_method_type": "google_pay",
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
}
}'
```
```json
{
"payment_id": "pay_Gfr2ciHSGx2abiThwEeb",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "authorizedotnet",
"client_secret": "pay_Gfr2ciHSGx2abiThwEeb_secret_RCNmYv7Vm6YA915Kj2fR",
"created": "2025-03-04T17:12:50.614Z",
"currency": "USD",
"customer_id": "userId",
"customer": {
"id": "userId",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "google_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "userId",
"created_at": 1741108370,
"expires": 1741111970,
"secret": "epk_9d2e899d1aae4a1eb19730fadd7cd51a"
},
"manual_retry_allowed": false,
"connector_transaction_id": "120058147194",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "120058147194",
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-04T17:27:50.614Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_Y5eD5ietWpQzEP4acuJp",
"payment_method_status": "active",
"updated": "2025-03-04T17:12:52.243Z",
"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": "929566110-928957293",
"card_discovery": null
}
```
</details>
____
**Apple Pay (confirm: `true`)**
**Normal Payment**
<details>
<summary>0. Apple Pay Payment Create</summary>
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data '{
"amount": 100,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "StripeCustomer",
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "eyJkYXRhIjoiRWQ0UjZYYzVuTk85ZjVZZHc2Z0RVTzlZRE9qSlpxdFg4ME9acEtVNWxNMFNVSU9xbEEvdDU3TDNyV09mNHNTZjZqaGIvKzhiZXFvNFlCM21wU0U5emUrZzAyY0w2S1hOaWlGN2pqbE81eC9FOFFYWW0vRjNNK2lJdmtrcVlzYzBmZWlLandzSkI3SGFoOWJpUW5oOFhJQ2dpREhUSXpZcFIwaUlyVi9rdjFSbGxGT21NNlZDQkM3QVhhenhqUTJ4NEtOVzVIZUw1c2lkdHhia3ZsS2xpa1ZDeloxK2kzYjcwaEw2ZUFlamVsUno3UlEyLzNDbTVScVVqTWZnaHMvd25PVUNZb280UGVwN1BUdHdXdXdid3VMV3lkM0ZRYzdMMjlIcE5STVhCckFFd1RLN2RMTjdTc1VGSGczaTF6N0kxeVM1N1FjQ0d1aGo2dGR6clNOWW1PRmk2Nm03NzZ4M3VVc2kwM3hwdlU2bGdjMVlneUFnT2VSelBlcTRNL0Z4dzU4SlZXVGxYdnY4M09ibXJPbzZrVk0vbDJLRlRZSEszK0hjL2Y1SEZhST0iLCJzaWduYXR1cmUiOiJNSUFHQ1NxR1NJYjNEUUVIQXFDQU1JQUNBUUV4RFRBTEJnbGdoa2dCWlFNRUFnRXdnQVlKS29aSWh2Y05BUWNCQUFDZ2dEQ0NBK1F3Z2dPTG9BTUNBUUlDQ0ZuWW9ieXE5T1BOTUFvR0NDcUdTTTQ5QkFNQ01Ib3hMakFzQmdOVkJBTU1KVUZ3Y0d4bElFRndjR3hwWTJGMGFXOXVJRWx1ZEdWbmNtRjBhVzl1SUVOQklDMGdSek14SmpBa0JnTlZCQXNNSFVGd2NHeGxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1STXdFUVlEVlFRS0RBcEJjSEJzWlNCSmJtTXVNUXN3Q1FZRFZRUUdFd0pWVXpBZUZ3MHlNVEEwTWpBeE9UTTNNREJhRncweU5qQTBNVGt4T1RNMk5UbGFNR0l4S0RBbUJnTlZCQU1NSDJWall5MXpiWEF0WW5KdmEyVnlMWE5wWjI1ZlZVTTBMVk5CVGtSQ1QxZ3hGREFTQmdOVkJBc01DMmxQVXlCVGVYTjBaVzF6TVJNd0VRWURWUVFLREFwQmNIQnNaU0JKYm1NdU1Rc3dDUVlEVlFRR0V3SlZVekJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUFCSUl3L2F2RG5QZGVJQ3hRMlp0RkV1WTM0cWtCM1d5ejRMSE5TMUpubVBqUFRyM29HaVdvd2g1TU05M09qaXFXd3Zhdm9aTURSY1RvZWtRbXpwVWJFcFdqZ2dJUk1JSUNEVEFNQmdOVkhSTUJBZjhFQWpBQU1COEdBMVVkSXdRWU1CYUFGQ1B5U2NSUGsrVHZKK2JFOWloc1A2SzcvUzVMTUVVR0NDc0dBUVVGQndFQkJEa3dOekExQmdnckJnRUZCUWN3QVlZcGFIUjBjRG92TDI5amMzQXVZWEJ3YkdVdVkyOXRMMjlqYzNBd05DMWhjSEJzWldGcFkyRXpNREl3Z2dFZEJnTlZIU0FFZ2dFVU1JSUJFRENDQVF3R0NTcUdTSWIzWTJRRkFUQ0IvakNCd3dZSUt3WUJCUVVIQWdJd2diWU1nYk5TWld4cFlXNWpaU0J2YmlCMGFHbHpJR05sY25ScFptbGpZWFJsSUdKNUlHRnVlU0J3WVhKMGVTQmhjM04xYldWeklHRmpZMlZ3ZEdGdVkyVWdiMllnZEdobElIUm9aVzRnWVhCd2JHbGpZV0pzWlNCemRHRnVaR0Z5WkNCMFpYSnRjeUJoYm1RZ1kyOXVaR2wwYVc5dWN5QnZaaUIxYzJVc0lHTmxjblJwWm1sallYUmxJSEJ2YkdsamVTQmhibVFnWTJWeWRHbG1hV05oZEdsdmJpQndjbUZqZEdsalpTQnpkR0YwWlcxbGJuUnpMakEyQmdnckJnRUZCUWNDQVJZcWFIUjBjRG92TDNkM2R5NWhjSEJzWlM1amIyMHZZMlZ5ZEdsbWFXTmhkR1ZoZFhSb2IzSnBkSGt2TURRR0ExVWRId1F0TUNzd0thQW5vQ1dHSTJoMGRIQTZMeTlqY213dVlYQndiR1V1WTI5dEwyRndjR3hsWVdsallUTXVZM0pzTUIwR0ExVWREZ1FXQkJRQ0pEQUxtdTd0UmpHWHBLWmFLWjVDY1lJY1JUQU9CZ05WSFE4QkFmOEVCQU1DQjRBd0R3WUpLb1pJaHZkalpBWWRCQUlGQURBS0JnZ3Foa2pPUFFRREFnTkhBREJFQWlCMG9iTWsyMEpKUXczVEoweFFkTVNBalpvZlNBNDZoY1hCTmlWbU1sKzhvd0lnYVRhUVU2djFDMXBTK2ZZQVRjV0tyV3hRcDlZSWFEZVE0S2M2MEI1SzJZRXdnZ0x1TUlJQ2RhQURBZ0VDQWdoSmJTKy9PcGphbHpBS0JnZ3Foa2pPUFFRREFqQm5NUnN3R1FZRFZRUUREQkpCY0hCc1pTQlNiMjkwSUVOQklDMGdSek14SmpBa0JnTlZCQXNNSFVGd2NHeGxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1STXdFUVlEVlFRS0RBcEJjSEJzWlNCSmJtTXVNUXN3Q1FZRFZRUUdFd0pWVXpBZUZ3MHhOREExTURZeU16UTJNekJhRncweU9UQTFNRFl5TXpRMk16QmFNSG94TGpBc0JnTlZCQU1NSlVGd2NHeGxJRUZ3Y0d4cFkyRjBhVzl1SUVsdWRHVm5jbUYwYVc5dUlFTkJJQzBnUnpNeEpqQWtCZ05WQkFzTUhVRndjR3hsSUVObGNuUnBabWxqWVhScGIyNGdRWFYwYUc5eWFYUjVNUk13RVFZRFZRUUtEQXBCY0hCc1pTQkpibU11TVFzd0NRWURWUVFHRXdKVlV6QlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDlBd0VIQTBJQUJQQVhFWVFaMTJTRjFScGVKWUVIZHVpQW91L2VlNjVONEkzOFM1UGhNMWJWWmxzMXJpTFFsM1lOSWs1N3VnajlkaGZPaU10MnUyWnd2c2pvS1lUL1ZFV2pnZmN3Z2ZRd1JnWUlLd1lCQlFVSEFRRUVPakE0TURZR0NDc0dBUVVGQnpBQmhpcG9kSFJ3T2k4dmIyTnpjQzVoY0hCc1pTNWpiMjB2YjJOemNEQTBMV0Z3Y0d4bGNtOXZkR05oWnpNd0hRWURWUjBPQkJZRUZDUHlTY1JQaytUdkorYkU5aWhzUDZLNy9TNUxNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdId1lEVlIwakJCZ3dGb0FVdTdEZW9WZ3ppSnFraXBuZXZyM3JyOXJMSktzd053WURWUjBmQkRBd0xqQXNvQ3FnS0lZbWFIUjBjRG92TDJOeWJDNWhjSEJzWlM1amIyMHZZWEJ3YkdWeWIyOTBZMkZuTXk1amNtd3dEZ1lEVlIwUEFRSC9CQVFEQWdFR01CQUdDaXFHU0liM1kyUUdBZzRFQWdVQU1Bb0dDQ3FHU000OUJBTUNBMmNBTUdRQ01EclBjb05SRnBteGh2czF3MWJLWXIvMEYrM1pEM1ZOb282KzhaeUJYa0szaWZpWTk1dFpuNWpWUVEyUG5lbkMvZ0l3TWkzVlJDR3dvd1YzYkYzek9EdVFaLzBYZkN3aGJaWlB4bkpwZ2hKdlZQaDZmUnVaeTVzSmlTRmhCcGtQQ1pJZEFBQXhnZ0dJTUlJQmhBSUJBVENCaGpCNk1TNHdMQVlEVlFRRERDVkJjSEJzWlNCQmNIQnNhV05oZEdsdmJpQkpiblJsWjNKaGRHbHZiaUJEUVNBdElFY3pNU1l3SkFZRFZRUUxEQjFCY0hCc1pTQkRaWEowYVdacFkyRjBhVzl1SUVGMWRHaHZjbWwwZVRFVE1CRUdBMVVFQ2d3S1FYQndiR1VnU1c1akxqRUxNQWtHQTFVRUJoTUNWVk1DQ0ZuWW9ieXE5T1BOTUFzR0NXQ0dTQUZsQXdRQ0FhQ0JrekFZQmdrcWhraUc5dzBCQ1FNeEN3WUpLb1pJaHZjTkFRY0JNQndHQ1NxR1NJYjNEUUVKQlRFUEZ3MHlOVEF6TURZeE1URXlOVFZhTUNnR0NTcUdTSWIzRFFFSk5ERWJNQmt3Q3dZSllJWklBV1VEQkFJQm9Rb0dDQ3FHU000OUJBTUNNQzhHQ1NxR1NJYjNEUUVKQkRFaUJDQS9FemxmRUhtbk5uSW9uS2FwOUpBVkNEdld3dmlMRkhuY0IwdmpaY21WN3pBS0JnZ3Foa2pPUFFRREFnUkhNRVVDSVFEeWV0MUdwSU9QcXkyRjFzYkY3M1hOSDRJTEp6WWozSDdXR1Zzd0huRzFBQUlnQVJYZG5HY0hERkI1LzNhc1I5bm9PNVdkMy95NlZKRFpmZXQ3WWV6RjFEMEFBQUFBQUFBPSIsImhlYWRlciI6eyJwdWJsaWNLZXlIYXNoIjoiVzFOT3JTbWhwTVdDQlg0cWE3NEZBeTNEMnNWZDZ3YWFzOEdHMWdYQ21Pdz0iLCJlcGhlbWVyYWxQdWJsaWNLZXkiOiJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVaUmdaNGkveUhwK3d3ckxtRGpDanJyTkJkQnB5b0tEU1VvamV0enBuVk4wdDNXajZiNjhnUWkvempTS3hsOUZ0eXdkb0lJSUFvWm9Sa0ZuMFpseTBMZz09IiwidHJhbnNhY3Rpb25JZCI6ImE3OWVjMjYyMThiZmZjNDNmYzlkZDZlMTg0ZDI4NDNmNzQ2MjNhNWE5ODJhZTY5YWM2NmU3ZjQ1ZDNiNzhiZDUifSwidmVyc2lvbiI6IkVDX3YxIn0=",
"payment_method": {
"display_name": "Visa 4228",
"network": "Visa",
"type": "debit"
},
"transaction_identifier": "a79ec26218bffc43fc9dd6e184d2843f74623a5a982ae69ac66e7f45d3b78bd5"
}
},
"billing": null
},
"billing": {
"address": {
"first_name": "John",
"last_name": "Doe",
"line1": "Harrison Street",
"city": "San Francisco",
"state": "California",
"zip": "94016",
"country": "US"
}
}
}'
```
```json
{
"payment_id": "pay_pQplkw03E65IspKj5Pgl",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 100,
"connector": "authorizedotnet",
"client_secret": "pay_pQplkw03E65IspKj5Pgl_secret_HIQ1AUupmzls5u5dlpV7",
"created": "2025-03-06T16:51:49.667Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "4228",
"card_network": "Visa",
"type": "debit"
}
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Francisco",
"country": "US",
"line1": "Harrison Street",
"line2": null,
"line3": null,
"zip": "94016",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "apple_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1741279909,
"expires": 1741283509,
"secret": "epk_8d33224b35174c7696b267531b5f1b10"
},
"manual_retry_allowed": false,
"connector_transaction_id": "120058500499",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "120058500499",
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-06T17:06:49.667Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-06T16:51:50.402Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null
}
```
</details>
**Mandate Payment**
<details>
<summary>1. 0 Auth mandate Apple Pay Payment Create (CIT)</summary>
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data-raw '{
"amount": 0,
"currency": "USD",
"confirm": true,
"business_country": "US",
"business_label": "default",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "cus_1741281436",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"setup_future_usage": "off_session",
"mandate_data": {
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"single_use": {
"amount": 8000,
"currency": "USD"
}
}
},
"payment_type": "setup_mandate",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "eyJkYXRhIjoiRWQ0UjZYYzVuTk85ZjVZZHc2Z0RVTzlZRE9qSlpxdFg4ME9acEtVNWxNMFNVSU9xbEEvdDU3TDNyV09mNHNTZjZqaGIvKzhiZXFvNFlCM21wU0U5emUrZzAyY0w2S1hOaWlGN2pqbE81eC9FOFFYWW0vRjNNK2lJdmtrcVlzYzBmZWlLandzSkI3SGFoOWJpUW5oOFhJQ2dpREhUSXpZcFIwaUlyVi9rdjFSbGxGT21NNlZDQkM3QVhhenhqUTJ4NEtOVzVIZUw1c2lkdHhia3ZsS2xpa1ZDeloxK2kzYjcwaEw2ZUFlamVsUno3UlEyLzNDbTVScVVqTWZnaHMvd25PVUNZb280UGVwN1BUdHdXdXdid3VMV3lkM0ZRYzdMMjlIcE5STVhCckFFd1RLN2RMTjdTc1VGSGczaTF6N0kxeVM1N1FjQ0d1aGo2dGR6clNOWW1PRmk2Nm03NzZ4M3VVc2kwM3hwdlU2bGdjMVlneUFnT2VSelBlcTRNL0Z4dzU4SlZXVGxYdnY4M09ibXJPbzZrVk0vbDJLRlRZSEszK0hjL2Y1SEZhST0iLCJzaWduYXR1cmUiOiJNSUFHQ1NxR1NJYjNEUUVIQXFDQU1JQUNBUUV4RFRBTEJnbGdoa2dCWlFNRUFnRXdnQVlKS29aSWh2Y05BUWNCQUFDZ2dEQ0NBK1F3Z2dPTG9BTUNBUUlDQ0ZuWW9ieXE5T1BOTUFvR0NDcUdTTTQ5QkFNQ01Ib3hMakFzQmdOVkJBTU1KVUZ3Y0d4bElFRndjR3hwWTJGMGFXOXVJRWx1ZEdWbmNtRjBhVzl1SUVOQklDMGdSek14SmpBa0JnTlZCQXNNSFVGd2NHeGxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1STXdFUVlEVlFRS0RBcEJjSEJzWlNCSmJtTXVNUXN3Q1FZRFZRUUdFd0pWVXpBZUZ3MHlNVEEwTWpBeE9UTTNNREJhRncweU5qQTBNVGt4T1RNMk5UbGFNR0l4S0RBbUJnTlZCQU1NSDJWall5MXpiWEF0WW5KdmEyVnlMWE5wWjI1ZlZVTTBMVk5CVGtSQ1QxZ3hGREFTQmdOVkJBc01DMmxQVXlCVGVYTjBaVzF6TVJNd0VRWURWUVFLREFwQmNIQnNaU0JKYm1NdU1Rc3dDUVlEVlFRR0V3SlZVekJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUFCSUl3L2F2RG5QZGVJQ3hRMlp0RkV1WTM0cWtCM1d5ejRMSE5TMUpubVBqUFRyM29HaVdvd2g1TU05M09qaXFXd3Zhdm9aTURSY1RvZWtRbXpwVWJFcFdqZ2dJUk1JSUNEVEFNQmdOVkhSTUJBZjhFQWpBQU1COEdBMVVkSXdRWU1CYUFGQ1B5U2NSUGsrVHZKK2JFOWloc1A2SzcvUzVMTUVVR0NDc0dBUVVGQndFQkJEa3dOekExQmdnckJnRUZCUWN3QVlZcGFIUjBjRG92TDI5amMzQXVZWEJ3YkdVdVkyOXRMMjlqYzNBd05DMWhjSEJzWldGcFkyRXpNREl3Z2dFZEJnTlZIU0FFZ2dFVU1JSUJFRENDQVF3R0NTcUdTSWIzWTJRRkFUQ0IvakNCd3dZSUt3WUJCUVVIQWdJd2diWU1nYk5TWld4cFlXNWpaU0J2YmlCMGFHbHpJR05sY25ScFptbGpZWFJsSUdKNUlHRnVlU0J3WVhKMGVTQmhjM04xYldWeklHRmpZMlZ3ZEdGdVkyVWdiMllnZEdobElIUm9aVzRnWVhCd2JHbGpZV0pzWlNCemRHRnVaR0Z5WkNCMFpYSnRjeUJoYm1RZ1kyOXVaR2wwYVc5dWN5QnZaaUIxYzJVc0lHTmxjblJwWm1sallYUmxJSEJ2YkdsamVTQmhibVFnWTJWeWRHbG1hV05oZEdsdmJpQndjbUZqZEdsalpTQnpkR0YwWlcxbGJuUnpMakEyQmdnckJnRUZCUWNDQVJZcWFIUjBjRG92TDNkM2R5NWhjSEJzWlM1amIyMHZZMlZ5ZEdsbWFXTmhkR1ZoZFhSb2IzSnBkSGt2TURRR0ExVWRId1F0TUNzd0thQW5vQ1dHSTJoMGRIQTZMeTlqY213dVlYQndiR1V1WTI5dEwyRndjR3hsWVdsallUTXVZM0pzTUIwR0ExVWREZ1FXQkJRQ0pEQUxtdTd0UmpHWHBLWmFLWjVDY1lJY1JUQU9CZ05WSFE4QkFmOEVCQU1DQjRBd0R3WUpLb1pJaHZkalpBWWRCQUlGQURBS0JnZ3Foa2pPUFFRREFnTkhBREJFQWlCMG9iTWsyMEpKUXczVEoweFFkTVNBalpvZlNBNDZoY1hCTmlWbU1sKzhvd0lnYVRhUVU2djFDMXBTK2ZZQVRjV0tyV3hRcDlZSWFEZVE0S2M2MEI1SzJZRXdnZ0x1TUlJQ2RhQURBZ0VDQWdoSmJTKy9PcGphbHpBS0JnZ3Foa2pPUFFRREFqQm5NUnN3R1FZRFZRUUREQkpCY0hCc1pTQlNiMjkwSUVOQklDMGdSek14SmpBa0JnTlZCQXNNSFVGd2NHeGxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1STXdFUVlEVlFRS0RBcEJjSEJzWlNCSmJtTXVNUXN3Q1FZRFZRUUdFd0pWVXpBZUZ3MHhOREExTURZeU16UTJNekJhRncweU9UQTFNRFl5TXpRMk16QmFNSG94TGpBc0JnTlZCQU1NSlVGd2NHeGxJRUZ3Y0d4cFkyRjBhVzl1SUVsdWRHVm5jbUYwYVc5dUlFTkJJQzBnUnpNeEpqQWtCZ05WQkFzTUhVRndjR3hsSUVObGNuUnBabWxqWVhScGIyNGdRWFYwYUc5eWFYUjVNUk13RVFZRFZRUUtEQXBCY0hCc1pTQkpibU11TVFzd0NRWURWUVFHRXdKVlV6QlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDlBd0VIQTBJQUJQQVhFWVFaMTJTRjFScGVKWUVIZHVpQW91L2VlNjVONEkzOFM1UGhNMWJWWmxzMXJpTFFsM1lOSWs1N3VnajlkaGZPaU10MnUyWnd2c2pvS1lUL1ZFV2pnZmN3Z2ZRd1JnWUlLd1lCQlFVSEFRRUVPakE0TURZR0NDc0dBUVVGQnpBQmhpcG9kSFJ3T2k4dmIyTnpjQzVoY0hCc1pTNWpiMjB2YjJOemNEQTBMV0Z3Y0d4bGNtOXZkR05oWnpNd0hRWURWUjBPQkJZRUZDUHlTY1JQaytUdkorYkU5aWhzUDZLNy9TNUxNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdId1lEVlIwakJCZ3dGb0FVdTdEZW9WZ3ppSnFraXBuZXZyM3JyOXJMSktzd053WURWUjBmQkRBd0xqQXNvQ3FnS0lZbWFIUjBjRG92TDJOeWJDNWhjSEJzWlM1amIyMHZZWEJ3YkdWeWIyOTBZMkZuTXk1amNtd3dEZ1lEVlIwUEFRSC9CQVFEQWdFR01CQUdDaXFHU0liM1kyUUdBZzRFQWdVQU1Bb0dDQ3FHU000OUJBTUNBMmNBTUdRQ01EclBjb05SRnBteGh2czF3MWJLWXIvMEYrM1pEM1ZOb282KzhaeUJYa0szaWZpWTk1dFpuNWpWUVEyUG5lbkMvZ0l3TWkzVlJDR3dvd1YzYkYzek9EdVFaLzBYZkN3aGJaWlB4bkpwZ2hKdlZQaDZmUnVaeTVzSmlTRmhCcGtQQ1pJZEFBQXhnZ0dJTUlJQmhBSUJBVENCaGpCNk1TNHdMQVlEVlFRRERDVkJjSEJzWlNCQmNIQnNhV05oZEdsdmJpQkpiblJsWjNKaGRHbHZiaUJEUVNBdElFY3pNU1l3SkFZRFZRUUxEQjFCY0hCc1pTQkRaWEowYVdacFkyRjBhVzl1SUVGMWRHaHZjbWwwZVRFVE1CRUdBMVVFQ2d3S1FYQndiR1VnU1c1akxqRUxNQWtHQTFVRUJoTUNWVk1DQ0ZuWW9ieXE5T1BOTUFzR0NXQ0dTQUZsQXdRQ0FhQ0JrekFZQmdrcWhraUc5dzBCQ1FNeEN3WUpLb1pJaHZjTkFRY0JNQndHQ1NxR1NJYjNEUUVKQlRFUEZ3MHlOVEF6TURZeE1URXlOVFZhTUNnR0NTcUdTSWIzRFFFSk5ERWJNQmt3Q3dZSllJWklBV1VEQkFJQm9Rb0dDQ3FHU000OUJBTUNNQzhHQ1NxR1NJYjNEUUVKQkRFaUJDQS9FemxmRUhtbk5uSW9uS2FwOUpBVkNEdld3dmlMRkhuY0IwdmpaY21WN3pBS0JnZ3Foa2pPUFFRREFnUkhNRVVDSVFEeWV0MUdwSU9QcXkyRjFzYkY3M1hOSDRJTEp6WWozSDdXR1Zzd0huRzFBQUlnQVJYZG5HY0hERkI1LzNhc1I5bm9PNVdkMy95NlZKRFpmZXQ3WWV6RjFEMEFBQUFBQUFBPSIsImhlYWRlciI6eyJwdWJsaWNLZXlIYXNoIjoiVzFOT3JTbWhwTVdDQlg0cWE3NEZBeTNEMnNWZDZ3YWFzOEdHMWdYQ21Pdz0iLCJlcGhlbWVyYWxQdWJsaWNLZXkiOiJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVaUmdaNGkveUhwK3d3ckxtRGpDanJyTkJkQnB5b0tEU1VvamV0enBuVk4wdDNXajZiNjhnUWkvempTS3hsOUZ0eXdkb0lJSUFvWm9Sa0ZuMFpseTBMZz09IiwidHJhbnNhY3Rpb25JZCI6ImE3OWVjMjYyMThiZmZjNDNmYzlkZDZlMTg0ZDI4NDNmNzQ2MjNhNWE5ODJhZTY5YWM2NmU3ZjQ1ZDNiNzhiZDUifSwidmVyc2lvbiI6IkVDX3YxIn0=",
"payment_method": {
"display_name": "Visa 4228",
"network": "Visa",
"type": "debit"
},
"transaction_identifier": "a79ec26218bffc43fc9dd6e184d2843f74623a5a982ae69ac66e7f45d3b78bd5"
}
},
"billing": null
}
}'
```
```json
{
"payment_id": "pay_q6QI3s5EftuPHiXweHO8",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "authorizedotnet",
"client_secret": "pay_q6QI3s5EftuPHiXweHO8_secret_iaQ0TCvv3cJEPx6C2H4T",
"created": "2025-03-06T17:17:11.969Z",
"currency": "USD",
"customer_id": "cus_1741281432",
"customer": {
"id": "cus_1741281432",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": "man_aSSagnsnEwx26GJmmv4D",
"mandate_data": {
"update_mandate_id": null,
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"single_use": {
"amount": 8000,
"currency": "USD",
"start_date": null,
"end_date": null,
"metadata": null
}
}
},
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "4228",
"card_network": "Visa",
"type": "debit"
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "apple_pay",
"connector_label": "authorizedotnet_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cus_1741281432",
"created_at": 1741281431,
"expires": 1741285031,
"secret": "epk_652599a411dc4037b07fdb5ff70c05cd"
},
"manual_retry_allowed": false,
"connector_transaction_id": null,
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-06T17:32:11.969Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_PvC6MYhxwlUucL32HX4C",
"payment_method_status": "active",
"updated": "2025-03-06T17:17:13.973Z",
"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": "929610853-929002308",
"card_discovery": null
}
```
</details>
<details>
<summary>2. 0 Auth mandate Apple Pay Payment Create (MIT)</summary>
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data '{
"amount": 1000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "cus_1741281432",
"client_secret": "pay_ldeENuwjOHvyLJ0xq5RS_secret_C5IomwEVgCsWGrQ8QOqV",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_PvC6MYhxwlUucL32HX4C"
},
"off_session": true,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
}
}'
```
```json
{
"payment_id": "pay_ldeENuwjOHvyLJ0xq5RS",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "authorizedotnet",
"client_secret": "pay_ldeENuwjOHvyLJ0xq5RS_secret_C5IomwEVgCsWGrQ8QOqV",
"created": "2025-03-06T17:17:40.740Z",
"currency": "USD",
"customer_id": "cus_1741281432",
"customer": {
"id": "cus_1741281432",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": null,
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "apple_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cus_1741281432",
"created_at": 1741281460,
"expires": 1741285060,
"secret": "epk_22f2d7c3c4b44c36aa837b5286c3bac4"
},
"manual_retry_allowed": false,
"connector_transaction_id": "120058501970",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "120058501970",
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-06T17:32:40.740Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_PvC6MYhxwlUucL32HX4C",
"payment_method_status": "active",
"updated": "2025-03-06T17:17:41.481Z",
"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": "929610853-929002308",
"card_discovery": null
}
```
</details>
____
**Apple Pay (confirm: `false`)**
**Normal Payment**
<details>
<summary>0. Apple Pay Payment Create</summary>
Create a payment with Apple Pay as payment method:
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": false,
"business_country": "US",
"business_label": "default",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```json
{
"payment_id": "pay_I1yph8Vzm5LYUKWYLeGE",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "requires_payment_method",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_I1yph8Vzm5LYUKWYLeGE_secret_HYK6Yj7wDW5bSe2HUMAS",
"created": "2025-03-06T17:27:47.474Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1741282067,
"expires": 1741285667,
"secret": "epk_188e2a750ea84059913ebd8490860258"
},
"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_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-06T17:42:47.474Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-06T17:27:47.483Z",
"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
}
```
Confirm the payment with the payment tokenizated data in the previous step:
```curl
curl --location 'http://Localhost:8080/payments/pay_I1yph8Vzm5LYUKWYLeGE/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data '{
"confirm": true,
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "eyJkYXRhIjoiRWQ0UjZYYzVuTk85ZjVZZHc2Z0RVTzlZRE9qSlpxdFg4ME9acEtVNWxNMFNVSU9xbEEvdDU3TDNyV09mNHNTZjZqaGIvKzhiZXFvNFlCM21wU0U5emUrZzAyY0w2S1hOaWlGN2pqbE81eC9FOFFYWW0vRjNNK2lJdmtrcVlzYzBmZWlLandzSkI3SGFoOWJpUW5oOFhJQ2dpREhUSXpZcFIwaUlyVi9rdjFSbGxGT21NNlZDQkM3QVhhenhqUTJ4NEtOVzVIZUw1c2lkdHhia3ZsS2xpa1ZDeloxK2kzYjcwaEw2ZUFlamVsUno3UlEyLzNDbTVScVVqTWZnaHMvd25PVUNZb280UGVwN1BUdHdXdXdid3VMV3lkM0ZRYzdMMjlIcE5STVhCckFFd1RLN2RMTjdTc1VGSGczaTF6N0kxeVM1N1FjQ0d1aGo2dGR6clNOWW1PRmk2Nm03NzZ4M3VVc2kwM3hwdlU2bGdjMVlneUFnT2VSelBlcTRNL0Z4dzU4SlZXVGxYdnY4M09ibXJPbzZrVk0vbDJLRlRZSEszK0hjL2Y1SEZhST0iLCJzaWduYXR1cmUiOiJNSUFHQ1NxR1NJYjNEUUVIQXFDQU1JQUNBUUV4RFRBTEJnbGdoa2dCWlFNRUFnRXdnQVlKS29aSWh2Y05BUWNCQUFDZ2dEQ0NBK1F3Z2dPTG9BTUNBUUlDQ0ZuWW9ieXE5T1BOTUFvR0NDcUdTTTQ5QkFNQ01Ib3hMakFzQmdOVkJBTU1KVUZ3Y0d4bElFRndjR3hwWTJGMGFXOXVJRWx1ZEdWbmNtRjBhVzl1SUVOQklDMGdSek14SmpBa0JnTlZCQXNNSFVGd2NHeGxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1STXdFUVlEVlFRS0RBcEJjSEJzWlNCSmJtTXVNUXN3Q1FZRFZRUUdFd0pWVXpBZUZ3MHlNVEEwTWpBeE9UTTNNREJhRncweU5qQTBNVGt4T1RNMk5UbGFNR0l4S0RBbUJnTlZCQU1NSDJWall5MXpiWEF0WW5KdmEyVnlMWE5wWjI1ZlZVTTBMVk5CVGtSQ1QxZ3hGREFTQmdOVkJBc01DMmxQVXlCVGVYTjBaVzF6TVJNd0VRWURWUVFLREFwQmNIQnNaU0JKYm1NdU1Rc3dDUVlEVlFRR0V3SlZVekJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUFCSUl3L2F2RG5QZGVJQ3hRMlp0RkV1WTM0cWtCM1d5ejRMSE5TMUpubVBqUFRyM29HaVdvd2g1TU05M09qaXFXd3Zhdm9aTURSY1RvZWtRbXpwVWJFcFdqZ2dJUk1JSUNEVEFNQmdOVkhSTUJBZjhFQWpBQU1COEdBMVVkSXdRWU1CYUFGQ1B5U2NSUGsrVHZKK2JFOWloc1A2SzcvUzVMTUVVR0NDc0dBUVVGQndFQkJEa3dOekExQmdnckJnRUZCUWN3QVlZcGFIUjBjRG92TDI5amMzQXVZWEJ3YkdVdVkyOXRMMjlqYzNBd05DMWhjSEJzWldGcFkyRXpNREl3Z2dFZEJnTlZIU0FFZ2dFVU1JSUJFRENDQVF3R0NTcUdTSWIzWTJRRkFUQ0IvakNCd3dZSUt3WUJCUVVIQWdJd2diWU1nYk5TWld4cFlXNWpaU0J2YmlCMGFHbHpJR05sY25ScFptbGpZWFJsSUdKNUlHRnVlU0J3WVhKMGVTQmhjM04xYldWeklHRmpZMlZ3ZEdGdVkyVWdiMllnZEdobElIUm9aVzRnWVhCd2JHbGpZV0pzWlNCemRHRnVaR0Z5WkNCMFpYSnRjeUJoYm1RZ1kyOXVaR2wwYVc5dWN5QnZaaUIxYzJVc0lHTmxjblJwWm1sallYUmxJSEJ2YkdsamVTQmhibVFnWTJWeWRHbG1hV05oZEdsdmJpQndjbUZqZEdsalpTQnpkR0YwWlcxbGJuUnpMakEyQmdnckJnRUZCUWNDQVJZcWFIUjBjRG92TDNkM2R5NWhjSEJzWlM1amIyMHZZMlZ5ZEdsbWFXTmhkR1ZoZFhSb2IzSnBkSGt2TURRR0ExVWRId1F0TUNzd0thQW5vQ1dHSTJoMGRIQTZMeTlqY213dVlYQndiR1V1WTI5dEwyRndjR3hsWVdsallUTXVZM0pzTUIwR0ExVWREZ1FXQkJRQ0pEQUxtdTd0UmpHWHBLWmFLWjVDY1lJY1JUQU9CZ05WSFE4QkFmOEVCQU1DQjRBd0R3WUpLb1pJaHZkalpBWWRCQUlGQURBS0JnZ3Foa2pPUFFRREFnTkhBREJFQWlCMG9iTWsyMEpKUXczVEoweFFkTVNBalpvZlNBNDZoY1hCTmlWbU1sKzhvd0lnYVRhUVU2djFDMXBTK2ZZQVRjV0tyV3hRcDlZSWFEZVE0S2M2MEI1SzJZRXdnZ0x1TUlJQ2RhQURBZ0VDQWdoSmJTKy9PcGphbHpBS0JnZ3Foa2pPUFFRREFqQm5NUnN3R1FZRFZRUUREQkpCY0hCc1pTQlNiMjkwSUVOQklDMGdSek14SmpBa0JnTlZCQXNNSFVGd2NHeGxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1STXdFUVlEVlFRS0RBcEJjSEJzWlNCSmJtTXVNUXN3Q1FZRFZRUUdFd0pWVXpBZUZ3MHhOREExTURZeU16UTJNekJhRncweU9UQTFNRFl5TXpRMk16QmFNSG94TGpBc0JnTlZCQU1NSlVGd2NHeGxJRUZ3Y0d4cFkyRjBhVzl1SUVsdWRHVm5jbUYwYVc5dUlFTkJJQzBnUnpNeEpqQWtCZ05WQkFzTUhVRndjR3hsSUVObGNuUnBabWxqWVhScGIyNGdRWFYwYUc5eWFYUjVNUk13RVFZRFZRUUtEQXBCY0hCc1pTQkpibU11TVFzd0NRWURWUVFHRXdKVlV6QlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDlBd0VIQTBJQUJQQVhFWVFaMTJTRjFScGVKWUVIZHVpQW91L2VlNjVONEkzOFM1UGhNMWJWWmxzMXJpTFFsM1lOSWs1N3VnajlkaGZPaU10MnUyWnd2c2pvS1lUL1ZFV2pnZmN3Z2ZRd1JnWUlLd1lCQlFVSEFRRUVPakE0TURZR0NDc0dBUVVGQnpBQmhpcG9kSFJ3T2k4dmIyTnpjQzVoY0hCc1pTNWpiMjB2YjJOemNEQTBMV0Z3Y0d4bGNtOXZkR05oWnpNd0hRWURWUjBPQkJZRUZDUHlTY1JQaytUdkorYkU5aWhzUDZLNy9TNUxNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdId1lEVlIwakJCZ3dGb0FVdTdEZW9WZ3ppSnFraXBuZXZyM3JyOXJMSktzd053WURWUjBmQkRBd0xqQXNvQ3FnS0lZbWFIUjBjRG92TDJOeWJDNWhjSEJzWlM1amIyMHZZWEJ3YkdWeWIyOTBZMkZuTXk1amNtd3dEZ1lEVlIwUEFRSC9CQVFEQWdFR01CQUdDaXFHU0liM1kyUUdBZzRFQWdVQU1Bb0dDQ3FHU000OUJBTUNBMmNBTUdRQ01EclBjb05SRnBteGh2czF3MWJLWXIvMEYrM1pEM1ZOb282KzhaeUJYa0szaWZpWTk1dFpuNWpWUVEyUG5lbkMvZ0l3TWkzVlJDR3dvd1YzYkYzek9EdVFaLzBYZkN3aGJaWlB4bkpwZ2hKdlZQaDZmUnVaeTVzSmlTRmhCcGtQQ1pJZEFBQXhnZ0dJTUlJQmhBSUJBVENCaGpCNk1TNHdMQVlEVlFRRERDVkJjSEJzWlNCQmNIQnNhV05oZEdsdmJpQkpiblJsWjNKaGRHbHZiaUJEUVNBdElFY3pNU1l3SkFZRFZRUUxEQjFCY0hCc1pTQkRaWEowYVdacFkyRjBhVzl1SUVGMWRHaHZjbWwwZVRFVE1CRUdBMVVFQ2d3S1FYQndiR1VnU1c1akxqRUxNQWtHQTFVRUJoTUNWVk1DQ0ZuWW9ieXE5T1BOTUFzR0NXQ0dTQUZsQXdRQ0FhQ0JrekFZQmdrcWhraUc5dzBCQ1FNeEN3WUpLb1pJaHZjTkFRY0JNQndHQ1NxR1NJYjNEUUVKQlRFUEZ3MHlOVEF6TURZeE1URXlOVFZhTUNnR0NTcUdTSWIzRFFFSk5ERWJNQmt3Q3dZSllJWklBV1VEQkFJQm9Rb0dDQ3FHU000OUJBTUNNQzhHQ1NxR1NJYjNEUUVKQkRFaUJDQS9FemxmRUhtbk5uSW9uS2FwOUpBVkNEdld3dmlMRkhuY0IwdmpaY21WN3pBS0JnZ3Foa2pPUFFRREFnUkhNRVVDSVFEeWV0MUdwSU9QcXkyRjFzYkY3M1hOSDRJTEp6WWozSDdXR1Zzd0huRzFBQUlnQVJYZG5HY0hERkI1LzNhc1I5bm9PNVdkMy95NlZKRFpmZXQ3WWV6RjFEMEFBQUFBQUFBPSIsImhlYWRlciI6eyJwdWJsaWNLZXlIYXNoIjoiVzFOT3JTbWhwTVdDQlg0cWE3NEZBeTNEMnNWZDZ3YWFzOEdHMWdYQ21Pdz0iLCJlcGhlbWVyYWxQdWJsaWNLZXkiOiJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVaUmdaNGkveUhwK3d3ckxtRGpDanJyTkJkQnB5b0tEU1VvamV0enBuVk4wdDNXajZiNjhnUWkvempTS3hsOUZ0eXdkb0lJSUFvWm9Sa0ZuMFpseTBMZz09IiwidHJhbnNhY3Rpb25JZCI6ImE3OWVjMjYyMThiZmZjNDNmYzlkZDZlMTg0ZDI4NDNmNzQ2MjNhNWE5ODJhZTY5YWM2NmU3ZjQ1ZDNiNzhiZDUifSwidmVyc2lvbiI6IkVDX3YxIn0=",
"payment_method": {
"display_name": "Visa 4228",
"network": "Visa",
"type": "debit"
},
"transaction_identifier": "a79ec26218bffc43fc9dd6e184d2843f74623a5a982ae69ac66e7f45d3b78bd5"
}
},
"billing": null
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
}
}'
```
```json
{
"payment_id": "pay_I1yph8Vzm5LYUKWYLeGE",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "authorizedotnet",
"client_secret": "pay_I1yph8Vzm5LYUKWYLeGE_secret_HYK6Yj7wDW5bSe2HUMAS",
"created": "2025-03-06T17:27:47.474Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "4228",
"card_network": "Visa",
"type": "debit"
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "apple_pay",
"connector_label": "authorizedotnet_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "120058504003",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "120058504003",
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-06T17:42:47.474Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"os_version": null,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"device_model": null,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"accept_language": "en",
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-06T17:28:06.643Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null
}
```
</details>
**Mandate Payment**
<details>
<summary>1. 0 Auth mandate Apple Pay Payment Create (CIT)</summary>
Create a payment with Apple Pay as payment method:
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data-raw '{
"amount": 0,
"currency": "USD",
"confirm": false,
"business_country": "US",
"business_label": "default",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"setup_future_usage": "off_session"
}'
```
```json
{
"payment_id": "pay_2tnZM8hO4nIxl6gox8rI",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "requires_payment_method",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_2tnZM8hO4nIxl6gox8rI_secret_wEWXQgZ7k7Rod2MdN7Kf",
"created": "2025-03-06T17:28:21.551Z",
"currency": "USD",
"customer_id": null,
"customer": {
"id": null,
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-06T17:43:21.551Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-06T17:28:21.561Z",
"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
}
```
Confirm the payment with the payment tokenizated data in the previous step:
```curl
curl --location 'http://Localhost:8080/payments/pay_2tnZM8hO4nIxl6gox8rI/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data '{
"confirm": true,
"payment_type": "setup_mandate",
"customer_id": "cus_1741282119",
"mandate_data": {
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"single_use": {
"amount": 8000,
"currency": "USD"
}
}
},
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "eyJkYXRhIjoiRWQ0UjZYYzVuTk85ZjVZZHc2Z0RVTzlZRE9qSlpxdFg4ME9acEtVNWxNMFNVSU9xbEEvdDU3TDNyV09mNHNTZjZqaGIvKzhiZXFvNFlCM21wU0U5emUrZzAyY0w2S1hOaWlGN2pqbE81eC9FOFFYWW0vRjNNK2lJdmtrcVlzYzBmZWlLandzSkI3SGFoOWJpUW5oOFhJQ2dpREhUSXpZcFIwaUlyVi9rdjFSbGxGT21NNlZDQkM3QVhhenhqUTJ4NEtOVzVIZUw1c2lkdHhia3ZsS2xpa1ZDeloxK2kzYjcwaEw2ZUFlamVsUno3UlEyLzNDbTVScVVqTWZnaHMvd25PVUNZb280UGVwN1BUdHdXdXdid3VMV3lkM0ZRYzdMMjlIcE5STVhCckFFd1RLN2RMTjdTc1VGSGczaTF6N0kxeVM1N1FjQ0d1aGo2dGR6clNOWW1PRmk2Nm03NzZ4M3VVc2kwM3hwdlU2bGdjMVlneUFnT2VSelBlcTRNL0Z4dzU4SlZXVGxYdnY4M09ibXJPbzZrVk0vbDJLRlRZSEszK0hjL2Y1SEZhST0iLCJzaWduYXR1cmUiOiJNSUFHQ1NxR1NJYjNEUUVIQXFDQU1JQUNBUUV4RFRBTEJnbGdoa2dCWlFNRUFnRXdnQVlKS29aSWh2Y05BUWNCQUFDZ2dEQ0NBK1F3Z2dPTG9BTUNBUUlDQ0ZuWW9ieXE5T1BOTUFvR0NDcUdTTTQ5QkFNQ01Ib3hMakFzQmdOVkJBTU1KVUZ3Y0d4bElFRndjR3hwWTJGMGFXOXVJRWx1ZEdWbmNtRjBhVzl1SUVOQklDMGdSek14SmpBa0JnTlZCQXNNSFVGd2NHeGxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1STXdFUVlEVlFRS0RBcEJjSEJzWlNCSmJtTXVNUXN3Q1FZRFZRUUdFd0pWVXpBZUZ3MHlNVEEwTWpBeE9UTTNNREJhRncweU5qQTBNVGt4T1RNMk5UbGFNR0l4S0RBbUJnTlZCQU1NSDJWall5MXpiWEF0WW5KdmEyVnlMWE5wWjI1ZlZVTTBMVk5CVGtSQ1QxZ3hGREFTQmdOVkJBc01DMmxQVXlCVGVYTjBaVzF6TVJNd0VRWURWUVFLREFwQmNIQnNaU0JKYm1NdU1Rc3dDUVlEVlFRR0V3SlZVekJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUFCSUl3L2F2RG5QZGVJQ3hRMlp0RkV1WTM0cWtCM1d5ejRMSE5TMUpubVBqUFRyM29HaVdvd2g1TU05M09qaXFXd3Zhdm9aTURSY1RvZWtRbXpwVWJFcFdqZ2dJUk1JSUNEVEFNQmdOVkhSTUJBZjhFQWpBQU1COEdBMVVkSXdRWU1CYUFGQ1B5U2NSUGsrVHZKK2JFOWloc1A2SzcvUzVMTUVVR0NDc0dBUVVGQndFQkJEa3dOekExQmdnckJnRUZCUWN3QVlZcGFIUjBjRG92TDI5amMzQXVZWEJ3YkdVdVkyOXRMMjlqYzNBd05DMWhjSEJzWldGcFkyRXpNREl3Z2dFZEJnTlZIU0FFZ2dFVU1JSUJFRENDQVF3R0NTcUdTSWIzWTJRRkFUQ0IvakNCd3dZSUt3WUJCUVVIQWdJd2diWU1nYk5TWld4cFlXNWpaU0J2YmlCMGFHbHpJR05sY25ScFptbGpZWFJsSUdKNUlHRnVlU0J3WVhKMGVTQmhjM04xYldWeklHRmpZMlZ3ZEdGdVkyVWdiMllnZEdobElIUm9aVzRnWVhCd2JHbGpZV0pzWlNCemRHRnVaR0Z5WkNCMFpYSnRjeUJoYm1RZ1kyOXVaR2wwYVc5dWN5QnZaaUIxYzJVc0lHTmxjblJwWm1sallYUmxJSEJ2YkdsamVTQmhibVFnWTJWeWRHbG1hV05oZEdsdmJpQndjbUZqZEdsalpTQnpkR0YwWlcxbGJuUnpMakEyQmdnckJnRUZCUWNDQVJZcWFIUjBjRG92TDNkM2R5NWhjSEJzWlM1amIyMHZZMlZ5ZEdsbWFXTmhkR1ZoZFhSb2IzSnBkSGt2TURRR0ExVWRId1F0TUNzd0thQW5vQ1dHSTJoMGRIQTZMeTlqY213dVlYQndiR1V1WTI5dEwyRndjR3hsWVdsallUTXVZM0pzTUIwR0ExVWREZ1FXQkJRQ0pEQUxtdTd0UmpHWHBLWmFLWjVDY1lJY1JUQU9CZ05WSFE4QkFmOEVCQU1DQjRBd0R3WUpLb1pJaHZkalpBWWRCQUlGQURBS0JnZ3Foa2pPUFFRREFnTkhBREJFQWlCMG9iTWsyMEpKUXczVEoweFFkTVNBalpvZlNBNDZoY1hCTmlWbU1sKzhvd0lnYVRhUVU2djFDMXBTK2ZZQVRjV0tyV3hRcDlZSWFEZVE0S2M2MEI1SzJZRXdnZ0x1TUlJQ2RhQURBZ0VDQWdoSmJTKy9PcGphbHpBS0JnZ3Foa2pPUFFRREFqQm5NUnN3R1FZRFZRUUREQkpCY0hCc1pTQlNiMjkwSUVOQklDMGdSek14SmpBa0JnTlZCQXNNSFVGd2NHeGxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1STXdFUVlEVlFRS0RBcEJjSEJzWlNCSmJtTXVNUXN3Q1FZRFZRUUdFd0pWVXpBZUZ3MHhOREExTURZeU16UTJNekJhRncweU9UQTFNRFl5TXpRMk16QmFNSG94TGpBc0JnTlZCQU1NSlVGd2NHeGxJRUZ3Y0d4cFkyRjBhVzl1SUVsdWRHVm5jbUYwYVc5dUlFTkJJQzBnUnpNeEpqQWtCZ05WQkFzTUhVRndjR3hsSUVObGNuUnBabWxqWVhScGIyNGdRWFYwYUc5eWFYUjVNUk13RVFZRFZRUUtEQXBCY0hCc1pTQkpibU11TVFzd0NRWURWUVFHRXdKVlV6QlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDlBd0VIQTBJQUJQQVhFWVFaMTJTRjFScGVKWUVIZHVpQW91L2VlNjVONEkzOFM1UGhNMWJWWmxzMXJpTFFsM1lOSWs1N3VnajlkaGZPaU10MnUyWnd2c2pvS1lUL1ZFV2pnZmN3Z2ZRd1JnWUlLd1lCQlFVSEFRRUVPakE0TURZR0NDc0dBUVVGQnpBQmhpcG9kSFJ3T2k4dmIyTnpjQzVoY0hCc1pTNWpiMjB2YjJOemNEQTBMV0Z3Y0d4bGNtOXZkR05oWnpNd0hRWURWUjBPQkJZRUZDUHlTY1JQaytUdkorYkU5aWhzUDZLNy9TNUxNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdId1lEVlIwakJCZ3dGb0FVdTdEZW9WZ3ppSnFraXBuZXZyM3JyOXJMSktzd053WURWUjBmQkRBd0xqQXNvQ3FnS0lZbWFIUjBjRG92TDJOeWJDNWhjSEJzWlM1amIyMHZZWEJ3YkdWeWIyOTBZMkZuTXk1amNtd3dEZ1lEVlIwUEFRSC9CQVFEQWdFR01CQUdDaXFHU0liM1kyUUdBZzRFQWdVQU1Bb0dDQ3FHU000OUJBTUNBMmNBTUdRQ01EclBjb05SRnBteGh2czF3MWJLWXIvMEYrM1pEM1ZOb282KzhaeUJYa0szaWZpWTk1dFpuNWpWUVEyUG5lbkMvZ0l3TWkzVlJDR3dvd1YzYkYzek9EdVFaLzBYZkN3aGJaWlB4bkpwZ2hKdlZQaDZmUnVaeTVzSmlTRmhCcGtQQ1pJZEFBQXhnZ0dJTUlJQmhBSUJBVENCaGpCNk1TNHdMQVlEVlFRRERDVkJjSEJzWlNCQmNIQnNhV05oZEdsdmJpQkpiblJsWjNKaGRHbHZiaUJEUVNBdElFY3pNU1l3SkFZRFZRUUxEQjFCY0hCc1pTQkRaWEowYVdacFkyRjBhVzl1SUVGMWRHaHZjbWwwZVRFVE1CRUdBMVVFQ2d3S1FYQndiR1VnU1c1akxqRUxNQWtHQTFVRUJoTUNWVk1DQ0ZuWW9ieXE5T1BOTUFzR0NXQ0dTQUZsQXdRQ0FhQ0JrekFZQmdrcWhraUc5dzBCQ1FNeEN3WUpLb1pJaHZjTkFRY0JNQndHQ1NxR1NJYjNEUUVKQlRFUEZ3MHlOVEF6TURZeE1URXlOVFZhTUNnR0NTcUdTSWIzRFFFSk5ERWJNQmt3Q3dZSllJWklBV1VEQkFJQm9Rb0dDQ3FHU000OUJBTUNNQzhHQ1NxR1NJYjNEUUVKQkRFaUJDQS9FemxmRUhtbk5uSW9uS2FwOUpBVkNEdld3dmlMRkhuY0IwdmpaY21WN3pBS0JnZ3Foa2pPUFFRREFnUkhNRVVDSVFEeWV0MUdwSU9QcXkyRjFzYkY3M1hOSDRJTEp6WWozSDdXR1Zzd0huRzFBQUlnQVJYZG5HY0hERkI1LzNhc1I5bm9PNVdkMy95NlZKRFpmZXQ3WWV6RjFEMEFBQUFBQUFBPSIsImhlYWRlciI6eyJwdWJsaWNLZXlIYXNoIjoiVzFOT3JTbWhwTVdDQlg0cWE3NEZBeTNEMnNWZDZ3YWFzOEdHMWdYQ21Pdz0iLCJlcGhlbWVyYWxQdWJsaWNLZXkiOiJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVaUmdaNGkveUhwK3d3ckxtRGpDanJyTkJkQnB5b0tEU1VvamV0enBuVk4wdDNXajZiNjhnUWkvempTS3hsOUZ0eXdkb0lJSUFvWm9Sa0ZuMFpseTBMZz09IiwidHJhbnNhY3Rpb25JZCI6ImE3OWVjMjYyMThiZmZjNDNmYzlkZDZlMTg0ZDI4NDNmNzQ2MjNhNWE5ODJhZTY5YWM2NmU3ZjQ1ZDNiNzhiZDUifSwidmVyc2lvbiI6IkVDX3YxIn0=",
"payment_method": {
"display_name": "Visa 4228",
"network": "Visa",
"type": "debit"
},
"transaction_identifier": "a79ec26218bffc43fc9dd6e184d2843f74623a5a982ae69ac66e7f45d3b78bd5"
}
},
"billing": null
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
}
}'
```
```json
{
"payment_id": "pay_2tnZM8hO4nIxl6gox8rI",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "authorizedotnet",
"client_secret": "pay_2tnZM8hO4nIxl6gox8rI_secret_wEWXQgZ7k7Rod2MdN7Kf",
"created": "2025-03-06T17:28:21.551Z",
"currency": "USD",
"customer_id": "cus_1741282115",
"customer": {
"id": "cus_1741282115",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": "man_f3nDuo2P2PnTlqkUuMQs",
"mandate_data": {
"update_mandate_id": null,
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"single_use": {
"amount": 8000,
"currency": "USD",
"start_date": null,
"end_date": null,
"metadata": null
}
}
},
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "4228",
"card_network": "Visa",
"type": "debit"
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"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": null,
"name": null,
"phone": null,
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "apple_pay",
"connector_label": "authorizedotnet_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": 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_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-06T17:43:21.551Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"os_version": null,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"device_model": null,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"accept_language": "en",
"java_script_enabled": true
},
"payment_method_id": "pm_EpXi7jTd8DzFIG5Vj2y7",
"payment_method_status": "active",
"updated": "2025-03-06T17:28:36.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": "929611432-929002945",
"card_discovery": null
}
```
</details>
<details>
<summary>2. 0 Auth mandate Apple Pay Payment Create (MIT)</summary>
Create + Confirm:
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_a0e1Cq93U9sDLfUgilzlEJqg4eBRZI4Y021Hqj6bTXhAZTC7gjLij6aqolpvM9Gn' \
--data '{
"amount": 1000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "cus_1741282115",
"client_secret": "pay_Jc0FhbExingoDJPnrOAQ_secret_eBhCpq9mBPOSajNH3Kpl",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_EpXi7jTd8DzFIG5Vj2y7"
},
"off_session": true,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
}
}'
```
```json
{
"payment_id": "pay_Jc0FhbExingoDJPnrOAQ",
"merchant_id": "postman_merchant_GHAction_1741082806",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "authorizedotnet",
"client_secret": "pay_Jc0FhbExingoDJPnrOAQ_secret_eBhCpq9mBPOSajNH3Kpl",
"created": "2025-03-06T17:28:53.109Z",
"currency": "USD",
"customer_id": "cus_1741282115",
"customer": {
"id": "cus_1741282115",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": null,
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "apple_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cus_1741282115",
"created_at": 1741282133,
"expires": 1741285733,
"secret": "epk_7b3fdc77c6c8443cb2d6ce57a1d7c4c1"
},
"manual_retry_allowed": false,
"connector_transaction_id": "120058504115",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "120058504115",
"payment_link": null,
"profile_id": "pro_oHA88TJXvZtdcosjZFkq",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_C6aMBB2E0kNICU09mSCP",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-06T17:43:53.109Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_EpXi7jTd8DzFIG5Vj2y7",
"payment_method_status": "active",
"updated": "2025-03-06T17:28:53.762Z",
"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": "929611432-929002945",
"card_discovery": null
}
```
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs`
- `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs`
**2. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**3. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (20 changes)
**Detailed Identifier Changes:**
Commit 07733a5c:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs**
Modify existing code
|
{"pr_number": 7412, "pr_title": "feat(connector): implement wallet mandates for authorizedotnet", "merged_at": "2025-03-11T14:41:15Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs", "crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"fields_added": 20}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(payment_methods): refactor customer payment methods list v2 code to follow better code practices
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR includes refactors around the customer payment methods list v2 code to follow some of the practices we've started enforcing in the recent few months. Additionally, I've picked up some minor refactors along the way.
This PR contains the following changes:
- Adds a `should_collect_cvv_during_payment` column to the business profile v2 table to replace the `{merchant_id}_requires_cvv` config we used to read previously (and still do in v1) from the `configs` table.
- Renames the `business_profile` field to `profile` in the `SavedPMLPaymentsInfo` struct. (This follows the changes done in #5877.)
- Renames the `requires_cvv` field to `collect_cvv_during_payment` in `SavedPMLPaymentsInfo` struct, to follow the new column added in the business profile v2 table.
- Passes profile to the `form_payments_info()` method instead of fetching it within the method. Eventually, we'd want to obtain the profile from the authentication layer instead, which would be passed forward.
- Moves the `PaymentsMandateReference` from the `router` crate to the `diesel_models` crate, and updates the `connector_mandate_details` field in the payment methods table to use `PaymentsMandateReference` instead of `serde_json::Value` in v2 code. (This should help reduce / prevent invalid data being stored in this column of the database.)
- Refactors the `get_mca_status()` function to avoid a possible database call (to fetch merchant connector accounts associated with a merchant / profile) happening within an iterator.
- Drops the `metadata` column from the payment methods table and API models in v2 code, since it isn't being actively used in v1 code anyway. Neither do any of our hosted environments have any useful data stored in that column.
The other minor refactors I took up along the way include:
- Improves the doc comment for the `is_network_tokenization_enabled` field in profile API models.
- Update the `ExtendedCardInfoUpdate`, `ConnectorAgnosticMitUpdate` and `NetworkTokenizationUpdate` enum variants of the `ProfileUpdate` domain model enum to have required fields instead of optional ones. (This is because these variants either enable something or not, and we always have the value to be updated in all cases.)
- Uses `serialize_and_set_key_with_expiry()` when storing payment method token in Redis instead of explicit JSON serialization happening in business logic.
- Replace usages of `create_payment_method()` (which only seemed to be updating the metadata field, and was thus confusing) with a correct `apply_changeset()` implementation. This change only affects MockDb implementation.
The PR can be reviewed one commit at a time, if that helps ease reviews.
### 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`
-->
- This PR adds a new column in the business profile v2 database table and corresponding field in the business profile v2 API models.
- This PR drops the metadata column from the payment methods v2 database table and corresponding payment methods v2 API models.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
This PR contains only a subset of the changes / improvements that can help us in arriving at the final implementation of the customer payment methods list v2 API. There are still a few more refactors pending, which would be taken up in subsequent PRs.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Haven't been able to test these changes, there are still a couple of panics remaining in the customer payment methods list v2 code.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/payment_method.rs`
- ... and 1 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
- `crates/hyperswitch_domain_models/src/merchant_connector_account.rs`
- `crates/hyperswitch_domain_models/src/payment_methods.rs`
- ... and 2 more files
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payment_methods/cards.rs`
- ... and 4 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs`
**6. Type Definitions**
- `crates/router/src/types/api/admin.rs`
- `crates/router/src/types/payment_methods.rs`
- `crates/router/src/types/storage/payment_method.rs`
**7. Other**
- `Cargo.lock`
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- ... and 7 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (10 changes)
- Extend existing types with new fields (171 changes)
- Add conditional logic for feature flags or filtering (3 changes)
- Modify database queries (4 changes)
**Detailed Identifier Changes:**
Commit 0389ae74:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payment_methods.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/diesel_models/src/payment_method.rs**
Remove:
- function: pub::create_payment_method
- function: pub::create_payment_method
Add:
- function: private::deref
- function: private::deref_mut
- struct: pub::PaymentsMandateReferenceRecord
- struct: pub::PaymentsMandateReference
- impl: impl std::ops::Deref for PaymentsMandateReference
- impl: impl std::ops::DerefMut for PaymentsMandateReference
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/merchant_connector_account.rs**
Add:
- function: pub::new
- function: pub::is_merchant_connector_account_id_in_connector_mandate_details
- struct: pub::MerchantConnectorAccounts
- impl: impl MerchantConnectorAccounts
**crates/hyperswitch_domain_models/src/payment_methods.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/cards.rs**
Remove:
- function: pub::update_payment_method_metadata_and_last_used
Add:
- function: pub::get_mca_status
**crates/router/src/core/payment_methods/transformers.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/tokenization.rs**
Modify existing code
**crates/router/src/db/payment_method.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Add:
- function: pub::check_client_secret_and_get_auth
- function: pub::is_ephemeral_auth
**crates/router/src/types/api/admin.rs**
Modify existing code
**crates/router/src/types/payment_methods.rs**
Modify existing code
**crates/router/src/types/storage/payment_method.rs**
Remove:
- function: private::deref
- function: private::deref_mut
- struct: pub::PaymentsMandateReferenceRecord
- struct: pub::PaymentsMandateReference
- impl: impl Deref for PaymentsMandateReference
- impl: impl DerefMut for PaymentsMandateReference
|
{"pr_number": 6433, "pr_title": "refactor(payment_methods): refactor customer payment methods list v2 code to follow better code practices", "merged_at": "2024-11-08T14:57:43Z", "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", "crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/payment_method.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/merchant_connector_account.rs", "crates/hyperswitch_domain_models/src/payment_methods.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/transformers.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/tokenization.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs"], "types": ["crates/router/src/types/api/admin.rs", "crates/router/src/types/payment_methods.rs", "crates/router/src/types/storage/payment_method.rs"], "other": ["Cargo.lock", "api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/router/src/db/payment_method.rs", "crates/router/src/routes/payment_methods.rs", "crates/router/src/services/authentication.rs", "v2_migrations/2024-08-23-112510_payment_methods_v2_db_changes/down.sql", "v2_migrations/2024-08-23-112510_payment_methods_v2_db_changes/up.sql", "v2_migrations/2024-08-28-081721_add_v2_columns/down.sql", "v2_migrations/2024-08-28-081721_add_v2_columns/up.sql"]}, "change_types": {"structs_added": 3, "functions_added": 10, "fields_added": 171, "imports_added": 3, "conditionals_added": 3, "database_queries": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(dynamic_routing): remove delete_merchant for DE
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
When deleting a merchant account, the code previously included a direct call to the **Decision Engine (DE)** to remove the merchant configuration (`delete_decision_engine_merchant`). This was gated behind the `dynamic_routing` and `v1` feature flags and executed synchronously within the merchant deletion flow.
#### **Change**
* **Removed** the in-place DE cleanup logic inside `merchant_account_delete`.
* Merchant deletion in the Decision Engine will now be handled separately instead of being triggered inline.
#### **Impact**
* Merchant deletion continues to work as expected.
* Decision Engine merchant cleanup is no longer triggered directly during merchant deletion.
* Any required DE sync/cleanup should be handled through explicit decision engine flows.
## How did you test it?
**Curls and Responses**
merchant_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_1756372072",
"locker_id": "m0010",
"merchant_name": "NewAge Retailer",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "[email protected]",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "[email protected]",
"secondary_phone": "cillum do dolor id",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name":"john",
"last_name":"Doe"
}
},
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url":"https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"parent_merchant_id":"merchant_123",
"metadata": {
"city": "NY",
"unit": "245"
},
"primary_business_details": [
{
"country": "US",
"business": "default"
}
]
}'
```
```
{
"merchant_id": "merchant_1756370034",
"merchant_name": "NewAge Retailer",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "vPKpQFWxI6vvWeAClk6U0JQ01ueIluSMVrsUv7uiFQL2Vmgo4fp1zCW1qXRzX7p3",
"redirect_to_merchant_with_http_post": false,
"merchant_details": {
"primary_contact_person": "John Test",
"primary_phone": "sunt laborum",
"primary_email": "[email protected]",
"secondary_contact_person": "John Test2",
"secondary_phone": "cillum do dolor id",
"secondary_email": "[email protected]",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "john",
"last_name": "Doe",
"origin_zip": null
}
},
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true,
"payment_statuses_enabled": null,
"refund_statuses_enabled": null,
"payout_statuses_enabled": null
},
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "pk_dev_bb568f9c214f4428b24e81ff7173b7be",
"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_5pSgHUtY3PbAsrEDWkij",
"is_recon_enabled": false,
"default_profile": "pro_t5bthtS2CtfrpA3UjL4H",
"recon_status": "not_requested",
"pm_collect_link_config": null,
"product_type": "orchestration",
"merchant_account_type": "standard"
}
```
create_sr_routing
```
curl --location 'http://localhost:8080/account/merchant_1756370034/business_profile/pro_t5bthtS2CtfrpA3UjL4H/dynamic_routing/success_based/create?enable=dynamic_connector_selection' \
--header 'Content-Type: application/json' \
--header 'api-key:****' \
--data '{
"decision_engine_configs": {
"defaultLatencyThreshold": 90,
"defaultBucketSize": 200,
"defaultHedgingPercent": 5,
"subLevelInputConfig": [
{
"paymentMethodType": "card",
"paymentMethod": "credit",
"bucketSize": 250,
"hedgingPercent": 1
}
]
}
}'
```
```
{
"id": "routing_usG7HRI5Ij3FoaOhOb5A",
"profile_id": "pro_t5bthtS2CtfrpA3UjL4H",
"name": "Success rate based dynamic routing algorithm",
"kind": "dynamic",
"description": "",
"created_at": 1756370043,
"modified_at": 1756370043,
"algorithm_for": "payment",
"decision_engine_routing_id": null
}
```
activate
```
curl --location 'http://localhost:8080/routing/routing_usG7HRI5Ij3FoaOhOb5A/activate' \
--header 'Content-Type: application/json' \
--header 'api-key:****' \
--data '{}'
```
```
{
"id": "routing_usG7HRI5Ij3FoaOhOb5A",
"profile_id": "pro_t5bthtS2CtfrpA3UjL4H",
"name": "Success rate based dynamic routing algorithm",
"kind": "dynamic",
"description": "",
"created_at": 1756370043,
"modified_at": 1756370043,
"algorithm_for": "payment",
"decision_engine_routing_id": null
}
```
delete_merchant
```
curl --location --request DELETE 'http://localhost:8080/accounts/merchant_1756370034' \
--header 'Accept: application/json' \
--header 'api-key: test_admin'
```
```
{
"merchant_id": "merchant_1756370034",
"deleted": true
}
```
delete business_profile
```
curl --location --request DELETE 'http://localhost:8080/account/merchant_1756370034/business_profile/pro_t5bthtS2CtfrpA3UjL4H' \
--header 'api-key: test_admin'
```
```true```
<img width="1313" height="333" alt="Screenshot 2025-08-28 at 2 50 14 PM" src="https://github.com/user-attachments/assets/2d005743-8ccd-4592-9547-fb52adf44b64" />
Deleted from hyperswitch
<img width="670" height="52" alt="Screenshot 2025-08-28 at 2 46 31 PM" src="https://github.com/user-attachments/assets/9412c39b-5bb6-4133-b6a2-d1f401aa070f" />
<img width="667" height="48" alt="Screenshot 2025-08-28 at 2 50 27 PM" src="https://github.com/user-attachments/assets/5a9da55d-d0f3-49fe-8ac5-1cc5f4d6c9e0" />
Not deleted from DE
<img width="757" height="316" alt="Screenshot 2025-08-28 at 2 47 01 PM" src="https://github.com/user-attachments/assets/3a0a12c6-4062-48c3-8c4d-edbf85aa7a96" />
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/admin.rs`
**Detailed Identifier Changes:**
Commit ec5a9551:
Files to modify:
**crates/router/src/core/admin.rs**
Modify existing code
|
{"pr_number": 9076, "pr_title": "refactor(dynamic_routing): remove delete_merchant for DE", "merged_at": "2025-09-01T13:35:37Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Implement UCS based upi for paytm and phonepe
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Fixed #8734
## Description
<!-- Describe your changes in detail -->
This PR implements UPI Intent and QR code payment flows for the Unified Connector Service (UCS) integration, adding default implementations for Paytm and PhonePe connectors.
### Key Changes:
- **Default Connector Implementations**: Added default implementations for Paytm and PhonePe connectors (the actual payment processing integration is handled by UCS)
- **UPI Intent Flow**: Implemented UPI Intent payment method support for mobile app integrations through UCS
- **QR Code Flow**: Added QR code generation and payment flow support for UPI payments via UCS
- **UCS Enhancement**: Extended the Unified Connector Service to route UPI Intent and QR code payment requests
- **Configuration**: Added necessary configuration entries for both connectors across all environments
- **Testing**: Included test suites for the default implementations
**Note**: This PR does not implement direct integrations with Paytm or PhonePe APIs. The actual payment processing and API communication is handled by the Unified Connector Service (UCS). This PR provides the necessary scaffolding and routing logic to support these payment methods through UCS.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
**Configuration changes can be found in:**
- `config/development.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/deployments/integration_test.toml`
- `crates/connector_configs/toml/*.toml`
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
This change enables merchants to accept UPI payments through Paytm and PhonePe payment gateways using the Unified Connector Service. UPI is a crucial payment method in India, and supporting Intent and QR code flows allows for seamless integration across mobile apps and web platforms.
The implementation leverages the UCS architecture where:
- Hyperswitch provides the routing and orchestration layer
- UCS handles the actual integration with Paytm and PhonePe APIs
- This PR adds the necessary connector definitions and routing logic to support these payment methods
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
### Automated Tests
- Added integration tests for both Paytm and PhonePe default implementations in `crates/router/tests/connectors/`
- Tests verify:
- Proper routing of payment requests to UCS
- UPI Intent payment method handling
- QR code flow support
- Status sync operations
- Refund request routing
- Webhook handling
- All tests pass successfully with the new implementations
### Manual Testing
1. **Enable UCS configuration:**
```bash
curl --location 'http://localhost:8080/configs/' \
--header 'Content-Type: application/json' \
--header 'api-key: [REDACTED]' \
--header 'x-tenant-id: public' \
--data '{
"key": "ucs_enabled",
"value": "true"
}'
```
2. **Create a UPI Intent payment request:**
```bash
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: [REDACTED]' \
--data-raw '{
"amount": 1000,
"currency": "INR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"customer_id": "IatapayCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "upi",
"payment_method_type": "upi_intent",
"payment_method_data": {
"upi": {
"upi_intent": {}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IN",
"first_name": "Swangi",
"last_name": "Kumari"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IN",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"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": "[email protected]"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"all_keys_required": true
}'
```
3. **Successful payment response received:**
```json
{
"payment_id": "pay_XzkwJ5pFVTmuGGAXBy3G",
"merchant_id": "merchant_1753180563",
"status": "processing",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "phonepe",
"client_secret": "[REDACTED]",
"created": "2025-07-23T08:36:35.265Z",
"currency": "INR",
"customer_id": "IatapayCustomer",
"customer": {
"id": "IatapayCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "upi",
"payment_method_data": {
"upi": {
"upi_intent": {}
},
"billing": {
"address": {
"city": "San Fransico",
"country": "IN",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "Swangi",
"last_name": "Kumari"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
}
},
"payment_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": "[email protected]"
},
"billing": {
"address": {
"city": "San Fransico",
"country": "IN",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": {
"type": "qr_code_information",
"image_data_url": "[REDACTED BASE64 QR CODE DATA]",
"display_to_timestamp": null,
"qr_code_url": null,
"display_text": null,
"border_color": null
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "upi_intent",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "IatapayCustomer",
"created_at": 1753259795,
"expires": 1753263395,
"secret": "[REDACTED]"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pay_XzkwJ5pFVTmuGGAXBy3G_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_XzkwJ5pFVTmuGGAXBy3G_1",
"payment_link": null,
"profile_id": "pro_aDyARAw6YQZAPr6sqHgi",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_fTVznSS9dGiTX3QEXrg3",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-23T08:51:35.265Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-07-23T08:36:35.797Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": 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": "{\"success\":true,\"code\":\"PAYMENT_INITIATED\",\"message\":\"Payment initiated\",\"data\":{\"merchantId\":\"JUSPAONLINE\",\"merchantTransactionId\":\"pay_XzkwJ5pFVTmuGGAXBy3G_1\",\"instrumentResponse\":{\"type\":\"UPI_INTENT\",\"intentUrl\":\"upi://pay?pa=JUSPAONLINE@ybl&pn=Juspay&am=10.00&mam=10.00&tr=OM2507231406356135400588&tn=Payment%20for%20pay_XzkwJ5pFVTmuGGAXBy3G_1&mc=6051&mode=04&purpose=00&utm_campaign=B2B_PG&utm_medium=JUSPAONLINE&utm_source=OM2507231406356135400588\"}}}"
}
```
The response shows successful routing through UCS with QR code generation (when invoked from sdk) for UPI payment.
## Checklist
<!-- Put an `x` in the boxes that 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. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/connector_endpoints.rs`
**2. Core Business Logic**
- `crates/router/src/core/connector_validation.rs`
- `crates/router/src/core/unified_connector_service.rs`
- `crates/router/src/core/unified_connector_service/transformers.rs`
**3. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 19 more files
**4. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**5. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 5 more files
**6. Other**
- `Cargo.lock`
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
**Code Patterns Applied:**
- Define new data structures (20 changes)
- Implement new functions (166 changes)
- Extend existing types with new fields (337 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 01e94748:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/external_services/src/grpc_client/unified_connector_service.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::paytm
- mod: pub::phonepe
**crates/hyperswitch_connectors/src/connectors/paytm.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::Paytm
- impl: impl Paytm
- impl: impl api::Payment for Paytm
- impl: impl api::PaymentSession for Paytm
- impl: impl api::ConnectorAccessToken for Paytm
- impl: impl api::MandateSetup for Paytm
- impl: impl api::PaymentAuthorize for Paytm
- impl: impl api::PaymentSync for Paytm
- impl: impl api::PaymentCapture for Paytm
- impl: impl api::PaymentVoid for Paytm
- impl: impl api::Refund for Paytm
- impl: impl api::RefundExecute for Paytm
- impl: impl api::RefundSync for Paytm
- impl: impl api::PaymentToken for Paytm
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Paytm
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Paytm
- impl: impl ConnectorCommon for Paytm
- impl: impl ConnectorValidation for Paytm
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Paytm
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Paytm
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Paytm
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Paytm
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Paytm
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Paytm
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Paytm
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Paytm
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Paytm
- impl: impl webhooks::IncomingWebhook for Paytm
- impl: impl ConnectorSpecifications for Paytm
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/paytm/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::PaytmRouterData
- struct: pub::PaytmPaymentsRequest
- struct: pub::PaytmCard
- struct: pub::PaytmAuthType
- struct: pub::PaytmPaymentsResponse
- struct: pub::PaytmRefundRequest
- struct: pub::RefundResponse
- struct: pub::PaytmErrorResponse
- enum: pub::PaytmPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for PaytmRouterData<T>
- impl: impl TryFrom<&PaytmRouterData<&PaymentsAuthorizeRouterData>> for PaytmPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for PaytmAuthType
- impl: impl From<PaytmPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, PaytmPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&PaytmRouterData<&RefundsRouterData<F>>> for PaytmRefundRequest
- 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/connectors/phonepe.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::Phonepe
- impl: impl Phonepe
- impl: impl api::Payment for Phonepe
- impl: impl api::PaymentSession for Phonepe
- impl: impl api::ConnectorAccessToken for Phonepe
- impl: impl api::MandateSetup for Phonepe
- impl: impl api::PaymentAuthorize for Phonepe
- impl: impl api::PaymentSync for Phonepe
- impl: impl api::PaymentCapture for Phonepe
- impl: impl api::PaymentVoid for Phonepe
- impl: impl api::Refund for Phonepe
- impl: impl api::RefundExecute for Phonepe
- impl: impl api::RefundSync for Phonepe
- impl: impl api::PaymentToken for Phonepe
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Phonepe
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Phonepe
- impl: impl ConnectorCommon for Phonepe
- impl: impl ConnectorValidation for Phonepe
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Phonepe
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Phonepe
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Phonepe
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Phonepe
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Phonepe
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Phonepe
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Phonepe
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Phonepe
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Phonepe
- impl: impl webhooks::IncomingWebhook for Phonepe
- impl: impl ConnectorSpecifications for Phonepe
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/phonepe/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::PhonepeRouterData
- struct: pub::PhonepePaymentsRequest
- struct: pub::PhonepeCard
- struct: pub::PhonepeAuthType
- struct: pub::PhonepePaymentsResponse
- struct: pub::PhonepeRefundRequest
- struct: pub::RefundResponse
- struct: pub::PhonepeErrorResponse
- enum: pub::PhonepePaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for PhonepeRouterData<T>
- impl: impl TryFrom<&PhonepeRouterData<&PaymentsAuthorizeRouterData>> for PhonepePaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for PhonepeAuthType
- impl: impl From<PhonepePaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, PhonepePaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&PhonepeRouterData<&RefundsRouterData<F>>> for PhonepeRefundRequest
- 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/payment_methods/src/configs/payment_connector_required_fields.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/core/connector_validation.rs**
Modify existing code
**crates/router/src/core/unified_connector_service.rs**
Modify existing code
**crates/router/src/core/unified_connector_service/transformers.rs**
Modify existing code
**crates/router/src/types/api/connector_mapping.rs**
Modify existing code
**crates/router/src/types/connector_transformers.rs**
Modify existing code
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::paytm
- mod: private::phonepe
**crates/router/tests/connectors/paytm.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::PaytmTest
- impl: impl ConnectorActions for PaytmTest
- impl: impl utils::Connector for PaytmTest
**crates/router/tests/connectors/phonepe.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::PhonepeTest
- impl: impl ConnectorActions for PhonepeTest
- impl: impl utils::Connector for PhonepeTest
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 8732, "pr_title": "feat(core): Implement UCS based upi for paytm and phonepe", "merged_at": "2025-07-31T14:18:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/connector_endpoints.rs"], "core_business": ["crates/router/src/core/connector_validation.rs", "crates/router/src/core/unified_connector_service.rs", "crates/router/src/core/unified_connector_service/transformers.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/external_services/src/grpc_client/unified_connector_service.rs", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/paytm.rs", "crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs", "crates/hyperswitch_connectors/src/connectors/phonepe.rs", "crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs", "crates/router/src/connector.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/src/types/connector_transformers.rs", "crates/router/tests/connectors/main.rs", "crates/router/tests/connectors/paytm.rs", "crates/router/tests/connectors/phonepe.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", "config/payment_required_fields_v2.toml", "crates/external_services/Cargo.toml", "crates/router/Cargo.toml"], "other": ["Cargo.lock", "api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json"]}, "change_types": {"structs_added": 20, "functions_added": 166, "enums_added": 4, "fields_added": 337, "imports_added": 48, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): verify existence of `payment_id` after redirection
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR adds a check in Cypress `redirectionHandler` to verify that `payment_id` exists after the redirection completes without which it throws an error!
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
We need to check if we get `payment_id` in return url after the redirection completes.
## How did you test 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 by inverting the check:
<img width="246" alt="image" src="https://github.com/user-attachments/assets/8d3462cf-c02b-48fa-98f8-75d191a982c3" />
since i asked cypress to throw an error if `payment_id` exist, it threw me an error:
<img width="402" alt="image" src="https://github.com/user-attachments/assets/afeacebe-b455-4eaf-abcb-5c66f1779ca6" />
so, the check works as expected.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `npm run format`
- [x] I addressed lints thrown by `npm run lint`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests/cypress/support/redirectionHandler.js`
**Code Patterns Applied:**
- Add conditional logic for feature flags or filtering (2 changes)
|
{"pr_number": 7657, "pr_title": "ci(cypress): verify existence of `payment_id` after redirection", "merged_at": "2025-04-02T06:55:56Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {"conditionals_added": 2}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(core): make raw_connector_response as secret
## 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 makes raw_connector_response as a Secret and it also addresses unresolved comments of https://github.com/juspay/hyperswitch/pull/8499
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Payments - Create
```
curl --location 'http://localhost:8080/v2/payments' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_2Epn3j4dw4PTTcAeiYCq' \
--header 'Authorization: api-key=dev_rVjIA9bnmFxbtjq0nZeACzzLz9mqAMLNNRBG26wWmCMnkUb3kAs2MaPXR0Nlxzkx' \
--data-raw '{
"amount_details": {
"currency": "USD",
"order_amount": 6540
},
"payment_method_data": {
"card": {
"card_cvc": "123",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_number": "4242424242424242"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IN",
"first_name": "Swangi",
"last_name": "Kumari"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
}
},
"payment_method_subtype": "credit",
"payment_method_type": "card",
"return_raw_connector_response": true
}'
```
Response
```
{
"id": "12345_pay_0197ede6d02c77d1a499530bf675e725",
"status": "succeeded",
"amount": {
"order_amount": 6540,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 6540,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 6540
},
"customer_id": null,
"connector": "stripe",
"created": "2025-07-09T06:36:56.236Z",
"payment_method_data": {
"billing": {
"address": {
"city": "San Fransico",
"country": "IN",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "Swangi",
"last_name": "Kumari"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector_transaction_id": "pi_3RirciD5R7gDAGff0JSMZ9vN",
"connector_reference_id": "pi_3RirciD5R7gDAGff0JSMZ9vN",
"merchant_connector_id": "mca_afJBIsuaoPHhNuVG2CCo",
"browser_info": null,
"error": null,
"shipping": null,
"billing": null,
"attempts": null,
"connector_token_details": {
"token": "pm_1RirciD5R7gDAGff9P1tYKQk",
"connector_token_request_reference_id": "cRhwNEwZyiEAeSeCCv"
},
"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": null,
"raw_connector_response": "{\n \"id\": \"pi_3RirciD5R7gDAGff0JSMZ9vN\",\n \"object\": \"payment_intent\",\n \"amount\": 6540,\n \"amount_capturable\": 0,\n \"amount_details\": {\n \"tip\": {}\n },\n \"amount_received\": 6540,\n \"application\": null,\n \"application_fee_amount\": null,\n \"automatic_payment_methods\": null,\n \"canceled_at\": null,\n \"cancellation_reason\": null,\n \"capture_method\": \"automatic\",\n \"client_secret\": \"pi_3RirciD5R7gDAGff0JSMZ9vN_secret_UW4tYLvjQrDi7NHt8Scv7Bade\",\n \"confirmation_method\": \"automatic\",\n \"created\": 1752043016,\n \"currency\": \"usd\",\n \"customer\": null,\n \"description\": null,\n \"invoice\": null,\n \"last_payment_error\": null,\n \"latest_charge\": {\n \"id\": \"ch_3RirciD5R7gDAGff0T483Brp\",\n \"object\": \"charge\",\n \"amount\": 6540,\n \"amount_captured\": 6540,\n \"amount_refunded\": 0,\n \"amount_updates\": [],\n \"application\": null,\n \"application_fee\": null,\n \"application_fee_amount\": null,\n \"balance_transaction\": \"txn_3RirciD5R7gDAGff0YvvPlkn\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Fransico\",\n \"country\": \"IN\",\n \"line1\": \"1467\",\n \"line2\": \"Harrison Street\",\n \"postal_code\": \"94122\",\n \"state\": \"California\"\n },\n \"email\": \"[email protected]\",\n \"name\": \"Swangi Kumari\",\n \"phone\": \"8056594427\",\n \"tax_id\": null\n },\n \"calculated_statement_descriptor\": \"D2CSTORE0\",\n \"captured\": true,\n \"created\": 1752043017,\n \"currency\": \"usd\",\n \"customer\": null,\n \"description\": null,\n \"destination\": null,\n \"dispute\": null,\n \"disputed\": false,\n \"failure_balance_transaction\": null,\n \"failure_code\": null,\n \"failure_message\": null,\n \"fraud_details\": {},\n \"invoice\": null,\n \"livemode\": false,\n \"metadata\": {\n \"order_id\": \"12345_att_0197ede6d0497bc3b00553f0bd9bf01c\"\n },\n \"on_behalf_of\": null,\n \"order\": null,\n \"outcome\": {\n \"advice_code\": null,\n \"network_advice_code\": null,\n \"network_decline_code\": null,\n \"network_status\": \"approved_by_network\",\n \"reason\": null,\n \"risk_level\": \"normal\",\n \"risk_score\": 4,\n \"rule\": \"allow_if_in_allowlist\",\n \"seller_message\": \"Payment complete.\",\n \"type\": \"authorized\"\n },\n \"paid\": true,\n \"payment_intent\": \"pi_3RirciD5R7gDAGff0JSMZ9vN\",\n \"payment_method\": \"pm_1RirciD5R7gDAGff9P1tYKQk\",\n \"payment_method_details\": {\n \"card\": {\n \"amount_authorized\": 6540,\n \"authorization_code\": \"667270\",\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"exp_month\": 10,\n \"exp_year\": 2025,\n \"extended_authorization\": {\n \"status\": \"disabled\"\n },\n \"fingerprint\": \"h7L3P7Ht9VtwZ6yb\",\n \"funding\": \"credit\",\n \"incremental_authorization\": {\n \"status\": \"unavailable\"\n },\n \"installments\": null,\n \"last4\": \"4242\",\n \"mandate\": null,\n \"multicapture\": {\n \"status\": \"unavailable\"\n },\n \"network\": \"visa\",\n \"network_token\": {\n \"used\": false\n },\n \"network_transaction_id\": \"104557651805572\",\n \"overcapture\": {\n \"maximum_amount_capturable\": 6540,\n \"status\": \"unavailable\"\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure\": null,\n \"wallet\": null\n },\n \"type\": \"card\"\n },\n \"radar_options\": {},\n \"receipt_email\": null,\n \"receipt_number\": null,\n \"receipt_url\": \"https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTTdmVGFENVI3Z0RBR2ZmKImcuMMGMgZ0E_VSu6k6LBYDbs4wzaE7cYX2DHDMygwy6f_E0Q1SGSjyRrHheoBChPHBQVxXj4zo7kwE\",\n \"refunded\": false,\n \"review\": null,\n \"shipping\": null,\n \"source\": null,\n \"source_transfer\": null,\n \"statement_descriptor\": null,\n \"statement_descriptor_suffix\": null,\n \"status\": \"succeeded\",\n \"transfer_data\": null,\n \"transfer_group\": null\n },\n \"livemode\": false,\n \"metadata\": {\n \"order_id\": \"12345_att_0197ede6d0497bc3b00553f0bd9bf01c\"\n },\n \"next_action\": null,\n \"on_behalf_of\": null,\n \"payment_method\": \"pm_1RirciD5R7gDAGff9P1tYKQk\",\n \"payment_method_configuration_details\": null,\n \"payment_method_options\": {\n \"card\": {\n \"installments\": null,\n \"mandate_options\": null,\n \"network\": null,\n \"request_three_d_secure\": \"automatic\"\n }\n },\n \"payment_method_types\": [\n \"card\"\n ],\n \"processing\": null,\n \"receipt_email\": null,\n \"review\": null,\n \"setup_future_usage\": \"on_session\",\n \"shipping\": null,\n \"source\": null,\n \"statement_descriptor\": null,\n \"statement_descriptor_suffix\": null,\n \"status\": \"succeeded\",\n \"transfer_data\": null,\n \"transfer_group\": null\n}"
}
```
The raw_connector_response was a JSON in logs, now it is a Secret

## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_data.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/flows/authorize_flow.rs`
- `crates/router/src/core/payments/flows/psync_flow.rs`
- ... and 1 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/razorpay.rs`
**5. Type Definitions**
- `crates/common_types/src/domain.rs`
**6. Other**
- `crates/router/src/services/api.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (6 changes)
**Detailed Identifier Changes:**
Commit fb33937c:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_types/src/domain.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/razorpay.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.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/psync_flow.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Modify existing code
**crates/router/src/services/api.rs**
Modify existing code
|
{"pr_number": 8565, "pr_title": "refactor(core): make raw_connector_response as secret", "merged_at": "2025-07-16T10:39:40Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/flows/authorize_flow.rs", "crates/router/src/core/payments/flows/psync_flow.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/razorpay.rs"], "types": ["crates/common_types/src/domain.rs"], "other": ["crates/router/src/services/api.rs"]}, "change_types": {"functions_added": 2, "fields_added": 6, "imports_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Added support for unified_connector_service CardNumber and Secret<String> Type
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Added SecretString type definition in UCS proto files which will get swapped out with hyperswitch_masking::Secret type during build. This will allow us to mask any sensitive data like card_cvc, card _exp_month etc.
In this PR, all proto request types for which masked types were added, have been handled.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Added SecretString type definition in UCS proto files which will get swapped out with hyperswitch_masking::Secret type during build. This will allow us to mask any sensitive data like card_cvc, card _exp_month etc.
In this PR, all proto request types for which masked types were added, have been handled.
## How did you test 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/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_zYV0Xu6QYgNJZuZOeDHIjfk3DluWR00euuAzMdaMqRxP49SewUCvTsDxUF7Pti1g' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "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": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737",
"card_network": "Visa"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (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": 30,
"screen_height": 1117,
"screen_width": 1728,
"time_zone": -330,
"java_enabled": true,
"java_script_enabled": true
}
}'
```
-Response
```
{
"payment_id": "pay_ti0kJ7n39hCU1Za6BA1Q",
"merchant_id": "postman_merchant_GHAction_f7d1326e-6685-4d0a-9e2b-cfa156f58d72",
"status": "succeeded",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6540,
"connector": "adyen",
"client_secret": "pay_ti0kJ7n39hCU1Za6BA1Q_secret_0u8uwkwWbCZoBzgbc1Gi",
"created": "2025-08-25T16:56:36.422Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1111",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null,
"origin_zip": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null,
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1756140996,
"expires": 1756144596,
"secret": "epk_771b7c9d4b7d496bbbe978d3d0a9cf3c"
},
"manual_retry_allowed": false,
"connector_transaction_id": "GC7LHGQ4H4H89PV5",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "unified_connector_service"
},
"reference_id": "pay_ti0kJ7n39hCU1Za6BA1Q_1",
"payment_link": null,
"profile_id": "pro_dofrMH9OfAlOx7z74Tqu",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_gGrBd8TAXH5LZWccr8Fm",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-25T17:11:36.422Z",
"fingerprint": null,
"browser_info": {
"language": "en-GB",
"time_zone": -330,
"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",
"color_depth": 30,
"java_enabled": true,
"screen_width": 1728,
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"screen_height": 1117,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-08-25T16:56:37.362Z",
"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,
"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/unified_connector_service.rs`
- `crates/router/src/core/unified_connector_service/transformers.rs`
**2. Configuration Files**
- `crates/external_services/Cargo.toml`
- `crates/router/Cargo.toml`
**3. Other**
- `Cargo.lock`
**Code Patterns Applied:**
- Extend existing types with new fields (42 changes)
**Detailed Identifier Changes:**
Commit cf64d2a9:
Files to modify:
**crates/router/src/core/unified_connector_service.rs**
Modify existing code
**crates/router/src/core/unified_connector_service/transformers.rs**
Modify existing code
|
{"pr_number": 9044, "pr_title": "feat(core): Added support for unified_connector_service CardNumber and Secret<String> Type", "merged_at": "2025-08-27T15:50:04Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/unified_connector_service.rs", "crates/router/src/core/unified_connector_service/transformers.rs"], "config": ["crates/external_services/Cargo.toml", "crates/router/Cargo.toml"], "other": ["Cargo.lock"]}, "change_types": {"fields_added": 42, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(analytics): Add ckh columns for 3ds intelligence analytics
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Enhancement
## Description
<!-- Describe your changes in detail -->
Add ckh columns for 3ds intelligence analytics
Added nullable columns in CKH authentication table
```
`mcc` Nullable(String),
`amount` Nullable(UInt32),
`currency` LowCardinality(Nullable(String)),
`merchant_country` LowCardinality(Nullable(String)),
`billing_country` LowCardinality(Nullable(String)),
`shipping_country` LowCardinality(Nullable(String)),
`issuer_country` LowCardinality(Nullable(String)),
`earliest_supported_version` LowCardinality(Nullable(String)),
`latest_supported_version` LowCardinality(Nullable(String)),
`whitelist_decision` Nullable(Bool),
`device_manufacturer` Nullable(String),
`platform` LowCardinality(Nullable(String)),
`device_type` LowCardinality(Nullable(String)),
`device_brand` Nullable(String),
`device_os` Nullable(String),
`device_display` Nullable(String),
`browser_name` Nullable(String),
`browser_version` Nullable(String),
`issuer_id` Nullable(String),
`scheme_name` Nullable(String),
`exemption_requested` Nullable(Bool),
`exemption_accepted` Nullable(Bool),
```
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
NA
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Other**
- `crates/analytics/docs/clickhouse/scripts/authentications.sql`
**Code Patterns Applied:**
- Modify database queries (2 changes)
|
{"pr_number": 8136, "pr_title": "feat(analytics): Add ckh columns for 3ds intelligence analytics", "merged_at": "2025-05-28T14:20:03Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["merchant", "card"]}, "hierarchy": {"other": ["crates/analytics/docs/clickhouse/scripts/authentications.sql"]}, "change_types": {"database_queries": 2}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(openapi): Fix broken mintlify pages (v2)
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [x] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Fixed the following mintlify pages:
- `v2/customers/customers--update.mdx`
- `payment-method-session--confirm-a-payment-method-session.mdx`
- `payment-method-session--delete-a-saved-payment-method.mdx`
- `payment-method-session--list-payment-methods.mdx`
- `payment-method-session--retrieve.mdx`
- `payment-method-session--update-a-saved-payment-method.mdx`
Added the following missing pages:
- `payment-method--list-customer-saved-payment-methods.mdx`
- `refunds--list.mdx`
- `refunds--metadata-update.mdx`
- `refunds--retrieve.mdx`
- `revenue-recovery--retrieve.mdx`
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 #8381
## How did you test 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 with `mint dev`
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Other**
- `api-reference/docs.json`
- `api-reference/v2/customers/customers--update.mdx`
- `api-reference/v2/openapi_spec_v2.json`
- ... and 15 more files
**Detailed Identifier Changes:**
Commit 9319c7a6:
Files to modify:
**crates/openapi/src/routes/payments.rs**
Modify existing code
**crates/openapi/src/routes/tokenization.rs**
Modify existing code
|
{"pr_number": 8382, "pr_title": "fix(openapi): Fix broken mintlify pages (v2)", "merged_at": "2025-06-20T13:54:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "refund"]}, "hierarchy": {"other": ["api-reference/docs.json", "api-reference/v2/customers/customers--update.mdx", "api-reference/v2/openapi_spec_v2.json", "api-reference/v2/payment-method-session/payment-method-session--confirm-a-payment-method-session.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/payment-methods/list-customer-saved-payment-methods-for-a-payment.mdx", "api-reference/v2/payment-methods/list-payment-methods-for-a-customer.mdx", "api-reference/v2/payment-methods/list-saved-payment-methods-for-a-customer.mdx", "api-reference/v2/customers/customers--list-saved-payment-methods.mdx", "api-reference/v2/refunds/refunds--list.mdx", "api-reference/v2/refunds/refunds--metadata-update.mdx", "api-reference/v2/refunds/refunds--retrieve.mdx", "api-reference/v2/revenue-recovery/revenue-recovery--retrieve.mdx", "crates/openapi/src/routes/payments.rs", "crates/openapi/src/routes/tokenization.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore(postman): update auth for payment connectors in postman collection
## 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 -->
Modified the Auth in the postman collection for payment connectors, from Admin API Key to API Key.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Ensure proper testing for the Payment Connector APIs.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
### Stripe
<img width="1191" alt="Screenshot 2025-04-02 at 5 04 26 PM" src="https://github.com/user-attachments/assets/29c5b2a7-bd54-42e1-907b-827927379f17" />
<img width="992" alt="image" src="https://github.com/user-attachments/assets/e7dc40b0-ddde-4c8d-bd5b-8496278d966e" />
### Bankofamerica
<img width="1197" alt="image" src="https://github.com/user-attachments/assets/f6b1526a-ac1d-4ef1-9e12-e8f92ba84229" />
<img width="1171" alt="image" src="https://github.com/user-attachments/assets/8c8f686d-cab5-4e82-af6b-77eb15a4f76b" />
### Hyperswitch
<img width="1214" alt="image" src="https://github.com/user-attachments/assets/a96a79c8-f16c-47bc-8367-2d92e1aef5e4" />
<img width="984" alt="image" src="https://github.com/user-attachments/assets/19306109-9c27-40fc-a6a6-8bd757a2c40e" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/bankofamerica/API Key/Delete API Key/event.test.js`
- `postman/collection-dir/hyperswitch/API Key/Delete API Key/event.test.js`
- `postman/collection-dir/stripe/API Key/Delete API Key/event.test.js`
**2. Other**
- `postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/request.json`
- `postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/request.json`
- `postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payout Connector - Create/request.json`
- ... and 66 more files
|
{"pr_number": 7702, "pr_title": "chore(postman): update auth for payment connectors in postman collection", "merged_at": "2025-04-04T09:42:24Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"tests": ["postman/collection-dir/bankofamerica/API Key/Delete API Key/event.test.js", "postman/collection-dir/hyperswitch/API Key/Delete API Key/event.test.js", "postman/collection-dir/stripe/API Key/Delete API Key/event.test.js"], "other": ["postman/collection-dir/aci/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/adyen_uk/Flow Testcases/QuickStart/Payout Connector - Create/request.json", "postman/collection-dir/airwallex/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/authorizedotnet/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/authorizedotnet/Flow Testcases/Variation Cases/Scenario12-Failed case for wrong api keys/Payment Connector - Update/request.json", "postman/collection-dir/bambora/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/bambora_3ds/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/bankofamerica/API Key/.meta.json", "postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json", "postman/collection-dir/bankofamerica/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json", "postman/collection-dir/bankofamerica/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/bankofamerica/PaymentConnectors/.meta.json", "postman/collection-dir/bankofamerica/API Key/Delete API Key/.event.meta.json", "postman/collection-dir/bankofamerica/API Key/Delete API Key/request.json", "postman/collection-dir/bankofamerica/API Key/Delete API Key/response.json", "postman/collection-dir/bankofamerica/PaymentConnectors/List Connectors by MID/request.json", "postman/collection-dir/bankofamerica/PaymentConnectors/Payment Connector - Create/request.json", "postman/collection-dir/bankofamerica/PaymentConnectors/Payment Connector - Retrieve/request.json", "postman/collection-dir/bankofamerica/PaymentConnectors/Payment Connector - Update/request.json", "postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/braintree/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/checkout/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/cybersource/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/forte/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/globalpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/hyperswitch/API Key/.meta.json", "postman/collection-dir/hyperswitch/Hackathon/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/hyperswitch/PaymentConnectors/.meta.json", "postman/collection-dir/hyperswitch/API Key/Delete API Key/.event.meta.json", "postman/collection-dir/hyperswitch/API Key/Delete API Key/request.json", "postman/collection-dir/hyperswitch/API Key/Delete API Key/response.json", "postman/collection-dir/hyperswitch/PaymentConnectors/List Connectors by MID/request.json", "postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Create/request.json", "postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Retrieve/request.json", "postman/collection-dir/hyperswitch/PaymentConnectors/Payment Connector - Update/request.json", "postman/collection-dir/hyperswitch/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/mollie/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/multisafepay/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/multisafepay/Flow Testcases/Variation Cases/Scenario6- Create payment with Invalid Merchant ID/Payment Connector - Update/request.json", "postman/collection-dir/nexinets/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/nmi/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/nuvei/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/payme/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/paypal/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/powertranz/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/prophetpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/rapyd/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/shift4/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/stripe/API Key/.meta.json", "postman/collection-dir/stripe/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/stripe/PaymentConnectors/.meta.json", "postman/collection-dir/stripe/API Key/Delete API Key/.event.meta.json", "postman/collection-dir/stripe/API Key/Delete API Key/request.json", "postman/collection-dir/stripe/API Key/Delete API Key/response.json", "postman/collection-dir/stripe/PaymentConnectors/List Connectors by MID/request.json", "postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create Multiple/Create First Connector/request.json", "postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create Multiple/Create Second Connector/request.json", "postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Create/request.json", "postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Retrieve/request.json", "postman/collection-dir/stripe/PaymentConnectors/Payment Connector - Update/request.json", "postman/collection-dir/stripe/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/stripe/QuickStart/Payment Connector - Update/request.json", "postman/collection-dir/trustpay/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/volt/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/wise/Flow Testcases/QuickStart/Payout Connector - Create/request.json", "postman/collection-dir/worldline/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/zen/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/zsl/Flow Testcases/QuickStart/Payment Connector - Create/request.json"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(utils): use to_state_code of hyperswitch_connectors in router
## 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 -->
to_state_code method of router is not updated so the implementation from hyperswitch_connectors needs to be used and the one from router is depreciated.
Note: Contains remaning European countries for ISO conversion
Note: hotfix against https://github.com/juspay/hyperswitch/pull/7278
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Sanity External 3DS payment, by sending billing_address in payment_method_data for Poland country address
CURL
```
curl --location 'localhost:8080/payments/pay_MRVy1jlxGGGZafdE7xsJ/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_d3a60dc7950549aa954219ca29746442' \
--data '{
"client_secret": "pay_MRVy1jlxGGGZafdE7xsJ_secret_at05FqOzGfMCtJ3bRw4Y",
"device_channel": "BRW",
"threeds_method_comp_ind": "Y"
}'
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/utils.rs`
- `crates/router/src/connector/netcetera/netcetera_types.rs`
- `crates/router/src/connector/threedsecureio/transformers.rs`
- ... and 1 more files
**2. Configuration Files**
- `.typos.toml`
**3. Other**
- `crates/common_enums/src/enums.rs`
**Code Patterns Applied:**
- Implement new functions (9 changes)
- Extend existing types with new fields (9 changes)
**Detailed Identifier Changes:**
Commit f63d7800:
Files to modify:
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::BelgiumStatesAbbreviation
- enum: pub::LuxembourgStatesAbbreviation
- enum: pub::RussiaStatesAbbreviation
- enum: pub::SanMarinoStatesAbbreviation
- enum: pub::SerbiaStatesAbbreviation
- enum: pub::SlovakiaStatesAbbreviation
- enum: pub::SloveniaStatesAbbreviation
- enum: pub::SwedenStatesAbbreviation
- enum: pub::UkraineStatesAbbreviation
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/router/src/connector/netcetera/netcetera_types.rs**
Modify existing code
**crates/router/src/connector/threedsecureio/transformers.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Remove:
- function: private::to_state_code
- function: private::to_state_code_as_optional
|
{"pr_number": 7303, "pr_title": "refactor(utils): use to_state_code of hyperswitch_connectors in router", "merged_at": "2025-02-19T09:27:16Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "connector"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/netcetera/netcetera_types.rs", "crates/router/src/connector/threedsecureio/transformers.rs", "crates/router/src/connector/utils.rs"], "config": [".typos.toml"], "other": ["crates/common_enums/src/enums.rs"]}, "change_types": {"functions_added": 9, "enums_added": 9, "fields_added": 9, "imports_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): Add type for fields in juspay threeds server
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Refactoring
## Description
<!-- Describe your changes in detail -->
Add type for fields in juspay threeds server
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Complied wasm in local terminal
<img width="917" height="396" alt="Screenshot 2025-10-08 at 3 48 48 PM" src="https://github.com/user-attachments/assets/380e43c9-43a1-4133-9be3-688b88c38208" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I 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. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
|
{"pr_number": 9744, "pr_title": "fix(core): Add type for fields in juspay threeds server", "merged_at": "2025-10-08T12:43:54Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): [NETCETERA] Add fix for netcetera authentication response
## 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 introduces the following struct fix for netcetera authentication response since `message_extension` is recieved in Netcetera's authentication response ARes and not in AReq.
**Current structure**
```
NetceteraAuthenticationSuccessResponse{
....
authentication_request: {
message_extension: Option<serde_json::Value>,
....
}
...
}
```
**Correct structure**
```
NetceteraAuthenticationSuccessResponse{
....
authentication_response: {
message_extension: Option<serde_json::Value>,
....
}
...
}
```
[Ref](https://docs.3dsecure.io/3dsv2/specification_231.html#attr-ARes-messageExtension) - 3dsecure.io docs highlights **message_extension**'s correct placement i.e ARes. Adding reference to 3dsecure.io docs since Netcetera documentation is not super clear.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
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)?
-->
`message_extension` field for Netcetera's authentication response is only available in prod
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [X] I formatted the code `cargo +nightly fmt --all`
- [X] I addressed lints thrown by `cargo clippy`
- [X] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit e2d72bef:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs**
Modify existing code
|
{"pr_number": 9077, "pr_title": "fix(connector): [NETCETERA] Add fix for netcetera authentication response", "merged_at": "2025-09-02T13:35:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(payments): automatic connector_payment_id hashing in v2 if length > 128
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Implement hashing in PaymentAttemptUpdate conversion by using ConnectorTransactionId::form_id_and_data, setting connector_payment_id to the hash and preserving the original in connector_payment_data.For worldpay connector_payment_id should be less then 128 so after this original payment_id will be stored in connector_payment_data and hased id will be stored in connector_payment_id that is less than 128.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
If connector transaction id is more than 128 then payment intents are failing.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Request:
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0198ccb7376f74a38cad615be26fa5a8/confirm-intent' \
--header 'x-profile-id: pro_ODIfdcDxqoiMbqheIsJk' \
--header 'x-client-secret: cs_0198ccb737837d90b70939489421999b' \
--header 'Authorization: api-key=dev_uf0UlpOafwdX9RSG1PcLVpW7X2QBwM9h3XQ0dYplnSaUxz19t18ylXpa7KcLMZK5' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_1c90c0f7679f4edd8544c8dfe39fc46d' \
--data '{
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "John Doe",
"card_cvc": "100"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"browser_info": {
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
"accept_header": "text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,*\\/*;q=0.8",
"language": "en-GB",
"color_depth": 24,
"screen_height": 1440,
"screen_width": 2560,
"time_zone": -330,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "0.0.0.0"
}
}'
```
Response:
```
{
"id": "12345_pay_0198ccb7376f74a38cad615be26fa5a8",
"status": "succeeded",
"amount": {
"order_amount": 100,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 100
},
"customer_id": null,
"connector": "worldpay",
"created": "2025-08-21T13:00:16.122Z",
"payment_method_data": {
"billing": null
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector_transaction_id": "eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT9TAfq0WMxFYyAoD6mMf6Crhf7XoNg6BSaRfnbGX:1Ranv7RKyexxN4UZGNvq4ZuRjjszRbCOMdf1GwWUwp05qAqWWPHGXgnjILdaJfxgAakBurvk:7t7Hx793s0jicYqEU4sbE4TxIcxVuGWepjm49witK5xZ3XDNLML2TKoEMEhI+bQbMnX8zOFyl9tDujZnveoWvbcKsU0kCH69a7ZfVd6u38N8OTvVGU+L0IvQTMgnGh5Fkg:0WwlgnJokKmtPBi4oU3Cnnm+nW8BSObf1OW7W1blA9xV3jt84HBWb3g==",
"connector_reference_id": "6632a554-bf74-46cb-be9c-c03c0f6e597d",
"merchant_connector_id": "mca_fRb8a8ohINpIeEdELcwq",
"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="1325" height="1039" alt="image" src="https://github.com/user-attachments/assets/a4d6841d-2819-4605-b2ac-f848ecaa468a" />
<img width="1721" height="205" alt="image" src="https://github.com/user-attachments/assets/850533c8-a55f-49fb-b1a4-acc3b88d692c" />
closes #9016
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (204 changes)
**Detailed Identifier Changes:**
Commit 97ae3203:
Files to modify:
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
|
{"pr_number": 9017, "pr_title": "fix(payments): automatic connector_payment_id hashing in v2 if length > 128", "merged_at": "2025-09-01T14:34:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs"]}, "change_types": {"functions_added": 1, "fields_added": 204}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(users): Mark user as verified if user logins from SSO
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Currently we are not marking users as verified if the user comes from SSO and there is no other way to verify if SSO is the only login method that is available.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 #6693.
## How did you test 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:9000/api/user/oidc' \
-H 'Content-Type: application/json' \
--data-raw '{"code":"okta oidc code","state":"okta oidc state"}'
```
- The above curl when hit correctly should verify the user if the user was unverified.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/user.rs`
**Code Patterns Applied:**
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 880ad1e8:
Files to modify:
**crates/router/src/core/user.rs**
Modify existing code
|
{"pr_number": 6694, "pr_title": "fix(users): Mark user as verified if user logins from SSO", "merged_at": "2024-11-29T10:52:38Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"core_business": ["crates/router/src/core/user.rs"]}, "change_types": {"conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [BRAINTREE] Paypal wallet added
## 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 -->
`Paypal` wallet added in `BRAINTREE`.
API contract changes are done in `PaypalSessionTokenResponse` because we would need more details (client_token, amount, currency, etc) in session token response as mentioned in the test cases.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
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)?
-->
SDK (because braintree supports third party SDK) and dashboard changes are required for paypal in Braintree.
PMD shouldn't be passed in payment-intent to fetch session-token for braintree. [Ref](https://github.com/juspay/hyperswitch/pull/8728#issuecomment-3389887380)
<details>
<summary>1. Session Token</summary>
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'x-merchant-domain: https://popular-grasshopper-95.telebit.io' \
--header 'api-key: pk_dev_d9bc174655254b479705763816e61259' \
--data '{
"payment_id": "pay_z7h5aBGzTHwYhw4Aw5WC",
"wallets": [],
"client_secret": "pay_z7h5aBGzTHwYhw4Aw5WC_secret_hIDNsxR1lOzC5AQydKKy"
}
'
```
Response:
```
{
"payment_id": "pay_z7h5aBGzTHwYhw4Aw5WC",
"client_secret": "pay_z7h5aBGzTHwYhw4Aw5WC_secret_hIDNsxR1lOzC5AQydKKy",
"session_token": [
{
"wallet_name": "paypal",
"connector": "braintree",
"session_token": "ASKAGh2WXgqfQ5TzjpZzLsfhVGlFbjq5VrV5IOX8KXDD2N_XqkGeYNDkWyr_UXnfhXpEkABdmP284b_2",
"sdk_next_action": {
"next_action": "confirm"
},
"client_token": "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiJleUowZVhBaU9pSktWMVFpTENKaGJHY2lPaUpGVXpJMU5pSXNJbXRwWkNJNklqSXdNVGd3TkRJMk1UWXRjMkZ1WkdKdmVDSXNJbWx6Y3lJNkltaDBkSEJ6T2k4dllYQnBMbk5oYm1SaWIzZ3VZbkpoYVc1MGNtVmxaMkYwWlhkaGVTNWpiMjBpZlEuZXlKbGVIQWlPakUzTlRVd016VTNNek1zSW1wMGFTSTZJakkxTjJKaU16VTJMV1JqTkRFdE5EUmlOaTFoT0dRekxUQXpNR1ZpWkdKaE0yRXdNU0lzSW5OMVlpSTZJbWR6Wm5BMmJubG5lVE5rZW1JNGMyc2lMQ0pwYzNNaU9pSm9kSFJ3Y3pvdkwyRndhUzV6WVc1a1ltOTRMbUp5WVdsdWRISmxaV2RoZEdWM1lYa3VZMjl0SWl3aWJXVnlZMmhoYm5RaU9uc2ljSFZpYkdsalgybGtJam9pWjNObWNEWnVlV2Q1TTJSNllqaHpheUlzSW5abGNtbG1lVjlqWVhKa1gySjVYMlJsWm1GMWJIUWlPbVpoYkhObExDSjJaWEpwWm5sZmQyRnNiR1YwWDJKNVgyUmxabUYxYkhRaU9tWmhiSE5sZlN3aWNtbG5hSFJ6SWpwYkltMWhibUZuWlY5MllYVnNkQ0pkTENKelkyOXdaU0k2V3lKQ2NtRnBiblJ5WldVNlZtRjFiSFFpTENKQ2NtRnBiblJ5WldVNlFWaFBJbDBzSW05d2RHbHZibk1pT25zaWJXVnlZMmhoYm5SZllXTmpiM1Z1ZEY5cFpDSTZJa0Z1WVc1a0lpd2ljR0Y1Y0dGc1gyTnNhV1Z1ZEY5cFpDSTZJa0ZUUzBGSGFESlhXR2R4WmxFMVZIcHFjRnA2VEhObWFGWkhiRVppYW5FMVZuSldOVWxQV0RoTFdFUkVNazVmV0hGclIyVlpUa1JyVjNseVgxVllibVpvV0hCRmEwRkNaRzFRTWpnMFlsOHlJbjE5Lk5FczRibmdHWUtGblF2T3BxTm9BdW1uY0VOUjFObDQ3LXlGZ1JYWG5NbktkNURnaDRlRWVQdDViWXVsSGpMWUtzNW9pd0IzeFIycDk1VnFxcnFZRERRIiwiY29uZmlnVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2dzZnA2bnlneTNkemI4c2svY2xpZW50X2FwaS92MS9jb25maWd1cmF0aW9uIiwibWVyY2hhbnRBY2NvdW50SWQiOiJBbmFuZCIsImdyYXBoUUwiOnsidXJsIjoiaHR0cHM6Ly9wYXltZW50cy5zYW5kYm94LmJyYWludHJlZS1hcGkuY29tL2dyYXBocWwiLCJkYXRlIjoiMjAxOC0wNS0wOCIsImZlYXR1cmVzIjpbInRva2VuaXplX2NyZWRpdF9jYXJkcyJdfSwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2dzZnA2bnlneTNkemI4c2svY2xpZW50X2FwaSIsImVudmlyb25tZW50Ijoic2FuZGJveCIsIm1lcmNoYW50SWQiOiJnc2ZwNm55Z3kzZHpiOHNrIiwiYXNzZXRzVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhdXRoVXJsIjoiaHR0cHM6Ly9hdXRoLnZlbm1vLnNhbmRib3guYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJ2ZW5tbyI6Im9mZiIsImNoYWxsZW5nZXMiOltdLCJ0aHJlZURTZWN1cmVFbmFibGVkIjp0cnVlLCJhbmFseXRpY3MiOnsidXJsIjoiaHR0cHM6Ly9vcmlnaW4tYW5hbHl0aWNzLXNhbmQuc2FuZGJveC5icmFpbnRyZWUtYXBpLmNvbS9nc2ZwNm55Z3kzZHpiOHNrIn0sImFwcGxlUGF5Ijp7ImNvdW50cnlDb2RlIjoiVVMiLCJjdXJyZW5jeUNvZGUiOiJVU0QiLCJtZXJjaGFudElkZW50aWZpZXIiOiJtZXJjaGFudC5jb20uYWR5ZW4uc2FuIiwic3RhdHVzIjoibW9jayIsInN1cHBvcnRlZE5ldHdvcmtzIjpbInZpc2EiLCJtYXN0ZXJjYXJkIiwiYW1leCIsImRpc2NvdmVyIl19LCJwYXlwYWxFbmFibGVkIjp0cnVlLCJwYXlwYWwiOnsiYmlsbGluZ0FncmVlbWVudHNFbmFibGVkIjp0cnVlLCJlbnZpcm9ubWVudE5vTmV0d29yayI6ZmFsc2UsInVudmV0dGVkTWVyY2hhbnQiOmZhbHNlLCJhbGxvd0h0dHAiOnRydWUsImRpc3BsYXlOYW1lIjoiSnVzcGF5IiwiY2xpZW50SWQiOiJBU0tBR2gyV1hncWZRNVR6anBaekxzZmhWR2xGYmpxNVZyVjVJT1g4S1hERDJOX1hxa0dlWU5Ea1d5cl9VWG5maFhwRWtBQmRtUDI4NGJfMiIsImFjY291bnROdW1iZXIiOm51bGwsImJhc2VVcmwiOiJodHRwczovL2Fzc2V0cy5icmFpbnRyZWVnYXRld2F5LmNvbSIsImFzc2V0c1VybCI6Imh0dHBzOi8vY2hlY2tvdXQucGF5cGFsLmNvbSIsImRpcmVjdEJhc2VVcmwiOm51bGwsImVudmlyb25tZW50Ijoib2ZmbGluZSIsImJyYWludHJlZUNsaWVudElkIjoibWFzdGVyY2xpZW50MyIsIm1lcmNoYW50QWNjb3VudElkIjoiQW5hbmQiLCJjdXJyZW5jeUlzb0NvZGUiOiJVU0QifX0=",
"transaction_info": {
"flow": "checkout",
"currency_code": "USD",
"total_price": "65.40"
}
},
{
"wallet_name": "google_pay",
"merchant_info": {
"merchant_name": "Braintree Merchant"
},
"shipping_address_required": false,
"email_required": false,
"shipping_address_parameters": {
"phone_number_required": false
},
"allowed_payment_methods": [],
"transaction_info": {
"country_code": "US",
"currency_code": "USD",
"total_price_status": "FINAL",
"total_price": "65.40"
},
"delayed_session_token": false,
"connector": "braintree",
"sdk_next_action": {
"next_action": "confirm"
},
"secrets": {
"display": "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiJleUowZVhBaU9pSktWMVFpTENKaGJHY2lPaUpGVXpJMU5pSXNJbXRwWkNJNklqSXdNVGd3TkRJMk1UWXRjMkZ1WkdKdmVDSXNJbWx6Y3lJNkltaDBkSEJ6T2k4dllYQnBMbk5oYm1SaWIzZ3VZbkpoYVc1MGNtVmxaMkYwWlhkaGVTNWpiMjBpZlEuZXlKbGVIQWlPakUzTlRVd016VTNNeklzSW1wMGFTSTZJbVZoWTJReE5tUTBMVFF6TURNdE5ERm1OaTFpWWpabExUY3dNbUpsWXpJNVptRTVNeUlzSW5OMVlpSTZJbWR6Wm5BMmJubG5lVE5rZW1JNGMyc2lMQ0pwYzNNaU9pSm9kSFJ3Y3pvdkwyRndhUzV6WVc1a1ltOTRMbUp5WVdsdWRISmxaV2RoZEdWM1lYa3VZMjl0SWl3aWJXVnlZMmhoYm5RaU9uc2ljSFZpYkdsalgybGtJam9pWjNObWNEWnVlV2Q1TTJSNllqaHpheUlzSW5abGNtbG1lVjlqWVhKa1gySjVYMlJsWm1GMWJIUWlPbVpoYkhObExDSjJaWEpwWm5sZmQyRnNiR1YwWDJKNVgyUmxabUYxYkhRaU9tWmhiSE5sZlN3aWNtbG5hSFJ6SWpwYkltMWhibUZuWlY5MllYVnNkQ0pkTENKelkyOXdaU0k2V3lKQ2NtRnBiblJ5WldVNlZtRjFiSFFpTENKQ2NtRnBiblJ5WldVNlFWaFBJbDBzSW05d2RHbHZibk1pT25zaWJXVnlZMmhoYm5SZllXTmpiM1Z1ZEY5cFpDSTZJa0Z1WVc1a0lpd2ljR0Y1Y0dGc1gyTnNhV1Z1ZEY5cFpDSTZJa0ZUUzBGSGFESlhXR2R4WmxFMVZIcHFjRnA2VEhObWFGWkhiRVppYW5FMVZuSldOVWxQV0RoTFdFUkVNazVmV0hGclIyVlpUa1JyVjNseVgxVllibVpvV0hCRmEwRkNaRzFRTWpnMFlsOHlJbjE5Lk84cktrUTRfTHctYi1wbkZJRVdqWkVZNDQ5aE5tSXBzc2RzZDMzQzRjenRoQ2FadF9kM3pMM2xaNDB6LWZIVC16N3ZyN1hSS0NXZnZicmprY0ZnZnhRIiwiY29uZmlnVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2dzZnA2bnlneTNkemI4c2svY2xpZW50X2FwaS92MS9jb25maWd1cmF0aW9uIiwibWVyY2hhbnRBY2NvdW50SWQiOiJBbmFuZCIsImdyYXBoUUwiOnsidXJsIjoiaHR0cHM6Ly9wYXltZW50cy5zYW5kYm94LmJyYWludHJlZS1hcGkuY29tL2dyYXBocWwiLCJkYXRlIjoiMjAxOC0wNS0wOCIsImZlYXR1cmVzIjpbInRva2VuaXplX2NyZWRpdF9jYXJkcyJdfSwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2dzZnA2bnlneTNkemI4c2svY2xpZW50X2FwaSIsImVudmlyb25tZW50Ijoic2FuZGJveCIsIm1lcmNoYW50SWQiOiJnc2ZwNm55Z3kzZHpiOHNrIiwiYXNzZXRzVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhdXRoVXJsIjoiaHR0cHM6Ly9hdXRoLnZlbm1vLnNhbmRib3guYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJ2ZW5tbyI6Im9mZiIsImNoYWxsZW5nZXMiOltdLCJ0aHJlZURTZWN1cmVFbmFibGVkIjp0cnVlLCJhbmFseXRpY3MiOnsidXJsIjoiaHR0cHM6Ly9vcmlnaW4tYW5hbHl0aWNzLXNhbmQuc2FuZGJveC5icmFpbnRyZWUtYXBpLmNvbS9nc2ZwNm55Z3kzZHpiOHNrIn0sImFwcGxlUGF5Ijp7ImNvdW50cnlDb2RlIjoiVVMiLCJjdXJyZW5jeUNvZGUiOiJVU0QiLCJtZXJjaGFudElkZW50aWZpZXIiOiJtZXJjaGFudC5jb20uYWR5ZW4uc2FuIiwic3RhdHVzIjoibW9jayIsInN1cHBvcnRlZE5ldHdvcmtzIjpbInZpc2EiLCJtYXN0ZXJjYXJkIiwiYW1leCIsImRpc2NvdmVyIl19LCJwYXlwYWxFbmFibGVkIjp0cnVlLCJwYXlwYWwiOnsiYmlsbGluZ0FncmVlbWVudHNFbmFibGVkIjp0cnVlLCJlbnZpcm9ubWVudE5vTmV0d29yayI6ZmFsc2UsInVudmV0dGVkTWVyY2hhbnQiOmZhbHNlLCJhbGxvd0h0dHAiOnRydWUsImRpc3BsYXlOYW1lIjoiSnVzcGF5IiwiY2xpZW50SWQiOiJBU0tBR2gyV1hncWZRNVR6anBaekxzZmhWR2xGYmpxNVZyVjVJT1g4S1hERDJOX1hxa0dlWU5Ea1d5cl9VWG5maFhwRWtBQmRtUDI4NGJfMiIsImFjY291bnROdW1iZXIiOm51bGwsImJhc2VVcmwiOiJodHRwczovL2Fzc2V0cy5icmFpbnRyZWVnYXRld2F5LmNvbSIsImFzc2V0c1VybCI6Imh0dHBzOi8vY2hlY2tvdXQucGF5cGFsLmNvbSIsImRpcmVjdEJhc2VVcmwiOm51bGwsImVudmlyb25tZW50Ijoib2ZmbGluZSIsImJyYWludHJlZUNsaWVudElkIjoibWFzdGVyY2xpZW50MyIsIm1lcmNoYW50QWNjb3VudElkIjoiQW5hbmQiLCJjdXJyZW5jeUlzb0NvZGUiOiJVU0QifX0=",
"payment": null
}
},
{
"wallet_name": "apple_pay",
"session_token_data": {
"secrets": {
"display": "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiJleUowZVhBaU9pSktWMVFpTENKaGJHY2lPaUpGVXpJMU5pSXNJbXRwWkNJNklqSXdNVGd3TkRJMk1UWXRjMkZ1WkdKdmVDSXNJbWx6Y3lJNkltaDBkSEJ6T2k4dllYQnBMbk5oYm1SaWIzZ3VZbkpoYVc1MGNtVmxaMkYwWlhkaGVTNWpiMjBpZlEuZXlKbGVIQWlPakUzTlRVd016VTNNek1zSW1wMGFTSTZJbVkzTXpnNU9EVTBMVFE0TnpndE5HTTVNQzFpTW1NMUxUWXpZVEkwWkdVeU56Vm1OeUlzSW5OMVlpSTZJbWR6Wm5BMmJubG5lVE5rZW1JNGMyc2lMQ0pwYzNNaU9pSm9kSFJ3Y3pvdkwyRndhUzV6WVc1a1ltOTRMbUp5WVdsdWRISmxaV2RoZEdWM1lYa3VZMjl0SWl3aWJXVnlZMmhoYm5RaU9uc2ljSFZpYkdsalgybGtJam9pWjNObWNEWnVlV2Q1TTJSNllqaHpheUlzSW5abGNtbG1lVjlqWVhKa1gySjVYMlJsWm1GMWJIUWlPbVpoYkhObExDSjJaWEpwWm5sZmQyRnNiR1YwWDJKNVgyUmxabUYxYkhRaU9tWmhiSE5sZlN3aWNtbG5hSFJ6SWpwYkltMWhibUZuWlY5MllYVnNkQ0pkTENKelkyOXdaU0k2V3lKQ2NtRnBiblJ5WldVNlZtRjFiSFFpTENKQ2NtRnBiblJ5WldVNlFWaFBJbDBzSW05d2RHbHZibk1pT25zaWJXVnlZMmhoYm5SZllXTmpiM1Z1ZEY5cFpDSTZJa0Z1WVc1a0lpd2ljR0Y1Y0dGc1gyTnNhV1Z1ZEY5cFpDSTZJa0ZUUzBGSGFESlhXR2R4WmxFMVZIcHFjRnA2VEhObWFGWkhiRVppYW5FMVZuSldOVWxQV0RoTFdFUkVNazVmV0hGclIyVlpUa1JyVjNseVgxVllibVpvV0hCRmEwRkNaRzFRTWpnMFlsOHlJbjE5Lm5nUHU2dkxlQ3g1bDZDclltMlJfWC1hWHdfZ3Q5ZkVMQ3BnQTc2US11bXJTMjRYdDNKLWNsOWdkM3JiZWZ5UDJOQ0VmRVpkUTMteW1pODVXTzR1NDBBIiwiY29uZmlnVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2dzZnA2bnlneTNkemI4c2svY2xpZW50X2FwaS92MS9jb25maWd1cmF0aW9uIiwibWVyY2hhbnRBY2NvdW50SWQiOiJBbmFuZCIsImdyYXBoUUwiOnsidXJsIjoiaHR0cHM6Ly9wYXltZW50cy5zYW5kYm94LmJyYWludHJlZS1hcGkuY29tL2dyYXBocWwiLCJkYXRlIjoiMjAxOC0wNS0wOCIsImZlYXR1cmVzIjpbInRva2VuaXplX2NyZWRpdF9jYXJkcyJdfSwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2dzZnA2bnlneTNkemI4c2svY2xpZW50X2FwaSIsImVudmlyb25tZW50Ijoic2FuZGJveCIsIm1lcmNoYW50SWQiOiJnc2ZwNm55Z3kzZHpiOHNrIiwiYXNzZXRzVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhdXRoVXJsIjoiaHR0cHM6Ly9hdXRoLnZlbm1vLnNhbmRib3guYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJ2ZW5tbyI6Im9mZiIsImNoYWxsZW5nZXMiOltdLCJ0aHJlZURTZWN1cmVFbmFibGVkIjp0cnVlLCJhbmFseXRpY3MiOnsidXJsIjoiaHR0cHM6Ly9vcmlnaW4tYW5hbHl0aWNzLXNhbmQuc2FuZGJveC5icmFpbnRyZWUtYXBpLmNvbS9nc2ZwNm55Z3kzZHpiOHNrIn0sImFwcGxlUGF5Ijp7ImNvdW50cnlDb2RlIjoiVVMiLCJjdXJyZW5jeUNvZGUiOiJVU0QiLCJtZXJjaGFudElkZW50aWZpZXIiOiJtZXJjaGFudC5jb20uYWR5ZW4uc2FuIiwic3RhdHVzIjoibW9jayIsInN1cHBvcnRlZE5ldHdvcmtzIjpbInZpc2EiLCJtYXN0ZXJjYXJkIiwiYW1leCIsImRpc2NvdmVyIl19LCJwYXlwYWxFbmFibGVkIjp0cnVlLCJwYXlwYWwiOnsiYmlsbGluZ0FncmVlbWVudHNFbmFibGVkIjp0cnVlLCJlbnZpcm9ubWVudE5vTmV0d29yayI6ZmFsc2UsInVudmV0dGVkTWVyY2hhbnQiOmZhbHNlLCJhbGxvd0h0dHAiOnRydWUsImRpc3BsYXlOYW1lIjoiSnVzcGF5IiwiY2xpZW50SWQiOiJBU0tBR2gyV1hncWZRNVR6anBaekxzZmhWR2xGYmpxNVZyVjVJT1g4S1hERDJOX1hxa0dlWU5Ea1d5cl9VWG5maFhwRWtBQmRtUDI4NGJfMiIsImFjY291bnROdW1iZXIiOm51bGwsImJhc2VVcmwiOiJodHRwczovL2Fzc2V0cy5icmFpbnRyZWVnYXRld2F5LmNvbSIsImFzc2V0c1VybCI6Imh0dHBzOi8vY2hlY2tvdXQucGF5cGFsLmNvbSIsImRpcmVjdEJhc2VVcmwiOm51bGwsImVudmlyb25tZW50Ijoib2ZmbGluZSIsImJyYWludHJlZUNsaWVudElkIjoibWFzdGVyY2xpZW50MyIsIm1lcmNoYW50QWNjb3VudElkIjoiQW5hbmQiLCJjdXJyZW5jeUlzb0NvZGUiOiJVU0QifX0=",
"payment": null
}
},
"payment_request_data": {
"country_code": "US",
"currency_code": "USD",
"total": {
"label": "applepay",
"type": null,
"amount": "65.40"
},
"merchant_capabilities": [
"supports3DS"
],
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_identifier": null
},
"connector": "braintree",
"delayed_session_token": false,
"sdk_next_action": {
"next_action": "confirm"
},
"connector_reference_id": null,
"connector_sdk_public_key": null,
"connector_merchant_id": null
}
]
}
```
</details>
<details>
<summary>2. Paypal</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_LyW7U8k5lBfnRiPjF75igyRatN0xh1g7cYbUW4pJiuZnmlaVOzeY0mw4bREoiQxh' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"amount_to_capture": 6540,
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "no_three_ds",
"setup_future_usage": "on_session",
"customer": {
"id": "customer123",
"name": "John Doe",
"email": "[email protected]",
"phone": "9999999999",
"phone_country_code": "+1"
},
"customer_id": "customer123",
"phone_country_code": "+1",
"routing": {
"type": "single",
"data": "stripe"
},
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "wallet",
"payment_method_type": "paypal",
"payment_method_data": {
"wallet": {
"paypal_sdk": {
"token": "b31837e5-c04e-1926-755a-8236ff8ef5e5"
}
}
},
"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": "[email protected]"
},
"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": "[email protected]"
},
"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_6b0waAI3jjWziaxxmGwU","merchant_id":"merchant_1754943264","status":"succeeded","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":0,"amount_received":6540,"connector":"braintree","client_secret":"pay_6b0waAI3jjWziaxxmGwU_secret_C16kSabSeIECI3GAnDPg","created":"2025-08-12T07:32:15.043Z","currency":"USD","customer_id":"customer123","customer":{"id":"customer123","name":"John Doe","email":"[email protected]","phone":"9999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"wallet","payment_method_data":{"wallet":{},"billing":null},"payment_token":null,"shipping":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"joseph","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"joseph","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":[{"sku":null,"upc":null,"brand":null,"amount":6540,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"description":null,"product_name":"Apple iphone 15","product_type":null,"sub_category":null,"total_amount":null,"commodity_code":null,"unit_of_measure":null,"product_img_link":null,"product_tax_code":null,"total_tax_amount":null,"requires_shipping":null,"unit_discount_amount":null}],"email":"[email protected]","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":"paypal","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":1754983934,"expires":1754987534,"secret":"epk_8e58911506de412686f6930dba01bd96"},"manual_retry_allowed":false,"connector_transaction_id":"dHJhbnNhY3Rpb25fMDE1djVtc2M","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":{"apple_pay":null,"airwallex":null,"noon":{"order_category":"pay"},"braintree":null,"adyen":null},"feature_metadata":{"redirect_response":null,"search_tags":null,"apple_pay_recurring_details":null,"gateway_system":"direct"},"reference_id":null,"payment_link":null,"profile_id":"pro_UF7x1VUr8LV9gu1lQwn1","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_HrBB5GxZaPbMIZm9sAkO","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-08-12T07:47:15.043Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"128.0.0.1","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":null,"payment_method_status":null,"updated":"2025-08-12T07:32:18.945Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":"test_ord","order_tax_amount":null,"connector_mandate_id":null,"card_discovery":null,"force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null,"enable_partial_authorization":null}
```
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/flows/session_flow.rs`
**3. 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
**4. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/openapi/src/openapi.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (27 changes)
**Detailed Identifier Changes:**
Commit f71090a9:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::PaypalTransactionInfo
- enum: pub::PaypalFlow
**crates/hyperswitch_connectors/src/connectors/braintree.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/payments/flows/session_flow.rs**
Modify existing code
|
{"pr_number": 8984, "pr_title": "feat(connector): [BRAINTREE] Paypal wallet added", "merged_at": "2025-10-09T15:25:24Z", "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"], "connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/braintree.rs", "crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 1, "functions_added": 1, "enums_added": 2, "fields_added": 27}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(revenue_recovery): Implement redis API to update the lock status for connector customer 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 API updates the lock status of customer token to unlock in revenue recovery.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
cURL:-
```
curl --location --request POST 'http://localhost:8080/v2/recovery/data-backfill/status/fake_token_number' \
--header 'Authorization: admin-api-key=' \
```
Response:-
```
{
"unlocked": true
}
```
Router logs:-
<img width="1058" height="759" alt="Screenshot 2025-09-16 at 18 30 15" src="https://github.com/user-attachments/assets/0a9de535-3b7f-4638-a941-bce5cfb5f4ad" />
Redis-cli logs:-
<img width="391" height="65" alt="Screenshot 2025-09-16 at 18 29 46" src="https://github.com/user-attachments/assets/d5f40b53-b4c0-46e1-9168-4420b43f2908" />
## Checklist
<!-- Put 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/revenue_recovery_data_backfill.rs`
**2. Core Business Logic**
- `crates/router/src/core/revenue_recovery_data_backfill.rs`
**3. Other**
- `crates/router/src/routes/app.rs`
- `crates/router/src/routes/revenue_recovery_data_backfill.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (4 changes)
- Extend existing types with new fields (6 changes)
**Detailed Identifier Changes:**
Commit 1d23e28a:
Files to modify:
**crates/api_models/src/revenue_recovery_data_backfill.rs**
Add:
- function: private::get_api_event_type
- struct: pub::UnlockStatusResponse
- impl: impl ApiEventMetric for UnlockStatusResponse
**crates/router/src/core/revenue_recovery_data_backfill.rs**
Add:
- function: pub::unlock_connector_customer_status
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/revenue_recovery_data_backfill.rs**
Add:
- function: pub::revenue_recovery_data_backfill_status
|
{"pr_number": 9403, "pr_title": "feat(revenue_recovery): Implement redis API to update the lock status for connector customer id", "merged_at": "2025-09-18T15:34:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "user", "token"]}, "hierarchy": {"api_models": ["crates/api_models/src/revenue_recovery_data_backfill.rs"], "core_business": ["crates/router/src/core/revenue_recovery_data_backfill.rs"], "other": ["crates/router/src/routes/app.rs", "crates/router/src/routes/revenue_recovery_data_backfill.rs"]}, "change_types": {"structs_added": 1, "functions_added": 4, "fields_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Loonio Webhooks
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Loomio webhooks for payments
## payment request
```json
{
"amount": 1500,
"currency": "CAD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "aaaa",
"authentication_type": "three_ds",
"payment_method": "bank_redirect",
"payment_method_type": "interac",
"payment_method_data": {
"bank_redirect": {
"interac": {}
}
},
"billing": {
"address": {
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"city": "Downtown Core",
"state": "Central Indiana America",
"zip": "039393",
"country": "SG",
"first_name": "Swangi",
"last_name": "Kumari"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
}
}
```
## response
```json
{
"payment_id": "pay_J3xaVGqCX1QbnGKyQoCQ",
"merchant_id": "merchant_1759821555",
"status": "requires_customer_action",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 1500,
"amount_received": null,
"connector": "loonio",
"client_secret": "pay_J3xaVGqCX1QbnGKyQoCQ_secret_IfvZo54PdakCzmi10muX",
"created": "2025-10-07T09:15:47.349Z",
"currency": "CAD",
"customer_id": "aaaa",
"customer": {
"id": "aaaa",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "bank_redirect",
"payment_method_data": {
"bank_redirect": {
"type": "BankRedirectResponse",
"bank_name": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Downtown Core",
"country": "SG",
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"zip": "039393",
"state": "Central Indiana America",
"first_name": "Swangi",
"last_name": "Kumari",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_J3xaVGqCX1QbnGKyQoCQ/merchant_1759821555/pay_J3xaVGqCX1QbnGKyQoCQ_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "interac",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "aaaa",
"created_at": 1759828547,
"expires": 1759832147,
"secret": "epk_dfb1c2f173f34c4da48ee0a98d48051f"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pay_J3xaVGqCX1QbnGKyQoCQ_1",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_MLEtbytGk3haqiqlaheV",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_UKE4wkdWmZVIs8oRKgbo",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-07T09:30:47.349Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-07T09:15:48.782Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
## make redirect
<img width="1708" height="1115" alt="Screenshot 2025-10-07 at 2 47 11 PM" src="https://github.com/user-attachments/assets/35ea68fa-8b86-48ef-9600-64916ebdaf2b" />
## the status will change when webhook reaches without force psync
<img width="1178" height="678" alt="Screenshot 2025-10-07 at 2 47 43 PM" src="https://github.com/user-attachments/assets/254d2a5f-eab1-4b15-988a-a353338d1536" />
## webhook source verificaiton = false
<img width="1085" height="311" alt="Screenshot 2025-10-07 at 6 15 09 PM" src="https://github.com/user-attachments/assets/0f21632f-0927-47ac-95b4-4593dcbb1633" />
<img width="648" height="246" alt="Screenshot 2025-10-07 at 6 15 21 PM" src="https://github.com/user-attachments/assets/1871af58-ce58-4c78-97d3-7c1502ab77ba" />
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/loonio.rs`
- `crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (4 changes)
- Extend existing types with new fields (37 changes)
**Detailed Identifier Changes:**
Commit 27a7845a:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/loonio.rs**
Add:
- function: private::verify_webhook_source
**crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs**
Add:
- function: private::from
- function: private::from
- struct: pub::LoonioWebhookBody
- enum: pub::LoonioWebhookTransactionType
- enum: pub::LoonioPaymentResponseData
- impl: impl From<&LoonioWebhookEventCode> for webhooks::IncomingWebhookEvent
- impl: impl From<&LoonioWebhookEventCode> for enums::AttemptStatus
|
{"pr_number": 9707, "pr_title": "feat(connector): Loonio Webhooks", "merged_at": "2025-10-07T17:37:38Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/loonio.rs", "crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs"]}, "change_types": {"structs_added": 1, "functions_added": 4, "enums_added": 3, "fields_added": 37, "imports_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(webhooks): adyen - consume and update connector's network_transaction_id in payment_methods
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Described in #6719
This PR introduces below changes
- `get_network_txn_id` fn in IncomingWebhook trait
- implement this new fn for Adyen for retrieving the network txn ID
- consume this fn in core flows for updating `network_transaction_id` in `payment_methods` table
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Helps persist network transaction IDs for connectors in case it was not present in Authorize or Capture responses but instead sent in the webhook!
## How did you test it?
- Ensure Adyen is configured in HS, along with webhooks!
- Ensure `network_tx_reference` (field in Adyen) is not returned in Authorize or Capture response
- This field should be populated in DB once webhooks are received (provided this field was also returned)
`network_transaction_id` is populated after receiving webhooks
<img width="1258" alt="Screenshot 2024-12-04 at 4 45 43 PM" src="https://github.com/user-attachments/assets/1caeb9cd-fd77-4b40-8aa5-01226c65c6b9">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_method.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs`
**3. Core Business Logic**
- `crates/router/src/core/webhooks/incoming.rs`
**4. External Connector Integration**
- `crates/router/src/connector/adyen.rs`
- `crates/router/src/connector/adyen/transformers.rs`
- `crates/router/src/services/connector_integration_interface.rs`
**5. Other**
- `crates/hyperswitch_interfaces/src/webhooks.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (5 changes)
- Extend existing types with new fields (27 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 871a3637:
Files to modify:
**crates/diesel_models/src/payment_method.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs**
Add:
- function: pub::new
- function: pub::get_id
- struct: pub::ConnectorNetworkTxnId
- impl: impl ConnectorNetworkTxnId
**crates/hyperswitch_interfaces/src/webhooks.rs**
Add:
- function: private::get_network_txn_id
**crates/router/src/connector/adyen.rs**
Add:
- function: private::get_network_txn_id
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/services/connector_integration_interface.rs**
Add:
- function: private::get_network_txn_id
|
{"pr_number": 6738, "pr_title": "feat(webhooks): adyen - consume and update connector's network_transaction_id in payment_methods", "merged_at": "2024-12-05T13:34:59Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"database": ["crates/diesel_models/src/payment_method.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_flow_types/webhooks.rs"], "core_business": ["crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/router/src/connector/adyen.rs", "crates/router/src/connector/adyen/transformers.rs", "crates/router/src/services/connector_integration_interface.rs"], "other": ["crates/hyperswitch_interfaces/src/webhooks.rs"]}, "change_types": {"structs_added": 1, "functions_added": 5, "fields_added": 27, "imports_added": 1, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(nuvei): Update countries list for nuvei
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
- Add missing countries and currencies for nuvei
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] 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`
- `loadtest/config/development.toml`
**2. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
|
{"pr_number": 9563, "pr_title": "fix(nuvei): Update countries list for nuvei", "merged_at": "2025-09-25T16:22:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
revert(routing): Add connectors from current active routing algorithm before adding fallback connectors
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Add fallback connectors to the list of eligible connectors for routing instead of connectors configured in the active routing rules
this PR reverts https://github.com/juspay/hyperswitch/pull/7921
Link for main branch revert PR - https://github.com/juspay/hyperswitch/pull/8207
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 #8210
## How did you test 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. Payment intent create
```
curl --location 'http://localhost:8080/vs/v1/payment_intents' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'User-Agent: helloMozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36' \
--header 'api-key: dev_HNJCTr3onNo0UnY29cikBPsTyLkRVBSS5iHAUwumtC****' \
--data-urlencode 'amount=5000' \
--data-urlencode 'currency=AED' \
--data-urlencode 'confirm=true' \
--data-urlencode 'payment_method_data%5Btype%5D=card' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bnumber%5D=4456530000001096' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bexp_month%5D=12' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bexp_year%5D=2030' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bcvc%5D=123' \
--data-urlencode 'connector%5B%5D=noon' \
--data-urlencode 'capture_method=automatic' \
--data-urlencode 'customer=sahkal' \
--data-urlencode 'statementDescriptorSuffix=merchant_101' \
--data-urlencode 'metadata%5BorderId%5D=1677581650' \
--data-urlencode 'payment_method_options%5Bcard%5D%5Brequest_three_d_secure%5D=automatic' \
--data-urlencode 'description=Card Payment' \
--data-urlencode 'off_session=true' \
--data-urlencode 'mandate_data%5Bcustomer_acceptance%5D%5Bonline%5D%5Buser_agent%5D=helloMozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36' \
--data-urlencode 'mandate_data%5Bcustomer_acceptance%5D%5Bonline%5D%5Bip_address%5D=123.32.25.123' \
--data-urlencode 'mandate_data%5Bamount%5D=20877' \
--data-urlencode 'setup_future_usage=off_session' \
--data-urlencode 'mandate_data%5Bmandate_type%5D=single_use' \
--data-urlencode 'mandate_data%5Bstart_date%5D=12127864781' \
--data-urlencode 'mandate_data%5Bend_date%5D=21312434324' \
--data-urlencode 'return_url=https://juspay.in' \
--data-urlencode 'merchant_connector_details%5Bencoded_data%5D=eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0.F1IBieprH7aT7fwe7p9ZtYdOv9JgoO87iALDjScYq9Y2H2yTvVEZLJ9aYs6ShMH3iieBdvwL7PwJ5k68qINzmHzKSYZ3cp5jGpyK5FjaoJu4zUAZbLcn-z4O6ajQ5OUZBjkqfkwo4SvQfM7ceg6_dLNbVa2dj9-YBp3pNfudc5eyKxIuvxDSmNSpoXr2Hr5Y2dDV5Z-15yfmcj-IDgZNibsUSSFuwqhHHfxk87HZRLM5-9kayXyfH4i_zdYleGR-iNX_OIzpJBpDeyJ_nbADgyi1NvBiNdDYiR-xCDuS0-DZZLVoOnJkbV23Q4XGkYRQSvI8VnWHKZhvqZi3-Nev7A.s4kCZx2KOzR50uoE.kdStc4m0EQ05J3nXd4EsxFgMj9Yp6Ji4JLRB7zjHGamjsMXwIBXhpFuexx58mqIueecXTOMz6nCjasgng8XKTKNBRsDshgFAzuO690--KQVIoSjADuRVuplTVgvg6xRaZN_cgdhfqo3DYS8MSALzoL0p1ylaAZuV_LGCJOLIcrhrP56xzmTX91tGHU3Dm1md.t-2pfHjICjZdya9g9WAxvQ' \
--data-urlencode 'merchant_connector_details%5Bcreds_identifier%5D=2025-06-04T08:02:45.485Z' \
--data-urlencode 'id=1749043393' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bname%5D=sahkal' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bemail%[email protected]' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bcity%5D=siliguri' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bcountry%5D=IN' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bstate%5D=westbengal' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bline1%5D=pritilata' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bzip%5D=734006' \
--data-urlencode 'metadata%5Btxn_Id%5D=sahkal_payment' \
--data-urlencode 'metadata%5BtxnUuid%5D=94hfdmoakosdkifdhaisl' \
--data-urlencode 'metadata%5Bmerchant_id%5D=sahkal' \
--data-urlencode 'metadata%5Beuler_merchant_id%5D=global_installment' \
--data-urlencode 'connector_metadata%5Bnoon%5D%5Border_category%5D=pay' \
--data-urlencode 'payment_method_data%5Bcard%5D%5Bholder_name%5D=sahkal'
```
2. Payment Intent Sync
request
```
curl --location 'http://localhost:8080/vs/v1/payment_intents/sync' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'idempodent-key: asfdasf' \
--header 'api-key: dev_HNJCTr3onNo0UnY29cikBPsTyLkRVBSS5iHAUwumtCN*****' \
--data-urlencode 'connector%5B%5D=noon' \
--data-urlencode 'merchant_connector_details%5Bencoded_data%5D=eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0.F1IBieprH7aT7fwe7p9ZtYdOv9JgoO87iALDjScYq9Y2H2yTvVEZLJ9aYs6ShMH3iieBdvwL7PwJ5k68qINzmHzKSYZ3cp5jGpyK5FjaoJu4zUAZbLcn-z4O6ajQ5OUZBjkqfkwo4SvQfM7ceg6_dLNbVa2dj9-YBp3pNfudc5eyKxIuvxDSmNSpoXr2Hr5Y2dDV5Z-15yfmcj-IDgZNibsUSSFuwqhHHfxk87HZRLM5-9kayXyfH4i_zdYleGR-iNX_OIzpJBpDeyJ_nbADgyi1NvBiNdDYiR-xCDuS0-DZZLVoOnJkbV23Q4XGkYRQSvI8VnWHKZhvqZi3-Nev7A.s4kCZx2KOzR50uoE.kdStc4m0EQ05J3nXd4EsxFgMj9Yp6Ji4JLRB7zjHGamjsMXwIBXhpFuexx58mqIueecXTOMz6nCjasgng8XKTKNBRsDshgFAzuO690--KQVIoSjADuRVuplTVgvg6xRaZN_cgdhfqo3DYS8MSALzoL0p1ylaAZuV_LGCJOLIcrhrP56xzmTX91tGHU3Dm1md.t-2pfHjICjZdya9g9WAxvQ' \
--data-urlencode 'payment_id=1749043226' \
--data-urlencode 'force_sync=true' \
--data-urlencode 'merchant_connector_details%5Bcreds_identifier%5D=2025-06-04T10:43:22.768Z'
```
response
```
{
"id": "1749043226",
"object": "payment_intent",
"amount": 5000,
"amount_received": 5000,
"amount_capturable": 0,
"currency": "aed",
"status": "succeeded",
"client_secret": "1749043226_secret_LvUNbfJaJkMi6izxIfzY",
"created": 1749043227,
"customer": "sahkal",
"refunds": null,
"mandate": null,
"metadata": {
"txn_Id": "sahkal_payment",
"orderId": "1677581650",
"txnUuid": "94hfdmoakosdkifdhaisl",
"merchant_id": "sahkal",
"euler_merchant_id": "global_installment"
},
"charges": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "http://placeholder"
},
"connector": "noon",
"description": "Card Payment",
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": true,
"authentication_type": "no_three_ds",
"next_action": null,
"cancellation_reason": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1096",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "445653",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "2030",
"card_holder_name": "sahkal",
"payment_checks": null,
"authentication_data": null
}
},
"shipping": null,
"billing": {
"address": {
"city": "siliguri",
"country": "IN",
"line1": "pritilata",
"line2": null,
"line3": null,
"zip": null,
"state": "westbengal",
"first_name": null,
"last_name": null
},
"phone": {
"number": null,
"country_code": "IN"
},
"email": "[email protected]"
},
"capture_on": null,
"payment_token": null,
"email": null,
"phone": null,
"statement_descriptor_suffix": null,
"statement_descriptor_name": null,
"capture_method": "automatic",
"name": null,
"last_payment_error": null,
"connector_transaction_id": "609246621589"
}
```
---
Apple pay testing
request
```
curl --location 'http://localhost:3030/vs/v1/payment_intents' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'User-Agent: EULER' \
--header 'api-key: dev_6HQ74YsSBdknkDwdGJnZPBC5cXCY5SHIkaLLCbYM6rbC******' \
--data-urlencode 'amount=1000' \
--data-urlencode 'currency=AED' \
--data-urlencode 'confirm=true' \
--data-urlencode 'payment_method_data%5Btype%5D=wallet' \
--data-urlencode 'connector%5B%5D=noon' \
--data-urlencode 'capture_method=automatic' \
--data-urlencode 'customer=sahkal' \
--data-urlencode 'statementDescriptorSuffix=merchant_101' \
--data-urlencode 'metadata%5BorderId%5D=1677581650' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bname%5D=sahkal' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bemail%[email protected]' \
--data-urlencode 'description=card Payment' \
--data-urlencode 'off_session=true' \
--data-urlencode 'merchant_connector_details%5Bencoded_data%5D=eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0.F1IBieprH7aT7fwe7p9ZtYdOv9JgoO87iALDjScYq9Y2H2yTvVEZLJ9aYs6ShMH3iieBdvwL7PwJ5k68qINzmHzKSYZ3cp5jGpyK5FjaoJu4zUAZbLcn-z4O6ajQ5OUZBjkqfkwo4SvQfM7ceg6_dLNbVa2dj9-YBp3pNfudc5eyKxIuvxDSmNSpoXr2Hr5Y2dDV5Z-15yfmcj-IDgZNibsUSSFuwqhHHfxk87HZRLM5-9kayXyfH4i_zdYleGR-iNX_OIzpJBpDeyJ_nbADgyi1NvBiNdDYiR-xCDuS0-DZZLVoOnJkbV23Q4XGkYRQSvI8VnWHKZhvqZi3-Nev7A.s4kCZx2KOzR50uoE.kdStc4m0EQ05J3nXd4EsxFgMj9Yp6Ji4JLRB7zjHGamjsMXwIBXhpFuexx58mqIueecXTOMz6nCjasgng8XKTKNBRsDshgFAzuO690--KQVIoSjADuRVuplTVgvg6xRaZN_cgdhfqo3DYS8MSALzoL0p1ylaAZuV_LGCJOLIcrhrP56xzmTX91tGHU3Dm1md.t-2pfHjICjZdya9g9WAxvQ' \
--data-urlencode 'merchant_connector_details%5Bcreds_identifier%5D=EulerTest' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_data%5D=eyJkYXRhIjoiUnZRZytEMEVsTElTREpqdFpkbXAxa05QVW9zdWY5ODk1ZDVUK0cvb1pNckRaY2ZXNXdkb1Y0SVBwWHdrRnJaS25LYlhNUktXVVJiNHJua3lZV01UKzRJL01Sc0tNaSt6KzFWbjFGYitQeldVUFErZlNsSUNUMWhTWkxkTDlnOEZGb091S2xQMW8rT0xhSjAyYWlVTVpXYnpFRDlVTVY5ckllWlU5M1pIa3g4Vm1Vdmxkd0hoSEFBVzRBUkFzNDAyaXRReTRYNHNIeEIxWG8xWUtTWUZOWlR1cEFDYnBrQk5QT3JFK1k4OStxdUhDVGtTbDJxL1hVL3hNcUJYcXR1MjJFQTdGMWRHQzBVVDZLV0FvcGpsSUFtMHdHZ1FGRUYvTlJseFlUVFBkd1NKOUV1SHlhbmtrYkZib2VBWk5vdUFtNHplYmw1czlyWG5ZZ3BjT0ZWckxzQjN0OW1tdmhEZEdNYkZJc21oY2o2Ni9OWEplRkR6alM4NG0wK3NVVXZGbWlxMWZ5ZGt0TW9xS1dmbGpnPT0iLCJzaWduYXR1cmUiOiJNSUFHQ1NxR1NJYjNEUUVIQXFDQU1JQUNBUUV4RFRBTEJnbGdoa2dCWlFNRUFnRXdnQVlKS29aSWh2Y05BUWNCQUFDZ2dEQ0NBK013Z2dPSW9BTUNBUUlDQ0V3d1FVbFJuVlEyTUFvR0NDcUdTTTQ5QkFNQ01Ib3hMakFzQmdOVkJBTU1KVUZ3Y0d4bElFRndjR3hwWTJGMGFXOXVJRWx1ZEdWbmNtRjBhVzl1SUVOQklDMGdSek14SmpBa0JnTlZCQXNNSFVGd2NHeGxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1STXdFUVlEVlFRS0RBcEJjSEJzWlNCSmJtTXVNUXN3Q1FZRFZRUUdFd0pWVXpBZUZ3MHhPVEExTVRnd01UTXlOVGRhRncweU5EQTFNVFl3TVRNeU5UZGFNRjh4SlRBakJnTlZCQU1NSEdWall5MXpiWEF0WW5KdmEyVnlMWE5wWjI1ZlZVTTBMVkJTVDBReEZEQVNCZ05WQkFzTUMybFBVeUJUZVhOMFpXMXpNUk13RVFZRFZRUUtEQXBCY0hCc1pTQkpibU11TVFzd0NRWURWUVFHRXdKVlV6QlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDlBd0VIQTBJQUJNSVZkKzNyMXNleUlZOW8zWENRb1NHTng3QzlieXdvUFlSZ2xkbEs5S1ZCRzROQ0R0Z1I4MEIrZ3pNZkhGVEQ5K3N5SU5hNjFkVHY5SktKaVQ1OER4T2pnZ0lSTUlJQ0RUQU1CZ05WSFJNQkFmOEVBakFBTUI4R0ExVWRJd1FZTUJhQUZDUHlTY1JQaytUdkorYkU5aWhzUDZLNy9TNUxNRVVHQ0NzR0FRVUZCd0VCQkRrd056QTFCZ2dyQmdFRkJRY3dBWVlwYUhSMGNEb3ZMMjlqYzNBdVlYQndiR1V1WTI5dEwyOWpjM0F3TkMxaGNIQnNaV0ZwWTJFek1ESXdnZ0VkQmdOVkhTQUVnZ0VVTUlJQkVEQ0NBUXdHQ1NxR1NJYjNZMlFGQVRDQi9qQ0J3d1lJS3dZQkJRVUhBZ0l3Z2JZTWdiTlNaV3hwWVc1alpTQnZiaUIwYUdseklHTmxjblJwWm1sallYUmxJR0o1SUdGdWVTQndZWEowZVNCaGMzTjFiV1Z6SUdGalkyVndkR0Z1WTJVZ2IyWWdkR2hsSUhSb1pXNGdZWEJ3YkdsallXSnNaU0J6ZEdGdVpHRnlaQ0IwWlhKdGN5QmhibVFnWTI5dVpHbDBhVzl1Y3lCdlppQjFjMlVzSUdObGNuUnBabWxqWVhSbElIQnZiR2xqZVNCaGJtUWdZMlZ5ZEdsbWFXTmhkR2x2YmlCd2NtRmpkR2xqWlNCemRHRjBaVzFsYm5SekxqQTJCZ2dyQmdFRkJRY0NBUllxYUhSMGNEb3ZMM2QzZHk1aGNIQnNaUzVqYjIwdlkyVnlkR2xtYVdOaGRHVmhkWFJvYjNKcGRIa3ZNRFFHQTFVZEh3UXRNQ3N3S2FBbm9DV0dJMmgwZEhBNkx5OWpjbXd1WVhCd2JHVXVZMjl0TDJGd2NHeGxZV2xqWVRNdVkzSnNNQjBHQTFVZERnUVdCQlNVVjl0djFYU0Job21KZGk5K1Y0VUg1NXRZSkRBT0JnTlZIUThCQWY4RUJBTUNCNEF3RHdZSktvWklodmRqWkFZZEJBSUZBREFLQmdncWhrak9QUVFEQWdOSkFEQkdBaUVBdmdsWEgrY2VIbk5iVmVXdnJMVEhMK3RFWHpBWVVpTEhKUkFDdGg2OWIxVUNJUURSaXpVS1hkYmRickYwWURXeEhyTE9oOCtqNXE5c3ZZT0FpUTNJTE4ycVl6Q0NBdTR3Z2dKMW9BTUNBUUlDQ0VsdEw3ODZtTnFYTUFvR0NDcUdTTTQ5QkFNQ01HY3hHekFaQmdOVkJBTU1Fa0Z3Y0d4bElGSnZiM1FnUTBFZ0xTQkhNekVtTUNRR0ExVUVDd3dkUVhCd2JHVWdRMlZ5ZEdsbWFXTmhkR2x2YmlCQmRYUm9iM0pwZEhreEV6QVJCZ05WQkFvTUNrRndjR3hsSUVsdVl5NHhDekFKQmdOVkJBWVRBbFZUTUI0WERURTBNRFV3TmpJek5EWXpNRm9YRFRJNU1EVXdOakl6TkRZek1Gb3dlakV1TUN3R0ExVUVBd3dsUVhCd2JHVWdRWEJ3YkdsallYUnBiMjRnU1c1MFpXZHlZWFJwYjI0Z1EwRWdMU0JITXpFbU1DUUdBMVVFQ3d3ZFFYQndiR1VnUTJWeWRHbG1hV05oZEdsdmJpQkJkWFJvYjNKcGRIa3hFekFSQmdOVkJBb01Da0Z3Y0d4bElFbHVZeTR4Q3pBSkJnTlZCQVlUQWxWVE1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRThCY1JoQm5YWklYVkdsNGxnUWQyNklDaTc5NTdyazNnamZ4TGsrRXpWdFZtV3pXdUl0Q1hkZzBpVG51NkNQMTJGODZJeTNhN1puQyt5T2dwaFA5VVJhT0I5ekNCOURCR0JnZ3JCZ0VGQlFjQkFRUTZNRGd3TmdZSUt3WUJCUVVITUFHR0ttaDBkSEE2THk5dlkzTndMbUZ3Y0d4bExtTnZiUzl2WTNOd01EUXRZWEJ3YkdWeWIyOTBZMkZuTXpBZEJnTlZIUTRFRmdRVUkvSkp4RStUNU84bjVzVDJLR3cvb3J2OUxrc3dEd1lEVlIwVEFRSC9CQVV3QXdFQi96QWZCZ05WSFNNRUdEQVdnQlM3c042aFdET0ltcVNLbWQ2K3ZldXYyc3NrcXpBM0JnTlZIUjhFTURBdU1DeWdLcUFvaGlab2RIUndPaTh2WTNKc0xtRndjR3hsTG1OdmJTOWhjSEJzWlhKdmIzUmpZV2N6TG1OeWJEQU9CZ05WSFE4QkFmOEVCQU1DQVFZd0VBWUtLb1pJaHZkalpBWUNEZ1FDQlFBd0NnWUlLb1pJemowRUF3SURad0F3WkFJd09zOXlnMUVXbWJHRyt6WERWc3Bpdi9RWDdka1BkVTJpanI3eG5JRmVRcmVKK0pqM20xbWZtTlZCRFkrZDZjTCtBakF5TGRWRUliQ2pCWGRzWGZNNE81Qm4vUmQ4TENGdGxrL0djbW1DRW05VStIcDlHNW5MbXdtSklXRUdtUThKa2gwQUFER0NBWWd3Z2dHRUFnRUJNSUdHTUhveExqQXNCZ05WQkFNTUpVRndjR3hsSUVGd2NHeHBZMkYwYVc5dUlFbHVkR1ZuY21GMGFXOXVJRU5CSUMwZ1J6TXhKakFrQmdOVkJBc01IVUZ3Y0d4bElFTmxjblJwWm1sallYUnBiMjRnUVhWMGFHOXlhWFI1TVJNd0VRWURWUVFLREFwQmNIQnNaU0JKYm1NdU1Rc3dDUVlEVlFRR0V3SlZVd0lJVERCQlNWR2RWRFl3Q3dZSllJWklBV1VEQkFJQm9JR1RNQmdHQ1NxR1NJYjNEUUVKQXpFTEJna3Foa2lHOXcwQkJ3RXdIQVlKS29aSWh2Y05BUWtGTVE4WERUSXpNRFV4T1RFeU5UUXpNVm93S0FZSktvWklodmNOQVFrME1Sc3dHVEFMQmdsZ2hrZ0JaUU1FQWdHaENnWUlLb1pJemowRUF3SXdMd1lKS29aSWh2Y05BUWtFTVNJRUlIYmttRnArVC8zeVhJczl5Y0hmdzJvZy9sdk0vY0hrd2xaeFZEc2NUV3NLTUFvR0NDcUdTTTQ5QkFNQ0JFY3dSUUlnZk1DK1N0TmVxWW1GV2hUY1oxVmluMHF1bEk0UkZoenoreTlSQjFLSjRONENJUURsSk42V1VqS25sTjVKaks3bUYxMGR4WW40WFZpcjFvcC9VWWFBVkRsdmJnQUFBQUFBQUE9PSIsImhlYWRlciI6eyJwdWJsaWNLZXlIYXNoIjoibncwNDN0SFRhSjhTRWc0R1F1aFhvYzUwcWxCdlM2M2Y2L1d3dmlhZFFUaz0iLCJlcGhlbWVyYWxQdWJsaWNLZXkiOiJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVrWW1PbWtSZGtac2w2QkFSZ2l0T043bTZFdlBER3FLWjZjRTB5elFJQ0kwUGdmc212Z2dveisvcnU5MGlTNklNeVBmN01Jek1mYUJId295ODRPOWtkZz09IiwidHJhbnNhY3Rpb25JZCI6IjU0OWJiOWEwNThmYjUxNGFiMWQ0ODZjNWMwZmU4NjlmZTlkYjg3MWUxNWY5M2Q3MWE3YTIwMzQxZjU1OTY0ZjQifSwidmVyc2lvbiI6IkVDX3YxIn0=' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_method%5D%5Bdisplay_name%5D=MasterCard 0049' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_method%5D%5Bnetwork%5D=MasterCard ' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Bpayment_method%5D%5Btype%5D=credit' \
--data-urlencode 'payment_method_data%5Bwallet%5D%5Bapple_pay%5D%5Btransaction_identifier%5D=549BB9A058FB514AB1D486C5C0FE869FE9DB871E15F93D71A7A20341F55964F4' \
--data-urlencode 'id=1749092667' \
--data-urlencode 'payment_method_types=apple_pay' \
--data-urlencode 'connector_metadata%5Bnoon%5D%5Border_category%5D=pay'
```
response
```
{
"id": "1749092639",
"object": "payment_intent",
"amount": 1000,
"amount_received": null,
"amount_capturable": 0,
"currency": "aed",
"status": "canceled",
"client_secret": "1749092639_secret_K8uEzdsNdac5doWHNGFg",
"created": 1749092639,
"customer": "sahkal",
"refunds": null,
"mandate": null,
"metadata": {
"orderId": "1677581650"
},
"charges": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "http://placeholder"
},
"connector": "noon",
"description": "card Payment",
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"authentication_type": "no_three_ds",
"next_action": null,
"cancellation_reason": null,
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "0049",
"card_network": "MasterCard ",
"type": "credit"
}
}
},
"shipping": null,
"billing": {
"address": null,
"phone": null,
"email": "[email protected]"
},
"capture_on": null,
"payment_token": null,
"email": null,
"phone": null,
"statement_descriptor_suffix": null,
"statement_descriptor_name": null,
"capture_method": "automatic",
"name": null,
"last_payment_error": {
"charge": null,
"code": "16200",
"decline_code": null,
"message": "Request data is not valid.",
"param": null,
"payment_method": {
"id": "place_holder_id",
"object": "payment_method",
"card": null,
"created": 1749092641,
"type": "card",
"livemode": false
},
"type": "16200"
},
"connector_transaction_id": null
}
```
apple pay for noon cannot be tested since we need to raise query to their support. But we are able to go to the connector without raising any core error.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments.rs`
**Detailed Identifier Changes:**
Commit 18262562:
Files to modify:
**crates/router/src/core/payments.rs**
Modify existing code
|
{"pr_number": 8259, "pr_title": "revert(routing): Add connectors from current active routing algorithm before adding fallback connectors", "merged_at": "2025-06-06T07:51:47Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
docs(analytics): add setup instructions for currency_conversion service
## 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 -->
Now that `analytics` depends on `currency_conversion` crate after this [PR](#6418), we need to include instructions in `analytics` documentation to set up this service.
## Fixes #6513
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
This is related to the PR #6418 and documents the necessary prerequisite setup info.
## How did you test 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**
- `crates/analytics/docs/README.md`
|
{"pr_number": 6516, "pr_title": "docs(analytics): add setup instructions for currency_conversion service", "merged_at": "2024-11-13T09:54:17Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["crates/analytics/docs/README.md"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(router): make `endpoint_prefix` optional in three_ds_metadata for unified_authentication_service
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
make `endpoint_prefix` optional in three_ds_metadata for unified_authentication_service
Main PR - https://github.com/juspay/hyperswitch/pull/9717
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Test cases in main PR
Clippy
<img width="1036" height="562" alt="image" src="https://github.com/user-attachments/assets/9c02e9fd-427b-4db9-8020-630e0aa950cc" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/unified_authentication_service.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/operations/payment_confirm.rs`
- `crates/router/src/core/unified_authentication_service.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (3 changes)
**Detailed Identifier Changes:**
Commit 3ed96882:
Files to modify:
**crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
|
{"pr_number": 9719, "pr_title": "fix(router): make `endpoint_prefix` optional in three_ds_metadata for unified_authentication_service", "merged_at": "2025-10-07T13:58:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs"], "core_business": ["crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/unified_authentication_service.rs"]}, "change_types": {"fields_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): Add Session Token Testcases
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Added Session Token Call Testcases in cypress
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
To include session token testcases in automation.
## How did you test it?
<img width="660" alt="Screenshot 2024-11-27 at 6 35 26 PM" src="https://github.com/user-attachments/assets/e43d53c1-5a12-4e39-b818-8a6213788f15">
<img width="726" alt="Screenshot 2024-12-23 at 6 30 29 PM" src="https://github.com/user-attachments/assets/83b30434-ecf8-4a40-95b8-bc242b53e8a7" />
<img width="769" alt="Screenshot 2024-12-23 at 6 31 16 PM" src="https://github.com/user-attachments/assets/d2b25aa4-6a1a-4912-a927-10da1762494d" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `.github/workflows/cypress-tests-runner.yml`
- `cypress-tests/cypress/e2e/PaymentTest/00024-SessionCall.cy.js`
- `cypress-tests/cypress/e2e/PaymentUtils/Commons.js`
- ... and 3 more files
**Code Patterns Applied:**
- Extend existing types with new fields (48 changes)
- Add conditional logic for feature flags or filtering (3 changes)
|
{"pr_number": 6683, "pr_title": "ci(cypress): Add Session Token Testcases", "merged_at": "2025-01-06T10:21:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "session", "token"]}, "hierarchy": {"tests": [".github/workflows/cypress-tests-runner.yml", "cypress-tests/cypress/e2e/PaymentTest/00024-SessionCall.cy.js", "cypress-tests/cypress/e2e/PaymentUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js", "cypress-tests/cypress/e2e/PaymentUtils/Stripe.js", "cypress-tests/cypress/support/commands.js"]}, "change_types": {"fields_added": 48, "conditionals_added": 3}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
chore(dynamic-fields): [Worldpay] update dynamic fields for payments
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR adds below dynamic required fields for processing Worldpay payments -
- address.line1
- address.city
- address.country
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
The txn will fail in case a few details are missing from address while processing a payment. To fix this, required fields are updated in `RequiredFields` struct which is requested by SDK at runtime for dynamically rendering the inputs for the required fields.
## How did you test it?
Tested by rendering a payment link locally.
<img width="612" alt="Screenshot 2025-01-07 at 4 22 32 PM" src="https://github.com/user-attachments/assets/8672d393-2774-40d1-b139-c86740f24cba" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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 (12 changes)
**Detailed Identifier Changes:**
Commit b46a921c:
Files to modify:
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Modify existing code
|
{"pr_number": 7002, "pr_title": "chore(dynamic-fields): [Worldpay] update dynamic fields for payments", "merged_at": "2025-01-08T08:15:47Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"connectors": ["crates/router/src/configs/defaults/payment_connector_required_fields.rs"]}, "change_types": {"fields_added": 12}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): adyen - propagate connector mandate details in incoming webhooks
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Described in the linked #6719
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Ensures mandate details are stored for Adyen.
## How did you test it?
Since this is an intermittent scenario, webhooks flow was tested locally by disabling propagation of mandate details during PSync flow for Adyen.
`connector_mandate_details` is populate post receiving the webhooks
<img width="1341" alt="Screenshot 2024-12-02 at 8 30 39 PM" src="https://github.com/user-attachments/assets/e488b0e1-e7cf-45a5-b706-cfe77ff50a85">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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.rs`
- `crates/router/src/connector/adyen/transformers.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (3 changes)
**Detailed Identifier Changes:**
Commit bea4b9e7:
Files to modify:
**crates/router/src/connector/adyen.rs**
Add:
- function: private::get_mandate_details
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
|
{"pr_number": 6720, "pr_title": "fix(connector): adyen - propagate connector mandate details in incoming webhooks", "merged_at": "2024-12-02T18:30:38Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector", "webhook"]}, "hierarchy": {"connectors": ["crates/router/src/connector/adyen.rs", "crates/router/src/connector/adyen/transformers.rs"]}, "change_types": {"functions_added": 1, "fields_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): [proxy payments] send external vault proxy metadata to UCS
## 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 -->
- pass external vault proxy metadata to uce for injector consumption
- it is passed in header as x-external-vault-metadata
- base64 encoded for parsing compatibility
### 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)?
-->
Not tested, need proxy module completely for testing
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. 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 2 more files
**3. External Connector Integration**
- `crates/external_services/src/grpc_client/unified_connector_service.rs`
**4. Other**
- `crates/external_services/src/lib.rs`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (5 changes)
- Extend existing types with new fields (36 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit c02d8b9b:
Files to modify:
**crates/external_services/src/grpc_client/unified_connector_service.rs**
Add:
- struct: pub::VgsMetadata
- enum: pub::ExternalVaultProxyMetadata
**crates/external_services/src/lib.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/merchant_connector_account.rs**
Add:
- struct: pub::ExternalVaultConnectorMetadata
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Add:
- function: private::call_unified_connector_service_with_external_vault_proxy
**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/unified_connector_service.rs**
Add:
- function: pub::build_unified_connector_service_external_vault_proxy_metadata
|
{"pr_number": 9108, "pr_title": "feat(core): [proxy payments] send external vault proxy metadata to UCS", "merged_at": "2025-09-01T11:21:32Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "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/external_proxy_flow.rs", "crates/router/src/core/unified_connector_service.rs"], "connectors": ["crates/external_services/src/grpc_client/unified_connector_service.rs"], "other": ["crates/external_services/src/lib.rs"]}, "change_types": {"structs_added": 2, "functions_added": 5, "enums_added": 1, "fields_added": 36, "imports_added": 4, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(config): redact config urls for hyperswitch vault
## 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 -->
URLs are removed from config for Hyperswitch vault
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
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/config.example.toml`
- `config/deployments/env_specific.toml`
- `config/deployments/production.toml`
- ... and 3 more files
|
{"pr_number": 8276, "pr_title": "refactor(config): redact config urls for hyperswitch vault", "merged_at": "2025-06-07T06:56:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(router): add display_name field to connector feature api
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
In this PR we will
1. Add display_name field to connector feature api
2. Rename non_threeDs to no_threeDs
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
List the connector feature and check if it contains display name and no_threeds instead of threeds
```
curl --location 'http://localhost:8080/feature_matrix' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'
```
Response
```
{
"connector_count": 3,
"connectors": [
{
"name": "BAMBORA",
"display_name": "Bambora",
"description": "Bambora is a leading online payment provider in Canada and United States.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "credit",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"AmericanExpress",
"Discover",
"JCB",
"DinersClub"
],
"supported_countries": [
"CA",
"US"
],
"supported_currencies": [
"USD"
]
}
],
"supported_webhook_flows": []
},
{
"name": "DEUTSCHEBANK",
"display_name": "Deutsche Bank",
"description": "Deutsche Bank is a German multinational investment bank and financial services company ",
"category": "bank_acquirer",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "credit",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "supported",
"no_three_ds": "not_supported",
"supported_card_networks": [
"Visa",
"Mastercard"
],
"supported_countries": null,
"supported_currencies": null
},
{
"payment_method": "bank_debit",
"payment_method_type": "sepa",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": null,
"supported_currencies": null
}
],
"supported_webhook_flows": []
},
{
"name": "ZSL",
"display_name": "ZSL",
"description": "Zsl is a payment gateway operating in China, specializing in facilitating local bank transfers",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "bank_transfer",
"payment_method_type": "local_bank_transfer",
"mandates": "not_supported",
"refunds": "not_supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"CN"
],
"supported_currencies": [
"CNY"
]
}
],
"supported_webhook_flows": []
}
]
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I 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/feature_matrix.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_response_types.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/bambora.rs`
- `crates/hyperswitch_connectors/src/connectors/deutschebank.rs`
- `crates/hyperswitch_connectors/src/connectors/zsl.rs`
**4. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/router/src/routes/feature_matrix.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (13 changes)
**Detailed Identifier Changes:**
Commit 50784ad1:
Files to modify:
**crates/api_models/src/feature_matrix.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bambora.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/deutschebank.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/zsl.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Modify existing code
**crates/router/src/routes/feature_matrix.rs**
Modify existing code
|
{"pr_number": 7121, "pr_title": "refactor(router): add display_name field to connector feature api ", "merged_at": "2025-02-07T08:29:19Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "refund", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/feature_matrix.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_response_types.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/bambora.rs", "crates/hyperswitch_connectors/src/connectors/deutschebank.rs", "crates/hyperswitch_connectors/src/connectors/zsl.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/router/src/routes/feature_matrix.rs"]}, "change_types": {"fields_added": 13}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Added ThreeDs server integration template pr
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] New feature
## Description
<!-- Describe your changes in detail -->
original pr's
https://github.com/juspay/hyperswitch/pull/7441
https://github.com/juspay/hyperswitch/pull/7424
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **validation** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/authentication/transformers.rs`
- ... and 5 more files
**2. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 11 more files
**3. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/api/authentication.rs`
- `crates/router/src/types/transformers.rs`
**4. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**5. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 3 more files
**6. Other**
- `crates/common_enums/src/enums.rs`
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (79 changes)
- Extend existing types with new fields (166 changes)
**Detailed Identifier Changes:**
Commit fc160caf:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::juspaythreedsserver
**crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.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::Juspaythreedsserver
- impl: impl Juspaythreedsserver
- impl: impl api::Payment for Juspaythreedsserver
- impl: impl api::PaymentSession for Juspaythreedsserver
- impl: impl api::ConnectorAccessToken for Juspaythreedsserver
- impl: impl api::MandateSetup for Juspaythreedsserver
- impl: impl api::PaymentAuthorize for Juspaythreedsserver
- impl: impl api::PaymentSync for Juspaythreedsserver
- impl: impl api::PaymentCapture for Juspaythreedsserver
- impl: impl api::PaymentVoid for Juspaythreedsserver
- impl: impl api::Refund for Juspaythreedsserver
- impl: impl api::RefundExecute for Juspaythreedsserver
- impl: impl api::RefundSync for Juspaythreedsserver
- impl: impl api::PaymentToken for Juspaythreedsserver
- impl: impl api::UnifiedAuthenticationService for Juspaythreedsserver
- impl: impl api::UasPreAuthentication for Juspaythreedsserver
- impl: impl api::UasPostAuthentication for Juspaythreedsserver
- impl: impl api::UasAuthenticationConfirmation for Juspaythreedsserver
- impl: impl api::UasAuthentication for Juspaythreedsserver
- impl: impl ConnectorIntegration<
PreAuthenticate,
UasPreAuthenticationRequestData,
UasAuthenticationResponseData,
> for Juspaythreedsserver
- impl: impl ConnectorIntegration<
PostAuthenticate,
UasPostAuthenticationRequestData,
UasAuthenticationResponseData,
> for Juspaythreedsserver
- impl: impl ConnectorIntegration<
AuthenticationConfirmation,
UasConfirmationRequestData,
UasAuthenticationResponseData,
> for Juspaythreedsserver
- impl: impl ConnectorIntegration<Authenticate, UasAuthenticationRequestData, UasAuthenticationResponseData> for Juspaythreedsserver
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Juspaythreedsserver
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Juspaythreedsserver
- impl: impl ConnectorCommon for Juspaythreedsserver
- impl: impl ConnectorValidation for Juspaythreedsserver
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Juspaythreedsserver
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Juspaythreedsserver
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Juspaythreedsserver
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Juspaythreedsserver
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Juspaythreedsserver
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Juspaythreedsserver
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Juspaythreedsserver
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Juspaythreedsserver
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Juspaythreedsserver
- impl: impl webhooks::IncomingWebhook for Juspaythreedsserver
- impl: impl ConnectorSpecifications for Juspaythreedsserver
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/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::JuspaythreedsserverRouterData
- struct: pub::JuspaythreedsserverPaymentsRequest
- struct: pub::JuspaythreedsserverCard
- struct: pub::JuspaythreedsserverAuthType
- struct: pub::JuspaythreedsserverPaymentsResponse
- struct: pub::JuspaythreedsserverRefundRequest
- struct: pub::RefundResponse
- struct: pub::JuspaythreedsserverErrorResponse
- enum: pub::JuspaythreedsserverPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for JuspaythreedsserverRouterData<T>
- impl: impl TryFrom<&JuspaythreedsserverRouterData<&PaymentsAuthorizeRouterData>> for JuspaythreedsserverPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for JuspaythreedsserverAuthType
- impl: impl From<JuspaythreedsserverPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, JuspaythreedsserverPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&JuspaythreedsserverRouterData<&RefundsRouterData<F>>> for JuspaythreedsserverRefundRequest
- 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/admin.rs**
Modify existing code
**crates/router/src/core/authentication.rs**
Modify existing code
**crates/router/src/core/authentication/transformers.rs**
Modify existing code
**crates/router/src/core/authentication/utils.rs**
Modify existing code
**crates/router/src/core/payments.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/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/api/authentication.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/tests/connectors/juspaythreedsserver.rs**
Add:
- function: private::new
- 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::JuspaythreedsserverTest
- impl: impl JuspaythreedsserverTest
- impl: impl ConnectorActions for JuspaythreedsserverTest
- impl: impl utils::Connector for JuspaythreedsserverTest
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::juspaythreedsserver
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 7446, "pr_title": "feat(connector): Added ThreeDs server integration template pr", "merged_at": "2025-03-06T12:14:51Z", "intent": {"feature_type": "validation", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/authentication.rs", "crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/authentication/utils.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/connector_integration_v2_impls.rs", "crates/router/src/core/payments/flows.rs", "crates/router/src/core/payments/operations/payment_confirm.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs", "crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/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/juspaythreedsserver.rs", "crates/router/tests/connectors/main.rs", "crates/test_utils/src/connector_auth.rs", "scripts/add_connector.sh"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/api/authentication.rs", "crates/router/src/types/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml", "crates/hyperswitch_interfaces/src/configs.rs"], "other": ["crates/common_enums/src/enums.rs"]}, "change_types": {"structs_added": 10, "functions_added": 79, "enums_added": 2, "fields_added": 166, "imports_added": 20}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore(docs): remove old add_connector.md file
## 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 -->
Removed old add_connector.md file
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 this [issue](https://github.com/juspay/hyperswitch/issues/8142)
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `add_connector.md`
- `add_connector_updated.md`
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (13 changes)
- Extend existing types with new fields (78 changes)
- Add conditional logic for feature flags or filtering (1 changes)
|
{"pr_number": 8143, "pr_title": "chore(docs): remove old add_connector.md file", "merged_at": "2025-05-29T10:25:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"connectors": ["add_connector.md", "add_connector_updated.md"]}, "change_types": {"structs_added": 4, "functions_added": 13, "enums_added": 1, "fields_added": 78, "conditionals_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.