prompt
stringlengths 83
247k
| response
stringlengths 121
36.1k
| metadata
stringlengths 314
42.3k
|
|---|---|---|
fix(connector): [ADYEN] Add fallback parsing for refusal codes and messages
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
In certain card networks like Amex and Visa, the `refusal_reason_raw` field inside `AdditionalData` comes as `51 : Insufficient funds/over credit limit`. In that case, we map `51` to `network_decline_code` and `Insufficient funds/over credit limit` to `network_error_message`
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Adyen - Payments Create :
cURL:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_1EDfF6duhCkHKeWxc2XymyUGtJbaSmEYxjfHrDIGThgZiSLvdXisAHmokmE1k7Va' \
--data-raw '
{
"amount": 4500,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"setup_future_usage": "off_session",
"connector": [
"adyen"
],
"customer_id": "agnostic_test_customer",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_cvc": "737"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"zip": "94122",
"country": "IT",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"zip": "94122",
"country": "IT",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IT"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
},
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "en-US",
"color_depth": 32,
"screen_height": 1117,
"screen_width": 1728,
"time_zone": -330,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"connector_metadata": {
"adyen": {
"testing": {
"holder_name": "CARD_EXPIREDab 50 : Issuer Error"
}
}
},
"session_expiry": 2890
}'
```
Response:
```
{
"payment_id": "pay_98upeKlIVvSlHIOI7Ta5",
"merchant_id": "merchant_1757580530",
"status": "failed",
"amount": 4500,
"net_amount": 4500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_98upeKlIVvSlHIOI7Ta5_secret_ktazXgF2d035E5h2Uztb",
"created": "2025-09-12T07:41:41.332Z",
"currency": "EUR",
"customer_id": "agnostic_test_customer",
"customer": {
"id": "agnostic_test_customer",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "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": {
"address": {
"city": "San Fransico",
"country": "IT",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": null,
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
}
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "IT",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": null,
"last_name": null,
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
},
"billing": {
"address": {
"city": "San Fransico",
"country": "IT",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": null,
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": "6",
"error_message": "Expired Card",
"unified_code": "UE_9000",
"unified_message": "Something went wrong",
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "agnostic_test_customer",
"created_at": 1757662901,
"expires": 1757666501,
"secret": "epk_e8753a47eb7d4757a626bc97e9547c87"
},
"manual_retry_allowed": true,
"connector_transaction_id": "QDGX2QX85W7NVB75",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": null,
"braintree": null,
"adyen": {
"testing": {
"holder_name": "CARD_EXPIREDab 50 : Issuer Error"
}
}
},
"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_3ASFtNO47YwNqaYA5iT6",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_r0akH66Vwujiv7yKIOFm",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-12T08:29:51.332Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": -330,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"color_depth": 32,
"java_enabled": true,
"screen_width": 1728,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1117,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-09-12T07:41:44.039Z",
"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": "50 ",
"issuer_error_message": "Issuer Error",
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": {
"network_advice_code": null
}
}
```
## Cypress Tests
<details>
<summary> This branch
</summary>
<img width="391" height="997" alt="Screenshot 2025-09-15 at 2 58 54 PM" src="https://github.com/user-attachments/assets/12c9a323-aa18-4bb7-a696-62153e7d533b" />
</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/adyen/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (7 changes)
**Detailed Identifier Changes:**
Commit 86609c66:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
|
{"pr_number": 9361, "pr_title": "fix(connector): [ADYEN] Add fallback parsing for refusal codes and messages", "merged_at": "2025-09-19T11:35:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs"]}, "change_types": {"fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix: trustpay `eps` redirection in cypress
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
Fix EPS Bank Redirect redirection in Cypress.
Closes #6528
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
NIL
## How did you test 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="453" alt="image" src="https://github.com/user-attachments/assets/a712b6c3-74fa-4a41-8eae-3045bc41e3ac">
## 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. Tests**
- `cypress-tests/cypress/support/redirectionHandler.js`
|
{"pr_number": 6529, "pr_title": "fix: trustpay `eps` redirection in cypress", "merged_at": "2024-11-12T07:17:51Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
chore(openapi): resolve openapi semantic inconsistency
## 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 fixes semantic inconsistency with openapi_spec.json
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/organization.rs`
**2. External Connector Integration**
- `crates/openapi/src/routes/merchant_connector_account.rs`
**3. Other**
- `api-reference/openapi_spec.json`
- `crates/openapi/src/routes/mandates.rs`
- `crates/openapi/src/routes/payment_method.rs`
- ... and 4 more files
**Detailed Identifier Changes:**
Commit fa4b552a:
Files to modify:
**crates/api_models/src/organization.rs**
Modify existing code
**crates/openapi/src/routes/mandates.rs**
Modify existing code
**crates/openapi/src/routes/merchant_connector_account.rs**
Modify existing code
**crates/openapi/src/routes/payment_method.rs**
Modify existing code
**crates/openapi/src/routes/payments.rs**
Modify existing code
**crates/openapi/src/routes/profile.rs**
Modify existing code
**crates/openapi/src/routes/relay.rs**
Modify existing code
**crates/router/src/routes/admin.rs**
Modify existing code
|
{"pr_number": 8099, "pr_title": "chore(openapi): resolve openapi semantic inconsistency", "merged_at": "2025-05-22T10:23:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"api_models": ["crates/api_models/src/organization.rs"], "connectors": ["crates/openapi/src/routes/merchant_connector_account.rs"], "other": ["api-reference/openapi_spec.json", "crates/openapi/src/routes/mandates.rs", "crates/openapi/src/routes/payment_method.rs", "crates/openapi/src/routes/payments.rs", "crates/openapi/src/routes/profile.rs", "crates/openapi/src/routes/relay.rs", "crates/router/src/routes/admin.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): add payment method Wallet check for decrypted wallet payment method token logic
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
* Updated to check if the payment method is `Wallet` before proceeding with the wallet decryption operation.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
-> Make a card payment without sending the payment method type
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-feature: router-custom' \
--header 'x-tenant-id: hyperswitch' \
--header 'api-key: dev_TkMYapm8vMYMcImjnH6Gkud5hM6jGVayHZTi3WSVU8eYUiMItzwlRYQlN3RtHIkD' \
--data-raw '{
"amount": 1000000,
"amount_to_capture": 1000000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"setup_future_usage": "on_session",
"capture_on": "2022-09-10T10:11:12Z",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"customer_id": "cu_1753349404",
"return_url": "http://127.0.0.1:4040",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX",
"last_name": "ss"
},
"email": "raj@gmail.com"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "125.0.0.1"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```
{
"payment_id": "pay_IUCHPAl9h0w2pU42MSjP",
"merchant_id": "merchant_1753349359",
"status": "succeeded",
"amount": 1000000,
"net_amount": 1000000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000000,
"connector": "adyen",
"client_secret": "pay_IUCHPAl9h0w2pU42MSjP_secret_qtpg5D3tmmR47Pa9zemV",
"created": "2025-07-24T09:29:57.265Z",
"currency": "USD",
"customer_id": "cu_1753349397",
"customer": {
"id": "cu_1753349397",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1111",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": "ss"
},
"phone": null,
"email": "raj@gmail.com"
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "http://127.0.0.1:4040/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cu_1753349397",
"created_at": 1753349397,
"expires": 1753352997,
"secret": "epk_e313bd1d47874c7fa7379c5c8d69fe53"
},
"manual_retry_allowed": false,
"connector_transaction_id": "N7DWCX9JCT8SXC75",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_IUCHPAl9h0w2pU42MSjP_1",
"payment_link": null,
"profile_id": "pro_gtFgPCNzLPlZCIzitXyr",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_F4voD3pzs9339zlOTZeT",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-24T09:44:57.265Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "125.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-07-24T09:29:58.665Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
-> apple pay hyperswitch decrypt
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_fG0Py6LkKzjLXPtMoUgqPAnmfzCxcRuf7nuOERwaXv1PBWEjjaqFARqp8PJL7yCZ' \
--data-raw '{
"amount": 6500,
"currency": "USD",
"confirm": true,
"business_country": "US",
"business_label": "default",
"amount_to_capture": 6500,
"customer_id": "cu_1753349907",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"setup_future_usage": "on_session",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"billing": {
"address": {
"line1": "1467",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
}
,
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "=",
"payment_method": {
"display_name": "Discover 9319",
"network": "Discover",
"type": "debit"
},
"transaction_identifier": "c635c5b3af900d7bd81fecd7028f1262f9d030754ee65ec7afd988a678194751"
}
}
}
}'
```
```
{
"payment_id": "pay_ehf8EOyIovaVY9IQudiA",
"merchant_id": "merchant_1753349865",
"status": "succeeded",
"amount": 6500,
"net_amount": 6500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6500,
"connector": "stripe",
"client_secret": "pay_ehf8EOyIovaVY9IQudiA_secret_kSZD9Lzhn0I7WWc10KJu",
"created": "2025-07-24T09:38:18.751Z",
"currency": "USD",
"customer_id": "cu_1753349899",
"customer": {
"id": "cu_1753349899",
"name": "Joseph Doe",
"email": "something@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "9319",
"card_network": "Discover",
"type": "debit"
}
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": null,
"line3": null,
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "apple_pay",
"connector_label": "stripe_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cu_1753349899",
"created_at": 1753349898,
"expires": 1753353498,
"secret": "epk_679a71f8c93842d397d49838846707c6"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3RoLbUEOqOywnAIx0OUznkxA",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3RoLbUEOqOywnAIx0OUznkxA",
"payment_link": null,
"profile_id": "pro_AHhiUwwtdVJF4wpev3kl",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_Nm3XaDfdM55WDDfkPSLi",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-24T09:53:18.751Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-07-24T09:38:21.475Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments.rs`
**Code Patterns Applied:**
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit be002728:
Files to modify:
**crates/router/src/core/payments.rs**
Modify existing code
|
{"pr_number": 8744, "pr_title": "fix(router): add payment method Wallet check for decrypted wallet payment method token logic", "merged_at": "2025-07-24T11:35:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs"]}, "change_types": {"conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(multitenancy): consistently use tenant nomenclature everywhere
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Enhancement
## Description
<!-- Describe your changes in detail -->
This fixes the inconsistent nomenclature used for tenants in router and drainer code
### Additional Changes
- [x] This PR modifies application configuration/environment variables
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
This will eradicate confusion between `name` and `tenant_id` names in the tenant config. In the config below
`public = { base_url = "http://localhost:8080/", schema = "public", redis_key_prefix = "", clickhouse_database = "default"}`
The key `public` will be the tenant_id. This PR adds a custom deserializer for this part
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
**This cannot be tested on sandbox without enabling Multi Tenancy**
1. Application runs with the changed config and so does drainer
2. Do a request with a valid `x-tenant-id`
```bash
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-tenant-id: public' \
--header 'api-key: test_admin' \
--data-raw '{
"merchant_id": "1729601216",
"locker_id": "m0010",
"merchant_name": "NewAge Retailer",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
},
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"metadata": {
"city": "NY",
"unit": "245"
},
"primary_business_details": [
{
"country": "US",
"business": "default"
}
]
}'
```
It should return 200 and `tenant-id` should be the which has been passed
3. Try the request with invalid `tenant-id`, It should return an 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
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payment_methods/cards.rs`
- `crates/router/src/core/routing/helpers.rs`
**2. Type Definitions**
- `crates/router/src/types/storage/payment_attempt.rs`
**3. Tests**
- `loadtest/config/development.toml`
**4. Configuration Files**
- `config/config.example.toml`
- `config/deployments/env_specific.toml`
- `config/development.toml`
- ... and 2 more files
**5. Other**
- `crates/drainer/src/settings.rs`
- `crates/router/src/middleware.rs`
- `crates/router/src/routes/app.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (4 changes)
- Extend existing types with new fields (21 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit aecd5eea:
Files to modify:
**crates/drainer/src/settings.rs**
Add:
- function: private::deserialize
- struct: private::Inner
- impl: impl Deserialize<'de> for TenantConfig
**crates/router/src/configs/settings.rs**
Add:
- function: pub::get_tenant_ids
- struct: private::Inner
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Modify existing code
**crates/router/src/middleware.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/services/api.rs**
Modify existing code
**crates/router/src/types/storage/payment_attempt.rs**
Modify existing code
|
{"pr_number": 6389, "pr_title": "fix(multitenancy): consistently use tenant nomenclature everywhere", "merged_at": "2024-10-28T15:42:38Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/routing/helpers.rs"], "types": ["crates/router/src/types/storage/payment_attempt.rs"], "tests": ["loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/settings.rs"], "other": ["crates/drainer/src/settings.rs", "crates/router/src/middleware.rs", "crates/router/src/routes/app.rs", "crates/router/src/services/api.rs"]}, "change_types": {"structs_added": 2, "functions_added": 4, "fields_added": 21, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
Feat(connector): [JP MORGAN] Added Template code for cards 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 -->
Template code added for new connector JP Morgan
https://developer.payments.jpmorgan.com/docs/commerce/online-payments/capabilities/online-payments/payment-methods/cards
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
No test cases required
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
This PR is related to the issue in https://github.com/juspay/hyperswitch-cloud: Fixes juspay/hyperswitch-cloud#7281
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/connector_enums.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/connector_integration_v2_impls.rs`
- `crates/router/src/core/payments/flows.rs`
**3. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/hyperswitch_connectors/src/connectors.rs`
- `crates/hyperswitch_connectors/src/connectors/jpmorgan.rs`
- ... and 9 more files
**4. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/transformers.rs`
**5. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**6. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (79 changes)
- Extend existing types with new fields (153 changes)
**Detailed Identifier Changes:**
Commit b048e39b:
Files to modify:
**crates/api_models/src/connector_enums.rs**
Modify existing code
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::jpmorgan
**crates/hyperswitch_connectors/src/connectors/jpmorgan.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::Jpmorgan
- impl: impl Jpmorgan
- impl: impl api::Payment for Jpmorgan
- impl: impl api::PaymentSession for Jpmorgan
- impl: impl api::ConnectorAccessToken for Jpmorgan
- impl: impl api::MandateSetup for Jpmorgan
- impl: impl api::PaymentAuthorize for Jpmorgan
- impl: impl api::PaymentSync for Jpmorgan
- impl: impl api::PaymentCapture for Jpmorgan
- impl: impl api::PaymentVoid for Jpmorgan
- impl: impl api::Refund for Jpmorgan
- impl: impl api::RefundExecute for Jpmorgan
- impl: impl api::RefundSync for Jpmorgan
- impl: impl api::PaymentToken for Jpmorgan
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Jpmorgan
- impl: impl ConnectorCommon for Jpmorgan
- impl: impl ConnectorValidation for Jpmorgan
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Jpmorgan
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Jpmorgan
- impl: impl webhooks::IncomingWebhook for Jpmorgan
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/jpmorgan/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::JpmorganRouterData
- struct: pub::JpmorganPaymentsRequest
- struct: pub::JpmorganCard
- struct: pub::JpmorganAuthType
- struct: pub::JpmorganPaymentsResponse
- struct: pub::JpmorganRefundRequest
- struct: pub::RefundResponse
- struct: pub::JpmorganErrorResponse
- enum: pub::JpmorganPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for JpmorganRouterData<T>
- impl: impl TryFrom<&JpmorganRouterData<&PaymentsAuthorizeRouterData>> for JpmorganPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for JpmorganAuthType
- impl: impl From<JpmorganPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, JpmorganPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&JpmorganRouterData<&RefundsRouterData<F>>> for JpmorganRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
- impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/configs.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/core/payments/connector_integration_v2_impls.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/tests/connectors/jpmorgan.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::JpmorganTest
- impl: impl JpmorganTest
- impl: impl ConnectorActions for JpmorganTest
- impl: impl utils::Connector for JpmorganTest
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::jpmorgan
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 6467, "pr_title": "Feat(connector): [JP MORGAN] Added Template code for cards integration", "merged_at": "2024-11-05T15:51:59Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "connector", "card"]}, "hierarchy": {"api_models": ["crates/api_models/src/connector_enums.rs"], "core_business": ["crates/router/src/core/payments/connector_integration_v2_impls.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/jpmorgan.rs", "crates/hyperswitch_connectors/src/connectors/jpmorgan/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/jpmorgan.rs", "crates/router/tests/connectors/main.rs", "crates/router/tests/connectors/sample_auth.toml", "crates/test_utils/src/connector_auth.rs", "scripts/add_connector.sh"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml", "crates/hyperswitch_interfaces/src/configs.rs"]}, "change_types": {"structs_added": 10, "functions_added": 79, "enums_added": 2, "fields_added": 153, "imports_added": 20}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [INESPAY] Integrate Sepa Bank Debit
## 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 payment flows (Auth, PSync, Refund, RSync, and Webhooks) for Inespay Sepa Bank Debit.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Merchant Account Create
2. API Key Create
3.Inespay Connector Create:
```
curl --location 'http://localhost:8080/account/merchant_1736331946/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "inespay",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "abc",
"key1": "abc"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "bank_debit",
"payment_method_types": [
{
"payment_method_type": "sepa",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
}
]
}
],
"connector_webhook_details": {
"merchant_secret": "abc",
"additional_secret": null
}
}'
```
4. Payments Create:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_t54RQO5Ci3L3J3sV0GFUeySuR0d3zPe66OxpRV8qKD3Th7Pyquxxro6afDNCapom' \
--data '{
"amount": 6540,
"currency": "EUR",
"confirm": true,
"amount_to_capture": 6540,
"customer_id": "StripbmnxeCustomer",
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "bank_debit",
"payment_method_type": "sepa",
"payment_method_data": {
"bank_debit": {
"sepa_bank_debit": {
"iban": "ES5031831357110123456789"
}
}
}
}'
```
Response:
```
{
"payment_id": "pay_2hUGMfU0Wv31Gn3unXgG",
"merchant_id": "merchant_1736331946",
"status": "requires_customer_action",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 6540,
"amount_received": null,
"connector": "inespay",
"client_secret": "pay_2hUGMfU0Wv31Gn3unXgG_secret_iYsSbpRHSGd4bEJ3OBET",
"created": "2025-01-09T08:55:12.497Z",
"currency": "EUR",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "bank_debit",
"payment_method_data": {
"bank_debit": {
"sepa": {
"iban": "ES503**************56789",
"bank_account_holder_name": null
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_2hUGMfU0Wv31Gn3unXgG/merchant_1736331946/pay_2hUGMfU0Wv31Gn3unXgG_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "sepa",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1736412912,
"expires": 1736416512,
"secret": "epk_a8553335e63d4417ba67bfe8301b8799"
},
"manual_retry_allowed": null,
"connector_transaction_id": "PMWC9HMC-E37E-I83G-FZWOCP9S2GDVX8ZD",
"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_oPMGl04eyRD2pY0laexI",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_RTX0eIQOVWNhcTAeKXQQ",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-09T09:10:12.497Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-01-09T08:55:13.385Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
5. Payments Retrieve:
```
curl --location 'http://localhost:8080/payments/pay_xoODE5mPdtuN8tr5xyMz?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_t54RQO5Ci3L3J3sV0GFUeySuR0d3zPe66OxpRV8qKD3Th7Pyquxxro6afDNCapom'
```
Response:
```
{
"payment_id": "pay_TcadxZAWM2P3PjWJ7PRC",
"merchant_id": "merchant_1736331946",
"status": "requires_customer_action",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 6540,
"amount_received": null,
"connector": "inespay",
"client_secret": "pay_TcadxZAWM2P3PjWJ7PRC_secret_xpi5fQgZ7uqbr42h1uxt",
"created": "2025-01-09T08:44:46.048Z",
"currency": "EUR",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "bank_debit",
"payment_method_data": {
"bank_debit": {
"sepa": {
"iban": "ES113**************40674",
"bank_account_holder_name": null
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_TcadxZAWM2P3PjWJ7PRC/merchant_1736331946/pay_TcadxZAWM2P3PjWJ7PRC_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "sepa",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "BKBBNZ68-17K5-B4SL-LTC0545XW13LKIBK",
"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_oPMGl04eyRD2pY0laexI",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_RTX0eIQOVWNhcTAeKXQQ",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-09T08:59:46.047Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-01-09T08:45:37.239Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
6. Refunds:
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_J5g19W9vemKtoeyfLV5hBEovbKns39FLpAxqj8SnuDnFdLCJcIHJX928eOVl8nkd' \
--data '{
"payment_id": "pay_2hUGMfU0Wv31Gn3unXgG",
"amount": 600,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
7. Refunds Retrieve:
```
curl --location 'http://localhost:8080/refunds/' \
--header 'Accept: application/json' \
--header 'api-key: dev_J5g19W9vemKtoeyfLV5hBEovbKns39FLpAxqj8SnuDnFdLCJcIHJX928eOVl8nkd'
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/admin.rs`
**2. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/hyperswitch_connectors/src/connectors/inespay.rs`
- ... and 1 more files
**3. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/transformers.rs`
**4. Configuration Files**
- `config/development.toml`
**5. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Define new data structures (7 changes)
- Implement new functions (10 changes)
- Extend existing types with new fields (140 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit ce2485c3:
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/inespay.rs**
Add:
- function: private::get_webhook_body
- function: private::get_webhook_source_verification_algorithm
- function: private::get_webhook_source_verification_signature
- function: private::get_webhook_source_verification_message
- function: private::verify_webhook_source
**crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs**
Remove:
- struct: pub::InespayCard
Add:
- function: private::try_from
- enum: pub::InespayPSyncStatus
**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
Commit a88cd218:
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/inespay.rs**
Add:
- function: private::get_webhook_body
- function: private::get_webhook_source_verification_algorithm
- function: private::get_webhook_source_verification_signature
- function: private::get_webhook_source_verification_message
- function: private::verify_webhook_source
**crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs**
Remove:
- struct: pub::InespayCard
Add:
- function: private::try_from
- enum: pub::InespayPSyncStatus
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 6755, "pr_title": "feat(connector): [INESPAY] Integrate Sepa Bank Debit", "merged_at": "2025-02-05T15:18:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/hyperswitch_connectors/src/connectors/inespay.rs", "crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "config": ["config/development.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"structs_added": 7, "functions_added": 10, "enums_added": 7, "fields_added": 140, "imports_added": 7, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
fix: capture installation errors from one-click and docker compose setup
## 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 -->
The installation tracking system has been upgraded to capture more information, errors and behaviors during the installation period such as:
- User aborts
- Server failure errors
- Dependency errors
- Successful installations
Hotfix PR for #[8238](https://github.com/juspay/hyperswitch/pull/8238)
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 using a mock server endpoint to verify the script captures all the errors and successes.
<img width="723" alt="Screenshot 2025-06-04 at 5 07 48 PM" src="https://github.com/user-attachments/assets/eb343199-f1ba-46d9-8347-45f632b631ee" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Configuration Files**
- `docker-compose.yml`
**2. Other**
- `.gitignore`
- `scripts/create_default_user.sh`
- `scripts/notify_scarf.sh`
- ... and 3 more files
**Code Patterns Applied:**
- Extend existing types with new fields (20 changes)
- Add conditional logic for feature flags or filtering (27 changes)
|
{"pr_number": 8237, "pr_title": "fix: capture installation errors from one-click and docker compose setup", "merged_at": "2025-06-12T13:58:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"config": ["docker-compose.yml"], "other": [".gitignore", "scripts/create_default_user.sh", "scripts/notify_scarf.sh", "scripts/poststart_hook.sh", "scripts/prestart_hook.sh", "scripts/setup.sh"]}, "change_types": {"fields_added": 20, "conditionals_added": 27}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(connector): fix wasm for Loonio
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
fix wasm 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?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
|
{"pr_number": 9647, "pr_title": "refactor(connector): fix wasm for Loonio", "merged_at": "2025-10-01T13:42:36Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(core): add bulk tokenization flows
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR introduces below changes
- Exposes two endpoints for
- Single card tokenization
- Tokenizing raw card details with the network
- Tokenizing an existing payment method in HS with the network (card only)
- Bulk tokenization
- Tokenizing using raw card details or an existing payment method
More details around the flow is present in https://github.com/juspay/hyperswitch/issues/6971
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding 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 helps merchants to tokenize their customer's payment methods with the card networks. A new payment method entry is created for every card which can be used to perform txns using the network tokens.
## How did you test it?
<details>
<summary>1. Tokenize using raw card details</summary>
cURL
curl --location --request POST 'http://localhost:8080/payment_methods/tokenize-card' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"card": {
"raw_card_number": "4761360080000093",
"card_expiry_month": "01",
"card_expiry_year": "26",
"card_cvc": "947"
},
"merchant_id": "merchant_1737627877",
"card_type": "debit",
"customer": {
"id": "cus_IoFeOlGhEeD54AbBdvxI"
}
}'
Response
{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_IoFeOlGhEeD54AbBdvxI","payment_method_id":"pm_ai4pU6o32LUgRy2kl5hd","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0093","expiry_month":"01","expiry_year":"26","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":null,"card_network":null,"card_isin":"476136","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:41:54.753Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_IoFeOlGhEeD54AbBdvxI","name":"John Nether","email":"guest@example.com","phone":"6168205362","phone_country_code":"+1"},"card_tokenized":true,"req":null}
</details>
<details>
<summary>2. Tokenize using existing payment method entry</summary>
cURL
curl --location --request POST 'http://localhost:8080/payment_methods/tokenize-card/pm_HHZV9XC6C10jjKGiK8m1' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"existing_payment_method": {
"card_cvc": "947"
},
"merchant_id": "merchant_1737627877",
"card_type": "debit",
"customer": {
"id": "cus_IoFeOlGhEeD54AbBdvxI"
}
}'
Response
{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_IoFeOlGhEeD54AbBdvxI","payment_method_id":"pm_HHZV9XC6C10jjKGiK8m1","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"03","expiry_year":"2030","card_token":null,"card_holder_name":"John US","card_fingerprint":null,"nick_name":"JD","card_network":null,"card_isin":"491761","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:43:02.151Z","last_used_at":"2025-01-23T10:43:02.151Z","client_secret":"pm_HHZV9XC6C10jjKGiK8m1_secret_SJC4AUiR4HmYzSDOKwPi"},"customer":{"id":"cus_IoFeOlGhEeD54AbBdvxI","name":null,"email":null,"phone":null,"phone_country_code":null},"card_tokenized":true,"req":null}
</details>
<details>
<summary>3. Bulk tokenize</summary>
cURL
curl --location --request POST 'http://localhost:8080/payment_methods/tokenize-card-batch' \
--header 'api-key: test_admin' \
--form 'merchant_id="merchant_1737627877"' \
--form 'file=@"/Users/Downloads/tokenization sample - Sheet 1.csv"'
Response
[{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_Hn03n9kbTqUxKZ0nZRVC","payment_method_id":"pm_eBONxbqiaf8T7KkGSlaq","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"2026","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:53.998Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_Hn03n9kbTqUxKZ0nZRVC","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_OWDUMC1QBmsTeImT9xCs","payment_method_id":"pm_nRtoCkil21RaGNJulP2L","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"2026","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:53.998Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_OWDUMC1QBmsTeImT9xCs","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_mBx8CYwaUldk2HbX9qBV","payment_method_id":"pm_nhtWX126LHU1BmoN48TB","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"2026","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:53.998Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_mBx8CYwaUldk2HbX9qBV","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_tpr9V8N4mPijFOZGbqjH","payment_method_id":"pm_eoyzCgzbJjbfREVKe7c0","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"2026","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:54.001Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_tpr9V8N4mPijFOZGbqjH","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_fdbpnmVFS3hhYZZfYquM","payment_method_id":"pm_ShvWRpaZyX5kucjVImmw","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"2026","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:54.001Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_fdbpnmVFS3hhYZZfYquM","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_HeGLoqXGsKYbpCTvvNCX","payment_method_id":"pm_w6QqSyug2w4rJAIxQY4a","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"2026","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:54.009Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_HeGLoqXGsKYbpCTvvNCX","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_3LgTOBzFOcMHEz1glZzF","payment_method_id":"pm_1G3NGbJG0LyJKvbIZvdJ","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"2026","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:54.009Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_3LgTOBzFOcMHEz1glZzF","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_bYIVR0NQF4T4bv5KjVNd","payment_method_id":"pm_31KM9k8uPbwUAUaq03N5","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"2026","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:54.010Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_bYIVR0NQF4T4bv5KjVNd","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_jxMzHRc3Ndfr9Mt2pHKg","payment_method_id":"pm_dAHGSnuIHQC4rHWEGAwF","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"25","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:54.010Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_jxMzHRc3Ndfr9Mt2pHKg","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_KyauqQZeqKbZCEdRCrPY","payment_method_id":"pm_im8kjgFyc5ydhrHES9z5","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"22","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:54.010Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_KyauqQZeqKbZCEdRCrPY","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_NuZ4Ntb7hWDXxFt7ro3D","payment_method_id":"pm_gfgZ1gOZ4kIdeBU7Cyqz","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"25","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:54.017Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_NuZ4Ntb7hWDXxFt7ro3D","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_UDoT3SdLhK62XG7xFo65","payment_method_id":"pm_cPsrZ1S3xV12NnF5uAH8","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"25","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:54.017Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_UDoT3SdLhK62XG7xFo65","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null},{"payment_method_response":{"merchant_id":"merchant_1737627877","customer_id":"cus_cxhCY1RgcvRPlIX891kU","payment_method_id":"pm_iHXORES9dupsE5ffAG0C","payment_method":"card","payment_method_type":null,"card":{"scheme":null,"issuer_country":null,"last4_digits":"0000","expiry_month":"1","expiry_year":"2022","card_token":null,"card_holder_name":null,"card_fingerprint":null,"nick_name":"real joe","card_network":null,"card_isin":"420000","card_issuer":null,"card_type":null,"saved_to_locker":false},"recurring_enabled":true,"installment_payment_enabled":false,"payment_experience":null,"metadata":null,"created":"2025-01-23T10:24:54.017Z","last_used_at":null,"client_secret":null},"customer":{"id":"cus_cxhCY1RgcvRPlIX891kU","name":"Max Mustermann","email":"noreply+20240930-220107@gmail.com","phone":null,"phone_country_code":null},"card_tokenized":true,"req":null}]
</details>
<details>
<summary>4. Network tokenization in payments flow</summary>
1. Enable `is_network_tokenization_enabled` in profile
cURL
curl --location --request POST 'http://localhost:8080/account/merchant_1739089569/business_profile/pro_y2hZRUddjwLlTtKLMPEM' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"is_network_tokenization_enabled": true
}'
2. Create a card txn using `no_three_ds` and `off_session`
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_E6uP3pz26jvUfMLK2UkVOax00881TBQscs85jNVqCBrFvcO5h2EsLtZ5HqXe93HF' \
--data-raw '{"amount":100,"currency":"USD","confirm":true,"capture_method":"automatic","capture_on":"2022-09-10T10:11:12Z","customer_id":"cus_3Nn60DzqkFOwJ9T2y4rG","email":"guest@example.com","name":"John Doe","phone":"999999999","profile_id":"pro_y2hZRUddjwLlTtKLMPEM","phone_country_code":"+65","description":"Its my first payment request","authentication_type":"no_three_ds","return_url":"https://hyperswitch.io","setup_future_usage":"off_session","customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"connector":["cybersource"],"payment_method":"card","payment_method_data":{"card":{"card_number":"4761360080000093","card_exp_month":"01","card_exp_year":"2026","card_cvc":"947","nick_name":"JD"},"billing":{"email":"guest@example.com","address":{"first_name":"John","last_name":"US"}}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"California","zip":"94122","country":"US","first_name":"John","last_name":"US"}},"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"ip_address":"129.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","language":"en-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true}}'
Response
{"merchant_id":"merchant_1739089569","profile_id":"pro_y2hZRUddjwLlTtKLMPEM","profile_name":"IN_default","return_url":"https://google.com/success","enable_payment_response_hash":true,"payment_response_hash_key":"onDz0wKFp8QXWiBCWX5vIvBLpcwnA6ajqvfcNmFwM66O9p59iK1uPYWVIS7pArqd","redirect_to_merchant_with_http_post":false,"webhook_details":{"webhook_version":"1.0.1","webhook_username":"random","webhook_password":"pass","webhook_url":"https://webhook.site/0728473e-e0aa-4bb6-9eea-85435cf54380","payment_created_enabled":true,"payment_succeeded_enabled":true,"payment_failed_enabled":true},"metadata":null,"routing_algorithm":null,"intent_fulfillment_time":900,"frm_routing_algorithm":null,"payout_routing_algorithm":null,"applepay_verified_domains":null,"session_expiry":900,"payment_link_config":{"domain_name":"gdpp-dev.zurich.com","theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico","seller_name":null,"sdk_layout":null,"display_sdk_only":null,"enabled_saved_payment_method":true,"hide_card_nickname_field":null,"show_card_form_by_default":null,"transaction_details":null,"background_image":null,"details_layout":null,"payment_button_text":"Proceed to Payment!","business_specific_configs":null,"allowed_domains":["localhost:5500"],"branding_visibility":null},"authentication_connector_details":null,"use_billing_as_payment_method_billing":true,"extended_card_info_config":null,"collect_shipping_details_from_wallet_connector":false,"collect_billing_details_from_wallet_connector":false,"always_collect_shipping_details_from_wallet_connector":false,"always_collect_billing_details_from_wallet_connector":false,"is_connector_agnostic_mit_enabled":true,"payout_link_config":null,"outgoing_webhook_custom_http_headers":null,"tax_connector_id":null,"is_tax_connector_enabled":false,"is_network_tokenization_enabled":true,"is_auto_retries_enabled":false,"max_auto_retries_enabled":null,"is_click_to_pay_enabled":false,"authentication_product_ids":null}
Verify if relevant network token locker IDs are stored in payment methods table
<img width="1675" alt="Screenshot 2025-02-09 at 2 33 01 PM" src="https://github.com/user-attachments/assets/68114287-9e88-420a-8a1f-dc8474ab3bf0" />
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payment_methods.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/bulk_tokenization.rs`
- `crates/hyperswitch_domain_models/src/lib.rs`
- `crates/hyperswitch_domain_models/src/network_tokenization.rs`
- ... and 1 more files
**3. Core Business Logic**
- `crates/router/src/core/errors.rs`
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payment_methods/cards.rs`
- ... and 5 more files
**4. Type Definitions**
- `crates/router/src/types/api/payment_methods.rs`
- `crates/router/src/types/api/payments.rs`
- `crates/router/src/types/domain.rs`
- ... and 2 more files
**5. Utils**
- `crates/router/src/routes/lock_utils.rs`
**6. 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 (28 changes)
- Implement new functions (67 changes)
- Extend existing types with new fields (692 changes)
- Add conditional logic for feature flags or filtering (5 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 2ff0d4f9:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Add:
- function: private::from
- struct: pub::CardNetworkTokenizeRequest
- struct: pub::TokenizeCardRequest
- struct: pub::TokenizePaymentMethodRequest
- struct: pub::CardNetworkTokenizeResponse
- enum: pub::TokenizeDataRequest
- impl: impl common_utils::events::ApiEventMetric for CardNetworkTokenizeRequest
- impl: impl common_utils::events::ApiEventMetric for CardNetworkTokenizeResponse
- impl: impl From<&Card> for MigrateCardDetail
**crates/hyperswitch_domain_models/src/bulk_tokenization.rs**
Add:
- function: private::foreign_from
- function: private::foreign_from
- function: private::foreign_try_from
- function: private::foreign_from
- function: private::foreign_try_from
- function: private::foreign_from
- function: private::foreign_from
- function: private::foreign_from
- function: private::foreign_from
- function: private::foreign_from
- function: private::foreign_from
- struct: pub::CardNetworkTokenizeRequest
- struct: pub::TokenizeCardRequest
- struct: pub::TokenizePaymentMethodRequest
- struct: pub::CardNetworkTokenizeRecord
- enum: pub::TokenizeDataRequest
- impl: impl ForeignFrom<&CardNetworkTokenizeRecord> for payments_api::CustomerDetails
- impl: impl ForeignFrom<&CardNetworkTokenizeRecord> for payments_api::Address
- impl: impl ForeignTryFrom<CardNetworkTokenizeRecord> for payment_methods_api::CardNetworkTokenizeRequest
- impl: impl ForeignFrom<&TokenizeCardRequest> for payment_methods_api::MigrateCardDetail
- impl: impl ForeignTryFrom<CustomerDetails> for payments_api::CustomerDetails
- impl: impl ForeignFrom<payment_methods_api::CardNetworkTokenizeRequest> for CardNetworkTokenizeRequest
- impl: impl ForeignFrom<payment_methods_api::TokenizeDataRequest> for TokenizeDataRequest
- impl: impl ForeignFrom<payments_api::CustomerDetails> for CustomerDetails
- impl: impl ForeignFrom<payments_api::Address> for Address
- impl: impl ForeignFrom<payments_api::AddressDetails> for AddressDetails
- impl: impl ForeignFrom<payments_api::PhoneDetails> for PhoneDetails
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- mod: pub::bulk_tokenization
**crates/hyperswitch_domain_models/src/network_tokenization.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- function: private::from
- struct: pub::CardDetail
- impl: impl From<&Card> for CardDetail
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/openapi/src/routes/payment_method.rs**
Add:
- function: pub::tokenize_card_api
- function: pub::tokenize_card_using_pm_api
**crates/router/src/core/errors.rs**
Add:
- enum: pub::BulkNetworkTokenizationError
**crates/router/src/core/payment_methods.rs**
Add:
- mod: pub::tokenize
**crates/router/src/core/payment_methods/cards.rs**
Add:
- function: pub::tokenize_card_flow
- function: pub::execute_card_tokenization
- function: pub::execute_payment_method_tokenization
**crates/router/src/core/payment_methods/network_tokenization.rs**
Modify existing code
**crates/router/src/core/payment_methods/tokenize.rs**
Add:
- function: pub::parse_csv
- function: pub::get_tokenize_card_form_records
- function: pub::tokenize_cards
- function: private::new
- function: private::encrypt_card
- function: private::encrypt_network_token
- function: private::fetch_bin_details_and_validate_card_network
- function: private::tokenize_card
- function: private::validate_card_network
- function: private::store_network_token_in_locker
- struct: pub::CardNetworkTokenizeForm
- struct: pub::StoreLockerResponse
- struct: pub::NetworkTokenizationBuilder
- struct: pub::CardNetworkTokenizeExecutor
- trait: pub::State
- trait: pub::TransitionTo
- trait: pub::NetworkTokenizationProcess
- impl: impl NetworkTokenizationProcess<'a, D> for CardNetworkTokenizeExecutor<'a, D>
- mod: pub::card_executor
- mod: pub::payment_method_executor
**crates/router/src/core/payment_methods/tokenize/card_executor.rs**
Add:
- function: private::default
- function: pub::new
- function: pub::set_validate_result
- function: pub::set_card_details
- function: pub::set_customer
- function: pub::get_optional_card_and_cvc
- function: pub::set_token_details
- function: pub::set_stored_card_response
- function: pub::set_stored_token_response
- function: pub::set_payment_method_response
- function: pub::build
- function: pub::validate_request_and_fetch_optional_customer
- function: pub::create_customer
- function: pub::store_card_and_token_in_locker
- function: pub::store_card_in_locker
- function: pub::create_payment_method
- struct: pub::TokenizeWithCard
- struct: pub::CardRequestValidated
- struct: pub::CardDetailsAssigned
- struct: pub::CustomerAssigned
- struct: pub::CardTokenized
- struct: pub::CardStored
- struct: pub::CardTokenStored
- struct: pub::PaymentMethodCreated
- impl: impl State for TokenizeWithCard
- impl: impl State for CustomerAssigned
- impl: impl State for CardRequestValidated
- impl: impl State for CardDetailsAssigned
- impl: impl State for CardTokenized
- impl: impl State for CardStored
- impl: impl State for CardTokenStored
- impl: impl State for PaymentMethodCreated
- impl: impl TransitionTo<CardRequestValidated> for TokenizeWithCard
- impl: impl TransitionTo<CardDetailsAssigned> for CardRequestValidated
- impl: impl TransitionTo<CustomerAssigned> for CardDetailsAssigned
- impl: impl TransitionTo<CardTokenized> for CustomerAssigned
- impl: impl TransitionTo<CardTokenStored> for CardTokenized
- impl: impl TransitionTo<PaymentMethodCreated> for CardTokenStored
- impl: impl Default for NetworkTokenizationBuilder<'_, TokenizeWithCard>
- impl: impl NetworkTokenizationBuilder<'a, TokenizeWithCard>
- impl: impl NetworkTokenizationBuilder<'a, CardRequestValidated>
- impl: impl NetworkTokenizationBuilder<'a, CardDetailsAssigned>
- impl: impl NetworkTokenizationBuilder<'a, CustomerAssigned>
- impl: impl NetworkTokenizationBuilder<'a, CardTokenized>
- impl: impl NetworkTokenizationBuilder<'a, CardStored>
- impl: impl NetworkTokenizationBuilder<'a, CardTokenStored>
- impl: impl NetworkTokenizationBuilder<'_, PaymentMethodCreated>
- impl: impl CardNetworkTokenizeExecutor<'_, domain::TokenizeCardRequest>
**crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs**
Add:
- function: private::default
- function: pub::new
- function: pub::set_payment_method
- function: pub::set_validate_result
- function: pub::set_card_details
- function: pub::get_optional_card_and_cvc
- function: pub::set_token_details
- function: pub::set_stored_token_response
- function: pub::set_payment_method
- function: pub::build
- function: pub::fetch_payment_method
- function: pub::validate_request_and_locker_reference_and_customer
- function: pub::update_payment_method
- struct: pub::TokenizeWithPmId
- struct: pub::PmValidated
- struct: pub::PmFetched
- struct: pub::PmAssigned
- struct: pub::PmTokenized
- struct: pub::PmTokenStored
- struct: pub::PmTokenUpdated
- impl: impl State for TokenizeWithPmId
- impl: impl State for PmValidated
- impl: impl State for PmFetched
- impl: impl State for PmAssigned
- impl: impl State for PmTokenized
- impl: impl State for PmTokenStored
- impl: impl State for PmTokenUpdated
- impl: impl TransitionTo<PmFetched> for TokenizeWithPmId
- impl: impl TransitionTo<PmValidated> for PmFetched
- impl: impl TransitionTo<PmAssigned> for PmValidated
- impl: impl TransitionTo<PmTokenized> for PmAssigned
- impl: impl TransitionTo<PmTokenStored> for PmTokenized
- impl: impl TransitionTo<PmTokenUpdated> for PmTokenStored
- impl: impl Default for NetworkTokenizationBuilder<'_, TokenizeWithPmId>
- impl: impl NetworkTokenizationBuilder<'a, TokenizeWithPmId>
- impl: impl NetworkTokenizationBuilder<'a, PmFetched>
- impl: impl NetworkTokenizationBuilder<'a, PmValidated>
- impl: impl NetworkTokenizationBuilder<'a, PmAssigned>
- impl: impl NetworkTokenizationBuilder<'a, PmTokenized>
- impl: impl NetworkTokenizationBuilder<'a, PmTokenStored>
- impl: impl NetworkTokenizationBuilder<'_, PmTokenUpdated>
- impl: impl CardNetworkTokenizeExecutor<'_, domain::TokenizePaymentMethodRequest>
**crates/router/src/core/payments/tokenization.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Add:
- function: pub::tokenize_card_api
- function: pub::tokenize_card_using_pm_api
- function: pub::tokenize_card_batch_api
**crates/router/src/types/api/payment_methods.rs**
Modify existing code
**crates/router/src/types/api/payments.rs**
Modify existing code
**crates/router/src/types/domain.rs**
Modify existing code
**crates/router/src/types/domain/payments.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 7066, "pr_title": "feat(core): add bulk tokenization flows", "merged_at": "2025-03-07T13:24:06Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "domain": ["crates/hyperswitch_domain_models/src/bulk_tokenization.rs", "crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/network_tokenization.rs", "crates/hyperswitch_domain_models/src/payment_method_data.rs"], "core_business": ["crates/router/src/core/errors.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/network_tokenization.rs", "crates/router/src/core/payment_methods/tokenize.rs", "crates/router/src/core/payment_methods/tokenize/card_executor.rs", "crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs", "crates/router/src/core/payments/tokenization.rs"], "types": ["crates/router/src/types/api/payment_methods.rs", "crates/router/src/types/api/payments.rs", "crates/router/src/types/domain.rs", "crates/router/src/types/domain/payments.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.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", "crates/router/src/routes/app.rs", "crates/router/src/routes/payment_methods.rs"]}, "change_types": {"structs_added": 28, "functions_added": 67, "enums_added": 3, "fields_added": 692, "imports_added": 38, "conditionals_added": 5, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix: web-docker pull from docker hub
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Docker pull from latest stable tag
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Web Docker Image was not working properly
<img width="1043" alt="Screenshot 2025-04-02 at 3 40 52 PM" src="https://github.com/user-attachments/assets/514b49c8-6a63-4c5b-934b-9d2f0709fc5f" />
Now with this fix its working
## How did you test it?
Via locally running Docker Image
## Checklist
<!-- Put an `x` in the boxes that 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 **validation** feature, you'll need to modify these architectural layers:
**1. Configuration Files**
- `docker-compose.yml`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
|
{"pr_number": 7700, "pr_title": "fix: web-docker pull from docker hub", "merged_at": "2025-04-03T07:29:59Z", "intent": {"feature_type": "validation", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"config": ["docker-compose.yml"]}, "change_types": {"fields_added": 2}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(users): add bad request for openidconnect
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Added a BadRequest response for SSO login when an invalid authorization code is provided.
<!-- Describe your changes in detail -->
### 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
Currently, when users provide an invalid or expired code during SSO login, the system returns a 500 response. This is misleading, as the issue is with the client input rather than a server error. This change introduces a proper 400 BadRequest response to better reflect the actual problem and improve error handling.
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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?
```sh
curl --location '<BASE URL>/user/oidc' \
--header 'Content-Type: application/json' \
--data '{
"state": "<correct state>",
"code": "<wrong code>"
}'
```
This should give `400` instead of 500.
<!--
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. Other**
- `crates/router/src/services/openidconnect.rs`
**Code Patterns Applied:**
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 09d475b4:
Files to modify:
**crates/router/src/services/openidconnect.rs**
Modify existing code
|
{"pr_number": 9244, "pr_title": "fix(users): add bad request for openidconnect", "merged_at": "2025-09-10T08:51:15Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"other": ["crates/router/src/services/openidconnect.rs"]}, "change_types": {"conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
revert: implement `NameType` for name validation (#6734)
This reverts commit 1100dcc6053990cf832c00cf29db700d77f78480.
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR revert #6734 in main
This is hotfix for https://github.com/juspay/hyperswitch/pull/7717
Reason: digit couldn't be added to nickname because nickname have the same validation as cardholder name.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/customers.rs`
- `crates/api_models/src/mandates.rs`
- `crates/api_models/src/payment_methods.rs`
- ... and 3 more files
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/address.rs`
- `crates/hyperswitch_domain_models/src/bulk_tokenization.rs`
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
- ... and 2 more files
**3. Core Business Logic**
- `crates/router/src/core/customers.rs`
- `crates/router/src/core/locker_migration.rs`
- `crates/router/src/core/payment_methods.rs`
- ... and 11 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs`
- ... and 34 more files
**5. Type Definitions**
- `crates/common_utils/src/types.rs`
- `crates/router/src/compatibility/stripe/customers/types.rs`
- `crates/router/src/compatibility/stripe/payment_intents/types.rs`
- ... and 3 more files
**6. Utils**
- `crates/router/src/utils.rs`
**7. Tests**
- `crates/cards/tests/basic.rs`
- `crates/router/tests/payments.rs`
- `crates/router/tests/payments2.rs`
**Code Patterns Applied:**
- Implement new functions (8 changes)
- Extend existing types with new fields (249 changes)
- Add conditional logic for feature flags or filtering (2 changes)
|
{"pr_number": 7718, "pr_title": "revert: implement `NameType` for name validation (#6734)", "merged_at": "2025-04-03T16:24:25Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["card"]}, "hierarchy": {"api_models": ["crates/api_models/src/customers.rs", "crates/api_models/src/mandates.rs", "crates/api_models/src/payment_methods.rs", "crates/api_models/src/payments.rs", "crates/api_models/src/payments/additional_info.rs", "crates/api_models/src/payouts.rs"], "domain": ["crates/hyperswitch_domain_models/src/address.rs", "crates/hyperswitch_domain_models/src/bulk_tokenization.rs", "crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_request_types/fraud_check.rs"], "core_business": ["crates/router/src/core/customers.rs", "crates/router/src/core/locker_migration.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/network_tokenization.rs", "crates/router/src/core/payment_methods/tokenize.rs", "crates/router/src/core/payment_methods/tokenize/card_executor.rs", "crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs", "crates/router/src/core/payment_methods/transformers.rs", "crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payouts/helpers.rs", "crates/router/src/core/unified_authentication_service.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/netcetera/netcetera_types.rs", "crates/router/src/connector/payone/transformers.rs", "crates/router/src/connector/riskified/transformers/api.rs", "crates/router/src/connector/signifyd/transformers/api.rs", "crates/router/src/connector/stripe/transformers.rs", "crates/router/src/connector/stripe/transformers/connect.rs", "crates/router/src/connector/utils.rs", "crates/router/tests/connectors/aci.rs", "crates/router/tests/connectors/adyen.rs", "crates/router/tests/connectors/airwallex.rs", "crates/router/tests/connectors/bitpay.rs", "crates/router/tests/connectors/bluesnap.rs", "crates/router/tests/connectors/coinbase.rs", "crates/router/tests/connectors/cryptopay.rs", "crates/router/tests/connectors/cybersource.rs", "crates/router/tests/connectors/fiserv.rs", "crates/router/tests/connectors/forte.rs", "crates/router/tests/connectors/iatapay.rs", "crates/router/tests/connectors/multisafepay.rs", "crates/router/tests/connectors/opennode.rs", "crates/router/tests/connectors/payme.rs", "crates/router/tests/connectors/rapyd.rs", "crates/router/tests/connectors/trustpay.rs", "crates/router/tests/connectors/utils.rs", "crates/router/tests/connectors/worldline.rs"], "types": ["crates/common_utils/src/types.rs", "crates/router/src/compatibility/stripe/customers/types.rs", "crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs", "crates/router/src/types/api/payments.rs", "crates/router/src/types/transformers.rs"], "utils": ["crates/router/src/utils.rs"], "tests": ["crates/cards/tests/basic.rs", "crates/router/tests/payments.rs", "crates/router/tests/payments2.rs"]}, "change_types": {"functions_added": 8, "fields_added": 249, "imports_added": 7, "conditionals_added": 2}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
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
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This pull request enhances the data migration API to support migrating customer and payment method data across multiple business profiles in a single request.
Specifically, the following changes have been made:
1. **Customer Data Migration:**
* Updated `PaymentMethodRecord` to allow `merchant_connector_id` to accept comma-separated string values.
* Modified `PaymentMethodCustomerMigrate` to use a `Vec` of connector-specific customer details.
* The `TryFrom<PaymentMethodRecord>` implementation for `PaymentMethodCustomerMigrate` has been updated to parse this comma-separated string.
2. **Payment Method Migration:**
* Updated `PaymentMethodsMigrateForm` to accept a comma-separated string for `merchant_connector_id`.
* The `get_payment_method_records` and `migrate_payment_methods` functions are updated to process multiple `merchant_connector_id`s.
* The `TryFrom` implementation for `PaymentMethodMigrate` is modified to create a `PaymentsMandateReference` for each `merchant_connector_id` provided.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
This allows migrating a payment method entity across multiple profiles (as `MerchantConnectorAccountId` is tied to a profile) during batch migration.
## How did you test it?
<details>
<summary>1. Batch migration for multiple profiles</summary>
cURL
curl --location --request POST 'http://localhost:8080/payment_methods/migrate-batch' \
--header 'api-key: test_admin' \
--form 'merchant_id="merchant_1751020165"' \
--form 'merchant_connector_ids="mca_lwpasOxD1FtFmG4SVdjX,mca_4tsKLvIinX1uVL8p9mhy"' \
--form 'file=@"migrate.csv"'
Response
[{"line_number":1,"payment_method_id":"pm_AO2rTJwFIH0I9yQiZ0zT","payment_method":"card","payment_method_type":"debit","customer_id":"45CC60D1F2283097BB1DE41A2636414445908518D50B8B4CDC57959CD7FB4539","migration_status":"Success","card_number_masked":"4360000 xxxx 0005","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":2,"payment_method_id":"pm_ZN9z4oKF439uxyBerwfL","payment_method":"card","payment_method_type":"credit","customer_id":"782BC898951D910C1A99DA69A4E4FAD6CEE53AB9311FA2C552028DA89428DB7F","migration_status":"Success","card_number_masked":"4111111 xxxx 1111","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null}]
Things to verify in DB
1. `connector_mandate_details` for a given payment_method_id in response has connector_mandate_id for multiple MCAs
<img width="421" alt="Screenshot 2025-06-28 at 3 09 18 PM" src="https://github.com/user-attachments/assets/8cfe8449-5ed1-441e-bd77-26540d5b6531" />
2. `connector_customer` for a given customer_id in response has mappings for multiple MCAs
<img width="748" alt="Screenshot 2025-06-28 at 3 09 41 PM" src="https://github.com/user-attachments/assets/dec23184-8014-4d8c-91b4-369ec6670e22" />
</details>
<details>
<summary>2. Batch migration for a single profile - For ensuring backwards compatibility</summary>
cURL
curl --location --request POST 'http://localhost:8080/payment_methods/migrate-batch' \
--header 'api-key: test_admin' \
--form 'merchant_id="merchant_1751020165"' \
--form 'merchant_connector_id="mca_lwpasOxD1FtFmG4SVdjX"' \
--form 'file=@"migrate.csv"'
Response
[{"line_number":1,"payment_method_id":"pm_ZGPPsRrU5f4IgVpMS9tj","payment_method":"card","payment_method_type":"debit","customer_id":"45CC60D1F2283097BB1DE41A2636414445908518D50B8B4CDC57959CD7FB4539","migration_status":"Success","card_number_masked":"4360000 xxxx 0005","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null},{"line_number":2,"payment_method_id":"pm_Lf2vcheQkYIiZx8PIDHt","payment_method":"card","payment_method_type":"credit","customer_id":"782BC898951D910C1A99DA69A4E4FAD6CEE53AB9311FA2C552028DA89428DB7F","migration_status":"Success","card_number_masked":"4111111 xxxx 1111","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":true,"network_transaction_id_migrated":null}]
Things to verify in DB
- PM migration happens for a single MCA (connector_mandate_details)
- Customer migration happens for a single MCA (connector_customer)
</details>
Sample migration data for multi profile migration
[multi-migrate-sample.csv](https://github.com/user-attachments/files/20974125/multi-migrate-sample.csv)
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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 ce2b90b3:
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": 8473, "pr_title": "feat(data-migration): add connector customer and mandate details support for multiple profiles", "merged_at": "2025-07-01T10:07:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "domain": ["crates/hyperswitch_domain_models/src/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"}
|
chore(analytics): opensearch client creation based on config
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Making `OpenSearchClient` optional based on the config for querying OpenSearch Server for dashboard based on the Deployment status of the same ( OpenSearch Server ).
### 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).
-->
When you don't have OpenSearch deployed for Global Search feature on dashboard , the `/health/ready` ( deep health check ) API which checks health of all the underlying queryable resources fails because OpenSearch is not present.
To make it optional based on the deployment type needs changes and should be dependent on a config which should be given out on time of router deployment
Currently if you don't have OpenSearch Deployment and have router running
```bash
curl http://localhost:8080/health/ready -v
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET /health/ready HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 500 Internal Server Error
< content-length: 136
< access-control-expose-headers: x-request-id, content-type, via, strict-transport-security
< via: HyperSwitch
< x-request-id: 019634f7-a837-7d50-9a50-bb8e7651bd62
< content-type: application/json
< vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers
< strict-transport-security: max-age=31536000
< date: Mon, 14 Apr 2025 15:42:47 GMT
<
{ [136 bytes data]
100 136 100 136 0 0 7613 0 --:--:-- --:--:-- --:--:-- 8000
* Connection #0 to host localhost left intact
{
"error": {
"type": "api",
"message": "Opensearch health check failed with error: Error while executing query in Opensearch",
"code": "HE_00"
}
}
```
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
```bash
curl http://localhost:8080/health/ready -v | jq .
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET /health/ready HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< content-length: 90
< content-type: application/json
< x-request-id: 01963e0a-e41d-7251-b20a-e9a0a6d1a67a
< vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers
< access-control-expose-headers: content-type, strict-transport-security, x-request-id, via
< strict-transport-security: max-age=31536000
< via: HyperSwitch
< date: Wed, 16 Apr 2025 10:00:23 GMT
<
{ [90 bytes data]
100 90 100 90 0 0 236 0 --:--:-- --:--:-- --:--:-- 236
* Connection #0 to host localhost left intact
{
"database": true,
"redis": true,
"analytics": true,
"opensearch": false,
"outgoing_request": true
}
```
## 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/health_check.rs`
**2. Configuration Files**
- `config/config.example.toml`
- `config/deployments/env_specific.toml`
- `config/development.toml`
- ... and 1 more files
**3. Other**
- `crates/analytics/src/opensearch.rs`
- `crates/router/src/analytics.rs`
- `crates/router/src/routes/app.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (5 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 2067bc35:
Files to modify:
**crates/analytics/src/opensearch.rs**
Modify existing code
**crates/router/src/analytics.rs**
Modify existing code
**crates/router/src/core/health_check.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
|
{"pr_number": 7810, "pr_title": "chore(analytics): opensearch client creation based on config", "merged_at": "2025-04-17T08:33:47Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"core_business": ["crates/router/src/core/health_check.rs"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/development.toml", "config/docker_compose.toml"], "other": ["crates/analytics/src/opensearch.rs", "crates/router/src/analytics.rs", "crates/router/src/routes/app.rs"]}, "change_types": {"functions_added": 1, "fields_added": 5, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(mandates): Allow connector_mandate_detail updation in case of 'Authorized' Payments
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Earlier we used to store the connector mandate id only in case of charged payments, Ideally we should store for both authorized and charged
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
Earlier
**CIT 3DS Auth**
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_l2PIg8yKpNpJYfXwnSgY8IppXOrB0Nz9OAfD36Y6Xtar5h5nyO5AgVhulydeirKW' \
--data-raw '{
"currency":"USD",
"amount": 300,
"confirm": true,
"amount_to_capture": 300,
"customer_id": "malay12345",
"capture_method": "manual",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"return_url": "https://www.google.com",
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"payment_method": "card",
"setup_future_usage":"off_session",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "CA",
"zip": "94122",
"country": "PL",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "109.71.40.0"
},
"metadata": {
"order_category": "applepay"
},
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 300,
"account_name": "transaction_processing"
}
],
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
}
}'
```
Repsonse
```
{
"payment_id": "pay_TZapMDLw1izXY80fkWEH",
"merchant_id": "postman_merchant_GHAction_f1627cea-94e6-4ac1-a32c-f5b323bd2352",
"status": "requires_customer_action",
"amount": 300,
"net_amount": 300,
"shipping_cost": null,
"amount_capturable": 300,
"amount_received": 0,
"connector": "stripe",
"client_secret": "pay_TZapMDLw1izXY80fkWEH_secret_Fa5P4Jmz6jprceQncpGy",
"created": "2024-10-21T11:06:52.457Z",
"currency": "USD",
"customer_id": "malay12345",
"customer": {
"id": "malay12345",
"name": "Joseph Doe",
"email": "something@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "PL",
"line1": "1467",
"line2": "CA",
"line3": "Harrison Street",
"zip": "94122",
"state": "CA",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": [
{
"brand": null,
"amount": 300,
"category": null,
"quantity": 1,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"requires_shipping": null
}
],
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://www.google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_TZapMDLw1izXY80fkWEH/postman_merchant_GHAction_f1627cea-94e6-4ac1-a32c-f5b323bd2352/pay_TZapMDLw1izXY80fkWEH_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": "",
"created_at": 1729508812,
"expires":,
"secret": ""
},
"manual_retry_allowed": null,
"connector_transaction_id": "",
"frm_message": null,
"metadata": {
"order_category": "applepay"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "",
"payment_link": null,
"profile_id": "",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-21T11:21:52.457Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "109.71.40.0",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_xoZahWXv8FU7pce7ZjsK",
"payment_method_status": "inactive",
"updated": "2024-10-21T11:06:53.794Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": ""
}
```
connector_mandate_details not populated after the successful Authorization+Capture call,
<img width="1029" alt="Screenshot 2024-10-21 at 4 44 40 PM" src="https://github.com/user-attachments/assets/20b84eea-0963-426b-a199-c3b2cb1bbc24">
**After the Changes**
CIT
```
3DS Auth
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_l2PIg8yKpNpJYfXwnSgY8IppXOrB0Nz9OAfD36Y6Xtar5h5nyO5AgVhulydeirKW' \
--data-raw '{
"currency":"USD",
"amount": 300,
"confirm": true,
"amount_to_capture": 300,
"customer_id": "malay123456",
"capture_method": "manual",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"return_url": "https://www.google.com",
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"payment_method": "card",
"setup_future_usage":"off_session",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "CA",
"zip": "94122",
"country": "PL",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "109.71.40.0"
},
"metadata": {
"order_category": "applepay"
},
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 300,
"account_name": "transaction_processing"
}
],
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
}
}'
```
```
Repsonse
{
"payment_id": "pay_f0asI05qFiTpX56aytDw",
"merchant_id": "postman_merchant_GHAction_f1627cea-94e6-4ac1-a32c-f5b323bd2352",
"status": "requires_customer_action",
"amount": 300,
"net_amount": 300,
"shipping_cost": null,
"amount_capturable": 300,
"amount_received": 0,
"connector": "stripe",
"client_secret": "pay_f0asI05qFiTpX56aytDw_secret_K3fvrqKOfg2zUt4WlnCA",
"created": "2024-10-21T11:16:29.680Z",
"currency": "USD",
"customer_id": "malay123456",
"customer": {
"id": "malay123456",
"name": "Joseph Doe",
"email": "something@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "PL",
"line1": "1467",
"line2": "CA",
"line3": "Harrison Street",
"zip": "94122",
"state": "CA",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": [
{
"brand": null,
"amount": 300,
"category": null,
"quantity": 1,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"requires_shipping": null
}
],
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://www.google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_f0asI05qFiTpX56aytDw/postman_merchant_GHAction_f1627cea-94e6-4ac1-a32c-f5b323bd2352/pay_f0asI05qFiTpX56aytDw_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": "malay123456",
"created_at": 1729509389,
"expires": 1729512989,
"secret": "epk_66072a2ebcc04f94a9030ec641d12bbb"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pi_3QCJb8D5R7gDAGff1zOIY34p",
"frm_message": null,
"metadata": {
"order_category": "applepay"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3QCJb8D5R7gDAGff1zOIY34p",
"payment_link": null,
"profile_id": "pro_hywyKTTMR8vbgRrlByUs",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_kUu56HqR9wmzMl8Eyw37",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-21T11:31:29.680Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "109.71.40.0",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_TqA1v1swJWaIAosbngS7",
"payment_method_status": "inactive",
"updated": "2024-10-21T11:16:30.793Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "pm_1QCJb8D5R7gDAGffQQgPIlwV"
}
```
Connector_mandate_details updated
<img width="1496" alt="Screenshot 2024-10-21 at 4 51 01 PM" src="https://github.com/user-attachments/assets/0ff1bf30-cf4f-490d-8292-e17491a9f9a7">
MIT Payments
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_l2PIg8yKpNpJYfXwnSgY8IppXOrB0Nz9OAfD36Y6Xtar5h5nyO5AgVhulydeirKW' \
--data '{
"amount": 999,
"currency": "USD",
"confirm": true,
"customer_id": "malay123456",
"return_url": "https://google.com",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_TqA1v1swJWaIAosbngS7"
},
"off_session": true,
"billing": {
"address": {
"first_name": "John",
"last_name": "Doe",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
}
}'
```
Response
```
{
"payment_id": "pay_6Rke8ssTgVD8tpgdzAoY",
"merchant_id": "postman_merchant_GHAction_f1627cea-94e6-4ac1-a32c-f5b323bd2352",
"status": "succeeded",
"amount": 999,
"net_amount": 999,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 999,
"connector": "stripe",
"client_secret": "pay_6Rke8ssTgVD8tpgdzAoY_secret_kMoLCmtZNaYBjz7PiakM",
"created": "2024-10-21T11:22:13.696Z",
"currency": "USD",
"customer_id": "malay123456",
"customer": {
"id": "malay123456",
"name": "Joseph Doe",
"email": "something@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "malay123456",
"created_at": 1729509733,
"expires": 1729513333,
"secret": "epk_0f6a979a0fa74288af9da2b3d966814a"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3QCJggD5R7gDAGff1FIsbuSL",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3QCJggD5R7gDAGff1FIsbuSL",
"payment_link": null,
"profile_id": "pro_hywyKTTMR8vbgRrlByUs",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_kUu56HqR9wmzMl8Eyw37",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-21T11:37:13.696Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_TqA1v1swJWaIAosbngS7",
"payment_method_status": "active",
"updated": "2024-10-21T11:22:14.920Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "pm_1QCJb8D5R7gDAGffQQgPIlwV"
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/operations/payment_response.rs`
**Code Patterns Applied:**
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit d09a805c:
Files to modify:
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
|
{"pr_number": 6379, "pr_title": "fix(mandates): Allow connector_mandate_detail updation in case of 'Authorized' Payments", "merged_at": "2024-10-21T14:18:31Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/payment_response.rs"]}, "change_types": {"conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(deployment-config): remove invalid currencies from worldpay filters
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Includes below changes -
- Fixes Worldpay's payment method filters
- Makes `payment_method_type` non-mandatatory for Cards
### 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?
Locally through payment links.
Things to test
1. Payments through SDK
<details>
<summary>1. Payments through SDK</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_sMl3D9efytjSoXznSOKCv5PHyql50M1BMhU8e7qsa5m6mXxHvyROVg7cER7AWue9' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_5A3VgopTFe8q83EEHgTq","profile_id":"pro_OodaMoJ1Y9nlnegU4soR","amount":100,"currency":"USD","payment_link":true,"capture_method":"automatic","setup_future_usage":"on_session","connector":["worldpay"],"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"US","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"}},"email":"john.doe@example.com","session_expiry":10000,"return_url":"https://example.com","payment_link_config":{"theme":"#14356f","logo":"https://hyperswitch.io/favicon.ico","seller_name":"HyperSwitch Inc."}}'
Response
{"payment_id":"pay_kjjXmgjTxSxUI598uRJ6","merchant_id":"merchant_1728979001","status":"requires_payment_method","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":null,"client_secret":"pay_kjjXmgjTxSxUI598uRJ6_secret_LeagJMq1vWdgjvPC1dHG","created":"2024-10-23T12:54:25.970Z","currency":"USD","customer_id":"cus_5A3VgopTFe8q83EEHgTq","customer":{"id":"cus_5A3VgopTFe8q83EEHgTq","name":"John Doe","email":"john.doe@example.com","phone":"999999999","phone_country_code":"+65"},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":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":"CA","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":"john.doe@example.com","name":"John Doe","phone":"999999999","return_url":"https://example.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_5A3VgopTFe8q83EEHgTq","created_at":1729688065,"expires":1729691665,"secret":"epk_dacf70917d6c42149373e4864df4f59b"},"manual_retry_allowed":null,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":{"link":"http://localhost:8080/payment_link/merchant_1728979001/pay_kjjXmgjTxSxUI598uRJ6?locale=en","secure_link":null,"payment_link_id":"plink_pk7a6Jn1WEtnN0CF47ue"},"profile_id":"pro_OodaMoJ1Y9nlnegU4soR","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":null,"incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2024-10-23T15:41:05.969Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2024-10-23T12:54:25.979Z","charges":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}
Open payment link and complete the txn
https://github.com/user-attachments/assets/0160ec30-c991-4f86-a5d0-539958e8b8f8
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/router/src/connector/worldpay/transformers.rs`
**2. Configuration Files**
- `config/deployments/sandbox.toml`
**Code Patterns Applied:**
- Extend existing types with new fields (3 changes)
**Detailed Identifier Changes:**
Commit aee11c56:
Files to modify:
**crates/router/src/connector/worldpay/transformers.rs**
Modify existing code
|
{"pr_number": 6400, "pr_title": "fix(deployment-config): remove invalid currencies from worldpay filters", "merged_at": "2024-10-23T14:23:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/connector/worldpay/transformers.rs"], "config": ["config/deployments/sandbox.toml"]}, "change_types": {"fields_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Handle incoming webhooks adyen
## 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 -->
Hotfix for https://github.com/juspay/hyperswitch/pull/9372
Add acknowledgement in adyen for incoming webhooks by sending status 200.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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)?
-->
We need to create two profiles having same adyen account, both the profiles should return 200 to webhooks even if it doesnt belongs to them.
here i made two profiles:
```
pro_JcW9GqodbWptCntfDiiJ : mca_kAzlkhIkGnErSSc3L6Xr
pro_4vFskA1mTL8nf81s9Fzq : mca_4F3FOjPSWuvclkKoiG06
```
Making below payments API:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_**' \
--data-raw '{
"amount": 700,
"currency": "USD",
"confirm": true,
"customer_id":"StripeCustomer",
"payment_link": false,
"capture_on": "2029-09-10T10:11:12Z",
"amount_to_capture": 700,
"name": "John Doe",
"email": "dg@example.com",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "30",
"card_cvc": "737"
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
}
},
"payment_method": "card",
"payment_method_type": "credit",
"profile_id": "pro_JcW9GqodbWptCntfDiiJ",
"browser_info": {
"color_depth": 24,
"java_enabled": true,
"java_script_enabled": true,
"language": "en-GB",
"screen_height": 720,
"screen_width": 1280,
"time_zone": -330,
"ip_address": "208.127.127.193",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0"
},
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"order_details": [
{
"product_name": "Tea",
"quantity": 1,
"amount": 110,
"product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
},
{
"product_name": "Tea",
"quantity": 1,
"amount": 110,
"product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
},
{
"product_name": "Tea",
"quantity": 1,
"amount": 110,
"product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
}
]
}'
```
Response:
```
{"payment_id":"pay_MGlcQq5UaVDvYSXAY6Xn","merchant_id":"merchant_1757925069","status":"succeeded","amount":700,"net_amount":700,"shipping_cost":null,"amount_capturable":0,"amount_received":700,"connector":"adyen","client_secret":"pay_MGlcQq5UaVDvYSXAY6Xn_secret_80ZstwkCzm9TyJVSzWLP","created":"2025-09-15T17:15:06.446Z","currency":"USD","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":"John Doe","email":"dg@example.com","phone":"999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"CA","line3":null,"zip":"94122","state":"California","first_name":null,"last_name":null,"origin_zip":null},"phone":null,"email":null}},"payment_token":null,"shipping":null,"billing":null,"order_details":[{"sku":null,"upc":null,"brand":null,"amount":110,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"description":null,"product_name":"Tea","product_type":null,"sub_category":null,"total_amount":null,"commodity_code":null,"unit_of_measure":null,"product_img_link":"https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg","product_tax_code":null,"total_tax_amount":null,"requires_shipping":null,"unit_discount_amount":null},{"sku":null,"upc":null,"brand":null,"amount":110,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"description":null,"product_name":"Tea","product_type":null,"sub_category":null,"total_amount":null,"commodity_code":null,"unit_of_measure":null,"product_img_link":"https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg","product_tax_code":null,"total_tax_amount":null,"requires_shipping":null,"unit_discount_amount":null},{"sku":null,"upc":null,"brand":null,"amount":110,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"description":null,"product_name":"Tea","product_type":null,"sub_category":null,"total_amount":null,"commodity_code":null,"unit_of_measure":null,"product_img_link":"https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg","product_tax_code":null,"total_tax_amount":null,"requires_shipping":null,"unit_discount_amount":null}],"email":"dg@example.com","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"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":1757956506,"expires":1757960106,"secret":"epk_"},"manual_retry_allowed":false,"connector_transaction_id":"MW2KB77642TBJWT5","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_MGlcQq5UaVDvYSXAY6Xn_1","payment_link":null,"profile_id":"pro_JcW9GqodbWptCntfDiiJ","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_kAzlkhIkGnErSSc3L6Xr","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-09-15T17:30:06.446Z","fingerprint":null,"browser_info":{"language":"en-GB","time_zone":-330,"ip_address":"208.127.127.193","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0","color_depth":24,"java_enabled":true,"screen_width":1280,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":720,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":"596288259500941","payment_method_status":null,"updated":"2025-09-15T17:15:07.684Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null,"enable_partial_authorization":null,"enable_overcapture":null,"is_overcapture_enabled":null,"network_details":null}
```
Refund:
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_OvYaTu43QFXUxM2Xs1KHS7YkWRkkh5nXp7x2BENotNMBzwCWVA0Yeug0f12ofDsB' \
--data '{
"payment_id": "pay_MGlcQq5UaVDvYSXAY6Xn",
"amount": 700,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
Response:
```
{"refund_id":"ref_aZfW2HjCEJKhRgsZguPr","payment_id":"pay_MGlcQq5UaVDvYSXAY6Xn","amount":700,"currency":"USD","status":"pending","reason":"Customer returned product","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"error_message":null,"error_code":null,"unified_code":null,"unified_message":null,"created_at":"2025-09-15T17:16:30.637Z","updated_at":"2025-09-15T17:16:31.861Z","connector":"adyen","profile_id":"pro_JcW9GqodbWptCntfDiiJ","merchant_connector_id":"mca_kAzlkhIkGnErSSc3L6Xr","split_refunds":null,"issuer_error_code":null,"issuer_error_message":null}
```
<img width="1888" height="127" alt="image" src="https://github.com/user-attachments/assets/562ef85f-f9c0-404e-b159-caa5ecfb06cb" />
<img width="1888" height="127" alt="image (1)" src="https://github.com/user-attachments/assets/de279cc0-5609-4e44-9396-98c3ab730b60" />
<img width="1888" height="127" alt="image (2)" src="https://github.com/user-attachments/assets/f3683d5e-c866-4fd7-9f9e-75c214f8267e" />
<img width="1888" height="127" alt="image" src="https://github.com/user-attachments/assets/c49f8495-f628-497e-baaa-e7c51957eb10" />
<img width="3456" height="2234" alt="image (6)" src="https://github.com/user-attachments/assets/5a0918e2-2cea-4bda-a135-63a637041079" />
Cargo clippy:
<img width="1728" height="1117" alt="image" src="https://github.com/user-attachments/assets/43bcbd3d-574d-44a9-97d0-62c949bd7f18" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/common_enums/src/connector_enums.rs`
- `crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs`
**Detailed Identifier Changes:**
Commit eb2d5a6b:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs**
Modify existing code
|
{"pr_number": 9425, "pr_title": "feat(router): Handle incoming webhooks adyen", "merged_at": "2025-09-17T18:56:54Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(dashboard_metadata): mask `poc_email` and `data_value` for DashboardMetadata
## 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 -->
- (api_models): change the `poc_email` type to `Secret<String>`
- Add some `pii::Email` validation to check for input validity
- (diesel_models): change `data_value` to `Secret<serde_json::Value>`
## Fixes #7128
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
`poc_email` isn't masked for `DashboardMetadata` which leads to it being logged both at API and diesel query level.
Example:
<img width="1114" alt="Image" src="https://github.com/user-attachments/assets/8aa98114-b492-40bf-bddf-68323f86ffc0" />
## How did you test 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 set metadata:
```bash
curl --location 'http://localhost:8080/user/data' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{TOKEN}}' \
--data '
{
"ProdIntent": {
"is_completed": true,
"legal_business_name": "test",
"business_label": "test",
"business_location": "US",
"display_name": "test",
"poc_email": "test@gmail.com",
"business_type": "test",
"business_identifier": "test",
"business_website": "test",
"poc_name": "test",
"poc_contact": "test",
"comments": "test"
}
}
'
```
Result:
<img width="815" alt="Screenshot 2025-01-28 at 3 03 49 PM" src="https://github.com/user-attachments/assets/039d9ee6-88f3-4213-92d6-0f6dba73c010" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/user/dashboard_metadata.rs`
**3. Core Business Logic**
- `crates/router/src/core/user/dashboard_metadata.rs`
**4. Type Definitions**
- `crates/router/src/services/email/types.rs`
**5. Utils**
- `crates/router/src/utils/user/dashboard_metadata.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (10 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 9b1b2455:
Files to modify:
**crates/api_models/src/user/dashboard_metadata.rs**
Modify existing code
**crates/diesel_models/src/user/dashboard_metadata.rs**
Modify existing code
**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": 7130, "pr_title": "fix(dashboard_metadata): mask `poc_email` and `data_value` for DashboardMetadata", "merged_at": "2025-02-06T15:16:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "token"]}, "hierarchy": {"api_models": ["crates/api_models/src/user/dashboard_metadata.rs"], "database": ["crates/diesel_models/src/user/dashboard_metadata.rs"], "core_business": ["crates/router/src/core/user/dashboard_metadata.rs"], "types": ["crates/router/src/services/email/types.rs"], "utils": ["crates/router/src/utils/user/dashboard_metadata.rs"]}, "change_types": {"functions_added": 1, "fields_added": 10, "imports_added": 6, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(core): add support for expand attempt list in psync v2
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
We have expand attempts list in v1 payment sync response which is used by dashboard team. We need similar support in v2. By passing expand_attempts in psync query param, vector of payment attempts associated with the intent will be returned in the payments get response.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Create payment intent and confirm the payment intent
Test case 1 : pass expand_attempts=true in payment get api
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0194eebea0707450881ed032755a27b7?expand_attempts=true' \
--header 'x-profile-id: pro_IpmUlwVXURuANo3ccFs0' \
--header 'api-key: dev_2my3hexC89mfCakPBewDWUw8Bzv4B1f00ytCBztsihHAfbVGhu3a7SGL5cSITK0K' \
--data ''
```
Response :
```
{
"id": "12345_pay_0194eebea0707450881ed032755a27b7",
"status": "failed",
"amount": {
"order_amount": 100,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"customer_id": null,
"connector": "stripe",
"client_secret": "12345_pay_0194eebea0707450881ed032755a27b7_secret_0194eebea0767932ab120325b3a4e16d",
"created": "2025-02-10T07:24:17.910Z",
"payment_method_data": {
"billing": null
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector_transaction_id": null,
"connector_reference_id": null,
"merchant_connector_id": "mca_2iDdLhFi0qpgbqzARCBQ",
"browser_info": null,
"error": {
"code": "invalid_expiry_month",
"message": "Your card's expiration month is invalid.",
"unified_code": null,
"unified_message": 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": "example@example.com"
},
"billing": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"line3": null,
"zip": null,
"state": null,
"first_name": "John",
"last_name": "Dough"
},
"phone": null,
"email": "example@example.com"
},
"attempts": [
{
"id": "12345_att_0194eebecdf97ec28ca55a5b24d25936",
"status": "started",
"amount": {
"net_amount": 100,
"amount_to_capture": null,
"surcharge_amount": null,
"tax_on_surcharge": null,
"amount_capturable": 0,
"shipping_cost": null,
"order_tax_amount": null
},
"connector": "stripe",
"error": {
"code": "invalid_expiry_month",
"message": "Your card's expiration month is invalid.",
"unified_code": null,
"unified_message": null
},
"authentication_type": "no_three_ds",
"created_at": "2025-02-10T07:24:29.561Z",
"modified_at": "2025-02-10T07:24:30.214Z",
"cancellation_reason": null,
"payment_token": null,
"connector_metadata": null,
"payment_experience": null,
"payment_method_type": "card",
"connector_reference_id": null,
"payment_method_subtype": "credit",
"connector_payment_id": null,
"payment_method_id": null,
"client_source": null,
"client_version": null
}
]
}
```
TestCase 2 : pass exapand_attemps = false or don't pass it in the query params, This should make attempts field in the response to null.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/payment_attempt.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
**4. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/operations/payment_get.rs`
- `crates/router/src/core/payments/transformers.rs`
- ... and 1 more files
**5. Other**
- `api-reference-v2/openapi_spec.json`
- `crates/openapi/src/openapi_v2.rs`
- `crates/router/src/db/kafka_store.rs`
- ... and 4 more files
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (82 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit d0933170:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::PaymentAttemptAmountDetails
- struct: pub::PaymentAttemptResponse
**crates/diesel_models/src/query/payment_attempt.rs**
Add:
- function: pub::find_by_payment_id
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_get.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Add:
- function: private::foreign_from
- function: private::foreign_from
- impl: impl ForeignFrom<&hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt> for api_models::payments::PaymentAttemptResponse
- impl: impl ForeignFrom<&hyperswitch_domain_models::payments::payment_attempt::AttemptAmountDetails> for api_models::payments::PaymentAttemptAmountDetails
**crates/router/src/core/webhooks/incoming_v2.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::find_payment_attempts_by_payment_intent_id
**crates/storage_impl/src/mock_db/payment_attempt.rs**
Add:
- function: private::find_payment_attempts_by_payment_intent_id
**crates/storage_impl/src/payments/payment_attempt.rs**
Add:
- function: private::find_payment_attempts_by_payment_intent_id
- function: private::find_payment_attempts_by_payment_intent_id
|
{"pr_number": 7209, "pr_title": "refactor(core): add support for expand attempt list in psync v2", "merged_at": "2025-02-11T11:34:47Z", "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/query/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_get.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/webhooks/incoming_v2.rs"], "other": ["api-reference-v2/openapi_spec.json", "crates/openapi/src/openapi_v2.rs", "crates/router/src/db/kafka_store.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "v2_migrations/2025-02-10-101458_create_index_payment_attempt_payment_id/down.sql", "v2_migrations/2025-02-10-101458_create_index_payment_attempt_payment_id/up.sql"]}, "change_types": {"structs_added": 2, "functions_added": 8, "fields_added": 82, "imports_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payments): [Payment links] Add locale case fix
(cherry picked from commit 84318427108a0f974b2519587d0e336807a9600c)
## 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/6789
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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/payment_link/locale.js`
**Code Patterns Applied:**
- Extend existing types with new fields (3 changes)
|
{"pr_number": 6820, "pr_title": "feat(payments): [Payment links] Add locale case fix", "merged_at": "2024-12-12T06:40:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/payment_link/locale.js"]}, "change_types": {"fields_added": 3}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(errors): Entry not found error as 4xx instead of 5xx
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [X] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Hotfix for original PR: [7712](https://github.com/juspay/hyperswitch/pull/7712)
A recent change in [this PR](https://github.com/juspay/hyperswitch/pull/7537) removed the usage of DomainStorageError in all the places and started using StorageError everywhere.
Previously, DataStorage and RedisError were manually converted into StorageError based on few conditions which was missing in the mentioned PR resulting in resource_not_found being thrown as 5xx instead of 4xx.
```
StorageError::DatabaseError(i) => match i.current_context() {
DatabaseError::DatabaseConnectionError => DataStorageError::DatabaseConnectionError,
// TODO: Update this error type to encompass & propagate the missing type (instead of generic `db value not found`)
DatabaseError::NotFound => {
DataStorageError::ValueNotFound(String::from("db value not found"))
}
// TODO: Update this error type to encompass & propagate the duplicate type (instead of generic `db value not found`)
DatabaseError::UniqueViolation => DataStorageError::DuplicateValue {
entity: "db entity",
key: None,
},
err => DataStorageError::DatabaseError(error_stack::report!(*err)),
}
```
This PR handles the manual conversion logic for DataStorageError and RedisError
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Resource_not_found being thrown as 5xx instead of 4xx
<details>
<summary>Create a payment with confirm false and try to confirm the payment with invalid publishable key</summary>
Request
Create a payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_KuDhgIFqeK0Qn8YjYAouk6ztEqJnElMO79hYsBooODvx09okKXcmeEj8bUU6mwXq' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": false,
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"customer_id": "ad",
"profile_id": "pro_3LcIbwh0xcM5yfjgk3ie",
"email": "hyperswitch_sdk_demo_id@gmail.com",
"description": "Hello this is description",
"shipping": {
"address": {
"state": "zsaasdas",
"city": "Banglore",
"country": "US",
"line1": "sdsdfsdf",
"line2": "hsgdbhd",
"line3": "alsksoe",
"zip": "571201",
"first_name": "joseph",
"last_name": "doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"setup_future_usage": "off_session",
"order_details": null
}'
confirm the payment with invalid publishable key
curl --location 'http://localhost:8080/payments/pay_mBeU1Aorcd7KB81NXAgV/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_42efcc8f61704637b51150f3413a1f8ca' \
--data '{
"payment_method": "card",
"payment_method_type": "credit",
"client_secret": "pay_mBeU1Aorcd7KB81NXAgV_secret_BC5WU8N6YMeIKOcgm2qH",
"profile_id": "pro_3LcIbwh0xcM5yfjgk3ie",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "CLBRW dffdg",
"card_cvc": "737"
}
},
"payment_type": "new_mandate",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "125.0.0.1",
"user_agent": "amet irure esse"
}
}
}'
Confirm Payment Response
500 Internal Server Error
{
"error": {
"type": "api",
"message": "Something went wrong",
"code": "HE_00"
}
}
</details>
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<details>
<summary>Create a payment with confirm false and try to confirm the payment with invalid publishable key</summary>
Request
Create a payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_KuDhgIFqeK0Qn8YjYAouk6ztEqJnElMO79hYsBooODvx09okKXcmeEj8bUU6mwXq' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": false,
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"customer_id": "ad",
"profile_id": "pro_3LcIbwh0xcM5yfjgk3ie",
"email": "hyperswitch_sdk_demo_id@gmail.com",
"description": "Hello this is description",
"shipping": {
"address": {
"state": "zsaasdas",
"city": "Banglore",
"country": "US",
"line1": "sdsdfsdf",
"line2": "hsgdbhd",
"line3": "alsksoe",
"zip": "571201",
"first_name": "joseph",
"last_name": "doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"setup_future_usage": "off_session",
"order_details": null
}'
confirm the payment with invalid publishable key
curl --location 'http://localhost:8080/payments/pay_sdeU1Aorcd7KB81NXASD/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_42efcc8f61704637b51150f3413a1f8ca' \
--data '{
"payment_method": "card",
"payment_method_type": "credit",
"client_secret": "pay_sdeU1Aorcd7KB81NXASD_secret_BC5WU8N6YMeIKOcgm2qH",
"profile_id": "pro_3LcIbwh0xcM5yfjgk3ie",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "CLBRW dffdg",
"card_cvc": "737"
}
},
"payment_type": "new_mandate",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "125.0.0.1",
"user_agent": "amet irure esse"
}
}
}'
Confirm Payment Response
401 Unathorized
{
"error": {
"type": "invalid_request",
"message": "API key not provided or invalid API key used",
"code": "IR_01"
}
}
</details>
<details>
<summary>Retrieve invalid payment id</summary>
Request
curl --location 'http://localhost:8080/payments/pay_FgG1La2kxeukSzIHUl8ns' \
--header 'Accept: application/json' \
--header 'x-feature: router-custom-dbd' \
--header 'api-key: dev_r6d1taIlStKeCplYDnDuPFrDT3Be1ZDq6pf0fTOOXioRoIi2pSOF5Jc8kzJJqNdz'
Response
404 Not found
{
"error": {
"type": "invalid_request",
"message": "Payment does not exist in our records",
"code": "HE_02"
}
}
</details>
<details>
<summary>Retrieve invalid refund id</summary>
Request
curl --location 'http://localhost:8080/refunds/ref_kL0UzbPptCK3qZLXH6KO' \
--header 'Accept: application/json' \
--header 'api-key: dev_r6d1taIlStKeCplYDnDuPFrDT3Be1ZDq6pf0fTOOXioRoIi2pSOF5Jc8kzJJqNdz'
Response
404 Not found
{
"error": {
"type": "invalid_request",
"message": "Refund does not exist in our records.",
"code": "HE_02"
}
}
</details>
<details>
<summary>Retrieve invalid merchant id</summary>
Request
curl --location 'http://localhost:8080/accounts/merchant_1743660591s' \
--header 'Accept: application/json' \
--header 'api-key: test_admin'
Response
404 Not found
{
"error": {
"type": "invalid_request",
"message": "Merchant account does not exist in our records",
"code": "HE_02"
}
}
</details>
<details>
<summary>Retrieve customers using invalid API key</summary>
Request
curl --location 'http://localhost:8080/customers/list' \
--header 'Accept: application/json' \
--header 'api-key: dev_r6d1taIlStKeCplYDnDuPFrDT3Be1ZDq6pf0fTOOXioRoIi2pSOF5Jc8kzJJqNdz'
Response
401 Unauthorized
{
"error": {
"type": "invalid_request",
"message": "API key not provided or invalid API key used",
"code": "IR_01"
}
}
</details>
<details>
<summary>Retrieve session tokens using invalid Publishable key</summary>
Request
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'accept: */*' \
--header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'api-key: pk_dev_b72a47690f4f4a95a8a447b8221b5370s' \
--header 'x-browser-name: Chrome' \
--header 'x-browser-version: 127.0.0' \
--header 'x-client-platform: web' \
--header 'x-client-version: 0.91.7' \
--header 'x-merchant-domain: www-merchant.com' \
--header 'x-payment-confirm-source: sdk' \
--data '{
"payment_id": "pay_pZNPfQY46nMLV5X225oW",
"client_secret": "pay_pZNPfQY46nMLV5X225oW_secret_wrQsBzqleBKnhoOu3bLR",
"wallets": [],
"delayed_session_token": false
}'
Response
401 Unauthorized
{
"error": {
"type": "invalid_request",
"message": "API key not provided or invalid API key used",
"code": "IR_01"
}
}
</details>
<details>
<summary>Retrieve merchant account payment methods using invalid Publishable key</summary>
Request
curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_pZNPfQY46nMLV5X225oW_secret_wrQsBzqleBKnhoOu3bLR' \
--header 'accept: */*' \
--header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'api-key: pk_dev_b72a47690f4f4a95a8a447b8221b5370s' \
--header 'content-type: application/json' \
--header 'priority: u=1, i' \
--header 'sec-ch-ua: "Not)A;Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-origin' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36' \
--header 'x-browser-name: Chrome' \
--header 'x-browser-version: 127.0.0' \
--header 'x-client-platform: web' \
--header 'x-client-version: 0.91.7' \
--header 'x-payment-confirm-source: sdk'
Response
401 Unauthorized
{
"error": {
"type": "invalid_request",
"message": "API key not provided or invalid API key used",
"code": "IR_01"
}
}
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Other**
- `crates/storage_impl/src/errors.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit f59eeccb:
Files to modify:
**crates/storage_impl/src/errors.rs**
Modify existing code
|
{"pr_number": 7719, "pr_title": "fix(errors): Entry not found error as 4xx instead of 5xx", "merged_at": "2025-04-04T10:35:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"other": ["crates/storage_impl/src/errors.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): [Nuvei] add stored credentials flag
## 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 -->
Connectors like Nuvei requires a field called as `storedCredentialMode` which represents if the merchant is using a card details which they previously used for same connector or any other PSP. This is used for risk lowering based on PSP's.
- Make a `is_stored_credential` in payment request if the merchant knows this is stored_credential. ( in this case merchant stores the card in his server . No way hyperswitch knows if this is stored or not)
- if `is_stored_credential` = false but using payment token or mandate or recurring flow : throw error.
- if `is_stored_credential` = None but using payment token or mandate or recurring flow : make the is_stored_credential as true in core
### Test cases
## Request `is_stored_credential` = true
```json
{
"amount": 30000,
"capture_method": "automatic",
"currency": "USD",
"confirm": true,
"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"
}
},
"connector":["nuvei"],
"customer_id": "nidthxxinn",
"return_url": "https://www.google.com",
"payment_method": "card",
"payment_method_type": "credit",
"authentication_type": "no_three_ds",
"description": "hellow world",
"billing": {
"address": {
"zip": "560095",
"country": "US",
"first_name": "Sakil",
"last_name": "Mostak",
"line1": "Fasdf",
"line2": "Fasdf",
"city": "Fasdf"
}
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},
"email": "hello@gmail.com",
"is_stored_credential":true,
"payment_method_data": {
"card": {
"card_number": "4000000000009995",
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "John Smith",
"card_cvc": "100"
}
}
}
```
## Connector Request
```json
{
"timeStamp": "20250923113846",
"sessionToken": "*** alloc::string::String ***",
"merchantId": "*** alloc::string::String ***",
"merchantSiteId": "*** alloc::string::String ***",
"clientRequestId": "*** alloc::string::String ***",
"amount": "300.00",
"currency": "USD",
"userTokenId": "nidthxxinn",
"clientUniqueId": "",
"transactionType": "Sale",
"paymentOption": {
"card": {
"cardNumber": "400000**********",
"cardHolderName": "*** alloc::string::String ***",
"expirationMonth": "*** alloc::string::String ***",
"expirationYear": "*** alloc::string::String ***",
"CVV": "*** alloc::string::String ***",
"storedCredentials": {
"storedCredentialsMode": "1" // stored creds
}
}
},
"deviceDetails": {
"ipAddress": "192.**.**.**"
},
"checksum": "*** alloc::string::String ***",
"billingAddress": {
"email": "*****@gmail.com",
"firstName": "*** alloc::string::String ***",
"lastName": "*** alloc::string::String ***",
"country": "US",
"city": "*** alloc::string::String ***",
"address": "*** alloc::string::String ***",
"zip": "*** alloc::string::String ***",
"addressLine2": "*** alloc::string::String ***"
},
"urlDetails": {
"successUrl": "https://google.com",
"failureUrl": "https://google.com",
"pendingUrl": "https://google.com"
},
"amountDetails": {
"totalTax": null,
"totalShipping": null,
"totalHandling": null,
"totalDiscount": null
}
}
```
### hs response
```json
{
"payment_id": "pay_kaDCghnJynclrXvAZ3Hr",
"merchant_id": "merchant_1758711570",
"status": "succeeded",
"amount": 4324,
"net_amount": 4324,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "nuvei",
"client_secret": "pay_kaDCghnJynclrXvAZ3Hr_secret_yYbm6qHvrDNGSZixiLoo",
"created": "2025-09-24T11:12:09.304Z",
"currency": "EUR",
"customer_id": "nidthhxxinn",
"customer": {
"id": "nidthhxxinn",
"name": null,
"email": "hello@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": "hellow world",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0005",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "378282",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "50",
"card_holder_name": "morino",
"payment_checks": {
"avs_result": "",
"avs_description": null,
"card_validation_result": "",
"card_validation_description": null
},
"authentication_data": {
"challengePreferenceReason": "12"
}
},
"billing": null
},
"payment_token": "token_AivOwxhMg1qSr4REuZA9",
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "hello@gmail.com",
"name": null,
"phone": null,
"return_url": "https://www.google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "nidthhxxinn",
"created_at": 1758712329,
"expires": 1758715929,
"secret": "epk_20c56304f56d4bd093ccbc5e642138be"
},
"manual_retry_allowed": null,
"connector_transaction_id": "7110000000017350215",
"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": "9126580111",
"payment_link": null,
"profile_id": "pro_Gs5O4gNYQYl12fxACtnf",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_nnxyjSuMhV7SIzNRzEmD",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-24T11:27:09.304Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": "pm_r5onP5L210YtcIwJR97v",
"network_transaction_id": "483299310332488",
"payment_method_status": "active",
"updated": "2025-09-24T11:12:15.875Z",
"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": "2512601111",
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": true //updated
}
```
## connector request when `is_stored_credential`=false
```json
{
"timeStamp": "20250923114107",
"sessionToken": "*** alloc::string::String ***",
"merchantId": "*** alloc::string::String ***",
"merchantSiteId": "*** alloc::string::String ***",
"clientRequestId": "*** alloc::string::String ***",
"amount": "300.00",
"currency": "USD",
"userTokenId": "nidthxxinn",
"clientUniqueId": "",
"transactionType": "Sale",
"paymentOption": {
"card": {
"cardNumber": "400000**********",
"cardHolderName": "*** alloc::string::String ***",
"expirationMonth": "*** alloc::string::String ***",
"expirationYear": "*** alloc::string::String ***",
"CVV": "*** alloc::string::String ***"
}
},
"deviceDetails": {
"ipAddress": "192.**.**.**"
},
"checksum": "*** alloc::string::String ***",
"billingAddress": {
"email": "*****@gmail.com",
"firstName": "*** alloc::string::String ***",
"lastName": "*** alloc::string::String ***",
"country": "US",
"city": "*** alloc::string::String ***",
"address": "*** alloc::string::String ***",
"zip": "*** alloc::string::String ***",
"addressLine2": "*** alloc::string::String ***"
},
"urlDetails": {
"successUrl": "https://google.com",
"failureUrl": "https://google.com",
"pendingUrl": "https://google.com"
},
"amountDetails": {
"totalTax": null,
"totalShipping": null,
"totalHandling": null,
"totalDiscount": null
}
}
```
## Error msg when is_stored_credential = false but using payment token flow in HS
- make CIT and get payment method token
```json
{
"amount": 333,
"currency": "EUR",
"customer_id": "nidthhxxinn",
"confirm": true,
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "{{payment_method_id}}"//pass the payment method id here
},
"is_stored_credential": false, // false should throw error
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
}
}
```
```json
{
"error": {
"type": "invalid_request",
"message": "is_stored_credential should be true when reusing stored payment method data",
"code": "IR_16"
}
}
```
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
- ... and 1 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
**4. Core Business Logic**
- `crates/router/src/core/payment_methods/cards.rs`
- `crates/router/src/core/payments/helpers.rs`
- `crates/router/src/core/payments/operations/payment_confirm.rs`
- ... and 4 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
- `crates/router/src/types/api/verify_connector.rs`
- ... and 1 more files
**6. Type Definitions**
- `crates/router/src/types.rs`
- `crates/router/src/types/storage/payment_attempt.rs`
**7. Utils**
- `crates/router/src/utils/user/sample_data.rs`
**8. Tests**
- `crates/router/tests/payments.rs`
- `crates/router/tests/payments2.rs`
**9. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `crates/router/src/db/events.rs`
- `crates/storage_impl/src/mock_db/payment_attempt.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (7 changes)
- Extend existing types with new fields (92 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit b776f92e:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- function: pub::validate_stored_credential
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/diesel_models/src/user/sample_data.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Add:
- function: private::get_is_stored_credential
- function: private::get_is_stored_credential
- function: private::get_is_stored_credential
- function: pub::get_optional_stored_credential
- struct: pub::StoredCredentialMode
- enum: pub::StoredCredentialModeType
- impl: impl StoredCredentialMode
**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_request_types.rs**
Modify existing code
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Add:
- function: pub::is_stored_credential
**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/retry.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/db/events.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/src/types/storage/payment_attempt.rs**
Modify existing code
**crates/router/src/utils/user/sample_data.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
**crates/router/tests/payments.rs**
Modify existing code
**crates/router/tests/payments2.rs**
Modify existing code
**crates/storage_impl/src/mock_db/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_attempt.rs**
Modify existing code
|
{"pr_number": 9515, "pr_title": "feat(core): [Nuvei] add stored credentials flag ", "merged_at": "2025-09-30T12:33:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs", "crates/diesel_models/src/user/sample_data.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_update.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/router/src/types.rs", "crates/router/src/types/storage/payment_attempt.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "tests": ["crates/router/tests/payments.rs", "crates/router/tests/payments2.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "crates/router/src/db/events.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "migrations/2025-09-22-084821_add_stored_credentials_payment_intent/down.sql", "migrations/2025-09-22-084821_add_stored_credentials_payment_intent/up.sql"]}, "change_types": {"structs_added": 1, "functions_added": 7, "enums_added": 1, "fields_added": 92, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connector): wasm changes
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Wasm changes for paysafe card 3ds
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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?
<img width="656" height="532" alt="Screenshot 2025-09-15 at 4 48 08 PM" src="https://github.com/user-attachments/assets/3f8b0d3c-22b6-4fb1-a94c-d4221d8ed035" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Extend existing types with new fields (4 changes)
**Detailed Identifier Changes:**
Commit d93e73dd:
Files to modify:
**crates/connector_configs/src/connector.rs**
Add:
- struct: pub::AccountIdConfigForCard
- struct: pub::AccountIDSupportedMethods
|
{"pr_number": 9380, "pr_title": "refactor(connector): wasm changes", "merged_at": "2025-09-16T07:22:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "card"]}, "hierarchy": {"connectors": ["crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"]}, "change_types": {"structs_added": 2, "fields_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Add VGS connector impls
## 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 Connector changes for VGS
- Implemented `ExternalVaultInsertFlow` and `ExternalVaultRetrieveFlow` for VGS
- This allows Payment methods to be vaulted in VGS when `is_external_vault_enabled` is set to true in profile
- Updated VGS URL in TOML files
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 #9023
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Confirm Request:
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0198d09ccd8a77729274a5c3858e13f3/confirm-intent' \
--header 'x-profile-id: pro_TVu6gSPZXAVEa2h0JCRe' \
--header 'x-client-secret: cs_0198d09cce0774338628683873a2db9d' \
--header 'Authorization: publishable-key=pk_dev_17e15cb3538d4bd99af971ee2d4d081f,client-secret=cs_0198d09cce0774338628683873a2db9d' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_17e15cb3538d4bd99af971ee2d4d081f' \
--data '{
"payment_method_data": {
"card": {
"card_cvc": "123",
"card_exp_month": "10",
"card_exp_year": "25",
"card_number": "4242424242424242",
"card_holder_name": "joseph Doe"
}
},
"payment_method_type": "card",
"payment_method_subtype": "card",
"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"
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "2022-09-10T10:11:12Z",
"online": {
"ip_address": "123.32.25.123",
"user_agent": "Mozilla/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"
}
}
}'
```
Insert Request:
<img width="1598" height="26" alt="image" src="https://github.com/user-attachments/assets/2e2e81e1-360a-481f-a018-91d7da156d54" />
Insert Response:
<img width="2364" height="38" alt="image" src="https://github.com/user-attachments/assets/aad8f89e-144c-4a0e-a6e5-9ec2c6aa957a" />
Confirm Request:
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0198d09ccd8a77729274a5c3858e13f3/confirm-intent' \
--header 'x-profile-id: pro_TVu6gSPZXAVEa2h0JCRe' \
--header 'x-client-secret: cs_0198d09cce0774338628683873a2db9d' \
--header 'Authorization: publishable-key=pk_dev_17e15cb3538d4bd99af971ee2d4d081f,client-secret=cs_0198d09cce0774338628683873a2db9d' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_17e15cb3538d4bd99af971ee2d4d081f' \
--data '{
"payment_method_data": {
"card_token": {
"card_cvc": "123"
}
},
"payment_method_type": "card",
"payment_method_subtype": "card",
"payment_token": "token_UBCgOA3daIE4CP4pugXW"
}'
```
Retrieve Request:
<img width="2364" height="38" alt="image" src="https://github.com/user-attachments/assets/0eaa5d7f-19e1-4cfb-95a4-b6376f8e3c74" />
Retrieve Response:
<img width="2373" height="51" alt="image" src="https://github.com/user-attachments/assets/9b81e22d-931f-4132-a8e4-2a7bd6341c02" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payment_methods.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/vgs.rs`
- `crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs`
- `crates/hyperswitch_connectors/src/default_implementations.rs`
- ... and 2 more files
**3. Type Definitions**
- `crates/router/src/types/api/feature_matrix.rs`
**4. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**5. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (8 changes)
- Implement new functions (2 changes)
- Extend existing types with new fields (46 changes)
**Detailed Identifier Changes:**
Commit ddf1a6a5:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/vgs.rs**
Remove:
- function: pub::new
- 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::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_content_type
- function: private::get_url
- function: private::get_headers
- function: private::get_content_type
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_content_type
- struct: pub::Vgs
- impl: impl Vgs
- impl: impl ConnectorValidation for Vgs
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Vgs
Add:
- struct: pub::Vgs
- impl: impl api::ExternalVaultInsert for Vgs
- impl: impl api::ExternalVault for Vgs
- impl: impl api::ExternalVaultRetrieve for Vgs
- impl: impl ConnectorValidation for Vgs
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Vgs
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Vgs
- impl: impl ConnectorIntegration<ExternalVaultInsertFlow, VaultRequestData, VaultResponseData> for vgs::VgsInsertRequest::try_from(req)
**crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs**
Remove:
- function: private::try_from
- struct: pub::VgsPaymentsRequest
Add:
- struct: pub::VgsTokenRequestItem
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/types/api/connector_mapping.rs**
Modify existing code
**crates/router/src/types/api/feature_matrix.rs**
Modify existing code
**crates/router/tests/connectors/vgs.rs**
Modify existing code
|
{"pr_number": 7942, "pr_title": "feat(connector): Add VGS connector impls", "merged_at": "2025-08-25T09:52:19Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/payment_methods.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/vgs.rs", "crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/tests/connectors/vgs.rs"], "types": ["crates/router/src/types/api/feature_matrix.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 8, "functions_added": 2, "fields_added": 46, "imports_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): add support for consuming eci for AuthNResponse in Authentication flow
…tication flow
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [X] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Added support for consuming eci for AuthNResponse in Authentication flow
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
### Create payment request via Archipel with 3ds external auth enabled via Netcetera
**Curl**
`curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_RjWWq6rhGEo3UkmUvEJjeduCwtMO5dsFDtL2ZjZDyOkM1ocKIkWKTm51bHgrPkDz' \
--data-raw '{
"amount": 10000,
"currency": "USD",
"confirm": true,
"payment_link": false,
"profile_id": "pro_02kD3gH7YOnsSoiguC9h",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 10000,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"request_external_three_ds_authentication": true,
"authentication_type": "three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "12",
"card_exp_year": "2025",
"card_cvc": "123",
"card_network": "Visa"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "12345",
"country": "US",
"first_name": "Debarati",
"last_name": "Ghatak"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"ip_address": "103.77.139.95",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"dg": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'`
<img width="940" alt="Screenshot 2025-06-03 at 4 20 52 PM" src="https://github.com/user-attachments/assets/876457c5-23e3-4517-ae8a-26201486b768" />
### Call 3ds authentication endpoint
**Curl**
`curl --location 'http://localhost:8080/payments/pay_RXcnxyQ4WX0ivbwJyd4V/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_89bfdedf18374b27b59ab42dc6508c57' \
--data '{
"client_secret": "pay_RXcnxyQ4WX0ivbwJyd4V_secret_xl0oe5UNKzIBjUBSLdHw",
"device_channel": "BRW",
"threeds_method_comp_ind": "Y"
}'`
<img width="940" alt="Screenshot 2025-06-03 at 4 21 24 PM" src="https://github.com/user-attachments/assets/72abb5e3-a417-4f74-8a59-3e2d76aaa7eb" />
### Call authorize for Archipel
**Curl**
<img width="940" alt="Screenshot 2025-06-03 at 4 21 40 PM" src="https://github.com/user-attachments/assets/7c4278c2-7bcd-42a9-afcd-36eb1532e8fb" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/authentication.rs`
**2. Domain Models (Business Logic Types)**
- `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/utils.rs`
- `crates/router/src/core/unified_authentication_service/utils.rs`
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Extend existing types with new fields (10 changes)
**Detailed Identifier Changes:**
Commit 33cd60e6:
Files to modify:
**crates/diesel_models/src/authentication.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs**
Modify existing code
**crates/hyperswitch_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/router/src/core/authentication/utils.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/utils.rs**
Modify existing code
|
{"pr_number": 8225, "pr_title": "feat(core): add support for consuming eci for AuthNResponse in Authentication flow", "merged_at": "2025-06-03T12:49:46Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"database": ["crates/diesel_models/src/authentication.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/authentication/utils.rs", "crates/router/src/core/unified_authentication_service/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs", "crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs", "crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs", "crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs"]}, "change_types": {"fields_added": 10, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): fixed click to pay metadata parsing issue
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
## Description
<!-- Describe your changes in detail -->
Currently click to pay session token is failing as it is not able to parse card brands, which should ideally be fetched from union of payment processors
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Add config to make the merchant eligible for authentication service
```shell
curl --location 'http://localhost:8080/configs/' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"key": "merchants_eligible_for_authentication_service",
"value": "[\"sahkal\", \"cewqcewc\", \"dqwdwljildwduoqwhduwqcqwjd\"]"
}'
```
Create merchant connector account for Ctp_mastercard
```shell
curl --location 'http://localhost:8080/account/dqwdwljildwduoqwhduwqcqwjd/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_Ln1VBidiPjZkR3OuxhdgOAMfwZ7atLwUDLPylBG22x9pnERlTCpvs18nnEkGqlCM' \
--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",
"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: dev_Ln1VBidiPjZkR3OuxhdgOAMfwZ7atLwUDLPylBG22x9pnERlTCpvs18nnEkGqlCM' \
--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: dev_Ln1VBidiPjZkR3OuxhdgOAMfwZ7atLwUDLPylBG22x9pnERlTCpvs18nnEkGqlCM' \
--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 Session call
```shell
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_c5c226cace0b4d98b8f29407cd025440' \
--data '{
"payment_id": "pay_9pQ3GAGiwtlt6HmWlqE0",
"client_secret": "pay_9pQ3GAGiwtlt6HmWlqE0_secret_oDBRYWg6ktOmc0sYa9tM",
"wallets": []
}
'
```
Response
```shell
{
"payment_id": "pay_9pQ3GAGiwtlt6HmWlqE0",
"client_secret": "pay_9pQ3GAGiwtlt6HmWlqE0_secret_oDBRYWg6ktOmc0sYa9tM",
"session_token": [
{
"wallet_name": "click_to_pay",
"dpa_id": "b6e06cc6-3018-4c4c-bbf5-9fb232615090",
"dpa_name": "TestMerchant",
"locale": "en_AU",
"card_brands": [
"Visa",
"Mastercard"
],
"acquirer_bin": "545301",
"acquirer_merchant_id": "SRC3DS",
"merchant_category_code": "0001",
"merchant_country_code": "US",
"transaction_amount": "0.10",
"transaction_currency_code": "EUR",
"phone_number": "999999999",
"email": "guest@example.com",
"phone_country_code": "+65",
"provider": "mastercard",
"dpa_client_id": null
}
]
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments.rs`
**Detailed Identifier Changes:**
Commit 951f4c29:
Files to modify:
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
|
{"pr_number": 9784, "pr_title": "fix(router): fixed click to pay metadata parsing issue", "merged_at": "2025-10-13T15:45:48Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "merchant", "connector"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/payments.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Altered the amount field in DisputePayload to StringMinorUnit
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
The amount field in DisputePayload in `crates/hyperswitch_interfaces/src/disputes.rs` was String. Changed it to StringMinorUnit.
Made changes in the following connectors : Adyen, Airwallex, Bluesnap, Braintree, Checkout, Novalnet, Payme, Paypal, Rapyd, Stripe, Trustpay.
In the Dispute table, changed the amount field from String to StringMinorUnit and dispute_amount from i64 to MinorUnit.
Dispute Webhooks need to be tested for all the above mentioned connectors.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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. Stripe Payments Create - cURL :
run these on stripe cli
```brew install stripe/stripe-cli/stripe```
```stripe login --api-key <stripe_api_key>```
```stripe listen --events charge.dispute.created \ --forward-to localhost:8080/webhook```
```stripe listen --forward-to http://localhost:8080/webhooks/<merchant_id>/<merchant_connector_id>```
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_k7bBo7Jh3VaqAt5yqY9tG8IjjVbi4VlCLNHxzifBoz4ckrJQGUZePElGu0NMl9N6' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"setup_future_usage": "on_session",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4000000000000259",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"routing": {
"type": "single",
"data": "stripe"
}
}'
```
This will initiate a dispute and you will either accept it or counter it and hence will receive incoming webhooks
<img width="1530" alt="Screenshot 2025-05-28 at 5 32 41 PM" src="https://github.com/user-attachments/assets/31156f62-963b-4c98-a2eb-45eb48359d11" />
2. Checkout Payments Create
cURL :
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_EAjwqV3dxVM3Lkxhw6O2epmoAoNaP5PXnCqJbeilH5OEBRNMzNWS5leo6KuJN4Pw' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
"amount": 1050,
"currency": "GBP",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1050,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4005519200000004",
"card_exp_month": "01",
"card_exp_year": "2099",
"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": "GB",
"first_name": "PiX"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "GB",
"first_name": "PiX"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
After this head to Checkout Dashboard and you'll see this being marked as `Dispute Resolved` and you'll receive Dispute Webhooks too.
<img width="1530" alt="Screenshot 2025-05-28 at 7 19 00 PM" src="https://github.com/user-attachments/assets/91bc1070-68b4-4e65-9761-c27130bc5d55" />
3. Trustpay
Manually sent incoming webhooks to Hyperswitch
```
curl --location 'https://1ebd-103-170-182-246.ngrok-free.app/webhooks/merchant_1748457198/mca_rBig1cjLFYB1NRvjE7EU' \
--header 'Content-Type: application/json' \
--data '{
"PaymentInformation": {
"CreditDebitIndicator": "DBIT",
"References": {
"MerchantReference": "pay_ViKeFnsTWv7YPs8HcLMM_1",
"PaymentId": "6964857984"
},
"Status": "Chargebacked",
"Amount": {
"Amount": 65.41,
"Currency": "EUR"
},
"StatusReasonInformation": null
},
"Signature": "abcd"
}'
```
<img width="1530" alt="Screenshot 2025-05-29 at 12 11 27 AM" src="https://github.com/user-attachments/assets/219e50d1-6f06-485a-916c-b9e0f671a167" />
4. Novalnet
https://developer.novalnet.com/asynchronousnotification/parameterspassed?payment=chargeback_creditcard_chargeback#parameter-list
Used Novalnet's Webhook simulator to send webhooks to Hyperswitch. `Payment Access Key` will be `key1` of Hyperswitch and `TID` will be `connector_transaction_id` with which a successful payment was made previously.
```
{
"event": {
"checksum": "df3cabaabce5c30559eacf25e4413ac2e4f612ceae3b048ac17adc85f60a6389",
"parent_tid": 15186900010502281,
"tid": 12186900010502281,
"type": "CHARGEBACK"
},
"result": {
"status": "SUCCESS",
"status_code": 100,
"status_text": "Successful"
},
"transaction": {
"amount": 10000,
"currency": "EUR",
"order_no": "pay_3jddDzdf0lWfwn05uI1q_1",
"payment_type": "CREDITCARD_CHARGEBACK",
"reason": "Fraud",
"status": "CONFIRMED",
"status_code": 100,
"test_mode": 1,
"tid": 12186900010502281
},
"merchant": {
"project": 6120,
"project_name": "Developer Portal",
"project_url": "https://developer.novalnet.de",
"vendor": 4
},
"customer": {
"billing": {
"city": "Musterhausen",
"country_code": "DE",
"house_no": "1467",
"street": "CA",
"zip": "12345"
},
"customer_ip": "103.170.182.246",
"email": "test@novalnet.de",
"first_name": "Max",
"gender": "u",
"last_name": "Mustermann",
"mobile": "8056594427"
}
}
```
<img width="1530" alt="Screenshot 2025-05-29 at 12 03 36 PM" src="https://github.com/user-attachments/assets/63c166b3-7cd6-453e-ab22-1a41f20725d5" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/disputes.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/dispute.rs`
**3. Core Business Logic**
- `crates/router/src/core/webhooks/incoming.rs`
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyen.rs`
- `crates/hyperswitch_connectors/src/connectors/airwallex.rs`
- `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs`
- ... and 19 more files
**5. Type Definitions**
- `crates/common_utils/src/types.rs`
- `crates/router/src/types/api.rs`
**6. Utils**
- `crates/router/src/utils/user/sample_data.rs`
**7. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/hyperswitch_interfaces/src/disputes.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (4 changes)
- Extend existing types with new fields (70 changes)
**Detailed Identifier Changes:**
Commit 04763612:
Files to modify:
**crates/api_models/src/disputes.rs**
Modify existing code
**crates/common_utils/src/types.rs**
Add:
- function: private::fmt
- function: private::from_sql
- function: private::to_sql
- function: private::build
- impl: impl Display for StringMinorUnit
- impl: impl FromSql<sql_types::Text, DB> for StringMinorUnit
- impl: impl ToSql<sql_types::Text, DB> for StringMinorUnit
- impl: impl Queryable<sql_types::Text, DB> for StringMinorUnit
**crates/diesel_models/src/dispute.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/airwallex.rs**
Remove:
- struct: pub::Airwallex
Add:
- function: pub::new
- struct: pub::Airwallex
- impl: impl Airwallex
**crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bluesnap.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/braintree.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/checkout.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/novalnet.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payme.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payme/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paypal.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/rapyd.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripe.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/trustpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Remove:
- function: pub::to_currency_lower_unit
**crates/hyperswitch_interfaces/src/disputes.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/compatibility/stripe/webhooks.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/db/dispute.rs**
Modify existing code
**crates/router/src/services/kafka/dispute.rs**
Modify existing code
**crates/router/src/services/kafka/dispute_event.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/utils/user/sample_data.rs**
Modify existing code
**crates/router/tests/connectors/airwallex.rs**
Modify existing code
|
{"pr_number": 8131, "pr_title": "feat(core): Altered the amount field in DisputePayload to StringMinorUnit", "merged_at": "2025-05-30T14:57:38Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/disputes.rs"], "database": ["crates/diesel_models/src/dispute.rs"], "core_business": ["crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/adyen.rs", "crates/hyperswitch_connectors/src/connectors/airwallex.rs", "crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bluesnap.rs", "crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs", "crates/hyperswitch_connectors/src/connectors/braintree.rs", "crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs", "crates/hyperswitch_connectors/src/connectors/checkout.rs", "crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs", "crates/hyperswitch_connectors/src/connectors/novalnet.rs", "crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payme.rs", "crates/hyperswitch_connectors/src/connectors/payme/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal.rs", "crates/hyperswitch_connectors/src/connectors/rapyd.rs", "crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/connectors/trustpay.rs", "crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/tests/connectors/airwallex.rs"], "types": ["crates/common_utils/src/types.rs", "crates/router/src/types/api.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/hyperswitch_interfaces/src/disputes.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/compatibility/stripe/webhooks.rs", "crates/router/src/db/dispute.rs", "crates/router/src/services/kafka/dispute.rs", "crates/router/src/services/kafka/dispute_event.rs"]}, "change_types": {"structs_added": 1, "functions_added": 4, "fields_added": 70, "imports_added": 13}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(users): add support for tenant level users
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
- Add api to create tenant users
- Add api to create orgs
- Support tenant level entity for the user hierarchy
A tenant level user should see dashboard as seen by the org admin. He will be pinned to one org, merchant and profile. And he can switch between any org in the given tenancy.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Closes #6707
## How did you test it?
Api for create tenant:
```
curl --location 'http://localhost:8080/user/tenant_signup' \
--header 'api-key: test_admin' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: test' \
--header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTJhMmViYzItOWZiZS00MDI0LThjODEtOWYwMzMyZTJlZDMxIiwicHVycG9zZSI6InRvdHAiLCJvcmlnaW4iOiJzaWduX3VwIiwicGF0aCI6W10sImV4cCI6MTczMzMwOTI2NSwidGVuYW50X2lkIjoicHVibGljIn0.3B918rdY_XM0dRH4yx9O7Nujd3FbLdmKUmBY52KVKAo' \
--data-raw '{
"name" : "tf2",
"email" : "cd7@juspay.in",
"password": "Pass@321"
}'
```
Response: 200 Ok, if tenant_admin got created successfully
A tenant can login with email and password and continue with 2FA, he will land into any one of organization existing for tenant.
Create Org Api, (works for tenant users only)
```
curl --location 'http://localhost:8080/user/create_org' \
--header 'x-tenant-id: test' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer JWT' \
--header 'Cookie: Cookie' \
--data '{
"organization_name": "ten",
"merchant_name": "pp_ten"
}'
```
Response will be 200 OK if the org got created success fully (1 org with 1 merchant and 1 profile)
After getting the login token tenant admin can switch to any org in the tenancy.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/events/user.rs`
- `crates/api_models/src/user.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/merchant_account.rs`
**3. Core Business Logic**
- `crates/router/src/core/user.rs`
- `crates/router/src/core/user_role.rs`
- `crates/router/src/core/user_role/role.rs`
**4. Type Definitions**
- `crates/router/src/types/domain/user.rs`
- `crates/router/src/types/domain/user/decision_manager.rs`
- `crates/router_env/src/logger/types.rs`
**5. Utils**
- `crates/common_utils/src/consts.rs`
- `crates/router/src/routes/lock_utils.rs`
- `crates/router/src/utils/user.rs`
- ... and 1 more files
**6. Other**
- `crates/common_enums/src/enums.rs`
- `crates/router/src/analytics.rs`
- `crates/router/src/consts/user.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (23 changes)
- Extend existing types with new fields (111 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit 357e8a00:
Files to modify:
**crates/api_models/src/events/user.rs**
Modify existing code
**crates/api_models/src/user.rs**
Add:
- struct: pub::CreateTenantUserRequest
- struct: pub::UserOrgMerchantCreateRequest
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_utils/src/consts.rs**
Modify existing code
**crates/diesel_models/src/query/merchant_account.rs**
Add:
- function: pub::list_all_merchant_accounts
**crates/router/src/analytics.rs**
Modify existing code
**crates/router/src/consts/user.rs**
Modify existing code
**crates/router/src/core/user.rs**
Add:
- function: pub::create_tenant_user
- function: pub::create_org_merchant_for_user
**crates/router/src/core/user_role.rs**
Modify existing code
**crates/router/src/core/user_role/role.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::list_merchant_and_org_ids
**crates/router/src/db/merchant_account.rs**
Add:
- function: private::list_merchant_and_org_ids
- function: private::list_merchant_and_org_ids
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/user.rs**
Add:
- function: pub::create_tenant_user
- function: pub::user_org_create
**crates/router/src/services/authorization/permissions.rs**
Modify existing code
**crates/router/src/services/authorization/roles/predefined_roles.rs**
Modify existing code
**crates/router/src/types/domain/user.rs**
Add:
- function: private::from
- function: private::foreign_from
- function: private::from
- function: private::try_from
- function: private::from
- struct: pub::MerchantAccountIdentifier
- struct: pub::TenantLevel
- impl: impl From<(user_api::CreateTenantUserRequest, MerchantAccountIdentifier)> for NewUserOrganization
- impl: impl ForeignFrom<api_models::user::UserOrgMerchantCreateRequest> for diesel_models::organization::OrganizationNew
- impl: impl From<(user_api::CreateTenantUserRequest, MerchantAccountIdentifier)> for NewUserMerchant
- impl: impl TryFrom<(user_api::CreateTenantUserRequest, MerchantAccountIdentifier)> for NewUser
- impl: impl From<TenantLevel> for EntityInfo
**crates/router/src/types/domain/user/decision_manager.rs**
Modify existing code
**crates/router/src/utils/user.rs**
Add:
- function: pub::create_merchant_account_request_for_org
**crates/router/src/utils/user_role.rs**
Add:
- function: pub::get_single_org_id
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 6708, "pr_title": "feat(users): add support for tenant level users", "merged_at": "2024-12-06T13:19:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "token"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/user.rs", "crates/api_models/src/user.rs"], "database": ["crates/diesel_models/src/query/merchant_account.rs"], "core_business": ["crates/router/src/core/user.rs", "crates/router/src/core/user_role.rs", "crates/router/src/core/user_role/role.rs"], "types": ["crates/router/src/types/domain/user.rs", "crates/router/src/types/domain/user/decision_manager.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/consts.rs", "crates/router/src/routes/lock_utils.rs", "crates/router/src/utils/user.rs", "crates/router/src/utils/user_role.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/analytics.rs", "crates/router/src/consts/user.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/merchant_account.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/user.rs", "crates/router/src/services/authorization/permissions.rs", "crates/router/src/services/authorization/roles/predefined_roles.rs"]}, "change_types": {"structs_added": 4, "functions_added": 23, "fields_added": 111, "imports_added": 5, "conditionals_added": 1, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(users): Use domain email type in user DB functions
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR does 3 things.
1. Throw 401 if cookies are not found in request or if JWT is not found in cookies.
2. Cache role info only if the ttl is greater than or equal to 0.
3. Use `UserEmail` type in DB functions.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
4. `crates/router/src/configs`
5. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Closes #6696.
Closes #6697.
Closes #6698.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
todo!()
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/user.rs`
- `crates/router/src/core/user_role.rs`
**3. Type Definitions**
- `crates/router/src/services/email/types.rs`
- `crates/router/src/types/domain/user.rs`
**4. Utils**
- `crates/router/src/utils/user.rs`
**5. Other**
- `crates/router/src/compatibility/stripe/errors.rs`
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/db/user.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Implement new functions (4 changes)
- Extend existing types with new fields (8 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (5 changes)
**Detailed Identifier Changes:**
Commit 55fe82fd:
Files to modify:
**crates/hyperswitch_domain_models/src/errors/api_error_response.rs**
Modify existing code
**crates/router/src/compatibility/stripe/errors.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/core/user_role.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/db/user.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Modify existing code
**crates/router/src/services/authentication/cookies.rs**
Modify existing code
**crates/router/src/services/authorization.rs**
Modify existing code
**crates/router/src/services/email/types.rs**
Modify existing code
**crates/router/src/types/domain/user.rs**
Add:
- function: pub::get_inner
**crates/router/src/utils/user.rs**
Modify existing code
|
{"pr_number": 6699, "pr_title": "refactor(users): Use domain email type in user DB functions", "merged_at": "2024-11-29T13:37:38Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/errors/api_error_response.rs"], "core_business": ["crates/router/src/core/user.rs", "crates/router/src/core/user_role.rs"], "types": ["crates/router/src/services/email/types.rs", "crates/router/src/types/domain/user.rs"], "utils": ["crates/router/src/utils/user.rs"], "other": ["crates/router/src/compatibility/stripe/errors.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/user.rs", "crates/router/src/services/authentication.rs", "crates/router/src/services/authentication/cookies.rs", "crates/router/src/services/authorization.rs"]}, "change_types": {"functions_added": 4, "fields_added": 8, "imports_added": 2, "conditionals_added": 1, "database_queries": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(cypress): Fiuu connector configuration changes
## Type of Change
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
The FIUU Connector was not functioning as expected.
## Key Changes
- Added fiuu connector configs for `PaymentConfirmWithShippingCost`, `ZeroAuthMandate`, and `SaveCardConfirmAutoCaptureOffSessionWithoutBilling`.
- Added `billing.email` in some places in the configs where it was a required parameter.
- Mapped `error_message: "The currency not allow for the RecordType"` wherever necessary.
- Mandate Payments using PMID responds with the `connector_transaction_id: null` if the payment fails. So, changed the command accordingly.
- Fiuu does not support Connector Diagnostic, so updated the exclusion list to include Fiuu connector.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
Initial Condition
<img width="710" alt="image" src="https://github.com/user-attachments/assets/976bb14e-c200-4d34-a61d-a8ab46115824" />
Current Condition
<img width="710" alt="image" src="https://github.com/user-attachments/assets/3f01b9c3-3de1-468a-b022-2733d1c03c0b" />
## 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/Fiuu.js`
- `cypress-tests/cypress/e2e/configs/Payment/Modifiers.js`
- `cypress-tests/cypress/e2e/configs/Payment/Utils.js`
- ... and 4 more files
**Code Patterns Applied:**
- Extend existing types with new fields (62 changes)
- Add conditional logic for feature flags or filtering (4 changes)
|
{"pr_number": 7297, "pr_title": "refactor(cypress): Fiuu connector configuration changes", "merged_at": "2025-03-12T12:23:40Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Fiuu.js", "cypress-tests/cypress/e2e/configs/Payment/Modifiers.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/spec/Payment/00011-CreateSingleuseMandate.cy.js", "cypress-tests/cypress/e2e/spec/Payment/00012-CreateMultiuseMandate.cy.js", "cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.js", "cypress-tests/cypress/support/commands.js"]}, "change_types": {"fields_added": 62, "conditionals_added": 4}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(core): consume card details from billing connectors and first error codes and store them in payment intent table
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
The following details are needed to be stored in the payment intent feature metadata as a part of transaction monitoring system for revenue recovery.
1. Card Network
2. Card Issuer
3. First Payment Gateway Error Code
4. First Network Error Code
5. First Network Advice Code
These will be constant through out the lifecycle of the payment intent in revenue recovery system. We need to use these parameters further in revenue recovery system. We need this as training data and need these while Deciding optimal time for the retry.
These information is stored in payment intent because this information will be constant throughout for payment intent and this information cannot be populated every time we retry this payment.
### 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`
7. `crates/router/src/configs`
8. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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)?
-->
Can be tested by following the steps mentioned in this PR: #7461. Here are the test results:
```
{
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"payment_revenue_recovery_metadata": {
"total_retry_count": 2,
"payment_connector_transmission": "ConnectorCallUnsuccessful",
"billing_connector_id": "mca_MWigDQEKB7Du4L9YqeSe",
"active_attempt_payment_connector_id": "mca_PY26kh9v0Kiu1hd7lTzL",
"billing_connector_payment_details": {
"payment_processor_token": "card_1RXkE8RpLdtbmMLFiOTVtzLI",
"connector_customer_id": "cus_SSfYcZWkulAsCG"
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector": "stripe",
"invoice_next_billing_time": "2025-07-15 18:30:00.0",
"card_network": "Visa",
"card_issuer": null,
"first_payment_attempt_pg_error_code": "card_declined",
"first_payment_attempt_network_decline_code": "card_declined",
"first_payment_attempt_network_advice_code": "card_declined"
}
}
```
Or
Run this Curl by filling our:
```
curl --location 'http://localhost:8080/v2/payments/create-intent' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: Profile_id' \
--header 'Authorization: api-key=api-key' \
--header 'api-key: apikey' \
--data-raw '{
"amount_details": {
"order_amount": 100,
"currency": "USD"
},
"capture_method":"manual",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"first_name": "John",
"last_name": "Dough"
},
"email": "example@example.com"
},
"shipping": {
"address": {
"first_name": "John",
"last_name": "Dough",
"city": "Karwar",
"zip": "581301",
"state": "Karnataka"
},
"email": "example@example.com"
},
"feature_metadata": {
"payment_revenue_recovery_metadata": {
"total_retry_count": 2,
"payment_connector_transmission": "ConnectorCallUnsuccessful",
"billing_connector_id": "bca_12345",
"active_attempt_payment_connector_id": "pca_67890",
"billing_connector_payment_details": {
"payment_processor_token": "tok_abcdef123456",
"connector_customer_id": "cust_98765"
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector": "stripe",
"invoice_next_billing_time": "2025-06-12T15:00:00Z",
"billing_connector_payment_method_details": {
"type": "Card",
"value": {
"card_network": "Visa",
"card_issuer": "HDFC Bank"
}
},
"first_payment_attempt_pg_error_code": "PG001",
"first_payment_attempt_network_decline_code": "ND002",
"first_payment_attempt_network_advice_code": "AD003"
}
}
}'
```
This is the expected response
```
{
"id": "12345_pay_019763e442877b72aaa3b0a5304b2c4e",
"status": "requires_payment_method",
"amount_details": {
"order_amount": 100,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null
},
"client_secret": "cs_019763e442ad7ff1b735ca04e9810f2c",
"profile_id": "pro_jhWJnFzJZ4tDqxGRrSbX",
"merchant_reference_id": null,
"routing_algorithm_id": null,
"capture_method": "manual",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"line3": null,
"zip": null,
"state": null,
"first_name": "John",
"last_name": "Dough"
},
"phone": null,
"email": "example@example.com"
},
"shipping": {
"address": {
"city": "Karwar",
"country": null,
"line1": null,
"line2": null,
"line3": null,
"zip": "581301",
"state": "Karnataka",
"first_name": "John",
"last_name": "Dough"
},
"phone": null,
"email": "example@example.com"
},
"customer_id": null,
"customer_present": "present",
"description": null,
"return_url": null,
"setup_future_usage": "on_session",
"apply_mit_exemption": "Skip",
"statement_descriptor": null,
"order_details": null,
"allowed_payment_method_types": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"payment_revenue_recovery_metadata": {
"total_retry_count": 2,
"payment_connector_transmission": "ConnectorCallUnsuccessful",
"billing_connector_id": "bca_12345",
"active_attempt_payment_connector_id": "pca_67890",
"billing_connector_payment_details": {
"payment_processor_token": "tok_abcdef123456",
"connector_customer_id": "cust_98765"
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector": "stripe",
"billing_connector_payment_method_details": {
"type": "Card",
"value": {
"card_network": "Visa",
"card_issuer": "HDFC Bank"
}
},
"invoice_next_billing_time": "2025-06-12T15:00:00.000Z",
"first_payment_attempt_pg_error_code": "PG001",
"first_payment_attempt_network_decline_code": "ND002",
"first_payment_attempt_network_advice_code": "AD003"
}
},
"payment_link_enabled": "Skip",
"payment_link_config": null,
"request_incremental_authorization": "default",
"expires_on": "2025-06-12T11:41:33.123Z",
"frm_metadata": null,
"request_external_three_ds_authentication": "Skip"
}
```
Check the DB for feature metadata and verify the data.
Sample log:
<img width="1205" alt="Screenshot 2025-06-12 at 5 02 26 PM" src="https://github.com/user-attachments/assets/b93cdf63-b8fb-4ae8-be1e-8a11d8c66a96" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added support for capturing and displaying additional card metadata, including card network, card issuer, and card ISIN, in payment and revenue recovery data.
- Enhanced error reporting by including detailed error codes from the first payment attempt, such as payment gateway error codes, network decline codes, and advice codes.
- **Bug Fixes**
- Improved propagation and mapping of card and error information across payment and revenue recovery processes.
- **Chores**
- Updated internal processes to fetch and enrich card issuer information asynchronously during revenue recovery operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/types.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/lib.rs`
- `crates/hyperswitch_domain_models/src/payments.rs`
- `crates/hyperswitch_domain_models/src/revenue_recovery.rs`
- ... and 1 more files
**4. Core Business Logic**
- `crates/router/src/core/payments/operations/payment_attempt_record.rs`
- `crates/router/src/core/payments/transformers.rs`
- `crates/router/src/core/revenue_recovery.rs`
- ... and 2 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs`
**6. Other**
- `api-reference/v2/openapi_spec_v2.json`
- `crates/openapi/src/openapi_v2.rs`
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (7 changes)
- Extend existing types with new fields (64 changes)
**Detailed Identifier Changes:**
Commit abe9708d:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::BillingConnectorAdditionalCardInfo
- enum: pub::BillingConnectorPaymentMethodDetails
**crates/diesel_models/src/types.rs**
Add:
- struct: pub::BillingConnectorAdditionalCardInfo
- enum: pub::BillingConnectorPaymentMethodDetails
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs**
Remove:
- struct: pub::StripeCardFundingTypeDetails
Add:
- function: private::from
- struct: pub::StripeBillingCardDetails
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- function: private::convert_from
- function: private::convert_back
- function: private::convert_from
- function: private::convert_back
- impl: impl ApiModelToDieselModelConvertor<ApiBillingConnectorAdditionalCardInfo> for BillingConnectorAdditionalCardInfo
- impl: impl ApiModelToDieselModelConvertor<ApiBillingConnectorPaymentMethodDetails> for BillingConnectorPaymentMethodDetails
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/revenue_recovery.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_attempt_record.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Add:
- function: private::foreign_from
- impl: impl ForeignFrom<&diesel_models::types::BillingConnectorPaymentMethodDetails> for api_models::payments::BillingConnectorPaymentMethodDetails
**crates/router/src/core/revenue_recovery.rs**
Modify existing code
**crates/router/src/core/revenue_recovery/api.rs**
Modify existing code
**crates/router/src/core/webhooks/recovery_incoming.rs**
Modify existing code
|
{"pr_number": 8250, "pr_title": "feat(core): consume card details from billing connectors and first error codes and store them in payment intent table", "merged_at": "2025-06-16T11:39:32Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/types.rs"], "domain": ["crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs"], "core_business": ["crates/router/src/core/payments/operations/payment_attempt_record.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/revenue_recovery.rs", "crates/router/src/core/revenue_recovery/api.rs", "crates/router/src/core/webhooks/recovery_incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs", "crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs"], "other": ["api-reference/v2/openapi_spec_v2.json", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 3, "functions_added": 7, "enums_added": 3, "fields_added": 64, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): fixed ctp bug for confirmation and added multi profile support for modular auth
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
## Description
<!-- Describe your changes in detail -->
Currently normal 3ds payments are failing if we enable a merchant for UAS. This pr fixes that
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
MCA Nuvei
```
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_OLhAtJL71sjBsopNpxv8rRDRUPMsIBtIkIO9IRtKFzZfkyJwCJ9iaImStdtO3OuF' \
--data '{
"connector_type": "payment_processor",
"business_country": "US",
"business_label": "default",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "",
"key1": "",
"api_secret": ""
},
"connector_name": "nuvei",
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "debit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"report_group": "",
"merchant_config_currency": "",
"merchant_category_code": "",
"merchant_country_code": "",
"merchant_name": "",
"endpoint_prefix": "",
"three_ds_requestor_name": "juspay-prev",
"three_ds_requestor_id": "juspay-prev",
"pull_mechanism_for_external_3ds_enabled": true,
"acquirer_bin": "400000",
"acquirer_merchant_id": "",
"acquirer_country_code": ""
}
}'
```
Response
```
{
"connector_type": "payment_processor",
"connector_name": "nuvei",
"connector_label": "nuvei_US_default",
"merchant_connector_id": "mca_pLp74ti6st6k8YpYKNQu",
"profile_id": "pro_6ckTHsNzmfCzzRKi2EVD",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "80***************39",
"key1": "10***17",
"api_secret": "xH************************************************************dZ"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "debit",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"connector_webhook_details": null,
"metadata": {
"acquirer_bin": "400000",
"report_group": "Hello",
"merchant_name": "Dummy Merchant",
"endpoint_prefix": "",
"acquirer_merchant_id": "",
"acquirer_country_code": "",
"merchant_country_code": "840",
"three_ds_requestor_id": "juspay-prev",
"merchant_category_code": "",
"three_ds_requestor_name": "juspay-prev",
"merchant_config_currency": "",
"pull_mechanism_for_external_3ds_enabled": true
},
"test_mode": false,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null
}
```
MCA Juspay 3DS Server
```
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_OLhAtJL71sjBsopNpxv8rRDRUPMsIBtIkIO9IRtKFzZfkyJwCJ9iaImStdtO3OuF' \
--data '{
"connector_type": "authentication_processor",
"connector_name": "juspaythreedsserver",
"connector_account_details": {
"auth_type": "NoKey"
},
"test_mode": true,
"disabled": false,
"metadata": {
"merchant_category_code": "",
"merchant_country_code": "",
"merchant_name": "Dummy Merchant",
"endpoint_prefix": "",
"three_ds_requestor_name": "",
"three_ds_requestor_id": "",
"pull_mechanism_for_external_3ds_enabled": true,
"acquirer_bin":"400000",
"acquirer_merchant_id":"",
"acquirer_country_code": ""
}
}'
```
Response
```
{
"connector_type": "authentication_processor",
"connector_name": "juspaythreedsserver",
"connector_label": "juspaythreedsserver_US_default",
"merchant_connector_id": "mca_t8fUrrgC2L69A0Sn2wOg",
"profile_id": "pro_6ckTHsNzmfCzzRKi2EVD",
"connector_account_details": {
"auth_type": "NoKey"
},
"payment_methods_enabled": null,
"connector_webhook_details": null,
"metadata": {
"acquirer_bin": "",
"merchant_name": "",
"endpoint_prefix": "",
"acquirer_merchant_id": "",
"acquirer_country_code": "",
"merchant_country_code": "",
"three_ds_requestor_id": "juspay-prev",
"merchant_category_code": "5411",
"three_ds_requestor_name": "",
"pull_mechanism_for_external_3ds_enabled": true
},
"test_mode": true,
"disabled": false,
"frm_configs": null,
"business_country": null,
"business_label": null,
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null
}
```
Enable AuthenticationConfig For Merchant
```
curl --location 'http://localhost:8080/configs/merchants_eligible_for_authentication_service' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"key": "merchants_eligible_for_authentication_service",
"value": "[\"postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa\"]"
}'
```
Response
```
{
"key": "merchants_eligible_for_authentication_service",
"value": "[\"postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa\"]"
}
```
Payments Create + ThreeDS
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_OLhAtJL71sjBsopNpxv8rRDRUPMsIBtIkIO9IRtKFzZfkyJwCJ9iaImStdtO3OuF' \
--data-raw '{
"amount": 15100,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "BamboraCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "debit",
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},
"payment_method_data": {
"card": {
"card_number": "2221008123677736",
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"card_cvc": "100"
}
},
"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"
},
"setup_future_usage": "off_session"
}'
```
Response
```
{
"payment_id": "pay_x528QZvoT5MqjgzkqVYb",
"merchant_id": "postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa",
"status": "requires_customer_action",
"amount": 15100,
"net_amount": 15100,
"shipping_cost": null,
"amount_capturable": 15100,
"amount_received": null,
"connector": "nuvei",
"client_secret": "pay_x528QZvoT5MqjgzkqVYb_secret_zjEO4YtDNNAFyIXskzpT",
"created": "2025-09-24T13:12:07.493Z",
"currency": "USD",
"customer_id": "BamboraCustomer",
"customer": {
"id": "BamboraCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "7736",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "222100",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"payment_checks": {
"avs_result": "",
"avs_description": null,
"card_validation_result": "",
"card_validation_description": null
},
"authentication_data": {
"cReq": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjZmYzZkM2U3LTY3MjktNGJhZi05ZDRmLTBjODM4ZjNhZjUzNCIsImFjc1RyYW5zSUQiOiI5YTE5OTc0MC00YTlkLTQ2NmEtYTg4ZC1kYTAzMzAxOWFlNjIiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0",
"flow": "challenge",
"acsUrl": "https://3dsn.sandbox.safecharge.com/ThreeDSACSEmulatorChallenge/api/ThreeDSACSChallengeController/ChallengePage?eyJub3RpZmljYXRpb25VUkwiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvcGF5bWVudHMvcGF5X3g1MjhRWnZvVDVNcWpnemtxVlliL3Bvc3RtYW5fbWVyY2hhbnRfR0hBY3Rpb25fYmZmYmI2NmQtYjM3ZC00ZmJkLTljZjctZDc5YjhmYWUxM2ZhL3JlZGlyZWN0L2NvbXBsZXRlL251dmVpIiwidGhyZWVEU1NlcnZlclRyYW5zSUQiOiI2ZmM2ZDNlNy02NzI5LTRiYWYtOWQ0Zi0wYzgzOGYzYWY1MzQiLCJhY3NUcmFuc0lEIjoiOWExOTk3NDAtNGE5ZC00NjZhLWE4OGQtZGEwMzMwMTlhZTYyIiwiZHNUcmFuc0lEIjoiNzE5MDU1ZTAtZDRjNS00MGU5LWFmNjQtYjY0YmM2OWM3N2I4IiwiZGF0YSI6bnVsbCwiTWVzc2FnZVZlcnNpb24iOiIyLjIuMCJ9",
"version": "2.2.0",
"threeDFlow": "1",
"decisionReason": "NoPreference",
"threeDReasonId": "",
"acquirerDecision": "ExemptionRequest",
"challengePreferenceReason": "12",
"isExemptionRequestInAuthentication": "0"
}
},
"billing": null
},
"payment_token": "token_Y2zINZ6kChTFVv9dk4Oz",
"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": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_x528QZvoT5MqjgzkqVYb/postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa/pay_x528QZvoT5MqjgzkqVYb_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "BamboraCustomer",
"created_at": 1758719527,
"expires": 1758723127,
"secret": "epk_62b1f4961bd24584be423b0fbcaccfb6"
},
"manual_retry_allowed": null,
"connector_transaction_id": "7110000000017363647",
"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": "9132534111",
"payment_link": null,
"profile_id": "pro_6ckTHsNzmfCzzRKi2EVD",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_pLp74ti6st6k8YpYKNQu",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-24T13:27:07.493Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": "",
"payment_method_status": null,
"updated": "2025-09-24T13:12:10.955Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
Redirection
<img width="1009" height="629" alt="Screenshot 2025-09-24 at 6 49 55 PM" src="https://github.com/user-attachments/assets/9eb9e1f2-a654-4942-8362-b46134fc3ac8" />
Retreive:
```
{
"payment_id": "pay_x528QZvoT5MqjgzkqVYb",
"merchant_id": "postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa",
"status": "succeeded",
"amount": 15100,
"net_amount": 15100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 15100,
"connector": "nuvei",
"client_secret": "pay_x528QZvoT5MqjgzkqVYb_secret_zjEO4YtDNNAFyIXskzpT",
"created": "2025-09-24T13:12:07.493Z",
"currency": "USD",
"customer_id": "BamboraCustomer",
"customer": {
"id": "BamboraCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "7736",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "222100",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"payment_checks": {
"avs_result": "",
"avs_description": null,
"card_validation_result": "",
"card_validation_description": null
},
"authentication_data": {
"flow": "challenge",
"version": "2.2.0",
"decisionReason": "NoPreference",
"threeDReasonId": "",
"acquirerDecision": "ExemptionRequest",
"isLiabilityOnIssuer": "1",
"challengeCancelReason": "",
"challengeCancelReasonId": "",
"challengePreferenceReason": "12"
}
},
"billing": null
},
"payment_token": "token_Y2zINZ6kChTFVv9dk4Oz",
"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": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "7110000000017363885",
"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": "9132534111",
"payment_link": null,
"profile_id": "pro_6ckTHsNzmfCzzRKi2EVD",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_pLp74ti6st6k8YpYKNQu",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-24T13:27:07.493Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": "480213756166352",
"payment_method_status": null,
"updated": "2025-09-24T13:14:05.572Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
Payments Create : No 3ds
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_OLhAtJL71sjBsopNpxv8rRDRUPMsIBtIkIO9IRtKFzZfkyJwCJ9iaImStdtO3OuF' \
--data-raw '{
"amount": 15100,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "BamboraCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "debit",
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},
"payment_method_data": {
"card": {
"card_number": "2221008123677736",
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"card_cvc": "100"
}
},
"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"
},
"setup_future_usage": "off_session"
}'
```
Response
```
{
"payment_id": "pay_Zm0yWWDJcEndaKQUPQzC",
"merchant_id": "postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa",
"status": "succeeded",
"amount": 15100,
"net_amount": 15100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 15100,
"connector": "nuvei",
"client_secret": "pay_Zm0yWWDJcEndaKQUPQzC_secret_iPiWmFznasUOY7vOmJLk",
"created": "2025-09-24T13:20:39.839Z",
"currency": "USD",
"customer_id": "BamboraCustomer",
"customer": {
"id": "BamboraCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "7736",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "222100",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"payment_checks": {
"avs_result": "",
"avs_description": null,
"card_validation_result": "",
"card_validation_description": null
},
"authentication_data": {
"challengePreferenceReason": "12"
}
},
"billing": null
},
"payment_token": "token_nzGf7vRjyw0qD0AoLVX0",
"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": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "BamboraCustomer",
"created_at": 1758720039,
"expires": 1758723639,
"secret": "epk_b9dfe052c3f94a6b88b7734a2b0b4376"
},
"manual_retry_allowed": null,
"connector_transaction_id": "7110000000017364485",
"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": "9132955111",
"payment_link": null,
"profile_id": "pro_6ckTHsNzmfCzzRKi2EVD",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_pLp74ti6st6k8YpYKNQu",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-24T13:35:39.839Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": "480213756166352",
"payment_method_status": null,
"updated": "2025-09-24T13:20:43.815Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
Payments Create + External Juspay 3DS
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_OLhAtJL71sjBsopNpxv8rRDRUPMsIBtIkIO9IRtKFzZfkyJwCJ9iaImStdtO3OuF' \
--data-raw '{
"amount": 15100,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "BamboraCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"request_external_three_ds_authentication":true,
"payment_method": "card",
"payment_method_type": "debit",
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},
"payment_method_data": {
"card": {
"card_number": "2221008123677736",
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"card_cvc": "100"
}
},
"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"
},
"setup_future_usage": "off_session"
}'
```
Response
```
{
"payment_id": "pay_2CKMzGv6Fn3UBsB9s9tW",
"merchant_id": "postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa",
"status": "requires_customer_action",
"amount": 15100,
"net_amount": 15100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "nuvei",
"client_secret": "pay_2CKMzGv6Fn3UBsB9s9tW_secret_rXSWY1A65ehM14tipPwW",
"created": "2025-09-24T13:21:25.664Z",
"currency": "USD",
"customer_id": "BamboraCustomer",
"customer": {
"id": "BamboraCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "7736",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "222100",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_mQoCstXPpdPjuecDF4A8",
"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": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": {
"type": "three_ds_invoke",
"three_ds_data": {
"three_ds_authentication_url": "http://localhost:8080/payments/pay_2CKMzGv6Fn3UBsB9s9tW/3ds/authentication",
"three_ds_authorize_url": "http://localhost:8080/payments/pay_2CKMzGv6Fn3UBsB9s9tW/postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa/authorize/nuvei",
"three_ds_method_details": {
"three_ds_method_data_submission": false,
"three_ds_method_data": null,
"three_ds_method_url": null,
"three_ds_method_key": null,
"consume_post_message_for_three_ds_method_completion": false
},
"poll_config": {
"poll_id": "external_authentication_pay_2CKMzGv6Fn3UBsB9s9tW",
"delay_in_secs": 2,
"frequency": 5
},
"message_version": "2.2.0",
"directory_server_id": 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": "BamboraCustomer",
"created_at": 1758720085,
"expires": 1758723685,
"secret": "epk_95232ecdaf724adbb42626ce678c0c17"
},
"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_6ckTHsNzmfCzzRKi2EVD",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_pLp74ti6st6k8YpYKNQu",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": {
"authentication_flow": null,
"electronic_commerce_indicator": null,
"status": "pending",
"ds_transaction_id": "8f93298c-b126-4463-ad76-6127dcde2f65",
"version": "2.2.0",
"error_code": null,
"error_message": null
},
"external_3ds_authentication_attempted": true,
"expires_on": "2025-09-24T13:36:25.664Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-09-24T13:21:26.500Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
Authenticate
```
curl --location 'https://93a6a1e56b62.ngrok-free.app/payments/pay_2CKMzGv6Fn3UBsB9s9tW/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_f68a077767f849368ce529ce31efbf1b' \
--data '{
"client_secret": "pay_2CKMzGv6Fn3UBsB9s9tW_secret_rXSWY1A65ehM14tipPwW",
"device_channel": "BRW",
"threeds_method_comp_ind": "N"
}'
```
Response
```
{
"trans_status": "C",
"acs_url": "https://mock-three-ds-server-small-lake-1937.fly.dev/processor/mock/acs/trigger-otp?redirectUrl=http%3A%2F%2Flocalhost%3A8080%2Fpayments%2Fpay_2CKMzGv6Fn3UBsB9s9tW%2Fpostman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa%2Fauthorize%2Fnuvei",
"challenge_request": "eyJtZXNzYWdlVHlwZSI6IkNSZXEiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjhmOTMyOThjLWIxMjYtNDQ2My1hZDc2LTYxMjdkY2RlMmY2NSIsImFjc1RyYW5zSUQiOiIzNDk4YzEyMi1lZmFiLTQyN2ItYmRmNS0wYzUyZmNlODA4NTgiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0=",
"challenge_request_key": "creq",
"acs_reference_number": "3498c122-efab-427b-bdf5-0c52fce80858",
"acs_trans_id": "3498c122-efab-427b-bdf5-0c52fce80858",
"three_dsserver_trans_id": "8f93298c-b126-4463-ad76-6127dcde2f65",
"acs_signed_content": null,
"three_ds_requestor_url": "https://google.com",
"three_ds_requestor_app_url": null
}
```
Call Juspay 3DS Server
```
curl --location 'https://mock-three-ds-server-small-lake-1937.fly.dev/processor/mock/acs/trigger-otp?redirectUrl=http%3A%2F%2Flocalhost%3A8080%2Fpayments%2Fpay_2CKMzGv6Fn3UBsB9s9tW%2Fpostman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa%2Fauthorize%2Fnuvei' \
--header 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
--header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'origin: https://juspay-3ds-sdk.netlify.app' \
--header 'pragma: no-cache' \
--header 'priority: u=0, i' \
--header 'referer: https://juspay-3ds-sdk.netlify.app/' \
--header 'sec-ch-ua: "Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: iframe' \
--header 'sec-fetch-mode: navigate' \
--header 'sec-fetch-site: cross-site' \
--header 'sec-fetch-storage-access: active' \
--header 'upgrade-insecure-requests: 1' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36' \
--header 'api-key: dev_OLhAtJL71sjBsopNpxv8rRDRUPMsIBtIkIO9IRtKFzZfkyJwCJ9iaImStdtO3OuF' \
--data-urlencode 'creq={"messageType":"CReq","threeDSServerTransID":"8f93298c-b126-4463-ad76-6127dcde2f65","acsTransID":"3498c122-efab-427b-bdf5-0c52fce80858","challengeWindowSize":"01","messageVersion":"2.2.0"}'
```
Response
<img width="854" height="843" alt="Screenshot 2025-09-24 at 6 54 46 PM" src="https://github.com/user-attachments/assets/4548fffc-00e4-44f3-a0ca-4971fb87aa36" />
Retreive
```
{
"payment_id": "pay_2CKMzGv6Fn3UBsB9s9tW",
"merchant_id": "postman_merchant_GHAction_bffbb66d-b37d-4fbd-9cf7-d79b8fae13fa",
"status": "succeeded",
"amount": 15100,
"net_amount": 15100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 15100,
"connector": "nuvei",
"client_secret": "pay_2CKMzGv6Fn3UBsB9s9tW_secret_rXSWY1A65ehM14tipPwW",
"created": "2025-09-24T13:21:25.664Z",
"currency": "USD",
"customer_id": "BamboraCustomer",
"customer": {
"id": "BamboraCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "7736",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "222100",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"payment_checks": {
"avs_result": "",
"avs_description": null,
"card_validation_result": "",
"card_validation_description": null
},
"authentication_data": {
"version": "2.2.0",
"threeDReasonId": "",
"isLiabilityOnIssuer": "1",
"challengeCancelReason": "",
"challengeCancelReasonId": "",
"challengePreferenceReason": ""
}
},
"billing": null
},
"payment_token": "token_mQoCstXPpdPjuecDF4A8",
"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": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "7110000000017364907",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": {
"param": "",
"json_payload": {}
},
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": "9133109111",
"payment_link": null,
"profile_id": "pro_6ckTHsNzmfCzzRKi2EVD",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_pLp74ti6st6k8YpYKNQu",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": {
"authentication_flow": "challenge",
"electronic_commerce_indicator": "02",
"status": "success",
"ds_transaction_id": "8f93298c-b126-4463-ad76-6127dcde2f65",
"version": "2.2.0",
"error_code": null,
"error_message": null
},
"external_3ds_authentication_attempted": true,
"expires_on": "2025-09-24T13:36:25.664Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": "480213756166352",
"payment_method_status": null,
"updated": "2025-09-24T13:24:39.222Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/unified_authentication_service.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/aci/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit acf816d0:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/aci/transformers.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
|
{"pr_number": 9545, "pr_title": "fix(core): fixed ctp bug for confirmation and added multi profile support for modular auth", "merged_at": "2025-09-24T17:21:34Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/unified_authentication_service.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/aci/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(analytics): Add currency as dimension and filter for disputes
## 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 currency as dimension and filter for disputes, required for Analytics V2 Dashboard.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
For better filtering related analytics
## How did you test 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:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/disputes' \
--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: Chart' \
--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/129.0.0.0 Safari/537.36' \
--header 'api-key: dev_ssyiqBXK7Ou1HUQuH0Z80BsHuV5pojc0uWli4QbNXGM1f4pn7jCIyb9VFiHlyATQ' \
--header 'sec-ch-ua: "Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNmNkZTA0NzYtMTFlMi00NGE5LTlkMjUtOTA5M2QzNDQwZjhlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzM1MDQxMjkzIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczNjM2MDQ5Mywib3JnX2lkIjoib3JnX2pwanI5TkFEWlhqSENNYTU5MmF3IiwicHJvZmlsZV9pZCI6InByb19QRHUydVA3aWNuM2lXY0I3V0VVSSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.tCy_qvwHxdPO1yor-A6IpZKVpC8uWxFGOgMvS35tRJ4' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-10-16T18:30:00Z",
"endTime": "2024-10-24T12:09:00Z"
},
"timeSeries": {
"granularity": "G_ONEDAY"
},
"filters": {
"currency": ["USD"]
},
"mode": "ORDER",
"source": "BATCH",
"metrics": [
"dispute_status_metric"
]
}
]'
```
`clickhouse` as the source (query)

`sqlx` as the source (query)
<img width="1289" alt="image" src="https://github.com/user-attachments/assets/b6f8df85-2a3c-4521-be68-70d48caf9db5" />
Currency filter is now getting added in the query while trying to get the data to calculate the metrics.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/disputes.rs`
**2. Core Business Logic**
- `crates/analytics/src/disputes/core.rs`
**3. Type Definitions**
- `crates/analytics/src/disputes/types.rs`
**4. Other**
- `crates/analytics/src/disputes/filters.rs`
- `crates/analytics/src/disputes/metrics.rs`
- `crates/analytics/src/disputes/metrics/dispute_status_metric.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Extend existing types with new fields (5 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 8d7e2d3a:
Files to modify:
**crates/analytics/src/disputes/core.rs**
Modify existing code
**crates/analytics/src/disputes/filters.rs**
Modify existing code
**crates/analytics/src/disputes/metrics.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/dispute_status_metric.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/total_amount_disputed.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs**
Modify existing code
**crates/analytics/src/disputes/types.rs**
Modify existing code
**crates/analytics/src/sqlx.rs**
Modify existing code
**crates/api_models/src/analytics/disputes.rs**
Modify existing code
Commit 12a2f2ad:
Files to modify:
**crates/analytics/src/disputes/core.rs**
Modify existing code
**crates/analytics/src/disputes/filters.rs**
Modify existing code
**crates/analytics/src/disputes/metrics.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/dispute_status_metric.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/total_amount_disputed.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs**
Modify existing code
**crates/analytics/src/disputes/types.rs**
Modify existing code
**crates/analytics/src/sqlx.rs**
Modify existing code
**crates/api_models/src/analytics/disputes.rs**
Modify existing code
|
{"pr_number": 7006, "pr_title": "feat(analytics): Add currency as dimension and filter for disputes", "merged_at": "2025-02-05T14:29:40Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "order"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics/disputes.rs"], "core_business": ["crates/analytics/src/disputes/core.rs"], "types": ["crates/analytics/src/disputes/types.rs"], "other": ["crates/analytics/src/disputes/filters.rs", "crates/analytics/src/disputes/metrics.rs", "crates/analytics/src/disputes/metrics/dispute_status_metric.rs", "crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs", "crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs", "crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs", "crates/analytics/src/disputes/metrics/total_amount_disputed.rs", "crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs", "crates/analytics/src/sqlx.rs"]}, "change_types": {"fields_added": 5, "imports_added": 2, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
fix(router): fixed netcetera flow for backward flow cavv fetching
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
## Description
<!-- Describe your changes in detail -->
Currently if we cancel the transaction after initiating with netcetera we are trying hard fetch cavv stored in temp locker, which is causing 5xx.
with this PR we will be ignoring the cavv fetch error since it will be fetched in authorisation flow if authorisation need to be done!
main pr
https://github.com/juspay/hyperswitch/pull/8035
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/authentication.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 5c141f0c:
Files to modify:
**crates/router/src/core/authentication.rs**
Modify existing code
|
{"pr_number": 8051, "pr_title": "fix(router): fixed netcetera flow for backward flow cavv fetching", "merged_at": "2025-05-16T09:17:20Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["transaction"]}, "hierarchy": {"core_business": ["crates/router/src/core/authentication.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(routing): remove frm rule migration support as it is not supported in DE
## 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 -->
As FRM routing is not supported in DE we can remove support for it from DE migration endpoint
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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)?
-->
Compilation and cypress is working as expected.
## 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/routing.rs`
**Detailed Identifier Changes:**
Commit fdacec4b:
Files to modify:
**crates/router/src/core/routing.rs**
Modify existing code
|
{"pr_number": 8448, "pr_title": "fix(routing): remove frm rule migration support as it is not supported in DE", "merged_at": "2025-06-24T12:26:14Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/routing.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(framework): Diesel and domain model changes to support multiple outgoing webhooks
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Added the `multiple_webhook_detail` field to the Profile DB and domain model. Also populated these fields to as `None`.
Also we need `webhook_endpoint_id`, added support for this idType as well in this 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`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Only domain and diesel model changes (addition of fields only and no values populated), hence 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. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
**2. Type Definitions**
- `crates/router/src/types/transformers.rs`
**3. Utils**
- `crates/common_utils/src/id_type.rs`
- `crates/common_utils/src/id_type/webhook_endpoint.rs`
**4. Other**
- `crates/common_enums/src/enums.rs`
- `crates/router/src/db/events.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (8 changes)
**Detailed Identifier Changes:**
Commit ac8c6c96:
Files to modify:
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::OutgoingWebhookEndpointStatus
**crates/common_utils/src/id_type.rs**
Add:
- mod: private::webhook_endpoint
**crates/common_utils/src/id_type/webhook_endpoint.rs**
Add:
- function: pub::try_from_string
- impl: impl WebhookEndpointId
**crates/diesel_models/src/business_profile.rs**
Add:
- struct: pub::MultipleWebhookDetail
**crates/router/src/db/events.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 9816, "pr_title": "feat(framework): Diesel and domain model changes to support multiple outgoing webhooks", "merged_at": "2025-10-16T10:36:29Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["webhook"]}, "hierarchy": {"database": ["crates/diesel_models/src/business_profile.rs"], "types": ["crates/router/src/types/transformers.rs"], "utils": ["crates/common_utils/src/id_type.rs", "crates/common_utils/src/id_type/webhook_endpoint.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/db/events.rs"]}, "change_types": {"structs_added": 1, "functions_added": 1, "enums_added": 1, "fields_added": 8, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): revert noon-paypal
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
main pr - https://github.com/juspay/hyperswitch/pull/7864
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/toml/production.toml`
- `crates/hyperswitch_connectors/src/connectors/noon.rs`
- `crates/hyperswitch_connectors/src/connectors/noon/transformers.rs`
- ... and 1 more files
**2. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**3. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit b7915d32:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/noon.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/noon/transformers.rs**
Remove:
- function: private::try_from
- function: private::try_from
- struct: pub::NoonPaymentsCompleteAuthorizeRequest
- struct: pub::NoonCompleteOrder
- struct: pub::NoonCompletePaymentData
- struct: pub::NoonData
- struct: pub::NoonQueryData
- struct: pub::PaypalQueryData
- struct: pub::NoonPaypalResponse
- struct: pub::NoonPaypalResponseResult
- struct: pub::NoonPaypalPaymentData
- struct: pub::PaypalData
- enum: pub::NoonPaymentMethodType
- enum: pub::NoonAuthPaymentResponse
- impl: impl TryFrom<&NoonRouterData<&PaymentsCompleteAuthorizeRouterData>> for NoonPaymentsCompleteAuthorizeRequest
- impl: impl TryFrom<ResponseRouterData<F, NoonPaypalResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
|
{"pr_number": 7868, "pr_title": "fix(connector): revert noon-paypal", "merged_at": "2025-04-22T14:00:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/connector_configs/toml/production.toml", "crates/hyperswitch_connectors/src/connectors/noon.rs", "crates/hyperswitch_connectors/src/connectors/noon/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"functions_added": 1, "fields_added": 1, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore: address Rust 1.90.0 clippy lints
## 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 clippy lints occurring due to new rust version 1.90.0
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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="1866" height="513" alt="image" src="https://github.com/user-attachments/assets/9358b4cc-2c33-4350-b61f-d52c4d1b2cd2" />
<img width="1866" height="589" alt="image" src="https://github.com/user-attachments/assets/f0a03929-98c7-4aa6-ad78-0c9fc0f08d8a" />
## 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/fraud_check/operation.rs`
- `crates/router/src/core/fraud_check/operation/fraud_check_post.rs`
- `crates/router/src/core/fraud_check/operation/fraud_check_pre.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs`
- `crates/hyperswitch_connectors/src/connectors/globalpay/response.rs`
- ... and 5 more files
**3. Other**
- `crates/analytics/src/sqlx.rs`
- `crates/router/src/db.rs`
- `crates/router/src/db/kafka_store.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Implement new functions (14 changes)
**Detailed Identifier Changes:**
Commit 198fe078:
Files to modify:
**crates/analytics/src/sqlx.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs**
Remove:
- struct: private::BankAccountDetails
**crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs**
Remove:
- struct: pub::GlobalPayPayer
**crates/hyperswitch_connectors/src/connectors/globalpay/response.rs**
Remove:
- enum: pub::ApmProvider
- enum: pub::GlobalpayPaymentMethodStatus
**crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs**
Remove:
- struct: private::Recurrence
**crates/hyperswitch_connectors/src/connectors/payload/responses.rs**
Remove:
- struct: pub::PayloadCardResponse
**crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs**
Remove:
- enum: pub::Channel
**crates/hyperswitch_connectors/src/connectors/worldpay/response.rs**
Remove:
- struct: pub::PaymentLink
- enum: pub::WorldpayWebhookStatus
**crates/router/src/core/fraud_check/operation.rs**
Modify existing code
**crates/router/src/core/fraud_check/operation/fraud_check_post.rs**
Modify existing code
**crates/router/src/core/fraud_check/operation/fraud_check_pre.rs**
Modify existing code
**crates/router/src/db.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/services/api/client.rs**
Modify existing code
|
{"pr_number": 9511, "pr_title": "chore: address Rust 1.90.0 clippy lints", "merged_at": "2025-09-25T19:13:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"core_business": ["crates/router/src/core/fraud_check/operation.rs", "crates/router/src/core/fraud_check/operation/fraud_check_post.rs", "crates/router/src/core/fraud_check/operation/fraud_check_pre.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs", "crates/hyperswitch_connectors/src/connectors/globalpay/response.rs", "crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payload/responses.rs", "crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/response.rs"], "other": ["crates/analytics/src/sqlx.rs", "crates/router/src/db.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/routes/app.rs", "crates/router/src/services/api/client.rs"]}, "change_types": {"functions_added": 14}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix: cypress reports generation
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
closes https://github.com/juspay/hyperswitch/issues/6893
this pr also bumps cypress dependencies
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 report generation
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
the changes in this pr has been cherry picked from #6735. reports for failed tests were generated there.
an example of reports being generated: https://github.com/juspay/hyperswitch/actions/runs/12409713710?pr=6735
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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.config.js`
- `cypress-tests/package-lock.json`
- `cypress-tests/package.json`
|
{"pr_number": 6894, "pr_title": "fix: cypress reports generation", "merged_at": "2024-12-20T08:19:41Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["cypress-tests/cypress.config.js", "cypress-tests/package-lock.json", "cypress-tests/package.json"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(wasm): [Worldpayvantiv] add support for metadata.report_group
## 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 change adds support for capturing the reportGroup in the dashboard.
Currently, the dashboard does not extract the reportGroup from the metadata. With this update, it will start collecting and displaying the reportGroup field correctly.
## How did you test 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. External Connector Integration**
- `crates/connector_configs/src/connector.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit d15ee49b:
Files to modify:
**crates/connector_configs/src/connector.rs**
Modify existing code
|
{"pr_number": 8260, "pr_title": "fix(wasm): [Worldpayvantiv] add support for metadata.report_group", "merged_at": "2025-06-05T09:54:27Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"connectors": ["crates/connector_configs/src/connector.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(euclid): add dynamic routing in core flows
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This will add dynamic_routing in core flows.
After which once the toggle route is hit with `feature = dynamic_connector_selection`, routable connectors will be evaluated on basis of success_based routing.
### 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).
-->
Will enable success_based routing
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
### The testing flows are as follows:
1. Toggle the route with feature(`metrics`, `dynamic_conenctor_selection`, `none`) as `dynamic_connector_selection`.
```
curl --location --request POST 'http://localhost:8080/account/merchant_id/business_profile/profile_id/dynamic_routing/success_based/toggle?enable=dynamic_connector_selection' \
--header 'api-key: api_key'
```
2. Check the business_profile table for the enabled dynamic routing feature.
3. Moreover if the dynamic_connector_selection is enabled for business_profile, success_based_routing will be performed, which can be checked by having a log filter with `success_based_routing connectors`.
4. If metrics feature is enabled, there will be no logs from the 3rd step instead there will be a log something like `successfully pushed success_based_routing metrics`, NOTE: this log will also be present in step 3rd.
5. if None is selected no logs regarding `success_based_routing` will be there.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/routing.rs`
**2. Core Business Logic**
- `crates/router/src/core/errors.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/operations/payment_response.rs`
- ... and 3 more files
**3. Other**
- `api-reference/openapi_spec.json`
- `crates/openapi/src/openapi.rs`
- `crates/openapi/src/routes/routing.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (5 changes)
- Extend existing types with new fields (58 changes)
- Add conditional logic for feature flags or filtering (7 changes)
**Detailed Identifier Changes:**
Commit ce732db9:
Files to modify:
**crates/api_models/src/routing.rs**
Add:
- function: pub::update_enabled_features
- struct: pub::SuccessBasedAlgorithm
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/routes/routing.rs**
Remove:
- function: pub::success_based_routing_update_configs
**crates/router/src/core/errors.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Add:
- function: pub::perform_success_based_routing
**crates/router/src/core/routing.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Modify existing code
**crates/router/src/routes/routing.rs**
Modify existing code
|
{"pr_number": 6333, "pr_title": "feat(euclid): add dynamic routing in core flows", "merged_at": "2024-10-25T11:39:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/errors.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/routing.rs", "crates/router/src/core/routing/helpers.rs"], "other": ["api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/routes/routing.rs", "crates/router/src/routes/routing.rs"]}, "change_types": {"structs_added": 1, "functions_added": 5, "enums_added": 1, "fields_added": 58, "imports_added": 6, "conditionals_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connectors): [worldpay] send decoded token for ApplePay
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR fixes the ApplePay integration with WorldPay.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding 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 enables processing ApplePay txns through WorldPay.
## How did you test it?
Tested locally by setting up ApplePay with Worldpay connector
<details>
<summary>Process an ApplePay txn through WP</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_roIAheQpBhdk54rvqzIWVex9ffGGpoTEDrpqhygbxtyZgsuGlPeOb6sHs5gRwP65' \
--data-raw '{"authentication_type":"three_ds","customer_id":"cus_G6gAIQuPgLJqht6Ny27k","profile_id":"pro_QSzisIfNqLE7FdEU3Wmr","amount":100,"currency":"USD","payment_link":true,"description":"This is my description of why this payment was requested.","capture_method":"automatic","billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"US","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"}},"email":"john.doe@example.co.in","session_expiry":100000,"return_url":"https://example.com","payment_link_config":{"theme":"#0E103D","logo":"https://hyperswitch.io/favicon.ico","seller_name":"Hyperswitch Inc.","enabled_saved_payment_method":true,"hide_card_nickname_field":true,"show_card_form_by_default":true,"transaction_details":[{"key":"Policy Number","value":"938478327648","ui_configuration":{"is_key_bold":false,"is_value_bold":false,"position":2}},{"key":"Business Country","value":"Germany","ui_configuration":{"is_key_bold":false,"is_value_bold":false,"position":1}},{"key":"Product Name","value":"Life Insurance Elite","ui_configuration":{"is_key_bold":false,"is_value_bold":false,"position":3}}]}}'
Response
{"payment_id":"pay_i5hWlAfZJt989EoU0Qzn","merchant_id":"merchant_1737359846","status":"requires_payment_method","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":null,"client_secret":"pay_i5hWlAfZJt989EoU0Qzn_secret_WSq9QS2DQqybQHc2FrIO","created":"2025-01-20T08:43:12.479Z","currency":"USD","customer_id":"cus_G6gAIQuPgLJqht6Ny27k","customer":{"id":"cus_G6gAIQuPgLJqht6Ny27k","name":"John Nether","email":"john.doe@example.co.in","phone":"6168205362","phone_country_code":"+1"},"description":"This is my description of why this payment was requested.","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":"CA","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":"john.doe@example.co.in","name":"John Nether","phone":"6168205362","return_url":"https://example.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_G6gAIQuPgLJqht6Ny27k","created_at":1737362592,"expires":1737366192,"secret":"epk_522026e973534fa0b6e85fc425de48ec"},"manual_retry_allowed":null,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":{"link":"https://onemore.tame-bird-39.telebit.io/payment_link/merchant_1737359846/pay_i5hWlAfZJt989EoU0Qzn?locale=en","secure_link":null,"payment_link_id":"plink_3VVma7RRENT8hvLlfCko"},"profile_id":"pro_QSzisIfNqLE7FdEU3Wmr","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":null,"incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-01-21T12:29:52.477Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-01-20T08:43:12.492Z","split_payments":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}
- Open payment link and complete txn
- Retrieve payment
cURL
curl --location --request GET 'http://localhost:8080/payments/pay_i5hWlAfZJt989EoU0Qzn?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_roIAheQpBhdk54rvqzIWVex9ffGGpoTEDrpqhygbxtyZgsuGlPeOb6sHs5gRwP65'
Response
{"payment_id":"pay_i5hWlAfZJt989EoU0Qzn","merchant_id":"merchant_1737359846","status":"succeeded","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":100,"connector":"worldpay","client_secret":"pay_i5hWlAfZJt989EoU0Qzn_secret_WSq9QS2DQqybQHc2FrIO","created":"2025-01-20T08:43:12.479Z","currency":"USD","customer_id":"cus_G6gAIQuPgLJqht6Ny27k","customer":{"id":"cus_G6gAIQuPgLJqht6Ny27k","name":"John Nether","email":"john.doe@example.co.in","phone":"6168205362","phone_country_code":"+1"},"description":"This is my description of why this payment was requested.","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":"0492","card_network":"Visa","type":"debit"}},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":"john.doe@example.co.in","name":"John Nether","phone":"6168205362","return_url":"https://example.com/","authentication_type":"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":null,"manual_retry_allowed":false,"connector_transaction_id":"eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT6h+lbqfJa+1BSoKFSY8HLg2sGkO:vYpWC37Db6JbhdEll9fIyaH2kwt88eyzXjPICpZY8cZeCeMgt1ol:GABqQG6u+T:u3sfHv3ezSOJxioRTixsThPEhzFW4ZZ6mObj3CK0rnFndcM0swvZMqgQwSEj5tBsydfzM4XKX20O6Nme96ha9twqxTSQIfr1rtl9V3q7fw3w5O9UZT4vQi9BMyCcaHkWSD:RbCWCcmiQqa68XlOgjFizTujqaSOCiqD3rKLoKWRGY+zDciMqs+3KEOGqQBtmdOWzHeNbZ7Y2C6t+hQ9RR:Z491q0vLPK+etGkmyVNB6HsgNKLVR8BWjehM+WuX0NAJU:Z4P8Bpdq0Is5ExjJf8mIzQPCvm4AC2kHDz9uIAwzPK7A7AtWsm1vb","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"1e5bf75c-944c-4446-9cf0-f3720ee9c894","payment_link":null,"profile_id":"pro_QSzisIfNqLE7FdEU3Wmr","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_GHrUdffckdzZorvJydsF","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-01-21T12:29:52.477Z","fingerprint":null,"browser_info":{"os_type":"macOS","language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","os_version":"10.15.7","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15","color_depth":24,"device_model":"Macintosh","java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-01-20T08:44:49.142Z","split_payments":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 7fd3551a:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
|
{"pr_number": 7069, "pr_title": "fix(connectors): [worldpay] send decoded token for ApplePay", "merged_at": "2025-01-24T08:32:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(dashboard): added wasm changes for threedsecure.io for collecting acquirer_bin, acquirer_merchant_id and acquirer_country_code in MCA
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Enhancement
## Description
<!-- Describe your changes in detail -->
add wasm changes for threedsecure.io for collecting acquirer_bin, acquirer_merchant_id and acquirer_country_code in MCA
<!--
Provide links to the files with corresponding changes.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] 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. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
|
{"pr_number": 8330, "pr_title": "feat(dashboard): added wasm changes for threedsecure.io for collecting acquirer_bin, acquirer_merchant_id and acquirer_country_code in MCA", "merged_at": "2025-06-12T11:02:04Z", "intent": {"feature_type": "validation", "action": "add_feature", "entities": ["merchant"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(connector): [INESPAY] Enable Inespay In Dashboard
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Inespay enablement in dashboard. Added the changes in connector configs.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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)?
-->
Nothing to test, just env changes.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
|
{"pr_number": 7233, "pr_title": "feat(connector): [INESPAY] Enable Inespay In Dashboard", "merged_at": "2025-02-11T12:49:47Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(core): populate billing_address for payment with pm_id
## 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 -->
- Billing address was empty during payment request with payment_method_id
- This is due to not saving billing_address in payment_methods table while generating payment_method_id
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested through Postman:
- Create an MCA (Cybersource):
- Create a Zero Dollar Payment:
```
{
"amount": 0,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "{{customer_id}}",
"email": "guest@example.com",
"customer_acceptance": {
"acceptance_type": "online"
},
"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": "card",
"payment_method_type": "credit",
"payment_type": "setup_mandate",
"payment_method_data": {
"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": "guest@example.com"
},
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "Test Holder",
"card_cvc": "737"
}
},
"authentication_type": "no_three_ds"
}
```
- The response must contain payment_method_id, below is an example:
```
{
"payment_id": "pay_NopvXqZ0s6Wrrkt3gdcz",
"merchant_id": "merchant_1729681685",
"status": "succeeded",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "cybersource",
"client_secret": "pay_NopvXqZ0s6Wrrkt3gdcz_secret_UEdSnA9WlM3IKbfiv6z2",
"created": "2024-10-23T11:08:19.949Z",
"currency": "USD",
"customer_id": "cus_UQrYo4q9l14smT8z4PNP",
"customer": {
"id": "cus_UQrYo4q9l14smT8z4PNP",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": "Visa",
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": null,
"payment_checks": {
"avs_response": {
"code": "Y",
"codeRaw": "Y"
},
"card_verification": null
},
"authentication_data": 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": "guest@example.com"
}
},
"payment_token": "token_NfMUts131a2Zk2EKWJeL",
"shipping": null,
"billing": null,
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cus_UQrYo4q9l14smT8z4PNP",
"created_at": 1729681699,
"expires": 1729685299,
"secret": "epk_cce0314b6b1b43d382c55c5cc0ede2c1"
},
"manual_retry_allowed": false,
"connector_transaction_id": "7296817011606489603955",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_NopvXqZ0s6Wrrkt3gdcz_1",
"payment_link": null,
"profile_id": "pro_l7pRXMW7PtoxvOQW40jp",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_eKo5qWiMoB3koUlBpxgC",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-23T11:23:19.949Z",
"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_KAdC0MveEBnhHirWs8zP",
"payment_method_status": null,
"updated": "2024-10-23T11:08:22.079Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "252384F2473C94E6E063A2598D0AC502"
}
```
- Create a payment with payment_method_id:
```
{
"amount": 1000,
"currency": "USD",
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"confirm": true,
"customer_id": "{{customer_id}}",
"off_session": true,
"description": "Hello this is description",
"setup_future_usage": "off_session",
"profile_id": "{{profile_id}}",
"recurring_details": {
"type": "payment_method_id",
"data": "{{payment_method_id}}"
}
}
```
- The status should be succeeded in resposne, below is an example response:
```
{
"payment_id": "pay_jdnqKqKh6oJhnHee3qo1",
"merchant_id": "merchant_1729681685",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "cybersource",
"client_secret": "pay_jdnqKqKh6oJhnHee3qo1_secret_sssxYGZP4juZWgVNMtXK",
"created": "2024-10-23T11:09:37.178Z",
"currency": "USD",
"customer_id": "cus_UQrYo4q9l14smT8z4PNP",
"customer": {
"id": "cus_UQrYo4q9l14smT8z4PNP",
"name": "John Doe",
"email": "****@gmail.com",
"phone": "*** alloc::string::String ***",
"phone_country_code": "+65"
},
"description": "Hello this is description",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": true,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": "Visa",
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": null,
"payment_checks": {
"avs_response": {
"code": "Y",
"codeRaw": "Y"
},
"card_verification": null
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "****@gmail.com",
"name": "John Doe",
"phone": "*** alloc::string::String ***",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cus_UQrYo4q9l14smT8z4PNP",
"created_at": 1729681777,
"expires": 1729685377,
"secret": "epk_ba69fda0726f442c81084bd90e9d1cff"
},
"manual_retry_allowed": false,
"connector_transaction_id": "7296817775036519703955",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_jdnqKqKh6oJhnHee3qo1_1",
"payment_link": null,
"profile_id": "pro_l7pRXMW7PtoxvOQW40jp",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_eKo5qWiMoB3koUlBpxgC",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-23T11:24:37.178Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_KAdC0MveEBnhHirWs8zP",
"payment_method_status": "active",
"updated": "2024-10-23T11:09:39.658Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payments/operations/payment_response.rs`
- `crates/router/src/core/payments/tokenization.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit 8e58b56b:
Files to modify:
**crates/router/src/core/payment_methods.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
|
{"pr_number": 6411, "pr_title": "fix(core): populate billing_address for payment with pm_id", "merged_at": "2024-10-24T15:57:04Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payment_methods.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/tokenization.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Make payment_method_subtype optional in payment_attempt [V2]
## 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 diesel migration to make `payment_method_subtype` Nullable in `payment_attempt` table
- Made `payment_method_subtype` an `Option` in request and response structs
### Additional Changes
- [x] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Closes #7567
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Payments - Confirm:
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0195adf1544079139067663acdbff178/confirm-intent' \
--header 'x-client-secret: 12345_pay_0195adf1544079139067663acdbff178_secret_0195adf154487933ae61c8ca769286b0' \
--header 'x-profile-id: pro_6XA4kopfg4VAYLy2jNzW' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_196e797040ba4ecbb064ee14e53c8817' \
--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"
}'
```
Response:
```json
{
"id": "12345_pay_0195adf1544079139067663acdbff178",
"status": "requires_capture",
"amount": {
"order_amount": 100,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 100,
"amount_to_capture": null,
"amount_capturable": 100,
"amount_captured": 0
},
"customer_id": null,
"connector": "stripe",
"client_secret": "12345_pay_0195adf1544079139067663acdbff178_secret_0195adf154487933ae61c8ca769286b0",
"created": "2025-03-19T10:27:09.001Z",
"payment_method_data": {
"billing": null
},
"payment_method_type": "card",
"payment_method_subtype": null,
"connector_transaction_id": "pi_3R4Jq8D5R7gDAGff1B5K8RjQ",
"connector_reference_id": null,
"merchant_connector_id": "mca_vwmIHkB372B5SHcDO0wC",
"browser_info": null,
"error": null,
"shipping": null,
"billing": null,
"attempts": null,
"connector_token_details": {
"token": "pm_1R4Jq8D5R7gDAGffQmkzcinv",
"connector_token_request_reference_id": "q0miVgxYfHkoOfwax6"
},
"payment_method_id": null,
"next_action": null,
"return_url": "https://google.com/success",
"authentication_type": "no_three_ds",
"authentication_type_applied": "no_three_ds"
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payment_methods.rs`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/schema_v2.rs`
- `crates/diesel_models/src/types.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/revenue_recovery.rs`
**4. Core Business Logic**
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payments/routing.rs`
- `crates/router/src/core/payments/transformers.rs`
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs`
**6. Type Definitions**
- `crates/router/src/types/api/payment_methods.rs`
**7. Other**
- `api-reference-v2/openapi_spec.json`
- `v2_migrations/2025-03-19-080705_payment-method-subtype-optional/down.sql`
- `v2_migrations/2025-03-19-080705_payment-method-subtype-optional/up.sql`
**Code Patterns Applied:**
- Extend existing types with new fields (19 changes)
**Detailed Identifier Changes:**
Commit 86306bd5:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/diesel_models/src/types.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/revenue_recovery.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/types/api/payment_methods.rs**
Modify existing code
|
{"pr_number": 7568, "pr_title": "feat(router): Make payment_method_subtype optional in payment_attempt [V2]", "merged_at": "2025-03-24T07:53:07Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs", "crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/schema_v2.rs", "crates/diesel_models/src/types.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/revenue_recovery.rs"], "core_business": ["crates/router/src/core/payment_methods.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs"], "types": ["crates/router/src/types/api/payment_methods.rs"], "other": ["api-reference-v2/openapi_spec.json", "v2_migrations/2025-03-19-080705_payment-method-subtype-optional/down.sql", "v2_migrations/2025-03-19-080705_payment-method-subtype-optional/up.sql"]}, "change_types": {"fields_added": 19}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [fiuu]fix mandates for fiuu
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR fixes following things
-> Required fileds for mandates for fiuu
-> fix check for required fileds for mandates
-> add 3ds cypress 3ds test case
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
added cypress tests
<img width="528" alt="Screenshot 2024-11-07 at 9 42 23 AM" src="https://github.com/user-attachments/assets/96b7cd27-ad7a-4736-9c8e-a69c7f0f526d">
<img width="522" alt="Screenshot 2024-11-07 at 9 42 09 AM" src="https://github.com/user-attachments/assets/3451953a-abd3-48fe-aaea-5c564e1b2b35">
<img width="525" alt="Screenshot 2024-11-07 at 4 58 33 PM" src="https://github.com/user-attachments/assets/4765e74b-4fe5-430f-a3e4-c7782a9f314b">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
- `crates/router/src/configs/defaults/payment_connector_required_fields.rs`
**3. Tests**
- `cypress-tests/cypress/e2e/PaymentUtils/Fiuu.js`
- `cypress-tests/cypress/support/commands.js`
- `cypress-tests/cypress/support/redirectionHandler.js`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (143 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit bc92a2e9:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_card_holder_name_from_additional_payment_method_data
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Modify existing code
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
|
{"pr_number": 6487, "pr_title": "fix(connector): [fiuu]fix mandates for fiuu", "merged_at": "2024-11-08T13:38:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"core_business": ["crates/router/src/core/payment_methods/cards.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/configs/defaults/payment_connector_required_fields.rs"], "tests": ["cypress-tests/cypress/e2e/PaymentUtils/Fiuu.js", "cypress-tests/cypress/support/commands.js", "cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {"functions_added": 2, "fields_added": 143, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment_methods): populate connector_customer during customer creation step in payment methods migrate flow
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR introduces populating `connector_customer` field in `customers` table during payment method migration.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Allows merchants to populate `connector_customer` per `merchant_connector_id` based on `connector_customer_id` passed in the request.
## How did you test it?
Steps for testing -
1. Create a merchant account
2. Create a merchant's connector account
<details>
<summary>3. Run /migrate-form API</summary>
cURL
curl --location --request POST 'http://localhost:8080/payment_methods/migrate-batch' \
--header 'api-key: test_admin' \
--form 'merchant_id="merchant_1749642145"' \
--form 'merchant_connector_id="mca_llNSJsE2tTVdpfrb6n3x"' \
--form 'file=@"/Users/test/Downloads/migrate_sample.csv"'
Response
[{"line_number":1,"customer_id":"customerReference-43","migration_status":"Failed","migration_error":"{\"error\":{\"type\":\"invalid_request_error\",\"code\":\"IR_16\",\"message\":\"Card Expired\"}}","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":null,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null},{"line_number":2,"customer_id":"customerReference-44","migration_status":"Failed","migration_error":"{\"error\":{\"type\":\"invalid_request_error\",\"code\":\"IR_16\",\"message\":\"Card Expired\"}}","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":null,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null},{"line_number":3,"customer_id":"customerReference-45","migration_status":"Failed","migration_error":"{\"error\":{\"type\":\"invalid_request_error\",\"code\":\"IR_16\",\"message\":\"Card Expired\"}}","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":null,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null},{"line_number":4,"customer_id":"customerReference-46","migration_status":"Failed","migration_error":"{\"error\":{\"type\":\"invalid_request_error\",\"code\":\"IR_16\",\"message\":\"Card Expired\"}}","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":null,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null},{"line_number":5,"customer_id":"customerReference-47","migration_status":"Failed","migration_error":"{\"error\":{\"type\":\"invalid_request_error\",\"code\":\"IR_16\",\"message\":\"Card Expired\"}}","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":null,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null},{"line_number":6,"payment_method_id":"pm_YQMH2vTIIhT0dDwIz2wu","payment_method":"card","payment_method_type":"credit","customer_id":"customerReference-48","migration_status":"Success","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":true},{"line_number":7,"payment_method_id":"pm_6ir1orxpyF5wy4kkOYwh","payment_method":"card","payment_method_type":"credit","customer_id":"customerReference-49","migration_status":"Success","card_number_masked":"","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":true},{"line_number":8,"customer_id":"customerReference-50","migration_status":"Failed","migration_error":"{\"error\":{\"type\":\"invalid_request_error\",\"code\":\"IR_07\",\"message\":\"Invalid value provided: card_exp_month\"}}","card_number_masked":"","card_migrated":null,"network_token_migrated":null,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null},{"line_number":9,"payment_method_id":"pm_uMqDIb7yeJL6cKDXHOm0","payment_method":"card","payment_method_type":"credit","customer_id":"customerReference-51","migration_status":"Success","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null},{"line_number":10,"customer_id":"customerReference-69","migration_status":"Failed","migration_error":"{\"error\":{\"type\":\"invalid_request_error\",\"code\":\"IR_16\",\"message\":\"Card Expired\"}}","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":null,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null},{"line_number":11,"customer_id":"customerReference-89","migration_status":"Failed","migration_error":"{\"error\":{\"type\":\"invalid_request_error\",\"code\":\"IR_16\",\"message\":\"Invalid Expiry Year\"}}","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":null,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null},{"line_number":12,"customer_id":"customerReference-99","migration_status":"Failed","migration_error":"{\"error\":{\"type\":\"invalid_request_error\",\"code\":\"IR_16\",\"message\":\"Invalid Expiry Year\"}}","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":null,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null},{"line_number":13,"payment_method_id":"pm_CuESKjB4r0rosTccLRMV","payment_method":"card","payment_method_type":"credit","customer_id":"customerReference-52","migration_status":"Success","card_number_masked":"420000XXXXXX0000","card_migrated":null,"network_token_migrated":true,"connector_mandate_details_migrated":null,"network_transaction_id_migrated":null}]
</details>
<details>
<summary>Look for connector_customer in customers table</summary>
<img width="587" alt="Screenshot 2025-06-11 at 10 08 27 PM" src="https://github.com/user-attachments/assets/21247f0f-2998-4fd3-8ccb-a77a15a25f95" />
</details>
<details>
<summary>Find CSV data below</summary>
name,email,phone,phone_country_code,customer_id,subscription_id,payment_method,payment_method_type,nick_name,payment_instrument_id,raw_card_number,card_number_masked,card_expiry_month,card_expiry_year,card_scheme,network_token_number,network_token_requestor_ref_id,network_token_expiry_month,network_token_expiry_year,original_transaction_id,billing_address_zip,billing_address_state,billing_address_first_name,billing_address_last_name,billing_address_city,billing_address_country,billing_address_line1,billing_address_line2,connector_customer_id,merchant_connector_id
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-43,orderReference-20240930-220107,card,credit,real joe,instructionReference-20240930-220107-S,4200000000000000,420000XXXXXX0000,1,2025,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2025,60720116005060,530004,Oman,joey,joey,Oman,,st mark,oman,1,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-44,orderReference-20240930-220107,card,credit,real joe,instructionReference-20240930-220107-S,4200000000000000,420000XXXXXX0000,1,2025,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2025,60720116005060,530004,Oman,joey,joey,Oman,,st mark,oman,2,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-45,orderReference-20240930-220107,card,credit,real joe,,4200000000000000,420000XXXXXX0000,1,2025,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2025,60720116005060,530004,Oman,joey,joey,Oman,,st mark,oman,3,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-46,orderReference-20240930-220107,card,credit,real joe,,4200000000000000,420000XXXXXX0000,1,2025,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2025,60720116005060,530004,Oman,joey,joey,Oman,,st mark,oman,4,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-47,orderReference-20240930-220107,card,credit,real joe,,4200000000000000,420000XXXXXX0000,1,2025,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2025,60720116005060,530004,Oman,joey,joey,Oman,,st mark,oman,5,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-48,orderReference-20240930-220107,card,credit,real joe,,,420000XXXXXX0000,1,2025,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2025,60720116005060,530004,Oman,joey,joey,Oman,,st mark,oman,7,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-49,orderReference-20240930-220107,card,credit,real joe,,,,1,2025,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2025,60720116005060,530004,Oman,joey,joey,Oman,,st mark,oman,6,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-50,orderReference-20240930-220107,card,credit,real joe,,,,,,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2025,60720116005060,530004,Oman,joey,joey,Oman,,st mark,oman,8,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-51,orderReference-20240930-220107,card,credit,real joe,,,420000XXXXXX0000,1,25,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2025,,530004,Oman,joey,joey,Oman,,st mark,oman,9,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-69,orderReference-20240930-220107,card,credit,real joe,,4200000000000000,420000XXXXXX0000,1,25,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2022,,530004,Oman,joey,joey,Oman,,st mark,oman,10,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-89,orderReference-20240930-220107,card,credit,real joe,,4200000000000000,420000XXXXXX0000,1,22,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2022,,530004,Oman,joey,joey,Oman,,st mark,oman,11,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-99,orderReference-20240930-220107,card,credit,real joe,,4200000000000000,420000XXXXXX0000,1,2022,,5595300359062662,RR16qBRBV-00a00a20uBPVV-18sNRV20uFBTTD22w18s12mRR18sZ00000334051,1,2022,,530004,Oman,joey,joey,Oman,,st mark,oman,12,mca_llNSJsE2tTVdpfrb6n3x
Max Mustermann,noreply+20240930-220107@gmail.com,,,customerReference-52,orderReference-20240930-220107,card,credit,real joe,,,420000XXXXXX0000,1,25,,,,,,,530004,Oman,joey,joey,Oman,,st mark,oman,13,mca_llNSJsE2tTVdpfrb6n3x
</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
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added support for associating connector-specific customer details with customers during creation and migration.
- Enhanced customer migration to include connector customer information when available.
- **Bug Fixes**
- Updated customer creation and migration flows to handle new customer details without disrupting existing functionality.
- **Chores**
- Improved internal handling of customer data to support future extensibility with connector-specific fields.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payment_methods.rs`
**2. Core Business Logic**
- `crates/router/src/core/customers.rs`
**3. Type Definitions**
- `crates/common_types/src/customers.rs`
- `crates/router/src/types/api/payment_methods.rs`
**4. Other**
- `crates/router/src/compatibility/stripe/customers.rs`
- `crates/router/src/routes/customers.rs`
- `crates/router/src/routes/payment_methods.rs`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (34 changes)
**Detailed Identifier Changes:**
Commit 3899ddd5:
Files to modify:
**crates/api_models/src/payment_methods.rs**
Remove:
- impl: impl From<(PaymentMethodRecord, id_type::MerchantId)> for customers::CustomerRequest
Add:
- struct: pub::ConnectorCustomerDetails
- struct: pub::PaymentMethodCustomerMigrate
- impl: impl From<(PaymentMethodRecord, id_type::MerchantId)> for PaymentMethodCustomerMigrate
**crates/common_types/src/customers.rs**
Add:
- function: pub::new
- impl: impl ConnectorCustomerMap
**crates/router/src/compatibility/stripe/customers.rs**
Modify existing code
**crates/router/src/core/customers.rs**
Modify existing code
**crates/router/src/routes/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": 8319, "pr_title": "feat(payment_methods): populate connector_customer during customer creation step in payment methods migrate flow", "merged_at": "2025-06-17T09:58:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payment_methods.rs"], "core_business": ["crates/router/src/core/customers.rs"], "types": ["crates/common_types/src/customers.rs", "crates/router/src/types/api/payment_methods.rs"], "other": ["crates/router/src/compatibility/stripe/customers.rs", "crates/router/src/routes/customers.rs", "crates/router/src/routes/payment_methods.rs"]}, "change_types": {"structs_added": 2, "functions_added": 1, "fields_added": 34, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(currency_conversion): add support for expiring forex data in redis
## 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 -->
Adding a custom expiry time for Forex data saved in redis (172800 seconds ~ 2days).
A new config is added as well:
`redis_cache_expiry_in_seconds = 172800`
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
```
curl --location 'http://localhost:8080/forex/rates' \
--header 'api-key: dev_Gt1XtwvVZ9bw94pn30Cvs3Oc5buVwgAxPEIyNwz1hFjyNUIYEHC7NDSWzHlFc84H' \
--data ''
```
## 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/currency.rs`
**2. Utils**
- `crates/router/src/utils/currency.rs`
**3. Tests**
- `loadtest/config/development.toml`
**4. Configuration Files**
- `config/config.example.toml`
- `config/deployments/env_specific.toml`
- `config/development.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (7 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 480e8c3d:
Files to modify:
**crates/router/src/configs/settings.rs**
Modify existing code
**crates/router/src/core/currency.rs**
Modify existing code
**crates/router/src/utils/currency.rs**
Remove:
- enum: pub::ForexCacheError
Add:
- enum: pub::ForexError
|
{"pr_number": 7455, "pr_title": "refactor(currency_conversion): add support for expiring forex data in redis", "merged_at": "2025-03-17T14:49:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/currency.rs"], "utils": ["crates/router/src/utils/currency.rs"], "tests": ["loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/settings.rs"]}, "change_types": {"functions_added": 2, "enums_added": 1, "fields_added": 7, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): move customer acceptance in configs to a const within commons
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR is just a minor refactor of removing duplicate / redundant `customer_acceptance` object by re-using it.
Moved the object to `Commons` and imported the object where ever the duplicate code exist.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Reduce code duplication
closes https://github.com/juspay/hyperswitch/issues/7436
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
CI should pass
## 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/e2e/configs/Payment/Adyen.js`
- `cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js`
- `cypress-tests/cypress/e2e/configs/Payment/Bluesnap.js`
- ... and 10 more files
**Code Patterns Applied:**
- Extend existing types with new fields (97 changes)
|
{"pr_number": 7435, "pr_title": "ci(cypress): move customer acceptance in configs to a const within commons", "merged_at": "2025-03-06T07:19:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Adyen.js", "cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js", "cypress-tests/cypress/e2e/configs/Payment/Bluesnap.js", "cypress-tests/cypress/e2e/configs/Payment/Commons.js", "cypress-tests/cypress/e2e/configs/Payment/Cybersource.js", "cypress-tests/cypress/e2e/configs/Payment/Elavon.js", "cypress-tests/cypress/e2e/configs/Payment/Fiservemea.js", "cypress-tests/cypress/e2e/configs/Payment/Fiuu.js", "cypress-tests/cypress/e2e/configs/Payment/Moneris.js", "cypress-tests/cypress/e2e/configs/Payment/Noon.js", "cypress-tests/cypress/e2e/configs/Payment/Stripe.js", "cypress-tests/cypress/e2e/configs/Payment/Trustpay.js", "cypress-tests/cypress/e2e/configs/Payment/WellsFargo.js"]}, "change_types": {"fields_added": 97}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(events): adding infra level components to api-events
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Adding infra level information to `ApiEvent` based on config from deployment config under `infra_values`
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
```bash
[infra_values]
cluster = "CLUSTER" # value of CLUSTER from deployment
version = "HOSTNAME" # value of HOSTNAME from deployment which tells its version
```
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
This is required for comparing events generation and their status code for comparing success rate of 2 different versions of router
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<img width="985" alt="Screenshot 2025-06-03 at 11 18 29 AM" src="https://github.com/user-attachments/assets/8cc863c5-f948-4232-969f-7a6d44be1dac" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/webhooks/incoming.rs`
- `crates/router/src/core/webhooks/incoming_v2.rs`
**2. Configuration Files**
- `config/config.example.toml`
- `config/development.toml`
- `config/docker_compose.toml`
- ... and 2 more files
**3. Other**
- `crates/router/src/events/api_logs.rs`
- `crates/router/src/routes/app.rs`
- `crates/router/src/services/api.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (9 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit ec908d38:
Files to modify:
**crates/router/src/configs/secrets_transformers.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming_v2.rs**
Modify existing code
**crates/router/src/events/api_logs.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Add:
- function: pub::process_env_mappings
**crates/router/src/services/api.rs**
Modify existing code
|
{"pr_number": 8214, "pr_title": "feat(events): adding infra level components to api-events", "merged_at": "2025-06-04T06:30:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"core_business": ["crates/router/src/core/webhooks/incoming.rs", "crates/router/src/core/webhooks/incoming_v2.rs"], "config": ["config/config.example.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/secrets_transformers.rs", "crates/router/src/configs/settings.rs"], "other": ["crates/router/src/events/api_logs.rs", "crates/router/src/routes/app.rs", "crates/router/src/services/api.rs"]}, "change_types": {"functions_added": 1, "fields_added": 9, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(nuvei): nuvei 3ds fix + psync fix
## 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 -->
- 3ds transaction were not actually 3ds transactions in Nuvei system. This occurred because we were not passing previous transaction data while making 3ds complete-authorize call.
- Prevoiusly psync was implemeted with session token. If we make 3ds payment but not confirm and make psycn the nuvei would return error as session transaction not found. Now we have implemented psync with transaction_id .
## TEST
### Trigger 3ds payment
<details>
<summary> Request </summary>
```json
{
"amount": 15100,
"currency": "EUR",
"confirm": true,
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
// "order_tax_amount": 100,
"setup_future_usage": "off_session",
// "payment_type":"setup_mandate",
"customer_id": "nithxxinn",
"return_url": "https://www.google.com",
"capture_method": "automatic",
"payment_method": "card",
"payment_method_type": "credit",
"authentication_type": "three_ds",
"description": "hellow world",
"billing": {
"address": {
"zip": "560095",
"country": "US",
"first_name": "Sakil",
"last_name": "Mostak",
"line1": "Fasdf",
"line2": "Fasdf",
"city": "Fasdf"
}
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},
"email": "hello@gmail.com",
"payment_method_data": {
"card": {
"card_number": "2221008123677736",
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"card_cvc": "100"
}
}
}
```
</details>
<details>
<summary> Response </summary>
```
{
"payment_id": "pay_wiZYcVFqfCNBOJMEpznT",
"merchant_id": "merchant_1756789409",
"status": "requires_customer_action",
"amount": 15100,
"net_amount": 15100,
"shipping_cost": null,
"amount_capturable": 15100,
"amount_received": null,
"connector": "nuvei",
"client_secret": "pay_wiZYcVFqfCNBOJMEpznT_secret_GiNUpAUyDpT4rK5COmn9",
"created": "2025-09-10T05:09:57.712Z",
"currency": "EUR",
"customer_id": "nithxxinn",
"customer": {
"id": "nithxxinn",
"name": null,
"email": "hello@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": "hellow world",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "7736",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "222100",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"payment_checks": {
"avs_description": null,
"avs_result_code": "",
"cvv_2_reply_code": "",
"cvv_2_description": null,
"merchant_advice_code": "",
"merchant_advice_code_description": null
},
"authentication_data": {
"cReq": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjE4MWEzOTQ4LWI5ZmYtNGMyZi05ODJkLTAzOTU1OTYzMjhjMSIsImFjc1RyYW5zSUQiOiIwMjcwOTg4OC0xNWIxLTRjOWMtYTA2OC04ZWVlMTBlZmRlODIiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0",
"flow": "challenge",
"acsUrl": "https://3dsn.sandbox.safecharge.com/ThreeDSACSEmulatorChallenge/api/ThreeDSACSChallengeController/ChallengePage?eyJub3RpZmljYXRpb25VUkwiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvcGF5bWVudHMvcGF5X3dpWlljVkZxZkNOQk9KTUVwem5UL21lcmNoYW50XzE3NTY3ODk0MDkvcmVkaXJlY3QvY29tcGxldGUvbnV2ZWkiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjE4MWEzOTQ4LWI5ZmYtNGMyZi05ODJkLTAzOTU1OTYzMjhjMSIsImFjc1RyYW5zSUQiOiIwMjcwOTg4OC0xNWIxLTRjOWMtYTA2OC04ZWVlMTBlZmRlODIiLCJkc1RyYW5zSUQiOiJmMmRhYTg2Yi1kZWM2LTQ0ZmItODQzMC0zNGI4ZGFhZGVlMjAiLCJkYXRhIjpudWxsLCJNZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0=",
"version": "2.2.0",
"threeDFlow": "1",
"decisionReason": "NoPreference",
"threeDReasonId": "",
"acquirerDecision": "ExemptionRequest",
"challengePreferenceReason": "12",
"isExemptionRequestInAuthentication": "0"
}
},
"billing": null
},
"payment_token": "token_zab9VyBWQCNOWzesgwEe",
"shipping": null,
"billing": {
"address": {
"city": "Fasdf",
"country": "US",
"line1": "Fasdf",
"line2": "Fasdf",
"line3": null,
"zip": "560095",
"state": null,
"first_name": "Sakil",
"last_name": "Mostak",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "hello@gmail.com",
"name": null,
"phone": null,
"return_url": "https://www.google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_wiZYcVFqfCNBOJMEpznT/merchant_1756789409/pay_wiZYcVFqfCNBOJMEpznT_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "nithxxinn",
"created_at": 1757480997,
"expires": 1757484597,
"secret": "epk_f4e147f4736a41c0bf152be511495bd2"
},
"manual_retry_allowed": null,
"connector_transaction_id": "8110000000013946637",
"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": "8656791111",
"payment_link": null,
"profile_id": "pro_EzO6xGQZdE5pd9I5Rdzs",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_i5QVCDvXmBLbZg7n97n2",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-10T05:24:57.712Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": "pm_PNtSuuIcOnjnfMyAoL8x",
"network_transaction_id": null,
"payment_method_status": "inactive",
"updated": "2025-09-10T05:10:01.440Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "2090421111",
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null
}
```
</details>
- connector_transaction_id = `8110000000013946637`
### Make psync Before redirection
<details>
<summary>Response </summary>
```json
{
"payment_id": "pay_wiZYcVFqfCNBOJMEpznT",
"merchant_id": "merchant_1756789409",
"status": "requires_customer_action",
"amount": 15100,
"net_amount": 15100,
"shipping_cost": null,
"amount_capturable": 15100,
"amount_received": null,
"connector": "nuvei",
"client_secret": "pay_wiZYcVFqfCNBOJMEpznT_secret_GiNUpAUyDpT4rK5COmn9",
"created": "2025-09-10T05:09:57.712Z",
"currency": "EUR",
"customer_id": "nithxxinn",
"customer": {
"id": "nithxxinn",
"name": null,
"email": "hello@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": "hellow world",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "7736",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "222100",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"payment_checks": {
"avs_description": null,
"avs_result_code": "",
"cvv_2_reply_code": "",
"cvv_2_description": null,
"merchant_advice_code": "",
"merchant_advice_code_description": null
},
"authentication_data": {
"cReq": "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjE4MWEzOTQ4LWI5ZmYtNGMyZi05ODJkLTAzOTU1OTYzMjhjMSIsImFjc1RyYW5zSUQiOiIwMjcwOTg4OC0xNWIxLTRjOWMtYTA2OC04ZWVlMTBlZmRlODIiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0",
"flow": "challenge",
"acsUrl": "https://3dsn.sandbox.safecharge.com/ThreeDSACSEmulatorChallenge/api/ThreeDSACSChallengeController/ChallengePage?eyJub3RpZmljYXRpb25VUkwiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvcGF5bWVudHMvcGF5X3dpWlljVkZxZkNOQk9KTUVwem5UL21lcmNoYW50XzE3NTY3ODk0MDkvcmVkaXJlY3QvY29tcGxldGUvbnV2ZWkiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjE4MWEzOTQ4LWI5ZmYtNGMyZi05ODJkLTAzOTU1OTYzMjhjMSIsImFjc1RyYW5zSUQiOiIwMjcwOTg4OC0xNWIxLTRjOWMtYTA2OC04ZWVlMTBlZmRlODIiLCJkc1RyYW5zSUQiOiJmMmRhYTg2Yi1kZWM2LTQ0ZmItODQzMC0zNGI4ZGFhZGVlMjAiLCJkYXRhIjpudWxsLCJNZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0=",
"version": "2.2.0",
"threeDFlow": "1",
"decisionReason": "NoPreference",
"threeDReasonId": "",
"acquirerDecision": "ExemptionRequest",
"challengePreferenceReason": "12",
"isExemptionRequestInAuthentication": "0"
}
},
"billing": null
},
"payment_token": "token_zab9VyBWQCNOWzesgwEe",
"shipping": null,
"billing": {
"address": {
"city": "Fasdf",
"country": "US",
"line1": "Fasdf",
"line2": "Fasdf",
"line3": null,
"zip": "560095",
"state": null,
"first_name": "Sakil",
"last_name": "Mostak",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "hello@gmail.com",
"name": null,
"phone": null,
"return_url": "https://www.google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_wiZYcVFqfCNBOJMEpznT/merchant_1756789409/pay_wiZYcVFqfCNBOJMEpznT_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "8110000000013946637",
"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": "8656791111",
"payment_link": null,
"profile_id": "pro_EzO6xGQZdE5pd9I5Rdzs",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_i5QVCDvXmBLbZg7n97n2",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-10T05:24:57.712Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": "pm_PNtSuuIcOnjnfMyAoL8x",
"network_transaction_id": null,
"payment_method_status": "inactive",
"updated": "2025-09-10T05:11:10.384Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "2090421111",
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null
}
```
</details>
### Complete redirection challenge
### Check Psync again
<details>
<summary>Response </summary>
```json
{
"payment_id": "pay_wiZYcVFqfCNBOJMEpznT",
"merchant_id": "merchant_1756789409",
"status": "succeeded",
"amount": 15100,
"net_amount": 15100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 15100,
"connector": "nuvei",
"client_secret": "pay_wiZYcVFqfCNBOJMEpznT_secret_GiNUpAUyDpT4rK5COmn9",
"created": "2025-09-10T05:09:57.712Z",
"currency": "EUR",
"customer_id": "nithxxinn",
"customer": {
"id": "nithxxinn",
"name": null,
"email": "hello@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": "hellow world",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "7736",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "222100",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "CL-BRW2",
"payment_checks": {
"avs_description": null,
"avs_result_code": "",
"cvv_2_reply_code": "",
"cvv_2_description": null,
"merchant_advice_code": "",
"merchant_advice_code_description": null
},
"authentication_data": {
"flow": "challenge",
"version": "2.2.0",
"decisionReason": "NoPreference",
"threeDReasonId": "",
"acquirerDecision": "ExemptionRequest",
"isLiabilityOnIssuer": "1",
"challengeCancelReason": "",
"challengeCancelReasonId": "",
"challengePreferenceReason": "12"
}
},
"billing": null
},
"payment_token": "token_zab9VyBWQCNOWzesgwEe",
"shipping": null,
"billing": {
"address": {
"city": "Fasdf",
"country": "US",
"line1": "Fasdf",
"line2": "Fasdf",
"line3": null,
"zip": "560095",
"state": null,
"first_name": "Sakil",
"last_name": "Mostak",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "hello@gmail.com",
"name": null,
"phone": null,
"return_url": "https://www.google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": 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": "8110000000013946718",
"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": "8656791111",
"payment_link": null,
"profile_id": "pro_EzO6xGQZdE5pd9I5Rdzs",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_i5QVCDvXmBLbZg7n97n2",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-10T05:24:57.712Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": "pm_PNtSuuIcOnjnfMyAoL8x",
"network_transaction_id": null,
"payment_method_status": "active",
"updated": "2025-09-10T05:11:56.957Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null
}
```
</details>
- connector_transaction_id : `8110000000013946718`
### Check transaction in nuvei dashboard for complete validation
<img width="1857" height="938" alt="Screenshot 2025-09-10 at 10 43 50 AM" src="https://github.com/user-attachments/assets/2985795f-8c0b-43d8-a58f-fecd59af3273" />
<img width="1761" height="859" alt="Screenshot 2025-09-10 at 10 44 16 AM" src="https://github.com/user-attachments/assets/7d2436df-1004-4de0-b1e3-d6fcfb83adef" />
<img width="1356" height="1029" alt="Screenshot 2025-09-10 at 11 04 41 AM" src="https://github.com/user-attachments/assets/bd1bafeb-19e3-475d-a4a5-266d1cca0ce9" />
<img width="1728" height="1078" alt="Screenshot 2025-09-10 at 11 08 15 AM" src="https://github.com/user-attachments/assets/43c00bb3-1c0c-4366-92d2-1fed1f498f64" />
| InitAuth3d | Auth3d | Sale |
|----------|----------|----------|
| 8110000000013946633 | 8110000000013946637 | 8110000000013946718 |
<!-- Similarly test txn id for manual capture 8110000000013946951 -->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/nuvei.rs`
- `crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs`
**2. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Nuvei.js`
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (16 changes)
- Extend existing types with new fields (141 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit ebba12ec:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/nuvei.rs**
Remove:
- impl: impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData> for Nuvei
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Nuvei
Add:
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Nuvei
- impl: impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData> for Nuvei
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Remove:
- function: private::get_complete_authorize_url
- function: private::get_complete_authorize_url
Add:
- function: private::get_complete_authorize_url
- function: private::get_complete_authorize_url
|
{"pr_number": 9279, "pr_title": "fix(nuvei): nuvei 3ds fix + psync fix", "merged_at": "2025-09-11T14:31:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nuvei.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Nuvei.js"]}, "change_types": {"structs_added": 5, "functions_added": 16, "fields_added": 141, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payments_v2): add finish redirection endpoint
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] New feature
## Description
<!-- Describe your changes in detail -->
This PR adds a new endpoint called `finish_redirection` to payments v2.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Finish redirection endpoint is hit by the processor once the redirection / authentication is performed.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
- Create a payment
```bash
curl --location 'http://localhost:8080/v2/payments/create-intent' \
--header 'api-key: dev_cNekK3F8YFiugPANtfmCEe1UpYOP05C71OOMLaCNYB5H1RYtZWuphmKgPZc9aqVi' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_Va3FwgfK5v2F1ZiK3N9r' \
--data '{
"amount_details": {
"order_amount": 100,
"currency": "USD"
}
}'
```
```json
{
"id": "12345_pay_019323d64de67fe3b7e62c45751a37cd",
"status": "requires_payment_method",
"amount_details": {
"order_amount": 100,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"skip_external_tax_calculation": "Skip",
"skip_surcharge_calculation": "Skip",
"surcharge_amount": null,
"tax_on_surcharge": null
},
"client_secret": "12345_pay_019323d64de67fe3b7e62c45751a37cd_secret_019323d64de67fe3b7e62c53b39411be",
"merchant_reference_id": null,
"routing_algorithm_id": null,
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"billing": null,
"shipping": null,
"customer_id": null,
"customer_present": "Present",
"description": null,
"return_url": null,
"setup_future_usage": "on_session",
"apply_mit_exemption": "Skip",
"statement_descriptor": null,
"order_details": null,
"allowed_payment_method_types": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"payment_link_enabled": "Skip",
"payment_link_config": null,
"request_incremental_authorization": "default",
"expires_on": "2024-11-13T04:59:27.494Z",
"frm_metadata": null,
"request_external_three_ds_authentication": "Skip"
}
```
- Confirm the payment with a 3ds card
```bash
curl --location 'http://localhost:8080/v2/payments/12345_pay_019323d64de67fe3b7e62c45751a37cd/confirm-intent' \
--header 'x-profile-id: pro_Va3FwgfK5v2F1ZiK3N9r' \
--header 'x-client-secret: 12345_pay_019323d64de67fe3b7e62c45751a37cd_secret_019323d64de67fe3b7e62c53b39411be' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_72ad688781744773b42030b6b7000e80' \
--data '{
"payment_method_data": {
"card": {
"card_number": "4000008400001280",
"card_exp_month": "01",
"card_exp_year": "25",
"card_holder_name": "John Doe",
"card_cvc": "100"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"client_secret": "33333_pay_0192570fe84d7c02bf4df06c650e216e_secret_0192570fe85773c1916af7b3288bd8f1"
}'
```
```json
{
"id": "12345_pay_019323d64de67fe3b7e62c45751a37cd",
"status": "requires_customer_action",
"amount": {
"order_amount": 100,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"skip_external_tax_calculation": "Skip",
"skip_surcharge_calculation": "Skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"connector": "stripe",
"client_secret": "12345_pay_019323d64de67fe3b7e62c45751a37cd_secret_019323d64de67fe3b7e62c53b39411be",
"created": "2024-11-13T04:44:27.494Z",
"payment_method_data": null,
"payment_method_type": "card",
"payment_method_subtype": "credit",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/v2/payments/12345_pay_019323d64de67fe3b7e62c45751a37cd/start_redirection?publishable_key=pk_dev_72ad688781744773b42030b6b7000e80&profile_id=pro_Va3FwgfK5v2F1ZiK3N9r"
},
"connector_transaction_id": "pi_3QKYROIVaesDjvMP1uVuUQYg",
"connector_reference_id": null,
"merchant_connector_id": "mca_mcB1x1Sg0OaPyc0Efywe",
"browser_info": null,
"error": null
}
```
- Complete the redirection
<img width="1370" alt="image" src="https://github.com/user-attachments/assets/d91cf92f-46b3-4e7a-a302-7f4f01e8837a">
## 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. API Request/Response Models**
- `crates/api_models/src/admin.rs`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
- `crates/hyperswitch_domain_models/src/payments.rs`
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/helpers.rs`
- ... and 8 more files
**5. External Connector Integration**
- `crates/router/src/routes/dummy_connector.rs`
**6. Type Definitions**
- `crates/common_utils/src/types.rs`
- `crates/router/src/types.rs`
**7. Utils**
- `crates/common_utils/src/consts.rs`
- `crates/common_utils/src/events.rs`
**8. Other**
- `api-reference-v2/openapi_spec.json`
- `crates/router/src/analytics.rs`
- `crates/router/src/events/api_logs.rs`
- ... and 5 more files
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (19 changes)
- Extend existing types with new fields (75 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 0805a937:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Add:
- struct: pub::RedirectionResponse
**crates/common_utils/src/consts.rs**
Modify existing code
**crates/common_utils/src/events.rs**
Modify existing code
**crates/common_utils/src/types.rs**
Remove:
- struct: pub::LengthString
- impl: impl Deserialize<'de>
- impl: impl FromSql<sql_types::Text, DB>
- impl: impl ToSql<sql_types::Text, DB>
Add:
- function: pub::add_query_params
- function: pub::generate
- function: pub::get_string_repr
- function: private::build
- function: private::from_sql
- function: private::to_sql
- struct: pub::LengthString
- struct: pub::PublishableKey
- impl: impl Deserialize<'de>
- impl: impl FromSql<sql_types::Text, DB>
- impl: impl ToSql<sql_types::Text, DB>
- impl: impl Queryable<sql_types::Text, DB>
- impl: impl PublishableKey
- impl: impl Queryable<sql_types::Text, DB> for PublishableKey
- impl: impl FromSql<sql_types::Text, DB> for PublishableKey
- impl: impl ToSql<sql_types::Text, DB> for PublishableKey
**crates/diesel_models/src/business_profile.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::create_finish_redirection_url
**crates/router/src/analytics.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Add:
- function: private::handle_payments_redirect_response
- function: private::validate_status_for_operation
- function: private::call_payment_flow
- function: private::generate_response
- function: private::get_payment_action
- struct: pub::PaymentsRedirectResponseData
- impl: impl ValidateStatusForOperation for &PaymentRedirectSync
- impl: impl PaymentRedirectFlow for PaymentRedirectSync
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations.rs**
Remove:
- struct: pub::GetTrackerResponse
Add:
- struct: pub::GetTrackerResponse
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_get.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_get_intent.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/events/api_logs.rs**
Add:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for PaymentsRedirectResponseData
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/dummy_connector.rs**
Modify existing code
**crates/router/src/routes/dummy_connector/core.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Add:
- function: private::get_locking_input
- function: pub::payments_finish_redirection
- impl: impl GetLockingInput for payments::PaymentsRedirectResponseData
**crates/router/src/routes/user.rs**
Modify existing code
**crates/router/src/services/api.rs**
Modify existing code
**crates/router/src/types.rs**
Add:
- struct: pub::RedirectPaymentFlowResponse
|
{"pr_number": 6549, "pr_title": "feat(payments_v2): add finish redirection endpoint", "merged_at": "2024-11-15T09:08:39Z", "intent": {"feature_type": "payment", "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"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/payments.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_create_intent.rs", "crates/router/src/core/payments/operations/payment_get.rs", "crates/router/src/core/payments/operations/payment_get_intent.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/user.rs", "crates/router/src/routes/dummy_connector/core.rs"], "connectors": ["crates/router/src/routes/dummy_connector.rs"], "types": ["crates/common_utils/src/types.rs", "crates/router/src/types.rs"], "utils": ["crates/common_utils/src/consts.rs", "crates/common_utils/src/events.rs"], "other": ["api-reference-v2/openapi_spec.json", "crates/router/src/analytics.rs", "crates/router/src/events/api_logs.rs", "crates/router/src/lib.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs", "crates/router/src/routes/user.rs", "crates/router/src/services/api.rs"]}, "change_types": {"structs_added": 5, "functions_added": 19, "fields_added": 75, "imports_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(sample_data): generate random disputes for sample data
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
I added dispute generation to function `generate_sample_data` in `utils/user/sample_data.rs`.
The number of disputes generated is based on the number of payments created:
2 disputes if the number of payments is between 50 and 100.
1 dispute if the number of payments is less than 50.
Other changes I made is just to accommodate the dispute generation code changes.
### 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).
-->
#6117
## How did you test 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.
Initial state for both Case1 and Case2:
Before sending POST request to `sample_data`, there are 18 non-generated `payment_attempt` records, and 0 `dispute` record.
<img width="1384" alt="image" src="https://github.com/user-attachments/assets/a97abf7e-34d4-4bc2-b5e6-fd7ff2908c94">
<img width="1146" alt="image" src="https://github.com/user-attachments/assets/31dddc64-7063-41e3-80d0-c57d378debcf">
#### Case 1: 2 disputes if the number of payments is between 50 and 100.
We send a POST request without payload to `sample_data`, by default, 100 `payment_attempt` records will be generated, along with 2 `dispute`. Now there are 118 generated `pyament_attempt` records, and 2 `dispute` records with `test_` prefixed `dispute_id`.
<img width="1107" alt="image" src="https://github.com/user-attachments/assets/df612a03-dc3d-4af2-9588-a5b4381f7c09">
<img width="1384" alt="image" src="https://github.com/user-attachments/assets/16d5f449-4f92-417f-991e-8ddb4e9f2548">
#### Case 2: 1 dispute if the number of payments is less than 50.
We send a POST request with payload `{ "record": 30 }` to `sample_data`, 30 `payment_attempt` records will be generated, along with 1 `dispute`. Now there are 48 generated `pyament_attempt` records, and 1 `dispute` records with `test_` prefixed `dispute_id`.
<img width="1364" alt="image" src="https://github.com/user-attachments/assets/5e9f1712-3be2-4b88-acac-08ac866e64df">
<img width="1385" alt="image" src="https://github.com/user-attachments/assets/a2efec0a-cbec-4154-8d86-98aa5aecb3de">
#### Case Delete:
When there exists data generated by `sample_api`, sending a `DELETE` request to `sample_api` deletes all the generated sample data (back to initial state in this example).
<img width="1076" alt="image" src="https://github.com/user-attachments/assets/42414fe0-11d0-40ae-987d-7d0c8fd19d4b">
<img width="1057" alt="image" src="https://github.com/user-attachments/assets/4fe4cbba-21de-4b69-82f6-5049e61f69a6">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/sample_data.rs`
**2. Utils**
- `crates/router/src/utils/user/sample_data.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (22 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit e36ea184:
Files to modify:
**crates/router/src/core/user/sample_data.rs**
Modify existing code
**crates/router/src/utils/user/sample_data.rs**
Modify existing code
|
{"pr_number": 6341, "pr_title": "feat(sample_data): generate random disputes for sample data", "merged_at": "2024-10-25T08:45:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/user/sample_data.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"]}, "change_types": {"fields_added": 22, "imports_added": 2, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add three_ds_decision_rule support in routing apis
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
add three_ds_decision_rule support in routing apis
This pull request introduces support for a new `ThreeDsDecisionRule` routing algorithm and a corresponding `ThreeDsAuthentication` transaction type, while also implementing validation and error handling for these additions. The changes span multiple files and include updates to enums, structs, and core routing logic.
### Additions to Routing Algorithm and Transaction Type
* Added `ThreeDsDecisionRule` to `RoutingAlgorithmKind` and `RoutingAlgorithm`, along with a validation method to determine if connectors should be validated for this algorithm. (`crates/api_models/src/routing.rs`, [[1]](diffhunk://#diff-6eb6e93a94555e904f304999acc96ab6125769971da9ec3dcbb30d5912b4fc45R306) [[2]](diffhunk://#diff-6eb6e93a94555e904f304999acc96ab6125769971da9ec3dcbb30d5912b4fc45R329-R338)
* Introduced `ThreeDsAuthentication` to `TransactionType` with a helper method `is_three_ds_authentication` for type checks. (`crates/common_enums/src/enums.rs`, [crates/common_enums/src/enums.rsR7232-R7238](diffhunk://#diff-955707712c9bdbbd986dc29a9dd001579001580cf0a65e286ac8a2a25a2a49f2R7232-R7238))
### Updates to Routing Logic
* Modified routing-related functions to handle the new `ThreeDsDecisionRule` algorithm and `ThreeDsAuthentication` transaction type, including validation and error handling. (`crates/router/src/core/routing.rs`, [[1]](diffhunk://#diff-d5e8699013fe33212f63d552ecebf1c6a9ab1c0f3aa36662702a7426bcb8cee2L148-R156) [[2]](diffhunk://#diff-d5e8699013fe33212f63d552ecebf1c6a9ab1c0f3aa36662702a7426bcb8cee2R331) [[3]](diffhunk://#diff-d5e8699013fe33212f63d552ecebf1c6a9ab1c0f3aa36662702a7426bcb8cee2L852-R855)
* Updated routing cache logic to exclude `ThreeDsAuthentication` from cache invalidation. (`crates/router/src/core/routing/helpers.rs`, [crates/router/src/core/routing/helpers.rsR269-R284](diffhunk://#diff-ea48d33e52b2cb7edbbba1d236b55f946fdb2c178f8c76f4226818b3630c4658R269-R284))
### Error Handling Enhancements
* Added new error types, such as `InvalidTransactionType` and `InvalidRoutingAlgorithmStructure`, to manage unsupported scenarios. (`crates/router/src/core/errors.rs`, [crates/router/src/core/errors.rsR387-R388](diffhunk://#diff-8df7200d52ca866d681cea17f2bd2387674aa34b63eff8d46eb8a7ba8b1d6738R387-R388))
### Struct and Enum Extensions
* Extended routing-related structs to include `transaction_type` as an optional field for better configurability. (`crates/api_models/src/routing.rs`, [[1]](diffhunk://#diff-6eb6e93a94555e904f304999acc96ab6125769971da9ec3dcbb30d5912b4fc45R66) [[2]](diffhunk://#diff-6eb6e93a94555e904f304999acc96ab6125769971da9ec3dcbb30d5912b4fc45R80-R91)
* Updated `RoutingAlgorithmSerde` to support serialization and deserialization of the `ThreeDsDecisionRule` algorithm. (`crates/api_models/src/routing.rs`, [crates/api_models/src/routing.rsR348](diffhunk://#diff-6eb6e93a94555e904f304999acc96ab6125769971da9ec3dcbb30d5912b4fc45R348))
### Validation and Helper Updates
* Enhanced validation logic to handle the new algorithm and transaction type, ensuring unsupported configurations are rejected. (`crates/router/src/core/routing/helpers.rs`, [crates/router/src/core/routing/helpers.rsR568-R572](diffhunk://#diff-ea48d33e52b2cb7edbbba1d236b55f946fdb2c178f8c76f4226818b3630c4658R568-R572))
* Added a default configuration key for `ThreeDsAuthentication` in helper functions. (`crates/router/src/core/routing/helpers.rs`, [crates/router/src/core/routing/helpers.rsR594-R596](diffhunk://#diff-ea48d33e52b2cb7edbbba1d236b55f946fdb2c178f8c76f4226818b3630c4658R594-R596))
### Additional Changes
- [x] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested Manually
1. Static routing (rule based) sanity
2. Create Three DS Deicison rule using routing create config api
**CURL**
```
curl --location '{{BASE_URL}}/routing' \
--header 'api-key: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"name": "Three DS Decision Rule for exemption",
"description": "This is a three_ds_decision_rule",
"profile_id": "pro_grHb38qPPHB61ZxZQL4f",
"transaction_type": "three_ds_authentication",
"algorithm": {
"type": "three_ds_decision_rule",
"data": {
"defaultSelection": {
"decision": "no_three_ds"
},
"rules": [
{
"name": "rule_1",
"connectorSelection": {
"decision": "challenge_requested"
},
"statements": [
{
"condition": [
{
"lhs": "issuer_country",
"comparison": "equal",
"value": {
"type": "enum_variant",
"value": "Switzerland"
},
"metadata": {}
},
{
"lhs": "acquirer_country",
"comparison": "equal",
"value": {
"type": "enum_variant",
"value": "Switzerland"
},
"metadata": {}
}
]
}
]
}
],
"metadata": {}
}
}
}'
```
Response
```
{
"id": "routing_apyFo6xRDVwBgIM2xzqh",
"profile_id": "pro_grHb38qPPHB61ZxZQL4f",
"name": "Three DS Decision Rule for exemption",
"kind": "three_ds_decision_rule",
"description": "This is a three_ds_decision_rule",
"created_at": 1748119944,
"modified_at": 1748119944,
"algorithm_for": "three_ds_authentication",
"decision_engine_routing_id": null
}
```
3. Activate the Three DS decision rule using activate api
**CURL**
```
curl --location '{{BASE_URL}}/routing/routing_apyFo6xRDVwBgIM2xzqh/activate' \
--header 'api-key: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"transaction_type": "three_ds_authentication"
}'
```
Response
```
{
"id": "routing_apyFo6xRDVwBgIM2xzqh",
"profile_id": "pro_grHb38qPPHB61ZxZQL4f",
"name": "Three DS Decision Rule for exemption",
"kind": "three_ds_decision_rule",
"description": "This is a three_ds_decision_rule",
"created_at": 1748119944,
"modified_at": 1748119944,
"algorithm_for": "three_ds_authentication",
"decision_engine_routing_id": null
}
```
Business Profile DB to verify the value of three_ds_decision_algorithm
<img width="865" alt="image" src="https://github.com/user-attachments/assets/79228567-2c36-4d79-b157-ded84790f758" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/routing.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/enums.rs`
**3. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/errors.rs`
- `crates/router/src/core/payments/routing.rs`
- ... and 3 more files
**4. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 8 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (2 changes)
- Extend existing types with new fields (21 changes)
- Add conditional logic for feature flags or filtering (2 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit 9bac41b2:
Files to modify:
**crates/api_models/src/routing.rs**
Add:
- function: pub::should_validate_connectors_in_routing_config
- struct: pub::RoutingActivatePayload
- struct: pub::ProgramThreeDsDecisionRule
- struct: pub::RuleThreeDsDecisionRule
**crates/common_enums/src/enums.rs**
Add:
- function: pub::is_three_ds_authentication
- impl: impl TransactionType
**crates/diesel_models/src/enums.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/admin.rs**
Modify existing code
**crates/router/src/core/errors.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Modify existing code
**crates/router/src/core/routing.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Modify existing code
**crates/router/src/core/routing/transformers.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/routing.rs**
Modify existing code
|
{"pr_number": 8132, "pr_title": "feat(router): add three_ds_decision_rule support in routing apis", "merged_at": "2025-05-30T14:04:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector", "transaction"]}, "hierarchy": {"api_models": ["crates/api_models/src/routing.rs"], "database": ["crates/diesel_models/src/enums.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/errors.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/routing.rs", "crates/router/src/core/routing/helpers.rs", "crates/router/src/core/routing/transformers.rs"], "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/app.rs", "crates/router/src/routes/routing.rs", "migrations/2025-05-22-191239_add-three-ds-decision-rule-to-algorithm-kind/down.sql", "migrations/2025-05-22-191239_add-three-ds-decision-rule-to-algorithm-kind/up.sql", "migrations/2025-05-24-205102_add-three-ds-authentication-to-transaction-type/down.sql", "migrations/2025-05-24-205102_add-three-ds-authentication-to-transaction-type/up.sql"]}, "change_types": {"structs_added": 3, "functions_added": 2, "fields_added": 21, "imports_added": 2, "conditionals_added": 2, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(subscriptions): Add update subscriptions APIs with payments update 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 -->
1. This pr adds plan_id and price_id columns to the subscription table.
2. Created the subscription update call, which takes `plan_id`, `item_price_id`, `amount`, and `currency` as input.
3. Added payment update s2s call.
4. This PR removes all subscription information from the subscription confirm API so that the SDK can use it.
Subscription Update call does 2 things
- Takes `plan_id`, `item_price_id` and update subscription
- Takes `amount`, and `currency`, and updates the invoice and makes an S2S call to the payment update so that the confirm call can use the new amount and currency
### Additional Changes
- [x] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Create customer
```
curl --location 'http://localhost:8080/customers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_KPQB3szY5nQvoegkHrIXZYsWEhsnljhp0CXly5dZUWNPmXgwICqUMHcl1qKKg2kb' \
--data-raw '{
"email": "guest@example.com",
"name": "Gauarv",
"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_zxMLIuJnnIJHR0A3ku4M",
"name": "Gauarv",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"address": null,
"created_at": "2025-10-09T20:29:01.003Z",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"default_payment_method_id": null,
"tax_registration_id": null
}
```
Create subscription without price_id and plan_id
```
curl --location 'http://localhost:8080/subscriptions/create' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_q2odjxxoYxhwy5tXZKU1' \
--header 'api-key: dev_KPQB3szY5nQvoegkHrIXZYsWEhsnljhp0CXly5dZUWNPmXgwICqUMHcl1qKKg2kb' \
--data '{
"customer_id": "cus_zxMLIuJnnIJHR0A3ku4M",
"amount": 14100,
"currency": "USD",
"payment_details": {
"authentication_type": "no_three_ds",
"setup_future_usage": "off_session",
"capture_method": "automatic",
"return_url": "https://google.com"
}
}'
```
Response
```
{
"id": "sub_h33npFPFe6Ok81MWv4Tq",
"merchant_reference_id": null,
"status": "created",
"plan_id": null,
"price_id": null,
"profile_id": "pro_q2odjxxoYxhwy5tXZKU1",
"client_secret": "sub_h33npFPFe6Ok81MWv4Tq_secret_xzh9usiNTNxjxAqcPWtk",
"merchant_id": "merchant_1760011611",
"coupon_code": null,
"customer_id": "cus_zxMLIuJnnIJHR0A3ku4M",
"payment": {
"payment_id": "pay_vz8HWByS019g2YMwt1is",
"status": "requires_payment_method",
"amount": 14100,
"currency": "USD",
"connector": null,
"payment_method_id": null,
"payment_experience": null,
"error_code": null,
"error_message": null,
"payment_method_type": null,
"client_secret": "pay_vz8HWByS019g2YMwt1is_secret_iYCy8Ksl0Zs68VBDPNzq"
},
"invoice": {
"id": "invoice_OYxNwCMfnZDjRgcAqFxg",
"subscription_id": "sub_h33npFPFe6Ok81MWv4Tq",
"merchant_id": "merchant_1760011611",
"profile_id": "pro_q2odjxxoYxhwy5tXZKU1",
"merchant_connector_id": "mca_okM9o35Qk3O0VE9XS5ux",
"payment_intent_id": "pay_vz8HWByS019g2YMwt1is",
"payment_method_id": null,
"customer_id": "cus_zxMLIuJnnIJHR0A3ku4M",
"amount": 14100,
"currency": "USD",
"status": "invoice_created"
}
}
```
Request to update subscription
```
curl --location 'http://localhost:8080/subscriptions/sub_h33npFPFe6Ok81MWv4Tq/update' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_q2odjxxoYxhwy5tXZKU1' \
--header 'api-key: dev_KPQB3szY5nQvoegkHrIXZYsWEhsnljhp0CXly5dZUWNPmXgwICqUMHcl1qKKg2kb' \
--data '{
"plan_id":"cbdemo_enterprise-suite",
"item_price_id":"cbdemo_enterprise-suite-monthly",
"amount": 15100,
"currency": "USD"
}'
```
Response
```
{
"id": "sub_h33npFPFe6Ok81MWv4Tq",
"merchant_reference_id": null,
"status": "created",
"plan_id": "cbdemo_enterprise-suite",
"price_id": "cbdemo_enterprise-suite-monthly",
"profile_id": "pro_q2odjxxoYxhwy5tXZKU1",
"client_secret": "sub_h33npFPFe6Ok81MWv4Tq_secret_xzh9usiNTNxjxAqcPWtk",
"merchant_id": "merchant_1760011611",
"coupon_code": null,
"customer_id": "cus_zxMLIuJnnIJHR0A3ku4M",
"payment": null,
"invoice": null
}
```
confirm subscription
```
curl --location 'http://localhost:8080/subscriptions/sub_h33npFPFe6Ok81MWv4Tq/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_q2odjxxoYxhwy5tXZKU1' \
--header 'api-key: pk_dev_13728cd3e3454df58262ffb8d10ce8c5' \
--data '{
"client_secret": "sub_h33npFPFe6Ok81MWv4Tq_secret_xzh9usiNTNxjxAqcPWtk",
"payment_details": {
"shipping": {
"address": {
"state": "zsaasdas",
"city": "Banglore",
"country": "US",
"line1": "sdsdfsdf",
"line2": "hsgdbhd",
"line3": "alsksoe",
"zip": "571201",
"first_name": "joseph",
"last_name": "doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "CLBRW dffdg",
"card_cvc": "737"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
}
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
}
}
}'
```
Response
```
{
"id": "sub_h33npFPFe6Ok81MWv4Tq",
"merchant_reference_id": null,
"status": "active",
"plan_id": "sub_h33npFPFe6Ok81MWv4Tq",
"price_id": "cbdemo_enterprise-suite",
"coupon": null,
"profile_id": "pro_q2odjxxoYxhwy5tXZKU1",
"payment": {
"payment_id": "pay_vz8HWByS019g2YMwt1is",
"status": "succeeded",
"amount": 15100,
"currency": "USD",
"connector": "stripe",
"payment_method_id": "pm_BPUrH5VzG88jktYbihGO",
"payment_experience": null,
"error_code": null,
"error_message": null,
"payment_method_type": "credit",
"client_secret": "pay_vz8HWByS019g2YMwt1is_secret_iYCy8Ksl0Zs68VBDPNzq"
},
"customer_id": "cus_zxMLIuJnnIJHR0A3ku4M",
"invoice": {
"id": "invoice_OYxNwCMfnZDjRgcAqFxg",
"subscription_id": "sub_h33npFPFe6Ok81MWv4Tq",
"merchant_id": "merchant_1760011611",
"profile_id": "pro_q2odjxxoYxhwy5tXZKU1",
"merchant_connector_id": "mca_okM9o35Qk3O0VE9XS5ux",
"payment_intent_id": "pay_vz8HWByS019g2YMwt1is",
"payment_method_id": "pm_BPUrH5VzG88jktYbihGO",
"customer_id": "cus_zxMLIuJnnIJHR0A3ku4M",
"amount": 15100,
"currency": "USD",
"status": "payment_pending"
},
"billing_processor_subscription_id": "cbdemo_enterprise-suite-monthly"
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/subscription.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/invoice.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
- ... and 1 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/invoice.rs`
- `crates/hyperswitch_domain_models/src/subscription.rs`
**4. Core Business Logic**
- `crates/router/src/core/subscription.rs`
- `crates/router/src/core/subscription/invoice_handler.rs`
- `crates/router/src/core/subscription/payments_api_client.rs`
- ... and 2 more files
**5. Type Definitions**
- `crates/router_env/src/logger/types.rs`
**6. Utils**
- `crates/router/src/routes/lock_utils.rs`
**7. Other**
- `crates/router/src/routes/app.rs`
- `crates/router/src/routes/payments.rs`
- `crates/router/src/routes/subscription.rs`
- ... and 4 more files
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (10 changes)
- Extend existing types with new fields (125 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 36fbaa07:
Files to modify:
**crates/api_models/src/subscription.rs**
Remove:
- function: pub::get_item_price_id
Add:
- struct: pub::UpdateSubscriptionRequest
- impl: impl ApiEventMetric for UpdateSubscriptionRequest
**crates/diesel_models/src/invoice.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/diesel_models/src/subscription.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/invoice.rs**
Add:
- function: pub::update_amount_and_currency
- function: pub::update_connector_and_status
- function: pub::update_payment_and_status
- function: private::from
- struct: pub::AmountAndCurrencyUpdate
- struct: pub::ConnectorAndStatusUpdate
- struct: pub::PaymentAndStatusUpdate
- enum: pub::InvoiceUpdateRequest
- impl: impl InvoiceUpdateRequest
- impl: impl From<InvoiceUpdateRequest> for InvoiceUpdate
**crates/hyperswitch_domain_models/src/subscription.rs**
Modify existing code
**crates/router/src/core/subscription.rs**
Add:
- function: pub::update_subscription
**crates/router/src/core/subscription/invoice_handler.rs**
Add:
- function: pub::update_payment
**crates/router/src/core/subscription/payments_api_client.rs**
Add:
- function: pub::update_payment
**crates/router/src/core/subscription/subscription_handler.rs**
Modify existing code
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Modify existing code
**crates/router/src/routes/subscription.rs**
Add:
- function: pub::update_subscription
**crates/router/src/services/authentication.rs**
Add:
- function: pub::check_internal_api_key_auth_no_client_secret
**crates/router/src/workflows/invoice_sync.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 9778, "pr_title": "feat(subscriptions): Add update subscriptions APIs with payments update call", "merged_at": "2025-10-14T10:54:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/subscription.rs"], "database": ["crates/diesel_models/src/invoice.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs", "crates/diesel_models/src/subscription.rs"], "domain": ["crates/hyperswitch_domain_models/src/invoice.rs", "crates/hyperswitch_domain_models/src/subscription.rs"], "core_business": ["crates/router/src/core/subscription.rs", "crates/router/src/core/subscription/invoice_handler.rs", "crates/router/src/core/subscription/payments_api_client.rs", "crates/router/src/core/subscription/subscription_handler.rs", "crates/router/src/core/webhooks/incoming.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "other": ["crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs", "crates/router/src/routes/subscription.rs", "crates/router/src/services/authentication.rs", "crates/router/src/workflows/invoice_sync.rs", "migrations/2025-10-07-160015_add-plan-id-and-price-id-to-subscription/down.sql", "migrations/2025-10-07-160015_add-plan-id-and-price-id-to-subscription/up.sql"]}, "change_types": {"structs_added": 4, "functions_added": 10, "enums_added": 1, "fields_added": 125, "imports_added": 4, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(dispute): change dispute currency type to currency enum
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Changed Dispute Currency from String to ENUM.
Connector create (Stripe):
`curl --location 'http://localhost:8080/account/merchant_1731933435/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "stripe",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "abc"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"payment_method_type": "klarna",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"apple_pay_combined": {
"manual": {
"session_token_data": {
"initiative": "web",
"certificate": "",
"display_name": "applepay",
"certificate_keys": "",
"payment_processing_details_at": "Connector",
"initiative_context": "sdk-test-app.netlify.app",
"merchant_identifier": "merchant.com.stripe.sang",
"merchant_business_country": "US"
},
"payment_request_data": {
"label": "applepay",
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_capabilities": [
"supports3DS"
]
}
}
},
"google_pay": {
"merchant_info": {
"merchant_name": "Stripe"
},
"allowed_payment_methods": [
{
"type": "CARD",
"parameters": {
"allowed_auth_methods": [
"PAN_ONLY",
"CRYPTOGRAM_3DS"
],
"allowed_card_networks": [
"AMEX",
"DISCOVER",
"INTERAC",
"JCB",
"MASTERCARD",
"VISA"
]
},
"tokenization_specification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "stripe",
"stripe:version": "2018-10-31",
"stripe:publishableKey": "abc"
}
}
}
]
}
}
}'`
Payments Create:
`curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: abc' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'`
payment_intent of the webhook body should be the `connector_transaction_id` of the Payments create response.
Webhook testing:
`curl --location 'http://localhost:8080/webhooks/merchant_1731037648/mca_X1y5O8y5i29CXmimByPp' \
--header 'stripe-signature: t=1730987258,v1=,v0=' \
--header 'Content-Type: application/json' \
--data '{
"id": "evt_1QIW3iD5R7gDAGffqLkKU7uK",
"object": "event",
"api_version": "2022-11-15",
"created": 1730987257,
"data": {
"object": {
"id": "dp_1QIW3hD5R7gDAGffIDgTp3hd",
"object": "dispute",
"amount": 100,
"balance_transaction": null,
"balance_transactions": [],
"charge": "ch_3QIW3hD5R7gDAGff1ZNgFNL9",
"created": 1730987257,
"currency": "usd",
"enhanced_eligibility_types": [],
"evidence": {
"access_activity_log": null,
"billing_address": null,
"cancellation_policy": null,
"cancellation_policy_disclosure": null,
"cancellation_rebuttal": null,
"customer_communication": null,
"customer_email_address": null,
"customer_name": null,
"customer_purchase_ip": null,
"customer_signature": null,
"duplicate_charge_documentation": null,
"duplicate_charge_explanation": null,
"duplicate_charge_id": null,
"enhanced_evidence": {},
"product_description": null,
"receipt": null,
"refund_policy": null,
"refund_policy_disclosure": null,
"refund_refusal_explanation": null,
"service_date": null,
"service_documentation": null,
"shipping_address": null,
"shipping_carrier": null,
"shipping_date": null,
"shipping_documentation": null,
"shipping_tracking_number": null,
"uncategorized_file": null,
"uncategorized_text": null
},
"evidence_details": {
"due_by": 1731801599,
"enhanced_eligibility": {},
"has_evidence": false,
"past_due": false,
"submission_count": 0
},
"is_charge_refundable": true,
"livemode": false,
"metadata": {},
"payment_intent": "pi_3QIjEqD5R7gDAGff1hTCMHyE",
"payment_method_details": {
"card": {
"brand": "visa",
"case_type": "inquiry",
"network_reason_code": "10"
},
"type": "card"
},
"reason": "fraudulent",
"status": "warning_needs_response"
}
},
"livemode": false,
"pending_webhooks": 12,
"request": {
"id": "req_LYPj1MWBqlb5QS",
"idempotency_key": "7469f2e2-fe9f-4c8d-b863-cf7d4d7e325c"
},
"type": "charge.dispute.created"
}'`
In the `dispute table` the `dispute_currency` column should contain actual currency enum like: `USD`
Connectors that returns uppercase currency but implemented as String: Airwallex, Braintree, Checkout, TrustPay
and lowercase currency("usd"): Stripe
Migration query to be run before running up.sql:
`UPDATE dispute SET currency = UPPER(currency);`
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/disputes.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/dispute.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Core Business Logic**
- `crates/router/src/core/webhooks/incoming.rs`
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/novalnet.rs`
- `crates/router/src/connector/adyen.rs`
- ... and 10 more files
**5. Type Definitions**
- `crates/router/src/types/storage/dispute.rs`
- `crates/router/src/types/transformers.rs`
**6. Utils**
- `crates/router/src/utils/user/sample_data.rs`
**7. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/hyperswitch_interfaces/src/disputes.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (40 changes)
- Modify database queries (5 changes)
**Detailed Identifier Changes:**
Commit 98aa84b7:
Files to modify:
**crates/api_models/src/disputes.rs**
Modify existing code
**crates/diesel_models/src/dispute.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/airwallex/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/novalnet.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/disputes.rs**
Modify existing code
**crates/router/src/compatibility/stripe/webhooks.rs**
Modify existing code
**crates/router/src/connector/adyen.rs**
Modify existing code
**crates/router/src/connector/bluesnap.rs**
Modify existing code
**crates/router/src/connector/braintree.rs**
Modify existing code
**crates/router/src/connector/braintree/transformers.rs**
Modify existing code
**crates/router/src/connector/checkout/transformers.rs**
Modify existing code
**crates/router/src/connector/payme.rs**
Modify existing code
**crates/router/src/connector/paypal.rs**
Modify existing code
**crates/router/src/connector/rapyd.rs**
Modify existing code
**crates/router/src/connector/stripe/transformers.rs**
Modify existing code
**crates/router/src/connector/trustpay/transformers.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Add:
- function: pub::convert_uppercase
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/db/dispute.rs**
Modify existing code
**crates/router/src/services/kafka/dispute.rs**
Modify existing code
**crates/router/src/services/kafka/dispute_event.rs**
Modify existing code
**crates/router/src/types/storage/dispute.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/src/utils/user/sample_data.rs**
Modify existing code
|
{"pr_number": 6454, "pr_title": "fix(dispute): change dispute currency type to currency enum", "merged_at": "2024-11-20T14:14:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/disputes.rs"], "database": ["crates/diesel_models/src/dispute.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "core_business": ["crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs", "crates/hyperswitch_connectors/src/connectors/novalnet.rs", "crates/router/src/connector/adyen.rs", "crates/router/src/connector/bluesnap.rs", "crates/router/src/connector/braintree.rs", "crates/router/src/connector/braintree/transformers.rs", "crates/router/src/connector/checkout/transformers.rs", "crates/router/src/connector/payme.rs", "crates/router/src/connector/paypal.rs", "crates/router/src/connector/rapyd.rs", "crates/router/src/connector/stripe/transformers.rs", "crates/router/src/connector/trustpay/transformers.rs", "crates/router/src/connector/utils.rs"], "types": ["crates/router/src/types/storage/dispute.rs", "crates/router/src/types/transformers.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/hyperswitch_interfaces/src/disputes.rs", "crates/router/src/compatibility/stripe/webhooks.rs", "crates/router/src/db/dispute.rs", "crates/router/src/services/kafka/dispute.rs", "crates/router/src/services/kafka/dispute_event.rs", "migrations/2024-10-28-125949_add_dispute_currency_column_in_dispute_table/down.sql", "migrations/2024-10-28-125949_add_dispute_currency_column_in_dispute_table/up.sql"]}, "change_types": {"functions_added": 1, "fields_added": 40, "imports_added": 6, "database_queries": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(subscription): domain_model for subscription and invoice
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This pull request introduces new domain models for subscriptions and invoices, and refactors the codebase to use these models instead of the previous Diesel-based models. The changes improve type safety and abstraction for subscription and invoice handling, and update relevant interfaces and function calls throughout the codebase to use the new models.
**Domain Model Additions:**
* Added a new `Subscription` domain model in `crates/hyperswitch_domain_models/src/subscription.rs`, including the `SubscriptionStatus` enum, conversion traits, and the `SubscriptionInterface` trait for standardized operations. Also added the `SubscriptionUpdate` struct with conversion logic.
* Added a new `Invoice` domain model in `crates/hyperswitch_domain_models/src/invoice.rs`, including conversion traits, the `InvoiceInterface` trait for CRUD operations, and the `InvoiceUpdate` struct with conversion logic.
**Refactoring and Integration:**
* Refactored all subscription and invoice-related logic in `crates/router/src/core/subscription.rs` and `crates/router/src/core/subscription/billing_processor_handler.rs` to use the new domain models (`hyperswitch_domain_models::subscription::Subscription` and `hyperswitch_domain_models::invoice::Invoice`) instead of Diesel models. [[1]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL83-L95) [[2]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL201-R203) [[3]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL210-R213) [[4]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL320-R324) [[5]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL329-R334) [[6]](diffhunk://#diff-57a5a7402c9b28e022a6839808acf84b88808f76da82ce1c76a80660c8869ec6L168-R168) [[7]](diffhunk://#diff-bacee0b3d81189090ca0d5f72fc58118b681a7dd4aab772679f2dec2a585a073L13-R28) [[8]](diffhunk://#diff-bacee0b3d81189090ca0d5f72fc58118b681a7dd4aab772679f2dec2a585a073L47-R50)
* Updated the invoice creation logic in `invoice_handler.rs` to use the new domain model and retrieve the merchant key store for secure operations.
**Module Organization:**
* Registered the new `invoice` and `subscription` modules in `crates/hyperswitch_domain_models/src/lib.rs` for proper integration with the rest of the domain models. [[1]](diffhunk://#diff-7ea431033335b7e3d2454c104f750be19973ad4f061a8cdb5c50af53ebdff00bR18) [[2]](diffhunk://#diff-7ea431033335b7e3d2454c104f750be19973ad4f061a8cdb5c50af53ebdff00bR41)
These changes lay the groundwork for improved maintainability and extensibility in handling subscriptions and invoices in the codebase.
## How did you test it?
Create Billing Connector
```
curl --location 'http://localhost:8080/account/merchant_1759737987/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ****' \
--data '{
"connector_type": "billing_processor",
"connector_name": "chargebee",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "****"
},
"business_country": "US",
"business_label": "default",
"connector_webhook_details": {
"merchant_secret": "hyperswitch",
"additional_secret": "hyperswitch"
},
"metadata": {
"site": "hyperswitch-juspay3-test"
}
}'
```
```
{
"connector_type": "billing_processor",
"connector_name": "chargebee",
"connector_label": "chargebee_US_default",
"merchant_connector_id": "mca_nyehf3o9gtzGgeVFzsx0",
"profile_id": "pro_Ba2HYJtnuKdJzv2SBizB",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "te**********************************MK"
},
"payment_methods_enabled": null,
"connector_webhook_details": {
"merchant_secret": "hyperswitch",
"additional_secret": "hyperswitch"
},
"metadata": {
"site": "hyperswitch-juspay3-test"
},
"test_mode": null,
"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
}
```
Update profile to set the billing processor
```
curl --location 'http://localhost:8080/account/merchant_1759737987/business_profile/pro_Ba2HYJtnuKdJzv2SBizB' \
--header 'Content-Type: application/json' \
--header 'api-key: ****' \
--data '{
"billing_processor_id": "mca_nyehf3o9gtzGgeVFzsx0"
}'
```
```
{
"merchant_id": "merchant_1759737987",
"profile_id": "pro_Ba2HYJtnuKdJzv2SBizB",
"profile_name": "US_default",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "BPIswjNm5ivN92rBE9J4ShmB2dfLVLeQ8DRnzY7cR7qsaUlfNpBgvnOCBWRfhR5e",
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true,
"payment_statuses_enabled": null,
"refund_statuses_enabled": null,
"payout_statuses_enabled": null
},
"metadata": null,
"routing_algorithm": null,
"intent_fulfillment_time": 900,
"frm_routing_algorithm": null,
"payout_routing_algorithm": null,
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"extended_card_info_config": null,
"collect_shipping_details_from_wallet_connector": false,
"collect_billing_details_from_wallet_connector": false,
"always_collect_shipping_details_from_wallet_connector": false,
"always_collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": false,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null,
"tax_connector_id": null,
"is_tax_connector_enabled": false,
"is_network_tokenization_enabled": false,
"is_auto_retries_enabled": false,
"max_auto_retries_enabled": null,
"always_request_extended_authorization": null,
"is_click_to_pay_enabled": false,
"authentication_product_ids": null,
"card_testing_guard_config": {
"card_ip_blocking_status": "disabled",
"card_ip_blocking_threshold": 3,
"guest_user_card_blocking_status": "disabled",
"guest_user_card_blocking_threshold": 10,
"customer_id_blocking_status": "disabled",
"customer_id_blocking_threshold": 5,
"card_testing_guard_expiry": 3600
},
"is_clear_pan_retries_enabled": false,
"force_3ds_challenge": false,
"is_debit_routing_enabled": false,
"merchant_business_country": null,
"is_pre_network_tokenization_enabled": false,
"acquirer_configs": null,
"is_iframe_redirection_enabled": null,
"merchant_category_code": null,
"merchant_country_code": null,
"dispute_polling_interval": null,
"is_manual_retry_enabled": null,
"always_enable_overcapture": null,
"is_external_vault_enabled": "skip",
"external_vault_connector_details": null,
"billing_processor_id": "mca_nyehf3o9gtzGgeVFzsx0"
}
```
Create Customer
```
curl --location 'http://localhost:8080/customers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ****' \
--data-raw '{
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```
{
"customer_id": "cus_EkIUbktzRFCHooI9Kylq",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"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
},
"created_at": "2025-10-06T08:08:37.562Z",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"default_payment_method_id": null,
"tax_registration_id": null
}
```
Create Subscription
```
curl --location 'http://localhost:8080/subscriptions/create' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_Ba2HYJtnuKdJzv2SBizB' \
--header 'api-key: ****' \
--data '{
"customer_id": "cus_EkIUbktzRFCHooI9Kylq",
"amount": 14100,
"currency": "USD",
"payment_details": {
"authentication_type": "no_three_ds",
"setup_future_usage": "off_session",
"capture_method": "automatic",
"return_url": "https://google.com"
}
}'
```
```
{
"id": "sub_Q1ttH0p1b50OtnDgZfrz",
"merchant_reference_id": null,
"status": "created",
"plan_id": null,
"profile_id": "pro_Ba2HYJtnuKdJzv2SBizB",
"client_secret": "sub_Q1ttH0p1b50OtnDgZfrz_secret_jXFTn0oMPowj2RqRUcWX",
"merchant_id": "merchant_1759737987",
"coupon_code": null,
"customer_id": "cus_EkIUbktzRFCHooI9Kylq"
}
```
Confirm Subscription
```
curl --location 'http://localhost:8080/subscriptions/sub_Q1ttH0p1b50OtnDgZfrz/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_Ba2HYJtnuKdJzv2SBizB' \
--header 'api-key: ****' \
--data '{
"item_price_id": "cbdemo_enterprise-suite-monthly",
"customer_id": "cus_EkIUbktzRFCHooI9Kylq",
"description": "Hello this is description",
"shipping": {
"address": {
"state": "zsaasdas",
"city": "Banglore",
"country": "US",
"line1": "sdsdfsdf",
"line2": "hsgdbhd",
"line3": "alsksoe",
"zip": "571201",
"first_name": "joseph",
"last_name": "doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"payment_details": {
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "CLBRW dffdg",
"card_cvc": "737"
}
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
}
}
}'
```
```
{
"id": "sub_Q1ttH0p1b50OtnDgZfrz",
"merchant_reference_id": null,
"status": "active",
"plan_id": null,
"price_id": null,
"coupon": null,
"profile_id": "pro_Ba2HYJtnuKdJzv2SBizB",
"payment": {
"payment_id": "pay_uadWety0AlrsIpLa2Dt6",
"status": "succeeded",
"amount": 14100,
"currency": "USD",
"connector": "stripe",
"payment_method_id": "pm_HBp7wdIyHsvnta708kxF",
"payment_experience": null,
"error_code": null,
"error_message": null,
"payment_method_type": "credit"
},
"customer_id": "cus_EkIUbktzRFCHooI9Kylq",
"invoice": {
"id": "invoice_UwA8TmKbXgxE1a7s6Nux",
"subscription_id": "sub_Q1ttH0p1b50OtnDgZfrz",
"merchant_id": "merchant_1759737987",
"profile_id": "pro_Ba2HYJtnuKdJzv2SBizB",
"merchant_connector_id": "mca_nyehf3o9gtzGgeVFzsx0",
"payment_intent_id": "pay_uadWety0AlrsIpLa2Dt6",
"payment_method_id": "pm_HBp7wdIyHsvnta708kxF",
"customer_id": "cus_EkIUbktzRFCHooI9Kylq",
"amount": 14100,
"currency": "USD",
"status": "payment_pending"
},
"billing_processor_subscription_id": "sub_Q1ttH0p1b50OtnDgZfrz"
}
```
Screenshots
<img width="617" height="229" alt="Screenshot 2025-10-06 at 1 44 10 PM" src="https://github.com/user-attachments/assets/f11a1fe2-d7e9-4d2b-99db-c68f35212b2b" />
<img width="436" height="252" alt="Screenshot 2025-10-06 at 1 44 18 PM" src="https://github.com/user-attachments/assets/b66abdad-d216-4a12-84f0-653a1654ea7a" />
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/invoice.rs`
- `crates/hyperswitch_domain_models/src/lib.rs`
- `crates/hyperswitch_domain_models/src/subscription.rs`
**2. Core Business Logic**
- `crates/router/src/core/subscription.rs`
- `crates/router/src/core/subscription/billing_processor_handler.rs`
- `crates/router/src/core/subscription/invoice_handler.rs`
- ... and 1 more files
**3. Other**
- `crates/router/src/db.rs`
- `crates/router/src/db/invoice.rs`
- `crates/router/src/db/kafka_store.rs`
- ... and 5 more files
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (53 changes)
- Extend existing types with new fields (321 changes)
**Detailed Identifier Changes:**
Commit 17986c3b:
Files to modify:
**crates/hyperswitch_domain_models/src/invoice.rs**
Add:
- function: private::convert
- function: private::convert_back
- function: private::construct_new
- function: pub::to_invoice
- function: private::convert
- function: private::convert_back
- function: private::construct_new
- function: pub::new
- struct: pub::Invoice
- struct: pub::InvoiceUpdate
- trait: pub::InvoiceInterface
- impl: impl super::behaviour::Conversion for Invoice
- impl: impl Invoice
- impl: impl super::behaviour::Conversion for InvoiceUpdate
- impl: impl InvoiceUpdate
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- mod: pub::invoice
**crates/hyperswitch_domain_models/src/subscription.rs**
Add:
- function: private::fmt
- function: pub::generate_and_set_client_secret
- function: private::convert
- function: private::convert_back
- function: private::construct_new
- function: pub::new
- function: private::convert
- function: private::convert_back
- function: private::construct_new
- struct: pub::Subscription
- struct: pub::SubscriptionUpdate
- enum: pub::SubscriptionStatus
- trait: pub::SubscriptionInterface
- impl: impl std::fmt::Display for SubscriptionStatus
- impl: impl Subscription
- impl: impl super::behaviour::Conversion for Subscription
- impl: impl SubscriptionUpdate
- impl: impl super::behaviour::Conversion for SubscriptionUpdate
**crates/router/src/core/subscription.rs**
Modify existing code
**crates/router/src/core/subscription/billing_processor_handler.rs**
Modify existing code
**crates/router/src/core/subscription/invoice_handler.rs**
Modify existing code
**crates/router/src/core/subscription/subscription_handler.rs**
Modify existing code
**crates/router/src/db.rs**
Remove:
- mod: pub::invoice
- mod: pub::subscription
**crates/router/src/db/invoice.rs**
Remove:
- function: private::insert_invoice_entry
- function: private::find_invoice_by_invoice_id
- function: private::update_invoice_entry
- function: private::get_latest_invoice_for_subscription
- function: private::insert_invoice_entry
- function: private::find_invoice_by_invoice_id
- function: private::update_invoice_entry
- function: private::get_latest_invoice_for_subscription
- function: private::insert_invoice_entry
- function: private::find_invoice_by_invoice_id
- function: private::update_invoice_entry
- function: private::get_latest_invoice_for_subscription
- trait: pub::InvoiceInterface
- impl: impl InvoiceInterface for Store
- impl: impl InvoiceInterface for MockDb
- impl: impl InvoiceInterface for KafkaStore
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::insert_invoice_entry
- function: private::find_invoice_by_invoice_id
- function: private::update_invoice_entry
- function: private::get_latest_invoice_for_subscription
- function: private::insert_subscription_entry
- function: private::find_by_merchant_id_subscription_id
- function: private::update_subscription_entry
- impl: impl InvoiceInterface for KafkaStore
- impl: impl SubscriptionInterface for KafkaStore
**crates/router/src/db/subscription.rs**
Remove:
- function: private::insert_subscription_entry
- function: private::find_by_merchant_id_subscription_id
- function: private::update_subscription_entry
- function: private::insert_subscription_entry
- function: private::find_by_merchant_id_subscription_id
- function: private::update_subscription_entry
- function: private::insert_subscription_entry
- function: private::find_by_merchant_id_subscription_id
- function: private::update_subscription_entry
- trait: pub::SubscriptionInterface
- impl: impl SubscriptionInterface for Store
- impl: impl SubscriptionInterface for MockDb
- impl: impl SubscriptionInterface for KafkaStore
**crates/router/src/workflows/invoice_sync.rs**
Modify existing code
**crates/storage_impl/src/invoice.rs**
Add:
- function: private::insert_invoice_entry
- function: private::find_invoice_by_invoice_id
- function: private::update_invoice_entry
- function: private::get_latest_invoice_for_subscription
- function: private::insert_invoice_entry
- function: private::find_invoice_by_invoice_id
- function: private::update_invoice_entry
- function: private::get_latest_invoice_for_subscription
- function: private::insert_invoice_entry
- function: private::find_invoice_by_invoice_id
- function: private::update_invoice_entry
- function: private::get_latest_invoice_for_subscription
- impl: impl InvoiceInterface for RouterStore<T>
- impl: impl InvoiceInterface for KVRouterStore<T>
- impl: impl InvoiceInterface for MockDb
**crates/storage_impl/src/lib.rs**
Add:
- mod: pub::invoice
- mod: pub::subscription
**crates/storage_impl/src/subscription.rs**
Add:
- function: private::insert_subscription_entry
- function: private::find_by_merchant_id_subscription_id
- function: private::update_subscription_entry
- function: private::insert_subscription_entry
- function: private::find_by_merchant_id_subscription_id
- function: private::update_subscription_entry
- function: private::insert_subscription_entry
- function: private::find_by_merchant_id_subscription_id
- function: private::update_subscription_entry
- impl: impl SubscriptionInterface for RouterStore<T>
- impl: impl SubscriptionInterface for KVRouterStore<T>
- impl: impl SubscriptionInterface for MockDb
|
{"pr_number": 9640, "pr_title": "feat(subscription): domain_model for subscription and invoice", "merged_at": "2025-10-09T10:51:00Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/invoice.rs", "crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/subscription.rs"], "core_business": ["crates/router/src/core/subscription.rs", "crates/router/src/core/subscription/billing_processor_handler.rs", "crates/router/src/core/subscription/invoice_handler.rs", "crates/router/src/core/subscription/subscription_handler.rs"], "other": ["crates/router/src/db.rs", "crates/router/src/db/invoice.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/subscription.rs", "crates/router/src/workflows/invoice_sync.rs", "crates/storage_impl/src/invoice.rs", "crates/storage_impl/src/lib.rs", "crates/storage_impl/src/subscription.rs"]}, "change_types": {"structs_added": 4, "functions_added": 53, "enums_added": 1, "fields_added": 321, "imports_added": 19}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [DEUTSCHEBANK, FIUU ] Handle 2xx errors given by Connector
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [X] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
1. Consuming error message given by `DeutscheBank` in case of 2xx errors, because it is currently not handled for 2xx errors. Error message is only consumed for 4xx and 5xx.
2. Consuming error message given by `Fiuu` in case of 2xx errors only in case of `refunds`. In all other cases where 2xx errors are thrown, code is already handling it.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies 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)?
-->
Tested manually using Postman
1. DB testing
[Test Doc](https://docs.google.com/document/d/1DUUcWRbLXbaJWoxt1Rfn7s1rByJiMKouHXIk2VAONHk/edit?usp=sharing)
2. Not able to test manually for Fiuu
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [X] I formatted the code `cargo +nightly fmt --all`
- [X] I addressed lints thrown by `cargo clippy`
- [X] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (65 changes)
- Add conditional logic for feature flags or filtering (6 changes)
**Detailed Identifier Changes:**
Commit 573fc2ce:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs**
Add:
- function: private::get_error_response
- function: private::is_response_success
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
|
{"pr_number": 6727, "pr_title": "feat(connector): [DEUTSCHEBANK, FIUU ] Handle 2xx errors given by Connector", "merged_at": "2024-12-12T10:20:34Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["refund"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs"]}, "change_types": {"functions_added": 2, "fields_added": 65, "conditionals_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(payment_methods): card_network and card_scheme should be consistent
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
In customer payment method list api, card scheme and card network are showing different value for co-branded card it they are saved with both the network, to fix this issue, both these fields are now fetching the data from the card locker
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested through Postam:
- Create a MCA(Checkout):
- Create a payment with co-branded card with network at Visa:
```
{
"amount": 1043,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "{{customer_id}}",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4010061700000021",
"card_exp_month": "01",
"card_exp_year": "99",
"card_holder_name": "joseph Doe",
"card_cvc": "123",
"card_network": "Visa",
"nick_name": "Sakil"
}
},
"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"
},
"setup_future_usage": "on_session",
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "125.0.0.1",
"user_agent": "amet irure esse"
}
}
}
```
- Do a customer payment method list, the response should be following:
```
{
"customer_payment_methods": [
{
"payment_token": "token_I8i8KGuFhF4KSxQHFePi",
"payment_method_id": "pm_3D4MneEjvgweeRyfyiBv",
"customer_id": "cus_4hPhaiDFxK9W0qUpOGkq",
"payment_method": "card",
"payment_method_type": null,
"payment_method_issuer": null,
"payment_method_issuer_code": null,
"recurring_enabled": false,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": "Visa",
"issuer_country": null,
"last4_digits": "0021",
"expiry_month": "01",
"expiry_year": "99",
"card_token": null,
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": "Sakil",
"card_network": "Visa",
"card_isin": "401006",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
},
"metadata": null,
"created": "2024-12-16T10:20:59.201Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": true,
"last_used_at": "2024-12-16T10:20:59.201Z",
"default_payment_method_set": true,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": null,
"email": null
}
}
],
"is_guest_customer": false
}
```
- Create a payment again with co-branded card but with network as `CartesBancaires`:
```
{
"amount": 1043,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "{{customer_id}}",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4010061700000021",
"card_exp_month": "01",
"card_exp_year": "99",
"card_holder_name": "joseph Doe",
"card_cvc": "123",
"card_network": "CartesBancaires",
"nick_name": "Sakil"
}
},
"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"
},
"setup_future_usage": "on_session",
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "125.0.0.1",
"user_agent": "amet irure esse"
}
}
}
```
- Do a customer payment method list call, the response should be:
```
{
"customer_payment_methods": [
{
"payment_token": "token_I8i8KGuFhF4KSxQHFePi",
"payment_method_id": "pm_3D4MneEjvgweeRyfyiBv",
"customer_id": "cus_4hPhaiDFxK9W0qUpOGkq",
"payment_method": "card",
"payment_method_type": null,
"payment_method_issuer": null,
"payment_method_issuer_code": null,
"recurring_enabled": false,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": "CartesBancaires",
"issuer_country": null,
"last4_digits": "0021",
"expiry_month": "01",
"expiry_year": "99",
"card_token": null,
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": "Sakil",
"card_network": "CartesBancaires",
"card_isin": "401006",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
},
"metadata": null,
"created": "2024-12-16T10:20:59.201Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": true,
"last_used_at": "2024-12-16T10:20:59.201Z",
"default_payment_method_set": true,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": null,
"email": null
}
}
],
"is_guest_customer": 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. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_method.rs`
**2. Core Business Logic**
- `crates/router/src/core/payment_methods/cards.rs`
- `crates/router/src/core/payments/tokenization.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (16 changes)
**Detailed Identifier Changes:**
Commit 5c4de8a5:
Files to modify:
**crates/diesel_models/src/payment_method.rs**
Modify existing code
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
**crates/router/src/core/payments/tokenization.rs**
Modify existing code
|
{"pr_number": 6849, "pr_title": "fix(payment_methods): card_network and card_scheme should be consistent", "merged_at": "2024-12-17T14:16:31Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"database": ["crates/diesel_models/src/payment_method.rs"], "core_business": ["crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payments/tokenization.rs"]}, "change_types": {"fields_added": 16}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(authentication): modify auth for profiles and mca routes to `ApiKeyAuthWithMerchantIdFromRoute`
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Currently, the following routes use `AdminApiAuthWithMerchantIdFromRoute` for authentication:
- Profile Create, Retrieve, Update
- Merchant Connector Account Create, List, Retrieve, Update
This is being updated to a more appropriate auth layer: `ApiKeyAuthWithMerchantIdFromRoute`, which validates that the `merchant_id` in the API key matches the one in the route.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
These routes are profile and merchant-specific and can be accessed using the merchant's API key,
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Folowing are the endpoints which are changed:
### Business Profile Create:
```bash
curl --location 'http://localhost:8080/account/merchant_1743057601/business_profile' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_5xsUyXxOG9PXQcg3rFHb04PhdadsqtKltGAZ6ABoJBYXNSIqBlOuOouPin0bnvoY' \
--data '{
"profile_name": "final-test"
}'
```
### Business Profile Retrieve:
```bash
curl --location 'http://localhost:8080/account/merchant_1743057601/business_profile/pro_DaWH06Gvj0uyHu5TIzo9' \
--header 'api-key: dev_5xsUyXxOG9PXQcg3rFHb04PhdadsqtKltGAZ6ABoJBYXNSIqBlOuOouPin0bnvoY'
```
### Business Profile Update:
```bash
curl --location 'http://localhost:8080/account/merchant_1743057601/business_profile/pro_r4qhkx1sVFsohrVEKuu2' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_5xsUyXxOG9PXQcg3rFHb04PhdadsqtKltGAZ6ABoJBYXNSIqBlOuOouPin0bnvoY' \
--data '{
"profile_name": "test-profile-auth2"
}'
```
### Business Profile List:
```bash
curl --location 'http://localhost:8080/account/merchant_1743057601/business_profile' \
--header 'api-key: dev_5xsUyXxOG9PXQcg3rFHb04PhdadsqtKltGAZ6ABoJBYXNSIqBlOuOouPin0bnvoY'
```
### Merchant Connector Account Create
```bash
curl --location 'http://localhost:8080/account/merchant_1743084798/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_awg6L6UKmUmNmvnJhYmgZpyWGKW2IfpT3Aq9huE9SicU5HbH0qk95MgQRMrjIdfT' \
--data '{
"connector_type": "payment_processor",
"profile_id": "pro_diCodYSThA3xAuDZ2rKV",
"connector_name": "paypal_test",
"connector_label": "paypal_test_default4",
"disabled": false,
"test_mode": true,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "debit",
"card_networks": [
"Mastercard"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"Interac"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"AmericanExpress"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"JCB"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"DinersClub"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"Discover"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"CartesBancaires"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"UnionPay"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"Mastercard"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"Visa"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"Interac"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"AmericanExpress"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"JCB"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"DinersClub"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"Discover"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"CartesBancaires"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"UnionPay"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
}
]
}
],
"metadata": {},
"connector_account_details": {
"api_key": "test_key",
"auth_type": "HeaderKey"
},
"additional_merchant_data": null,
"status": "active",
"pm_auth_config": null,
"connector_wallets_details": null
}'
```
### Merchant Connector Account Retrieve
```bash
curl --location 'http://localhost:8080/account/merchant_1743084798/connectors/mca_zAKHkuRqGOnduBqTHzlO' \
--header 'Accept: application/json' \
--header 'api-key: dev_awg6L6UKmUmNmvnJhYmgZpyWGKW2IfpT3Aq9huE9SicU5HbH0qk95MgQRMrjIdfT'
```
### Merchant Connector Account Update
```bash
curl --location 'http://localhost:8080/account/merchant_1743084798/connectors/mca_zAKHkuRqGOnduBqTHzlO' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_awg6L6UKmUmNmvnJhYmgZpyWGKW2IfpT3Aq9huE9SicU5HbH0qk95MgQRMrjIdfT' \
--data '{
"connector_type": "payment_processor",
"connector_label": "paypal_test_default2",
"disabled": false,
"test_mode": true,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "debit",
"card_networks": [
"Mastercard"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"Interac"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"AmericanExpress"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"JCB"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"DinersClub"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"Discover"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"CartesBancaires"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "debit",
"card_networks": [
"UnionPay"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"Mastercard"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"Visa"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"Interac"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"AmericanExpress"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"JCB"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"DinersClub"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"Discover"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"CartesBancaires"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
},
{
"payment_method_type": "credit",
"card_networks": [
"UnionPay"
],
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
}
]
}
],
"metadata": {},
"additional_merchant_data": null,
"status": "active",
"pm_auth_config": null,
"connector_wallets_details": null
}'
```
### Merchant Connector Account List:
```bash
curl --location 'http://localhost:8080/account/merchant_1743084798/connectors' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_awg6L6UKmUmNmvnJhYmgZpyWGKW2IfpT3Aq9huE9SicU5HbH0qk95MgQRMrjIdfT'
```
### Merchant Connector Account Profile List:
```bash
curl --location 'http://localhost:8080/account/merchant_1743084798/profile/connectors' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_awg6L6UKmUmNmvnJhYmgZpyWGKW2IfpT3Aq9huE9SicU5HbH0qk95MgQRMrjIdfT'
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests-v2/cypress/support/commands.js`
- `cypress-tests/cypress/support/commands.js`
**2. Other**
- `crates/router/src/routes/admin.rs`
- `crates/router/src/routes/profiles.rs`
- `crates/router/src/services/authentication.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (2 changes)
- Extend existing types with new fields (7 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 4b39dc85:
Files to modify:
**crates/router/src/routes/admin.rs**
Modify existing code
**crates/router/src/routes/profiles.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Add:
- function: private::get_auth_type
- function: private::authenticate_and_fetch
- struct: pub::ApiKeyAuthWithMerchantIdFromRoute
- impl: impl GetAuthType for ApiKeyAuthWithMerchantIdFromRoute
- impl: impl AuthenticateAndFetch<AuthenticationData, A> for ApiKeyAuthWithMerchantIdFromRoute
|
{"pr_number": 7656, "pr_title": "refactor(authentication): modify auth for profiles and mca routes to `ApiKeyAuthWithMerchantIdFromRoute`", "merged_at": "2025-03-28T09:08:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "connector"]}, "hierarchy": {"tests": ["cypress-tests-v2/cypress/support/commands.js", "cypress-tests/cypress/support/commands.js"], "other": ["crates/router/src/routes/admin.rs", "crates/router/src/routes/profiles.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"structs_added": 1, "functions_added": 2, "fields_added": 7, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(refunds_v2): Add refunds list flow in v2 apis
## 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 support for listing refunds in v2 apis.
Available filters for listing are as follows
- `payment_id`: Filter by a specific payment identifier.
- `refund_id`: Filter by a specific refund identifier.
- `limit`: Maximum number of refund records to return.
- `offset`: Starting index for pagination.
- `time_range`: Filter refunds by a range of creation timestamps (start_time, end_time).
- `amount_filter`: Filter by refund amount (start_amount, end_amount).
- `connector`: Filter by a list of connector names.
- `connector_id_list`: Filter by specific merchant connector account IDs.
- `currency`: Filter by a list of currency codes.
- `refund_status`: Filter by a list of refund statuses.
### 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).
-->
Merchants will be able to list refunds upon merging this PR.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Create some payments and refunds before hand.
- List all refunds API call
```
curl --location --request GET 'http://localhost:8080/v2/refunds/list' \
--header 'x-profile-id: pro_PiIU0MSYNuU5kS96H0kV' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_nG2oG32R2dnadMOvkwfRyl0j1YB8uNf3t1FcDqhFgFxO7TtVS1kPQ8m4F3DEngVb' \
--data '{
}'
```
- Response from the above call
```
{
"count": 4,
"total_count": 4,
"data": [
{
"id": "12345_ref_0196a4badf2f7ed2b16c4ecaf1c814db",
"payment_id": "12345_pay_0196a4baa48772909f72eac2cd863d7b",
"merchant_reference_id": "1746520432",
"amount": 70,
"currency": "EUR",
"status": "succeeded",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-05-06T08:33:52.433Z",
"updated_at": "2025-05-06T08:33:53.474Z",
"connector": "stripe",
"profile_id": "pro_PiIU0MSYNuU5kS96H0kV",
"merchant_connector_id": "mca_jQBjGAAN1BgqzXa0Gpoy",
"connector_refund_reference_id": null
},
{
"id": "12345_ref_0196a4ba41147d138621293a283b9d3e",
"payment_id": "12345_pay_0196a4ba295477d0a4156e65135d8fb2",
"merchant_reference_id": "1746520392",
"amount": 1000,
"currency": "BBD",
"status": "succeeded",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-05-06T08:33:11.959Z",
"updated_at": "2025-05-06T08:33:13.047Z",
"connector": "stripe",
"profile_id": "pro_PiIU0MSYNuU5kS96H0kV",
"merchant_connector_id": "mca_jQBjGAAN1BgqzXa0Gpoy",
"connector_refund_reference_id": null
},
{
"id": "12345_ref_0196a4b978637810b17d2f855afb0305",
"payment_id": "12345_pay_0196a4b9609179429e3e0decc9892a55",
"merchant_reference_id": "1746520341",
"amount": 100,
"currency": "USD",
"status": "succeeded",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-05-06T08:32:20.588Z",
"updated_at": "2025-05-06T08:32:21.669Z",
"connector": "stripe",
"profile_id": "pro_PiIU0MSYNuU5kS96H0kV",
"merchant_connector_id": "mca_jQBjGAAN1BgqzXa0Gpoy",
"connector_refund_reference_id": null
},
{
"id": "12345_ref_01969f96f27e7213b4257eb238ec3a46",
"payment_id": "12345_pay_01969f96e02a7dd3a183592c24c6693e",
"merchant_reference_id": "1746434192",
"amount": 100,
"currency": "USD",
"status": "succeeded",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-05-05T08:36:32.015Z",
"updated_at": "2025-05-05T08:36:46.580Z",
"connector": "stripe",
"profile_id": "pro_PiIU0MSYNuU5kS96H0kV",
"merchant_connector_id": "mca_jQBjGAAN1BgqzXa0Gpoy",
"connector_refund_reference_id": null
}
]
}
```
- List refund by payment id API Call
```
curl --location --request GET 'http://localhost:8080/v2/refunds/list' \
--header 'x-profile-id: pro_PiIU0MSYNuU5kS96H0kV' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_nG2oG32R2dnadMOvkwfRyl0j1YB8uNf3t1FcDqhFgFxO7TtVS1kPQ8m4F3DEngVb' \
--data '{
"payment_id":"12345_pay_0196a4baa48772909f72eac2cd863d7b"
}'
```
- Response from the above call
```
{
"count": 1,
"total_count": 1,
"data": [
{
"id": "12345_ref_0196a4badf2f7ed2b16c4ecaf1c814db",
"payment_id": "12345_pay_0196a4baa48772909f72eac2cd863d7b",
"merchant_reference_id": "1746520432",
"amount": 70,
"currency": "EUR",
"status": "succeeded",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-05-06T08:33:52.433Z",
"updated_at": "2025-05-06T08:33:53.474Z",
"connector": "stripe",
"profile_id": "pro_PiIU0MSYNuU5kS96H0kV",
"merchant_connector_id": "mca_jQBjGAAN1BgqzXa0Gpoy",
"connector_refund_reference_id": null
}
]
}
```
- List refund by refund id API Call
```
curl --location --request GET 'http://localhost:8080/v2/refunds/list' \
--header 'x-profile-id: pro_PiIU0MSYNuU5kS96H0kV' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_nG2oG32R2dnadMOvkwfRyl0j1YB8uNf3t1FcDqhFgFxO7TtVS1kPQ8m4F3DEngVb' \
--data '{
"refund_id":"12345_ref_0196a4ba41147d138621293a283b9d3e"
}'
```
- Response from the above call
```
{
"count": 1,
"total_count": 1,
"data": [
{
"id": "12345_ref_0196a4ba41147d138621293a283b9d3e",
"payment_id": "12345_pay_0196a4ba295477d0a4156e65135d8fb2",
"merchant_reference_id": "1746520392",
"amount": 1000,
"currency": "BBD",
"status": "succeeded",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-05-06T08:33:11.959Z",
"updated_at": "2025-05-06T08:33:13.047Z",
"connector": "stripe",
"profile_id": "pro_PiIU0MSYNuU5kS96H0kV",
"merchant_connector_id": "mca_jQBjGAAN1BgqzXa0Gpoy",
"connector_refund_reference_id": null
}
]
}
```
- List refund by currencies API Call
```
curl --location --request GET 'http://localhost:8080/v2/refunds/list' \
--header 'x-profile-id: pro_PiIU0MSYNuU5kS96H0kV' \
--header 'Content-Type: application/json' \
--header 'Authorization: api-key=dev_nG2oG32R2dnadMOvkwfRyl0j1YB8uNf3t1FcDqhFgFxO7TtVS1kPQ8m4F3DEngVb' \
--data '{
"currency":["EUR","USD"]
}'
```
- Response from the above call
```
{
"count": 3,
"total_count": 3,
"data": [
{
"id": "12345_ref_0196a4badf2f7ed2b16c4ecaf1c814db",
"payment_id": "12345_pay_0196a4baa48772909f72eac2cd863d7b",
"merchant_reference_id": "1746520432",
"amount": 70,
"currency": "EUR",
"status": "succeeded",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-05-06T08:33:52.433Z",
"updated_at": "2025-05-06T08:33:53.474Z",
"connector": "stripe",
"profile_id": "pro_PiIU0MSYNuU5kS96H0kV",
"merchant_connector_id": "mca_jQBjGAAN1BgqzXa0Gpoy",
"connector_refund_reference_id": null
},
{
"id": "12345_ref_0196a4b978637810b17d2f855afb0305",
"payment_id": "12345_pay_0196a4b9609179429e3e0decc9892a55",
"merchant_reference_id": "1746520341",
"amount": 100,
"currency": "USD",
"status": "succeeded",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-05-06T08:32:20.588Z",
"updated_at": "2025-05-06T08:32:21.669Z",
"connector": "stripe",
"profile_id": "pro_PiIU0MSYNuU5kS96H0kV",
"merchant_connector_id": "mca_jQBjGAAN1BgqzXa0Gpoy",
"connector_refund_reference_id": null
},
{
"id": "12345_ref_01969f96f27e7213b4257eb238ec3a46",
"payment_id": "12345_pay_01969f96e02a7dd3a183592c24c6693e",
"merchant_reference_id": "1746434192",
"amount": 100,
"currency": "USD",
"status": "succeeded",
"reason": "Paid by mistake",
"metadata": {
"foo": "bar"
},
"error_details": {
"code": "",
"message": ""
},
"created_at": "2025-05-05T08:36:32.015Z",
"updated_at": "2025-05-05T08:36:46.580Z",
"connector": "stripe",
"profile_id": "pro_PiIU0MSYNuU5kS96H0kV",
"merchant_connector_id": "mca_jQBjGAAN1BgqzXa0Gpoy",
"connector_refund_reference_id": null
}
]
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/refunds.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/Cargo.toml`
- `crates/hyperswitch_domain_models/src/refunds.rs`
**3. Core Business Logic**
- `crates/router/src/core/refunds_v2.rs`
**4. Type Definitions**
- `crates/router/src/types/api/refunds.rs`
- `crates/router/src/types/storage/refund.rs`
**5. Configuration Files**
- `crates/router/Cargo.toml`
**6. Other**
- `api-reference-v2/openapi_spec.json`
- `crates/openapi/src/openapi_v2.rs`
- `crates/openapi/src/routes/refunds.rs`
- ... and 4 more files
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (16 changes)
- Extend existing types with new fields (93 changes)
- Add conditional logic for feature flags or filtering (24 changes)
- Modify database queries (52 changes)
**Detailed Identifier Changes:**
Commit 839eb2e8:
Files to modify:
**crates/api_models/src/refunds.rs**
Add:
- struct: pub::RefundListRequest
**crates/hyperswitch_domain_models/src/refunds.rs**
Add:
- function: private::from
- struct: pub::RefundListConstraints
- impl: impl From<(api_models::refunds::RefundListRequest, Profile)> for RefundListConstraints
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/openapi/src/routes/refunds.rs**
Add:
- function: pub::refunds_list
**crates/router/src/core/refunds_v2.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::filter_refund_by_constraints
- function: private::get_total_count_of_refunds
**crates/router/src/db/refund.rs**
Add:
- function: private::filter_refund_by_constraints
- function: private::get_total_count_of_refunds
- function: private::filter_refund_by_constraints
- function: private::get_total_count_of_refunds
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/refunds.rs**
Add:
- function: pub::refunds_list
**crates/router/src/types/api/refunds.rs**
Modify existing code
**crates/router/src/types/storage/refund.rs**
Add:
- function: private::filter_by_constraints
- function: private::get_refunds_count
|
{"pr_number": 7966, "pr_title": "feat(refunds_v2): Add refunds list flow in v2 apis", "merged_at": "2025-05-12T15:29:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "refund"]}, "hierarchy": {"api_models": ["crates/api_models/src/refunds.rs"], "domain": ["crates/hyperswitch_domain_models/Cargo.toml", "crates/hyperswitch_domain_models/src/refunds.rs"], "core_business": ["crates/router/src/core/refunds_v2.rs"], "types": ["crates/router/src/types/api/refunds.rs", "crates/router/src/types/storage/refund.rs"], "config": ["crates/router/Cargo.toml"], "other": ["api-reference-v2/openapi_spec.json", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes/refunds.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/refund.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/refunds.rs"]}, "change_types": {"structs_added": 2, "functions_added": 16, "fields_added": 93, "imports_added": 3, "conditionals_added": 24, "database_queries": 52}, "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
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for https://github.com/juspay/hyperswitch/pull/6725
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/admin.rs`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/payment_intent.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/lib.rs`
**4. Core Business Logic**
- `crates/router/src/core/payment_link.rs`
- `crates/router/src/core/payment_link/payment_link_initiate/payment_link.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 786adf99:
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": 6830, "pr_title": "feat(core): payment links - add support for custom background image and layout in details section", "merged_at": "2024-12-12T18:02:04Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "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"}
|
refactor(connector): [Airwallex] add device_data in payment request
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
- add a extra object `device_data` in payment request for both 3ds and no 3ds Cards for connector Airwallex
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
1. Create Merchant Account
2. Create API KEY
3. Create Airwallex connector
```
curl --location 'http://localhost:8080/account/merchant_1734509905/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "airwallex",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "_",
"key1": "_"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"AmericanExpress",
"Discover",
"Interac",
"JCB",
"Mastercard",
"Visa",
"DinersClub",
"UnionPay",
"RuPay"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"AmericanExpress",
"Discover",
"Interac",
"JCB",
"Mastercard",
"Visa",
"DinersClub",
"UnionPay",
"RuPay"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"city": "NY",
"unit": "245"
},
"connector_webhook_details": {
"merchant_secret": "dce1d767-7c28-429c-b0fe-9e0b9e91f962"
},
"business_country": "US",
"business_label": "food"
}'
```
4. Create a NO 3ds paymeny
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: __' \
--data '{
"amount": 8059,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4035 5010 0000 0008",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Joseph Doe",
"card_cvc": "123"
}
},
"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": 30,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1",
"device_model": "Apple IPHONE 7",
"os_type": "IOS or ANDROID",
"os_version": "IOS 14.5"
}
}'
```
Response
```
{
"payment_id": "pay_fdVhq7TQCaXIIADCLmNp",
"merchant_id": "merchant_1734509905",
"status": "succeeded",
"amount": 8059,
"net_amount": 8059,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 8059,
"connector": "airwallex",
"client_secret": "pay_fdVhq7TQCaXIIADCLmNp_secret_bVeE8hnJsaFiTbzrIqJh",
"created": "2024-12-18T12:37:55.786Z",
"currency": "USD",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0008",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "403550",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "int_hkdm4jkwfh2u604iorv",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "int_hkdm4jkwfh2u604iorv",
"payment_link": null,
"profile_id": "pro_UcNF1OhE6493bLkY3Ctw",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_6hSRrF0fBFgeNyGl73uh",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-18T12:52:55.786Z",
"fingerprint": null,
"browser_info": {
"os_type": "IOS or ANDROID",
"language": "nl-NL",
"time_zone": 30,
"ip_address": "127.0.0.1",
"os_version": "IOS 14.5",
"user_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": "Apple IPHONE 7",
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-18T12:37:57.324Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
5. Create a 3ds payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ___' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://duck.com",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4012000300000088",
"card_exp_month": "03",
"card_exp_year": "2033",
"card_holder_name": "joseph Doe",
"card_cvc": "333"
}
},
"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 (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": 30,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1",
"device_model": "Apple IPHONE 7",
"os_type": "IOS or ANDROID",
"os_version": "IOS 14.5"
}
}'
```
Response
```
{
"payment_id": "pay_IAJhBmLpJ2UdHomxxzwj",
"merchant_id": "merchant_1734509905",
"status": "requires_customer_action",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 6540,
"amount_received": null,
"connector": "airwallex",
"client_secret": "pay_IAJhBmLpJ2UdHomxxzwj_secret_Cy62sS6naxAPIan14QFO",
"created": "2024-12-18T12:39:34.582Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0088",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "401200",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2033",
"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 Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_IAJhBmLpJ2UdHomxxzwj/merchant_1734509905/pay_IAJhBmLpJ2UdHomxxzwj_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1734525574,
"expires": 1734529174,
"secret": "epk_8defd76d604642969d0315edc45eeb35"
},
"manual_retry_allowed": null,
"connector_transaction_id": "int_hkdm4jkwfh2u61r9twl",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "int_hkdm4jkwfh2u61r9twl",
"payment_link": null,
"profile_id": "pro_UcNF1OhE6493bLkY3Ctw",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_6hSRrF0fBFgeNyGl73uh",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-18T12:54:34.582Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-18T12:39:35.926Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Complete payment using redirection link
6. do psync
```
curl --location 'http://localhost:8080/payments/pay_IAJhBmLpJ2UdHomxxzwj?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: _'
```
Response
```
{
"payment_id": "pay_IAJhBmLpJ2UdHomxxzwj",
"merchant_id": "merchant_1734509905",
"status": "succeeded",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6540,
"connector": "airwallex",
"client_secret": "pay_IAJhBmLpJ2UdHomxxzwj_secret_Cy62sS6naxAPIan14QFO",
"created": "2024-12-18T12:39:34.582Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0088",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "401200",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2033",
"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 Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "int_hkdm4jkwfh2u61r9twl",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "int_hkdm4jkwfh2u61r9twl",
"payment_link": null,
"profile_id": "pro_UcNF1OhE6493bLkY3Ctw",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_6hSRrF0fBFgeNyGl73uh",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-18T12:54:34.582Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-18T12:40:09.676Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Connector raw request

## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
- `crates/router/src/connector/trustpay/transformers.rs`
- ... and 2 more files
**4. Type Definitions**
- `crates/common_utils/src/types.rs`
**5. Utils**
- `crates/router/src/routes/payments/helpers.rs`
**6. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (50 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 573974b3:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_utils/src/types.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs**
Add:
- struct: pub::DeviceData
- struct: pub::Browser
- struct: pub::Location
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_os_type
- function: private::get_os_version
- function: private::get_device_model
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/router/src/connector/trustpay/transformers.rs**
Modify existing code
**crates/router/src/routes/payments/helpers.rs**
Modify existing code
**crates/router/tests/connectors/trustpay.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
|
{"pr_number": 6881, "pr_title": "refactor(connector): [Airwallex] add device_data in payment request", "merged_at": "2024-12-22T17:58:07Z", "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_request_types.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/trustpay/transformers.rs", "crates/router/tests/connectors/trustpay.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/common_utils/src/types.rs"], "utils": ["crates/router/src/routes/payments/helpers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"structs_added": 4, "functions_added": 8, "fields_added": 50, "imports_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(xendit): Add Payment 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 -->
Added payment webhooks for Xendit.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Payments Create
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_cNMaN85VYZFs73xmXrkiblB9jjN2UAuXGXl8ugAwC8VryKE7jdoFJ9ZAexezTBCl' \
--data-raw '{
"amount": 6500000,
"currency": "IDR",
"confirm": true,
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "BamboraCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"payment_method": "card",
"payment_method_type": "credit",
"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_data": {
"card": {
"card_number": "5200000000000007",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "John Doe",
"card_cvc": "123"
}
}
}'
```
Payments Retreive
```
{
"payment_id": "pay_CleZXtwMiHopERTzohSV",
"merchant_id": "postman_merchant_GHAction_6621f23d-82d7-435e-81a9-37af6d536693",
"status": "succeeded",
"amount": 6500000,
"net_amount": 6500000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6500000,
"connector": "xendit",
"client_secret": "pay_CleZXtwMiHopERTzohSV_secret_wFk2C6sR0Ezbc91myxNM",
"created": "2025-03-04T07:30:34.565Z",
"currency": "IDR",
"customer_id": "BamboraCustomer",
"customer": {
"id": "BamboraCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": 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": "01",
"card_exp_year": "26",
"card_holder_name": "John Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "pr-c1b44047-5678-4a83-ba98-8448138b5c92",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "fa35a4df-5ba2-4b38-a085-4c2fb60d025d",
"payment_link": null,
"profile_id": "pro_A1vWHpGQ033zy8UiBEi5",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_w3G0ckrb5uz9qhcX4vw4",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-04T07:45:34.565Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-04T07:30:41.110Z",
"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"
}
```
Payment Catpure Success
<img width="988" alt="Screenshot 2025-03-04 at 12 39 50 PM" src="https://github.com/user-attachments/assets/b66c411f-25c0-4d21-b719-67e152788a1e" />
Payments Create (capture_method=manual)
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_cNMaN85VYZFs73xmXrkiblB9jjN2UAuXGXl8ugAwC8VryKE7jdoFJ9ZAexezTBCl' \
--data-raw '{
"amount": 6500000,
"currency": "IDR",
"confirm": true,
"capture_method": "manual",
"authentication_type": "no_three_ds",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "BamboraCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"payment_method": "card",
"payment_method_type": "credit",
"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_data": {
"card": {
"card_number": "5200000000000007",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "John Doe",
"card_cvc": "123"
}
}
}'
```
Payments Retreive
```
{
"payment_id": "pay_i5F9gX0WfXrVYx5sPZBU",
"merchant_id": "postman_merchant_GHAction_6621f23d-82d7-435e-81a9-37af6d536693",
"status": "requires_capture",
"amount": 6500000,
"net_amount": 6500000,
"shipping_cost": null,
"amount_capturable": 6500000,
"amount_received": null,
"connector": "xendit",
"client_secret": "pay_i5F9gX0WfXrVYx5sPZBU_secret_eVqoWHGBaqeBRoEuUT9s",
"created": "2025-03-04T07:10:13.948Z",
"currency": "IDR",
"customer_id": "BamboraCustomer",
"customer": {
"id": "BamboraCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "manual",
"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": "01",
"card_exp_year": "26",
"card_holder_name": "John Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "pr-8bb66c2c-58a5-49cc-a309-32895afef851",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "73a17fc9-9ac0-4276-a409-c0b43df60ff0",
"payment_link": null,
"profile_id": "pro_A1vWHpGQ033zy8UiBEi5",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_w3G0ckrb5uz9qhcX4vw4",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-04T07:25:13.948Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-04T07:10:18.710Z",
"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"
}
```
Payment Authorization Success
<img width="991" alt="Screenshot 2025-03-04 at 12 40 31 PM" src="https://github.com/user-attachments/assets/3e4e1d97-d7d7-4afe-be19-2dfbaeb65ffc" />
Refunds Webhooks not added
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (4 changes)
- Extend existing types with new fields (31 changes)
**Detailed Identifier Changes:**
Commit 6553e29e:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/xendit.rs**
Add:
- function: private::get_webhook_source_verification_signature
- function: private::verify_webhook_source
- function: private::get_webhook_source_verification_message
**crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs**
Add:
- struct: pub::XenditWebhookEvent
- struct: pub::EventDetails
- enum: pub::XenditResponse
- enum: pub::XenditEventType
|
{"pr_number": 7277, "pr_title": "feat(xendit): Add Payment Webhooks ", "merged_at": "2025-03-04T08:57:14Z", "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/xendit.rs", "crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs"]}, "change_types": {"structs_added": 2, "functions_added": 4, "enums_added": 2, "fields_added": 31, "imports_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Add gift card balance check endpoint (v2)
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
- Added `check-gift-card-balance` API
- Added `GiftCardBalanceCheck` flow for connectors and implemented it for Adyen
- Updated PML flow to store gift card enabled MCA in redis
<img width="2314" height="1286" alt="image" src="https://github.com/user-attachments/assets/50087048-1ac5-459f-84ee-d6af7cdbfcae" />
### 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).
-->
This change is required for supporting split payments. SDK will call this endpoint and based on the gift card balance and transaction amount it will either collect Gift card details only or Gift card + another payment method.
Closes #9101
## How did you test 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-Intent Call
2. PML for payments call
3. Request:
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_019937e3515f7462b97fe6f5f6901191/check-gift-card-balance' \
--header 'api-key: dev_vzsdTpwwx2h18nUXDFGPaIJmPifOT7zsX9DkCIA3FZQyJgny7c7MrV6RTdgStgOB' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_qAkCNwFOT6asT6ENbmFn' \
--header 'Authorization: publishable-key=pk_dev_433fd28e6bd24a6bb79527cde2af25e1, client-secret=cs_019937e351c171f19b62d7c44802d53e' \
--data '{
"gift_card_data": {
"givex": {
"number": "6036280000000000000",
"cvc": "123"
}
}
}'
```
Response:
```
{
"payment_id": "12345_pay_019937e3515f7462b97fe6f5f6901191",
"balance": 5000,
"currency": "EUR",
"needs_additional_pm_data": false,
"remaining_amount": 0
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/events/payment.rs`
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types/payments.rs`
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
- ... and 2 more files
**3. Core Business Logic**
- `crates/router/src/core.rs`
- `crates/router/src/core/gift_card.rs`
- `crates/router/src/core/payments/payment_methods.rs`
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyen.rs`
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
- `crates/hyperswitch_connectors/src/default_implementations.rs`
- ... and 1 more files
**5. Type Definitions**
- `crates/hyperswitch_interfaces/src/types.rs`
- `crates/router_env/src/logger/types.rs`
**6. Utils**
- `crates/common_utils/src/id_type/global_id/payment.rs`
- `crates/router/src/routes/lock_utils.rs`
**7. Other**
- `api-reference/docs.json`
- `api-reference/v2/openapi_spec_v2.json`
- `api-reference/v2/payments/payments--gift-card-balance-check.mdx`
- ... and 8 more files
**Code Patterns Applied:**
- Define new data structures (6 changes)
- Implement new functions (18 changes)
- Extend existing types with new fields (77 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 21316596:
Files to modify:
**crates/api_models/src/events/payment.rs**
Add:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for payments::GiftCardBalanceCheckResponse
**crates/api_models/src/payments.rs**
Add:
- struct: pub::GiftCardBalanceCheckResponse
- struct: pub::PaymentsGiftCardBalanceCheckRequest
**crates/common_utils/src/id_type/global_id/payment.rs**
Add:
- function: pub::get_gift_card_connector_key
**crates/hyperswitch_connectors/src/connectors/adyen.rs**
Add:
- function: private::get_headers
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_5xx_error_response
- impl: impl api::PaymentsGiftCardBalanceCheck for Adyen
- impl: impl ConnectorIntegration<
GiftCardBalanceCheck,
GiftCardBalanceCheckRequestData,
GiftCardBalanceCheckResponseData,
> for Adyen
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Add:
- function: private::try_from
- function: private::try_from
- impl: impl TryFrom<&PaymentsGiftCardBalanceCheckRouterData> for AdyenBalanceRequest<'_>
- impl: impl TryFrom<
ResponseRouterData<
GiftCardBalanceCheck,
AdyenBalanceResponse,
GiftCardBalanceCheckRequestData,
GiftCardBalanceCheckResponseData,
>,
> for RouterData<
GiftCardBalanceCheck,
GiftCardBalanceCheckRequestData,
GiftCardBalanceCheckResponseData,
>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Add:
- impl: impl PaymentsGiftCardBalanceCheck for connectors::DummyConnector<T>
- impl: impl ConnectorIntegration<
GiftCardBalanceCheck,
GiftCardBalanceCheckRequestData,
GiftCardBalanceCheckResponseData,
> for connectors::DummyConnector<T>
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Add:
- impl: impl PaymentsGiftCardBalanceCheckV2 for $connector
- impl: impl ConnectorIntegrationV2<
GiftCardBalanceCheck,
GiftCardBalanceCheckFlowData,
GiftCardBalanceCheckRequestData,
GiftCardBalanceCheckResponseData,
> for $connector
**crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs**
Add:
- struct: pub::GiftCardBalanceCheckFlowData
**crates/hyperswitch_domain_models/src/router_flow_types/payments.rs**
Add:
- struct: pub::GiftCardBalanceCheck
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Add:
- struct: pub::GiftCardBalanceCheckRequestData
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Add:
- struct: pub::GiftCardBalanceCheckResponseData
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/payments.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/payments_v2.rs**
Add:
- trait: pub::PaymentsGiftCardBalanceCheckV2
**crates/hyperswitch_interfaces/src/conversion_impls.rs**
Add:
- function: private::from_old_router_data
- function: private::to_old_router_data
- impl: impl RouterDataConversion<T, Req, Resp> for GiftCardBalanceCheckFlowData
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/openapi/src/routes/payments.rs**
Add:
- function: pub::payment_check_gift_card_balance
**crates/router/src/core.rs**
Add:
- mod: pub::gift_card
**crates/router/src/core/gift_card.rs**
Add:
- function: pub::payments_check_gift_card_balance_core
**crates/router/src/core/payments/payment_methods.rs**
Add:
- function: private::store_gift_card_mca_in_redis
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Add:
- function: pub::payment_check_gift_card_balance
**crates/router/src/services/api.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 9102, "pr_title": "feat(router): Add gift card balance check endpoint (v2)", "merged_at": "2025-09-17T07:50:47Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/payment.rs", "crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs", "crates/hyperswitch_domain_models/src/router_flow_types/payments.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs", "crates/hyperswitch_domain_models/src/types.rs"], "core_business": ["crates/router/src/core.rs", "crates/router/src/core/gift_card.rs", "crates/router/src/core/payments/payment_methods.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/adyen.rs", "crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/id_type/global_id/payment.rs", "crates/router/src/routes/lock_utils.rs"], "other": ["api-reference/docs.json", "api-reference/v2/openapi_spec_v2.json", "api-reference/v2/payments/payments--gift-card-balance-check.mdx", "crates/hyperswitch_interfaces/src/api/payments.rs", "crates/hyperswitch_interfaces/src/api/payments_v2.rs", "crates/hyperswitch_interfaces/src/conversion_impls.rs", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes/payments.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs", "crates/router/src/services/api.rs"]}, "change_types": {"structs_added": 6, "functions_added": 18, "fields_added": 77, "imports_added": 12, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payouts): Mapped Default Values to Unified Error Code and Message
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Previously unified error codes and messages were Optional. Hence if nothing is being returned by the connector, it displays as null. Mapped it with the default ones now.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
**For Success Scenarios** - `unified_error_code` and `unified_error_message` should come as null
Step 1 : AdyenPlatform MCA Create - Payouts (correct creds)
cURL :
```
curl --location 'http://localhost:8080/account/merchant_1756906797/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: HS_API_KEY' \
--data '{
"connector_type": "payout_processor",
"connector_name": "adyenplatform",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "ADYEN_API_KEY"
},
"test_mode": true,
"disabled": false,
"connector_webhook_details": {
"merchant_secret": "WEBHOOK_SECRET"
},
"metadata": {
"city": "NY",
"unit": "245",
"source_balance_account": "SOURCE_BALANCE_ACCOUNT"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "bank_transfer",
"payment_method_types": [
{
"payment_method_type": "sepa_bank_transfer",
"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
}
]
}
]
}'
```
Step 2: Customer Create
cURL:
```
curl --location 'http://localhost:8080/customers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_xgNuugja2IMr7oIyZtxoC956b2z8g5FA3pivJbRxGOVlHucD2Nf5CuERBGGT8w52' \
--data-raw '{
"email": "guest@example.com",
"name": "John Doe"
}'
```
Response:
```
{
"customer_id": "cus_KmXSoUNSG4hXwZh81iTu",
"name": "John Doe",
"email": "guest@example.com",
"phone": null,
"phone_country_code": null,
"description": null,
"address": null,
"created_at": "2025-09-03T13:40:23.200Z",
"metadata": null,
"default_payment_method_id": null,
"tax_registration_id": null
}
```
Use this `customer_id` in the Payouts Create Request
Step 3: Payouts Create:
cURL:
```
curl --location 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_xgNuugja2IMr7oIyZtxoC956b2z8g5FA3pivJbRxGOVlHucD2Nf5CuERBGGT8w52' \
--data '{
"amount": 100,
"currency": "USD",
"customer_id": "cus_KmXSoUNSG4hXwZh81iTu",
"connector": [
"adyenplatform"
],
"description": "Its my first payout request",
"payout_type": "card",
"payout_method_data": {
"card": {
"card_number": "4111111111111111",
"expiry_month": "03",
"expiry_year": "2031",
"card_holder_name": "John Doe"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"city": "San Fransico",
"country": "AT",
"first_name": "John",
"last_name": "Doe"
}
},
"recurring": true,
"metadata": {
"ref": "123"
},
"confirm": true,
"auto_fulfill": true
}'
```
Response:
```
{
"payout_id": "payout_G60sugqxS8iNYaeZB6MW",
"merchant_id": "merchant_1756907439",
"merchant_order_reference_id": null,
"amount": 100,
"currency": "USD",
"connector": "adyenplatform",
"payout_type": "card",
"payout_method_data": {
"card": {
"card_issuer": "JP Morgan",
"card_network": "Visa",
"card_type": "CREDIT",
"card_issuing_country": "INDIA",
"bank_code": "JP_JPM",
"last4": "1111",
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2031",
"card_holder_name": "John Doe"
}
},
"billing": {
"address": {
"city": "San Fransico",
"country": "AT",
"line1": "1467",
"line2": "Harrison Street",
"line3": null,
"zip": null,
"state": null,
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"auto_fulfill": true,
"customer_id": "cus_WVab6LEtVX0vdAQnj9OK",
"customer": {
"id": "cus_WVab6LEtVX0vdAQnj9OK",
"name": "John Doe",
"email": "guest@example.com",
"phone": null,
"phone_country_code": null
},
"client_secret": "payout_payout_G60sugqxS8iNYaeZB6MW_secret_4k8nOVj5bkY3xb78u4nv",
"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_QSJdkA08eYZeWH5qPgsL",
"status": "initiated",
"error_message": null,
"error_code": null,
"profile_id": "pro_vXCZfiB18BgJptZa8oPV",
"created": "2025-09-03T13:51:15.708Z",
"connector_transaction_id": "38E96O6874DHYEWT",
"priority": null,
"payout_link": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": null,
"phone_country_code": null,
"unified_code": null,
"unified_message": null,
"payout_method_id": "pm_B3PTwRMsmb7kWdFqvxaS"
}
```
**For Failure Scenarios** - `unified_error_code` and `unified_error_message` should come as as `Something went wrong` and `UE_9000`
Step 1 : AdyenPlatform MCA Create - Payouts (incorrect creds)
cURL :
```
curl --location 'http://localhost:8080/account/merchant_1756906797/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: HS_API_KEY' \
--data '{
"connector_type": "payout_processor",
"connector_name": "adyenplatform",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "ADYEN_API_KEY"
},
"test_mode": true,
"disabled": false,
"connector_webhook_details": {
"merchant_secret": "WEBHOOK_SECRET"
},
"metadata": {
"city": "NY",
"unit": "245",
"source_balance_account": "SOURCE_BALANCE_ACCOUNT"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "bank_transfer",
"payment_method_types": [
{
"payment_method_type": "sepa_bank_transfer",
"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
}
]
}
]
}'
```
Step 2: Customer Create
cURL:
```
curl --location 'http://localhost:8080/customers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: HS_API_KEY' \
--data-raw '{
"email": "guest@example.com",
"name": "John Doe"
}'
```
Response:
```
{
"customer_id": "cus_KmXSoUNSG4hXwZh81iTu",
"name": "John Doe",
"email": "guest@example.com",
"phone": null,
"phone_country_code": null,
"description": null,
"address": null,
"created_at": "2025-09-03T13:40:23.200Z",
"metadata": null,
"default_payment_method_id": null,
"tax_registration_id": null
}
```
Use this `customer_id` in the Payouts Create Request
Step 3: Payouts Create:
cURL:
```
curl --location 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: HS_API_KEY' \
--data '{
"amount": 100,
"currency": "USD",
"customer_id": "cus_KmXSoUNSG4hXwZh81iTu",
"connector": [
"adyenplatform"
],
"description": "Its my first payout request",
"payout_type": "card",
"payout_method_data": {
"card": {
"card_number": "4111111111111111",
"expiry_month": "03",
"expiry_year": "2031",
"card_holder_name": "John Doe"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"city": "San Fransico",
"country": "AT",
"first_name": "John",
"last_name": "Doe"
}
},
"recurring": true,
"metadata": {
"ref": "123"
},
"confirm": true,
"auto_fulfill": true
}'
```
Response:
```
{
"payout_id": "payout_GGTiHgALRVtjqNEnPbx0",
"merchant_id": "merchant_1756907500",
"merchant_order_reference_id": null,
"amount": 100,
"currency": "USD",
"connector": "adyenplatform",
"payout_type": "card",
"payout_method_data": {
"card": {
"card_issuer": "JP Morgan",
"card_network": "Visa",
"card_type": "CREDIT",
"card_issuing_country": "INDIA",
"bank_code": "JP_JPM",
"last4": "1111",
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2031",
"card_holder_name": "John Doe"
}
},
"billing": {
"address": {
"city": "San Fransico",
"country": "AT",
"line1": "1467",
"line2": "Harrison Street",
"line3": null,
"zip": null,
"state": null,
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"auto_fulfill": true,
"customer_id": "cus_qeZLhMUKClclwxfIexLg",
"customer": {
"id": "cus_qeZLhMUKClclwxfIexLg",
"name": "John Doe",
"email": "guest@example.com",
"phone": null,
"phone_country_code": null
},
"client_secret": "payout_payout_GGTiHgALRVtjqNEnPbx0_secret_qWucgev0p3N0L7sZbulg",
"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_z4DU1d4mWEhq3sY4f2md",
"status": "failed",
"error_message": "Unauthorized",
"error_code": "00_401",
"profile_id": "pro_JmTQPA5YxhJEXTvaqp9U",
"created": "2025-09-03T13:52:07.309Z",
"connector_transaction_id": null,
"priority": null,
"payout_link": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": null,
"phone_country_code": null,
"unified_code": "UE_9000",
"unified_message": "Something went wrong",
"payout_method_id": null
}
```
Note: We deliberately passed wrong creds so that we donot get a error message and the default values can be returned.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payouts.rs`
**Detailed Identifier Changes:**
Commit 4ab54f3c:
Files to modify:
**crates/router/src/core/payouts.rs**
Modify existing code
|
{"pr_number": 9262, "pr_title": "feat(payouts): Mapped Default Values to Unified Error Code and Message", "merged_at": "2025-09-03T15:49:59Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payouts.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor: add infra-values in intent kafka events
## 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 -->
Main PR - https://github.com/juspay/hyperswitch/pull/8264
add infra-values in intent kafka events
cluster populating in payment_intent kafka event
<img width="1327" alt="image" src="https://github.com/user-attachments/assets/f1a57f86-b657-4eec-a0e4-d2eee6d29e78" />
Ran clippy locally
<img width="1056" alt="image" src="https://github.com/user-attachments/assets/3e1f3667-c57b-4125-977b-0251158933d9" />
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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. Type Definitions**
- `crates/common_utils/src/types/keymanager.rs`
- `crates/router/src/types/domain/types.rs`
**2. Other**
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/services/kafka.rs`
- `crates/router/src/services/kafka/payment_intent.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Implement new functions (4 changes)
- Extend existing types with new fields (7 changes)
**Detailed Identifier Changes:**
Commit b68525d8:
Files to modify:
**crates/common_utils/src/types/keymanager.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/services/kafka.rs**
Modify existing code
**crates/router/src/services/kafka/payment_intent.rs**
Modify existing code
**crates/router/src/services/kafka/payment_intent_event.rs**
Modify existing code
**crates/router/src/types/domain/types.rs**
Modify existing code
|
{"pr_number": 8267, "pr_title": "refactor: add infra-values in intent kafka events", "merged_at": "2025-06-06T07:17:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"types": ["crates/common_utils/src/types/keymanager.rs", "crates/router/src/types/domain/types.rs"], "other": ["crates/router/src/db/kafka_store.rs", "crates/router/src/services/kafka.rs", "crates/router/src/services/kafka/payment_intent.rs", "crates/router/src/services/kafka/payment_intent_event.rs"]}, "change_types": {"functions_added": 4, "fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): card network for co-badged card and update regex
## 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 -->
- Regex for matching card network is updated to keep it in consistency with the frontend
- fix bug for card network where even if it is a co-badged card, it takes card network from the card api
Note: This is a pr against https://github.com/juspay/hyperswitch/pull/6801
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested through Postman:
- Create an MCA (Checkout)
- Create a payment with co-badged card
```
{
"amount": 1043,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4010061700000021",
"card_exp_month": "01",
"card_exp_year": "99",
"card_holder_name": "joseph Doe",
"card_cvc": "123",
"card_network": "CartesBancaires"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}
```
- In the response, the card_network should be present i.e. `CartesBancaires` and should match
- The response should look like following
```
{
"payment_id": "pay_wvcJQRPQKOvHjvzqFJix",
"merchant_id": "merchant_1733907987",
"status": "processing",
"amount": 1043,
"net_amount": 1043,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "checkout",
"client_secret": "pay_wvcJQRPQKOvHjvzqFJix_secret_SukmA54t9oep9K1KxSrc",
"created": "2024-12-11T09:52:28.477Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0021",
"card_type": null,
"card_network": "CartesBancaires",
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "401006",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "99",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1733910748,
"expires": 1733914348,
"secret": "epk_49d031a3596d4fadb79e7cdb7c58559d"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pay_ymjd6m5acujebkctxn4hteaswa",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_wvcJQRPQKOvHjvzqFJix_1",
"payment_link": null,
"profile_id": "pro_jkvQLXzyFlM6p3KyuUEY",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_wz0gCKtDv37owvc8fp6L",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-11T10:07:28.477Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-11T09:52:29.142Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/helpers.rs`
**2. Other**
- `crates/cards/src/validate.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit e520d054:
Files to modify:
**crates/cards/src/validate.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
|
{"pr_number": 6804, "pr_title": "fix(router): card network for co-badged card and update regex", "merged_at": "2024-12-11T13:01:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/helpers.rs"], "other": ["crates/cards/src/validate.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(authentication): added profile acquirer create module
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] New feature
## Description
<!-- Describe your changes in detail -->
added merchant acquirer create and list module
### Additional Changes
- [ ] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
Add new field merchant_acquirer_ids in business_profile
This pull request introduces support for managing acquirer configurations and profile acquirer entities, including updates to the OpenAPI specification, the Rust codebase, and database schema. The changes enable the creation, storage, and retrieval of acquirer configuration data and profile acquirer entities, which are essential for linking merchant profiles to acquirer accounts.
### API Enhancements:
* Added a new endpoint `/profile_acquirers` for creating profile acquirers in `api-reference/openapi_spec.json`. Includes request and response schemas (`ProfileAcquirerCreate` and `ProfileAcquirerResponse`). [[1]](diffhunk://#diff-120d5ba664a56f45b6d881ccac78000f991d22e2909b5e45c83602c7dfab27cdR5960-R5999) [[2]](diffhunk://#diff-120d5ba664a56f45b6d881ccac78000f991d22e2909b5e45c83602c7dfab27cdR25396-R25513)
* Defined schemas for `AcquirerConfig` and `AcquirerConfigMap` to describe acquirer configurations. [[1]](diffhunk://#diff-120d5ba664a56f45b6d881ccac78000f991d22e2909b5e45c83602c7dfab27cdR6350-R6406) [[2]](diffhunk://#diff-120d5ba664a56f45b6d881ccac78000f991d22e2909b5e45c83602c7dfab27cdR26036-R26043)
### Rust Codebase Updates:
* Introduced `ProfileAcquirerCreate` and `ProfileAcquirerResponse` structs in the new `crates/api_models/src/profile_acquirer.rs` file for handling profile acquirer data.
* Added `AcquirerConfig` and `AcquirerConfigMap` structs in `crates/common_types/src/domain.rs` to represent acquirer configuration data.
* Implemented `ProfileAcquirerId` type in `crates/common_utils/src/id_type/profile_acquirer.rs` for unique identification of profile acquirers.
### Database Schema Changes:
* Updated `business_profile` table to include a new column `acquirer_config_map` for storing acquirer configuration data in JSON format. [[1]](diffhunk://#diff-b3de56db64ac930fe24b6b0acb45282191598a506d20732f70ef00192b4b18d5R231) [[2]](diffhunk://#diff-22fdeee3005db31c44a9d40cd43c5a244e77a74e17d2e227d4c0b376f133f37eR226)
* Modified `Profile` and `ProfileUpdateInternal` structs in `crates/diesel_models/src/business_profile.rs` to include `acquirer_config_map`. [[1]](diffhunk://#diff-9580ab8a5056970f087fa2af0a8de98dae6bf038ade612e3c996b88b23ae6e11R77) [[2]](diffhunk://#diff-9580ab8a5056970f087fa2af0a8de98dae6bf038ade612e3c996b88b23ae6e11R187) [[3]](diffhunk://#diff-9580ab8a5056970f087fa2af0a8de98dae6bf038ade612e3c996b88b23ae6e11R239)
### Event and Utility Enhancements:
* Added `ProfileAcquirer` as a new event type in `crates/common_utils/src/events.rs`.
* Implemented utility functions for generating and handling `ProfileAcquirerId`. [[1]](diffhunk://#diff-9bbc934a55fcf5282e0b0ba208a3722e9691ee71709d15a5c0d0958759280fa0R256-R262) [[2]](diffhunk://#diff-42f2c04d1e7d6eaf0534968a602f64eb00017fc3799f3426816fd59abae0145cR1-R41)
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Currently we donot have a table to store merchant acquirer information, have build an api to insert data for merchant acquirer into business profile table
## How did you test 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 account
Once done create merchant_acquirer
Request
```shell
curl --location 'localhost:8080/profile_acquirer' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_rDKEInoZiJlNIfJPYNuqBMC2EOJjegGylLbzRMDw6kmSxV0FztdYfLcSoWZD6ZsT' \
--data '{
"acquirer_assigned_merchant_id": "ACQ1xwjnd23456",
"merchant_name": "Demo Merchant",
"merchant_country_code": "IN",
"network": "Visa",
"acquirer_bin": "400000",
"acquirer_ica": "ICA98765",
"acquirer_fraud_rate": 0.02,
"profile_id": "pro_AFTXNDSW2mZadl5tEmqd"
}'
```
Response:
```shell
{
"profile_acquirer_id": "pro_acq_ZlIC3dqlERLvrvLfXCUX",
"acquirer_assigned_merchant_id": "ACQ1xwjnd23456",
"merchant_name": "Demo Merchant",
"merchant_country_code": "IN",
"network": "Visa",
"acquirer_bin": "400000",
"acquirer_ica": "ICA98765",
"acquirer_fraud_rate": 0.02,
"profile_id": "pro_B9IE9uHjgRVKXHp9MSqG",
"created_at": "2025-05-27T11:43:15.477Z"
}
```
try hitting the api with same sample set
Response:shell
```
{
"error": {
"type": "invalid_request",
"message": "Profile acquirer configuration with id pro_acq_vhDNwqBvqM6BqbCZ8FJa already exists.",
"code": "IR_38"
}
}
```
Business profile schema details
```shell
Table "public.business_profile"
Column | Type | Collation | Nullable | Default
-------------------------------------------------------+-----------------------------+-----------+----------+-------------------------
profile_id | character varying(64) | | not null |
merchant_id | character varying(64) | | not null |
profile_name | character varying(64) | | not null |
created_at | timestamp without time zone | | not null |
modified_at | timestamp without time zone | | not null |
return_url | text | | |
enable_payment_response_hash | boolean | | not null | true
payment_response_hash_key | character varying(255) | | | NULL::character varying
redirect_to_merchant_with_http_post | boolean | | not null | false
webhook_details | json | | |
metadata | json | | |
routing_algorithm | json | | |
intent_fulfillment_time | bigint | | |
frm_routing_algorithm | jsonb | | |
payout_routing_algorithm | jsonb | | |
is_recon_enabled | boolean | | not null | false
applepay_verified_domains | text[] | | |
payment_link_config | jsonb | | |
session_expiry | bigint | | |
authentication_connector_details | jsonb | | |
payout_link_config | jsonb | | |
is_extended_card_info_enabled | boolean | | | false
extended_card_info_config | jsonb | | |
is_connector_agnostic_mit_enabled | boolean | | | false
use_billing_as_payment_method_billing | boolean | | | true
collect_shipping_details_from_wallet_connector | boolean | | | false
collect_billing_details_from_wallet_connector | boolean | | | false
outgoing_webhook_custom_http_headers | bytea | | |
always_collect_billing_details_from_wallet_connector | boolean | | | false
always_collect_shipping_details_from_wallet_connector | boolean | | | false
tax_connector_id | character varying(64) | | |
is_tax_connector_enabled | boolean | | |
version | "ApiVersion" | | not null | 'v1'::"ApiVersion"
dynamic_routing_algorithm | json | | |
is_network_tokenization_enabled | boolean | | not null | false
is_auto_retries_enabled | boolean | | |
max_auto_retries_enabled | smallint | | |
always_request_extended_authorization | boolean | | |
is_click_to_pay_enabled | boolean | | not null | false
authentication_product_ids | jsonb | | |
card_testing_guard_config | jsonb | | |
card_testing_secret_key | bytea | | |
is_clear_pan_retries_enabled | boolean | | not null | false
force_3ds_challenge | boolean | | | false
is_debit_routing_enabled | boolean | | not null | false
merchant_business_country | "CountryAlpha2" | | |
id | character varying(64) | | |
is_iframe_redirection_enabled | boolean | | |
is_pre_network_tokenization_enabled | boolean | | |
three_ds_decision_rule_algorithm | jsonb | | |
acquirer_config_map | jsonb | | |
Indexes:
"business_profile_pkey" PRIMARY KEY, btree (profile_id)
```
List profile acquirer account -- do business profile retrieve
```shell
curl --location 'localhost:8080/account/sahkal/business_profile/pro_RUyg7qT8yMzgfQpTqqm8' \
--header 'api-key: dev_dzO6ovCaZazaULNtb0AJxDIfCX67yQUQGYP190ZKX8KCd9WYoFhFIFRxVB8B5w6Q'
```
Response
```shell
{
"merchant_id": "sahkal",
"profile_id": "pro_RUyg7qT8yMzgfQpTqqm8",
"profile_name": "US_default",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "U9qcRdTlSXQc4cnsaEXMEpuiPVgw4RmekxfLjNznZjUt83u2tav6e6XYIdFZA9dw",
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": null,
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"metadata": null,
"routing_algorithm": null,
"intent_fulfillment_time": 900,
"frm_routing_algorithm": null,
"payout_routing_algorithm": null,
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"extended_card_info_config": null,
"collect_shipping_details_from_wallet_connector": false,
"collect_billing_details_from_wallet_connector": false,
"always_collect_shipping_details_from_wallet_connector": false,
"always_collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": false,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null,
"tax_connector_id": null,
"is_tax_connector_enabled": false,
"is_network_tokenization_enabled": false,
"is_auto_retries_enabled": false,
"max_auto_retries_enabled": null,
"always_request_extended_authorization": null,
"is_click_to_pay_enabled": false,
"authentication_product_ids": null,
"card_testing_guard_config": {
"card_ip_blocking_status": "disabled",
"card_ip_blocking_threshold": 3,
"guest_user_card_blocking_status": "disabled",
"guest_user_card_blocking_threshold": 10,
"customer_id_blocking_status": "disabled",
"customer_id_blocking_threshold": 5,
"card_testing_guard_expiry": 3600
},
"is_clear_pan_retries_enabled": false,
"force_3ds_challenge": false,
"is_debit_routing_enabled": false,
"merchant_business_country": null,
"is_pre_network_tokenization_enabled": false,
"acquirer_configs": {
"pro_acq_jkn6Di8kIqBVrmICSEYU": {
"acquirer_assigned_merchant_id": "fqwcqsqqwacccwwwec",
"merchant_name": "Demo Merchant",
"merchant_country_code": "US",
"network": "Visa",
"acquirer_bin": "400000",
"acquirer_ica": null,
"acquirer_fraud_rate": 0.06
},
"pro_acq_bbNCgQibI8K1Xr6Cv3fu": {
"acquirer_assigned_merchant_id": "fqwcqsqqwacdqwdwqdccwwwec",
"merchant_name": "Demo Merchant",
"merchant_country_code": "US",
"network": "Visa",
"acquirer_bin": "400000",
"acquirer_ica": null,
"acquirer_fraud_rate": 0.06
}
}
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added a new API endpoint to create Profile Acquirers linked to business profiles.
- Enabled profiles to store multiple acquirer configurations with detailed attributes like merchant ID, country code, network, BIN, ICA, and fraud rate.
- **Database**
- Introduced a new JSONB column to store acquirer configuration maps within business profiles.
- **API Documentation**
- Updated OpenAPI specs to document new Profile Acquirer endpoints and related schemas.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/admin.rs`
- `crates/api_models/src/lib.rs`
- `crates/api_models/src/profile_acquirer.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
**4. Core Business Logic**
- `crates/router/src/core.rs`
- `crates/router/src/core/payouts.rs`
- `crates/router/src/core/profile_acquirer.rs`
- ... and 1 more files
**5. Type Definitions**
- `crates/common_types/src/domain.rs`
- `crates/router/src/types/api/admin.rs`
- `crates/router_env/src/logger/types.rs`
**6. Utils**
- `crates/common_utils/src/events.rs`
- `crates/common_utils/src/id_type.rs`
- `crates/common_utils/src/id_type/profile_acquirer.rs`
- ... and 2 more files
**7. Configuration Files**
- `migrations/2025-06-05-122346_add-acquirer-config-in-business-profile/down.sql`
- `migrations/2025-06-05-122346_add-acquirer-config-in-business-profile/up.sql`
**8. Other**
- `api-reference/openapi_spec.json`
- `crates/openapi/src/openapi.rs`
- `crates/openapi/src/routes.rs`
- ... and 8 more files
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (118 changes)
**Detailed Identifier Changes:**
Commit f54d785e:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/lib.rs**
Add:
- mod: pub::profile_acquirer
**crates/api_models/src/profile_acquirer.rs**
Add:
- struct: pub::ProfileAcquirerCreate
- struct: pub::ProfileAcquirerResponse
- impl: impl common_utils::events::ApiEventMetric for ProfileAcquirerCreate
- impl: impl common_utils::events::ApiEventMetric for ProfileAcquirerResponse
**crates/common_types/src/domain.rs**
Add:
- struct: pub::AcquirerConfig
- struct: pub::AcquirerConfigMap
**crates/common_utils/src/events.rs**
Modify existing code
**crates/common_utils/src/id_type.rs**
Add:
- mod: private::profile_acquirer
**crates/common_utils/src/id_type/profile_acquirer.rs**
Add:
- function: private::get_api_event_type
- function: private::from_str
- function: private::from
- impl: impl crate::events::ApiEventMetric for ProfileAcquirerId
- impl: impl FromStr for ProfileAcquirerId
- impl: impl From<ProfileAcquirerId> for router_env::opentelemetry::Value
**crates/common_utils/src/lib.rs**
Add:
- function: pub::generate_profile_acquirer_id_of_default_length
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/routes.rs**
Add:
- mod: pub::profile_acquirer
**crates/openapi/src/routes/profile_acquirer.rs**
Add:
- function: pub::profile_acquirer_create
**crates/router/src/core.rs**
Add:
- mod: pub::profile_acquirer
**crates/router/src/core/payouts.rs**
Modify existing code
**crates/router/src/core/profile_acquirer.rs**
Add:
- function: pub::create_profile_acquirer
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes.rs**
Add:
- mod: pub::profile_acquirer
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- struct: pub::ProfileAcquirer
- impl: impl ProfileAcquirer
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/profile_acquirer.rs**
Add:
- function: pub::create_profile_acquirer
**crates/router/src/types/api/admin.rs**
Modify existing code
**crates/router/src/workflows/attach_payout_account_workflow.rs**
Modify existing code
**crates/router/src/workflows/outgoing_webhook_retry.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 8155, "pr_title": "feat(authentication): added profile acquirer create module", "merged_at": "2025-06-11T13:53:52Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs", "crates/api_models/src/lib.rs", "crates/api_models/src/profile_acquirer.rs"], "database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs"], "core_business": ["crates/router/src/core.rs", "crates/router/src/core/payouts.rs", "crates/router/src/core/profile_acquirer.rs", "crates/router/src/core/webhooks/incoming.rs"], "types": ["crates/common_types/src/domain.rs", "crates/router/src/types/api/admin.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/events.rs", "crates/common_utils/src/id_type.rs", "crates/common_utils/src/id_type/profile_acquirer.rs", "crates/common_utils/src/lib.rs", "crates/router/src/routes/lock_utils.rs"], "config": ["migrations/2025-06-05-122346_add-acquirer-config-in-business-profile/down.sql", "migrations/2025-06-05-122346_add-acquirer-config-in-business-profile/up.sql"], "other": ["api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/routes.rs", "crates/openapi/src/routes/profile_acquirer.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/lib.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/profile_acquirer.rs", "crates/router/src/workflows/attach_payout_account_workflow.rs", "crates/router/src/workflows/outgoing_webhook_retry.rs"]}, "change_types": {"structs_added": 5, "functions_added": 8, "fields_added": 118, "imports_added": 17}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Adds Billing Connector Invoice Sync flow in Revenue Recovery
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR adds billing connector invoice sync flow to revenue recovery. This is used to fetch invoice details from billing connectors. There is some invoice related information which are needed for revenue recovery system but our current flow is not enough for it. This PR just adds BIllingConnectorInvoiceSync Flow to RevenueRecovery.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
For Revenue Recovery Transaction Monitoring : In case of Recurly a billing connector, we need details such as retry_count which we wont get this through BillingConnectorPaymentSyncCall or webhook. To accommodate such things we need Invoice sync flow.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
No testing needed since this is just a definition of flow
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs`
- `crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs`
- ... and 2 more files
**2. Core Business Logic**
- `crates/router/src/core/payments/flows.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/default_implementations.rs`
- `crates/hyperswitch_connectors/src/default_implementations_v2.rs`
**4. Type Definitions**
- `crates/hyperswitch_interfaces/src/types.rs`
- `crates/router/src/types.rs`
- `crates/router/src/types/api.rs`
**5. Other**
- `crates/hyperswitch_interfaces/src/api/revenue_recovery.rs`
- `crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs`
- `crates/router/src/services/api.rs`
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Extend existing types with new fields (8 changes)
**Detailed Identifier Changes:**
Commit 3d0dd5bd:
Files to modify:
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Add:
- impl: impl BillingConnectorInvoiceSyncIntegrationV2 for $connector
- impl: impl ConnectorIntegrationV2<
BillingConnectorInvoiceSync,
BillingConnectorInvoiceSyncFlowData,
BillingConnectorInvoiceSyncRequest,
BillingConnectorInvoiceSyncResponse,
> for $connector
**crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs**
Add:
- struct: pub::BillingConnectorInvoiceSyncFlowData
**crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs**
Add:
- struct: pub::BillingConnectorInvoiceSync
**crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs**
Add:
- struct: pub::BillingConnectorInvoiceSyncRequest
**crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs**
Add:
- struct: pub::BillingConnectorInvoiceSyncResponse
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/revenue_recovery.rs**
Add:
- trait: private::BillingConnectorInvoiceSyncIntegration
**crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs**
Add:
- trait: private::BillingConnectorInvoiceSyncIntegrationV2
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Add:
- impl: impl api::BillingConnectorInvoiceSyncIntegration for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
BillingConnectorInvoiceSync,
types::BillingConnectorInvoiceSyncRequest,
types::BillingConnectorInvoiceSyncResponse,
> for connector::DummyConnector<T>
**crates/router/src/services/api.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
|
{"pr_number": 7799, "pr_title": "feat(core): Adds Billing Connector Invoice Sync flow in Revenue Recovery", "merged_at": "2025-04-29T07:26:23Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "connector", "webhook"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs", "crates/hyperswitch_domain_models/src/router_flow_types/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/types.rs"], "core_business": ["crates/router/src/core/payments/flows.rs"], "connectors": ["crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs", "crates/router/src/types.rs", "crates/router/src/types/api.rs"], "other": ["crates/hyperswitch_interfaces/src/api/revenue_recovery.rs", "crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs", "crates/router/src/services/api.rs"]}, "change_types": {"structs_added": 4, "fields_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(core): introduce new field `cardFundingSource` to `GooglePayPaymentMethodData`
## 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 -->
google recently [introduced](https://developers.google.com/pay/api/web/reference/response-objects#CardInfo) new field called `cardFundingSource`. It is an upcoming gpay api change
it takes an enum:
- `UNKNOWN`
- `CREDIT`
- `DEBIT`
- `PREPAID`
google has mentioned it on their api reference that this info will be `none` on production until q4 of 2025.
### 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).
-->
this new information will enable us to implement more sophisticated business logic such as routing, analytics, fraud management etc, tailored to different card types.
closes https://github.com/juspay/hyperswitch/issues/9570
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
```bash
curl --location 'http://localhost:8080/payments/pay_P9LfwQUR2raIVIvvY1pb/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_uDP0kqyLTXnlN5jYassJphQYXWAJEywH4BSkKQXtJoOYLCs71FGNCifuORqq9w2q' \
--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\":\"MEUCIAT1vH7oE0bc1FR..."
},
"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_P9LfwQUR2raIVIvvY1pb",
"merchant_id": "postman_merchant_GHAction_1758879946",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "cybersource",
"client_secret": "pay_P9LfwQUR2raIVIvvY1pb_secret_NWAWTxJGdQ0z1OAj5wAZ",
"created": "2025-09-26T09:45:52.604Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "likhin.bopanna@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"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",
"origin_zip": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "likhin.bopanna@gmail.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://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": "cybersource_US_default_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": "7588799552276876103812",
"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_P9LfwQUR2raIVIvvY1pb_1",
"payment_link": null,
"profile_id": "pro_QHOqYvAjzpmM3wQpjd2E",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_N8JtdITxcIuQ0D1tM1Uh",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-26T10:00:52.604Z",
"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": "016153570198200",
"payment_method_status": null,
"updated": "2025-09-26T09:45:56.234Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
nuvei:
```bash
{
"amount": 1,
"currency": "EUR",
"confirm": true,
"customer_id": "nithxxinn",
"return_url": "https://www.google.com",
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_type": "google_pay",
"authentication_type": "no_three_ds",
"description": "hellow world",
"billing": {
"address": {
"zip": "560095",
"country": "UA",
"first_name": "Sakil",
"last_name": "Mostak",
"line1": "Fasdf",
"line2": "Fasdf",
"city": "Fasdf"
},
"email": "nithin@test.com"
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},
"email": "hello@gmail.com",
"payment_method_data": {
"wallet": {
"google_pay": {
"description": "SG Visa Success: Visa •••• 1390",
"info": {
"assurance_details": {
"account_verified": true,
"card_holder_authenticated": false
},
"card_details": "1390",
"card_funding_source": "CREDIT",
"card_network": "VISA"
},
"tokenization_data": {
"token": "{...}",
"type": "PAYMENT_GATEWAY"
},
"type": "CARD"
}
}
}
}
```
```json
{
"payment_id": "pay_BHX5HsGxx8GWTqhtxv55",
"merchant_id": "merchant_1758885759",
"status": "succeeded",
"amount": 1,
"net_amount": 1,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1,
"connector": "nuvei",
"client_secret": "pay_BHX5HsGxx8GWTqhtxv55_secret_9ZgxOEN1NokJgukDDUKe",
"created": "2025-09-26T11:24:42.509Z",
"currency": "EUR",
"customer_id": "nithxxinn",
"customer": {
"id": "nithxxinn",
"name": null,
"email": "hello@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": "hellow world",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"google_pay": {
"last4": "1390",
"card_network": "VISA",
"type": "CARD"
}
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Fasdf",
"country": "UA",
"line1": "Fasdf",
"line2": "Fasdf",
"line3": null,
"zip": "560095",
"state": null,
"first_name": "Sakil",
"last_name": "Mostak",
"origin_zip": null
},
"phone": null,
"email": "nithin@test.com"
},
"order_details": null,
"email": "hello@gmail.com",
"name": null,
"phone": null,
"return_url": "https://www.google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "google_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "nithxxinn",
"created_at": 1758885882,
"expires": 1758889482,
"secret": "epk_31a09b5d224f4aea8bf6a114c6b7acd9"
},
"manual_retry_allowed": null,
"connector_transaction_id": "7110000000017459005",
"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": "9201058111",
"payment_link": null,
"profile_id": "pro_IOIVxznj4AqQbMy44z1p",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_MDGr4n22wQXL1OQXay79",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-26T11:39:42.509Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": "483297487231504",
"payment_method_status": null,
"updated": "2025-09-26T11:24:44.551Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": 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
}
```
<img width="1188" height="405" alt="image" src="https://github.com/user-attachments/assets/854b7c02-1125-4d4b-9d08-1b46153d8ab8" />
after unmasking, this data is being sent to the connector:
<img width="683" height="64" alt="image" src="https://github.com/user-attachments/assets/f3744dda-75b0-4aa5-a66a-b5185965c4ca" />
## 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
<!-- @coderabbitai ignore -->
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
- `crates/router/tests/connectors/payu.rs`
- ... and 1 more files
**4. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/common_enums/src/enums.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (9 changes)
**Detailed Identifier Changes:**
Commit daad946e:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::GooglePayCardFundingSource
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Remove:
- struct: pub::GooglePayPaymentMethodInfo
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/tests/connectors/payu.rs**
Modify existing code
**crates/router/tests/connectors/worldpay.rs**
Modify existing code
|
{"pr_number": 9571, "pr_title": "refactor(core): introduce new field `cardFundingSource` to `GooglePayPaymentMethodData`", "merged_at": "2025-10-01T09:57:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/payment_method_data.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/tests/connectors/payu.rs", "crates/router/tests/connectors/worldpay.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"enums_added": 1, "fields_added": 9, "imports_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): Handle Sequential Automatic case in MIT payments
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Handle Missing Sequential Automatic case for Paybox MIT
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
## How did you test it?
**CIT Payments**
```
Request
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_kHPzYM5Uswd1YML6yqjBYuZgFJaRFnAeTv40MYW8WQMZ9gxAeCEBkSnHYpV3sdcv' \
--data-raw '{
"amount":4501,
"currency": "EUR",
"confirm": true,
"capture_method": "sequential_automatic",
"email":"malay.awasthi@gmail.com",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"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_mit",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"setup_future_usage": "off_session"
}'
Response
{
"payment_id": "pay_D2ENFkStYUgugx0Q9NW2",
"merchant_id": "postman_merchant_GHAction_1884421b-a074-44dc-924d-bc781cdbdd54",
"status": "succeeded",
"amount": 4501,
"net_amount": 4501,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 4501,
"connector": "paybox",
"client_secret": "pay_D2ENFkStYUgugx0Q9NW2_secret_8i8Z2z18FRRo840ImOtR",
"created": "2024-12-13T07:17:33.311Z",
"currency": "EUR",
"customer_id": "test_mit",
"customer": {
"id": "test_mit",
"name": null,
"email": "malay.awasthi@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "sequential_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": "01",
"card_exp_year": "26",
"card_holder_name": "John T",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_EktIgFXmeOAPrmcj9wXQ",
"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": "malay.awasthi@gmail.com",
"name": null,
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": 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": "test_mit",
"created_at": 1734074253,
"expires": 1734077853,
"secret": "epk_60cc1d953798429a956ae369531e0d28"
},
"manual_retry_allowed": false,
"connector_transaction_id": "0080323748",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_2WtFSPeeLofbFL53TWqQ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_dKNEXIRHiiqcvbrnp0Ov",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-13T07:32:33.311Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_AJMluoicgaqijRnjgIzF",
"payment_method_status": "active",
"updated": "2024-12-13T07:17:35.747Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "SM@LpCp@L@C"
}
```
**MIT Payment with CaptureMethod: sequential_automatic**
```
Request
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_kHPzYM5Uswd1YML6yqjBYuZgFJaRFnAeTv40MYW8WQMZ9gxAeCEBkSnHYpV3sdcv' \
--data-raw '{"amount": 7100,
"currency": "EUR",
"confirm": true,
"customer_id": "test_mit",
"capture_method":"sequential_automatic",
"return_url": "https://google.com",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_AJMluoicgaqijRnjgIzF"
},
"off_session": true,
"payment_method":"card",
"billing": {
"address": {
"first_name":"John",
"last_name":"Doe",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email":"xyz@gmail.com"
}
}'
Response
{
"payment_id": "pay_GNFxctJ9uUJpVMw7pMS8",
"merchant_id": "postman_merchant_GHAction_1884421b-a074-44dc-924d-bc781cdbdd54",
"status": "succeeded",
"amount": 7100,
"net_amount": 7100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 7100,
"connector": "paybox",
"client_secret": "pay_GNFxctJ9uUJpVMw7pMS8_secret_TUY8vVAHyJtqHHt9h0Tu",
"created": "2024-12-13T07:17:45.709Z",
"currency": "EUR",
"customer_id": "test_mit",
"customer": {
"id": "test_mit",
"name": null,
"email": "malay.awasthi@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": "sequential_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": "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": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "xyz@gmail.com"
},
"order_details": null,
"email": "malay.awasthi@gmail.com",
"name": null,
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": 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": "test_mit",
"created_at": 1734074265,
"expires": 1734077865,
"secret": "epk_3ba90473fec549a0ba30a2b4823f5118"
},
"manual_retry_allowed": false,
"connector_transaction_id": "0080323750",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_2WtFSPeeLofbFL53TWqQ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_dKNEXIRHiiqcvbrnp0Ov",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-13T07:32:45.709Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_AJMluoicgaqijRnjgIzF",
"payment_method_status": "active",
"updated": "2024-12-13T07:17:46.985Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "******"
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs`
**Detailed Identifier Changes:**
Commit e4c7ab8e:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs**
Modify existing code
|
{"pr_number": 6833, "pr_title": "fix(connector): Handle Sequential Automatic case in MIT payments", "merged_at": "2025-03-18T13:06:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat: Add open API reference for Intelligent router
## 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 -->
Open API reference for Intelligent router
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<img width="1728" alt="image" src="https://github.com/user-attachments/assets/7df6c90a-a125-4dfb-aa36-6072881ecc23" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Configuration Files**
- `api-reference/hyperswitch_intelligent_router_open_api_spec.yml`
**2. Other**
- `api-reference/intelligent-router-api-reference/elimination/fetch-eliminated-processor-list.mdx`
- `api-reference/intelligent-router-api-reference/elimination/invalidate-elimination-bucket.mdx`
- `api-reference/intelligent-router-api-reference/elimination/update-elimination-bucket.mdx`
- ... and 6 more files
**Code Patterns Applied:**
- Extend existing types with new fields (486 changes)
|
{"pr_number": 7727, "pr_title": "feat: Add open API reference for Intelligent router", "merged_at": "2025-04-08T09:39:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"config": ["api-reference/hyperswitch_intelligent_router_open_api_spec.yml"], "other": ["api-reference/intelligent-router-api-reference/elimination/fetch-eliminated-processor-list.mdx", "api-reference/intelligent-router-api-reference/elimination/invalidate-elimination-bucket.mdx", "api-reference/intelligent-router-api-reference/elimination/update-elimination-bucket.mdx", "api-reference/intelligent-router-api-reference/overview.mdx", "api-reference/intelligent-router-api-reference/success-rate/fetch-entity-and-global-success-rates.mdx", "api-reference/intelligent-router-api-reference/success-rate/fetch-success-rate-for-an-entity.mdx", "api-reference/intelligent-router-api-reference/success-rate/invalidate-windows.mdx", "api-reference/intelligent-router-api-reference/success-rate/update-success-rate-window.mdx", "api-reference/mint.json"]}, "change_types": {"fields_added": 486}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(email): Add SMTP support to allow mails through self hosted/custom SMTP server
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [X] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Add SMTP support to allow mails through self-hosted/custom SMTP server
#5156
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Hyperswitch currently supports only AWS SES to send emails, other open users who want to use some custom SMTP server will have no way to configure it. With this implementation users can change below config to use their own SMTP server.
```
[email]
active_email_client = "SMTP"
[email.smtp]
host = "127.0.0.1"
port = 1025
timeout = 10
connection = "plaintext" #currently plaintext and starttls are supported
```
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Setup mailhog to test emails locally
```docker run -p 1025:1025 -p 8025:8025 mailhog/mailhog```
1. Check if is possible to disable email with the env config
```
[email]
active_email_client = "NO_EMAIL_CLIENT"
```
Start the server with `cargo r` and there should be no error
2. Check the SMTP server without authentication and No TLS with the above configs
Start the server with `cargo r`, and there should be no error
Start the dashboard and change the below config
```
[user]
base_url = "http://localhost:9000"
```
- Check if signup email is sent correctly
- Check if reset password email is sent correctly: Profile -> Reset Password
- Check if Forgot password email is sent correctly
- Check if magic link is working
- Check if invite user email is sent correctly
<img width="785" alt="Screenshot 2024-11-20 at 01 24 02" src="https://github.com/user-attachments/assets/feb21b27-07c4-4135-8ff2-bd114a704fcf">
<img width="1342" alt="Screenshot 2024-11-20 at 01 24 28" src="https://github.com/user-attachments/assets/7c141481-7a81-41cb-9253-b6fc2a6a07b7">
## 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**
- `loadtest/config/development.toml`
**2. Configuration Files**
- `config/development.toml`
- `config/docker_compose.toml`
- `crates/external_services/Cargo.toml`
- ... and 1 more files
**3. Other**
- `Cargo.lock`
- `crates/external_services/src/email.rs`
- `crates/external_services/src/email/no_email.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (15 changes)
- Extend existing types with new fields (32 changes)
**Detailed Identifier Changes:**
Commit 0f563b06:
Files to modify:
**crates/external_services/src/email.rs**
Remove:
- enum: pub::AvailableEmailClients
Add:
- enum: pub::EmailClientConfigs
- mod: pub::smtp
- mod: pub::no_email
**crates/external_services/src/email/no_email.rs**
Add:
- function: pub::create
- function: private::convert_to_rich_text
- function: private::send_email
- struct: pub::NoEmailClient
- impl: impl NoEmailClient
- impl: impl EmailClient for NoEmailClient
**crates/external_services/src/email/ses.rs**
Add:
- function: pub::validate
- impl: impl SESConfig
**crates/external_services/src/email/smtp.rs**
Add:
- function: pub::create_client
- function: pub::create
- function: private::to_mail_box
- function: pub::validate
- function: private::convert_to_rich_text
- function: private::send_email
- struct: pub::SmtpServer
- struct: pub::SmtpServerConfig
- enum: pub::SmtpConnection
- enum: pub::SmtpError
- impl: impl SmtpServer
- impl: impl SmtpServerConfig
- impl: impl EmailClient for SmtpServer
**crates/router/src/configs/settings.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
|
{"pr_number": 6617, "pr_title": "feat(email): Add SMTP support to allow mails through self hosted/custom SMTP server", "merged_at": "2024-11-20T14:48:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"tests": ["loadtest/config/development.toml"], "config": ["config/development.toml", "config/docker_compose.toml", "crates/external_services/Cargo.toml", "crates/router/src/configs/settings.rs"], "other": ["Cargo.lock", "crates/external_services/src/email.rs", "crates/external_services/src/email/no_email.rs", "crates/external_services/src/email/ses.rs", "crates/external_services/src/email/smtp.rs", "crates/router/src/routes/app.rs"]}, "change_types": {"structs_added": 3, "functions_added": 15, "enums_added": 3, "fields_added": 32, "imports_added": 13}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix: consider status of payment method before filtering wallets in list pm
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
https://github.com/juspay/hyperswitch/pull/3953
We were not considering the status of payment method in above filtering logic
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test 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 merchant_account, api_key, mca (with any wallet)
2. Create a payment with wallet as payment method with authentication_type as three_ds. Retain the status of payment as processing
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_qVglrYUpCaoLCvnixZd3hX0ls7du5ZmaVMhZJNGt8ezEN4Axn8oU22i2gRz0OTqx' \
--data '{
"amount": 6540,
"confirm": true,
"currency": "USD",
"customer_acceptance": {
"acceptance_type": "online"
},
"customer_id": "cus_kWEMsP0NufHyhHsBB1Ol",
"profile_id": "pro_mjcaEelE0mjdp8ODpfkc",
"authentication_type": "three_ds",
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "token",
"payment_method": {
"display_name": "Visa 0326",
"network": "Mastercard",
"type": "debit"
},
"transaction_identifier": "55CC32D7BF7890B9064433F15B9F23F849CF84AFD01E4E65DD8ADE306300E9D8"
}
}
}
}'
```
3. Create another payment with confirm:false
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_qVglrYUpCaoLCvnixZd3hX0ls7du5ZmaVMhZJNGt8ezEN4Axn8oU22i2gRz0OTqx' \
--data '{
"amount": 6540,
"confirm": false,
"currency": "USD",
"customer_acceptance": {
"acceptance_type": "online"
},
"customer_id": "cus_kWEMsP0NufHyhHsBB1Ol",
"profile_id": "pro_mjcaEelE0mjdp8ODpfkc",
"authentication_type": "three_ds"
}'
```
4. list merchant pml. When the status of payment_method is inactive in db, the wallet should appear in the list
```
curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_Fvjj9zQjd2BA47M6qFJO_secret_gV3eKHcXxHT9PdA7fBbk' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_c079bd1ada67401fb98568ea6f6043bf' \
--data '' "
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payment_methods/cards.rs`
**Detailed Identifier Changes:**
Commit d2212cb7:
Files to modify:
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
|
{"pr_number": 7004, "pr_title": "fix: consider status of payment method before filtering wallets in list pm", "merged_at": "2025-01-07T17:07:46Z", "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"}
|
chore(env): remove unified_authentication_service base_url from integ, sandbox and production toml
## 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 -->
remove unified_authentication_service base_url from integ, sandbox and production toml
### 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)?
-->
Compiler guided
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `config/deployments/integration_test.toml`
**2. Configuration Files**
- `config/deployments/env_specific.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
|
{"pr_number": 6865, "pr_title": "chore(env): remove unified_authentication_service base_url from integ, sandbox and production toml", "merged_at": "2024-12-18T08:28:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["config/deployments/integration_test.toml"], "config": ["config/deployments/env_specific.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(connector): [MPGS] 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 -->
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Only template PR 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. 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 (162 changes)
**Detailed Identifier Changes:**
Commit 98d924bf:
Files to modify:
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::mpgs
**crates/hyperswitch_connectors/src/connectors/mpgs.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::Mpgs
- impl: impl Mpgs
- impl: impl api::Payment for Mpgs
- impl: impl api::PaymentSession for Mpgs
- impl: impl api::ConnectorAccessToken for Mpgs
- impl: impl api::MandateSetup for Mpgs
- impl: impl api::PaymentAuthorize for Mpgs
- impl: impl api::PaymentSync for Mpgs
- impl: impl api::PaymentCapture for Mpgs
- impl: impl api::PaymentVoid for Mpgs
- impl: impl api::Refund for Mpgs
- impl: impl api::RefundExecute for Mpgs
- impl: impl api::RefundSync for Mpgs
- impl: impl api::PaymentToken for Mpgs
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Mpgs
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Mpgs
- impl: impl ConnectorCommon for Mpgs
- impl: impl ConnectorValidation for Mpgs
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Mpgs
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Mpgs
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Mpgs
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Mpgs
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Mpgs
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Mpgs
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Mpgs
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Mpgs
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Mpgs
- impl: impl webhooks::IncomingWebhook for Mpgs
- impl: impl ConnectorSpecifications for Mpgs
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/mpgs/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::MpgsRouterData
- struct: pub::MpgsPaymentsRequest
- struct: pub::MpgsCard
- struct: pub::MpgsAuthType
- struct: pub::MpgsPaymentsResponse
- struct: pub::MpgsRefundRequest
- struct: pub::RefundResponse
- struct: pub::MpgsErrorResponse
- enum: pub::MpgsPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for MpgsRouterData<T>
- impl: impl TryFrom<&MpgsRouterData<&PaymentsAuthorizeRouterData>> for MpgsPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for MpgsAuthType
- impl: impl From<MpgsPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, MpgsPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&MpgsRouterData<&RefundsRouterData<F>>> for MpgsRefundRequest
- 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::mpgs
**crates/router/tests/connectors/mpgs.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::MpgsTest
- impl: impl ConnectorActions for MpgsTest
- impl: impl utils::Connector for MpgsTest
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 8544, "pr_title": "feat(connector): [MPGS] template code", "merged_at": "2025-07-25T09:32:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/connector_endpoints.rs"], "connectors": ["crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/mpgs.rs", "crates/hyperswitch_connectors/src/connectors/mpgs/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/mpgs.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": 162, "imports_added": 22}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): add Samsung pay mandate support for Cybersource
## 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 Samsung pay mandate support for Cybersource and enable samsung pay for cybersource on sandbox.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 Cybersource connector with Samsung pay enabled for it
-> Make a samsung pay off_session payment with amount set to zero. Payment will be in failed status with `"error_message": "SERVER_ERROR"`. This is expected, we need to get off_session payments enabled for our cybersource account.
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api-key' \
--data-raw '{
"amount": 0,
"currency": "USD",
"confirm": true,
"business_country": "US",
"business_label": "default",
"customer_id": "cu_1739882499",
"setup_future_usage": "off_session",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"return_url": "https://google.com",
"email": "samsungpay@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"payment_type": "setup_mandate",
"description": "Its my first payment request",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"payment_method": "wallet",
"payment_method_type": "samsung_pay",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"payment_method_data": {
"wallet": {
"samsung_pay": {
"payment_credential": {
"3_d_s": {
"type": "S",
"version": "100",
"data": "samsung-pay-token"
},
"payment_card_brand": "VI",
"payment_currency_type": "USD",
"payment_last4_fpan": "1661",
"method": "3DS",
"recurring_payment": false
}
}
}
}
}
'
```
```
{
"payment_id": "pay_WXbt7aYJDjO0DvyZRpsf",
"merchant_id": "merchant_1739867293",
"status": "failed",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "cybersource",
"client_secret": "pay_WXbt7aYJDjO0DvyZRpsf_secret_qZUj82yqxmREZX3MBnTR",
"created": "2025-02-18T08:29:27.643Z",
"currency": "USD",
"customer_id": "cu_1739867368",
"customer": {
"id": "cu_1739867368",
"name": "Joseph Doe",
"email": "samsungpay@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"samsung_pay": {
"last4": "1661",
"card_network": "Visa",
"type": null
}
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "samsungpay@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"next_action": null,
"cancellation_reason": null,
"error_code": "SERVER_ERROR",
"error_message": "SERVER_ERROR",
"unified_code": "UE_9000",
"unified_message": "Something went wrong",
"payment_experience": null,
"payment_method_type": "samsung_pay",
"connector_label": "cybersource_US_default_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cu_1739867368",
"created_at": 1739867367,
"expires": 1739870967,
"secret": "epk_7c1492ae7ec84198a64f11a089f48508"
},
"manual_retry_allowed": true,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_lUspT7TZ8NWvqh6aWiEy",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_oGt66qf0Ct6bRlh8P9BN",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-18T08:44:27.643Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-18T08:29:28.698Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/toml/sandbox.toml`
- `crates/hyperswitch_connectors/src/connectors/cybersource.rs`
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (40 changes)
**Detailed Identifier Changes:**
Commit 9bc8fd4d:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/cybersource.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Add:
- function: private::get_samsung_pay_payment_information
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Modify existing code
|
{"pr_number": 7298, "pr_title": "feat(connector): add Samsung pay mandate support for Cybersource", "merged_at": "2025-02-22T08:40:23Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/cybersource.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/router/src/configs/defaults/payment_connector_required_fields.rs"]}, "change_types": {"functions_added": 2, "fields_added": 40}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add payment incoming webhooks support for v2
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
add payment incoming webhooks support for v2
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested Manually
1. Sanity payment webhooks in v1
2. Incoming payment webhooks (source_verified = true)


3. Incoming payment webhooks (source_verified = 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. API Request/Response Models**
- `crates/api_models/src/payments.rs`
- `crates/api_models/src/webhooks.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/query/payment_attempt.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/router_data.rs`
**4. Core Business Logic**
- `crates/router/src/core.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/webhooks.rs`
- ... and 2 more files
**5. Type Definitions**
- `crates/router/src/types/api/payments.rs`
**6. Utils**
- `crates/common_utils/src/events.rs`
- `crates/common_utils/src/id_type/global_id/payment.rs`
**7. Other**
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/events/outgoing_webhook_logs.rs`
- `crates/router/src/lib.rs`
- ... and 7 more files
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (28 changes)
- Extend existing types with new fields (147 changes)
- Add conditional logic for feature flags or filtering (4 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit 8e9c3ec8:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- function: private::expecting
- function: private::visit_str
- function: private::expecting
- function: private::visit_some
- function: private::visit_none
- function: private::visit_unit
- function: pub::deserialize
- function: pub::deserialize_option
- struct: private::PaymentIdVisitor
- struct: private::OptionalPaymentIdVisitor
- enum: pub::PaymentIdType
- impl: impl Visitor<'de> for PaymentIdVisitor
- impl: impl Visitor<'de> for OptionalPaymentIdVisitor
- mod: private::payment_id_type
**crates/api_models/src/webhooks.rs**
Add:
- function: pub::get_payment_id
- enum: pub::OutgoingWebhookContent
**crates/common_utils/src/events.rs**
Modify existing code
**crates/common_utils/src/id_type/global_id/payment.rs**
Add:
- function: private::try_from
- impl: impl TryFrom<std::borrow::Cow<'static, str>> for GlobalAttemptId
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/diesel_models/src/query/payment_attempt.rs**
Add:
- function: pub::find_by_profile_id_connector_transaction_id
**crates/hyperswitch_domain_models/src/payments.rs**
Add:
- function: pub::get_payment_id
- impl: impl PaymentStatusData<F>
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/router/src/core.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/webhooks.rs**
Add:
- mod: private::incoming_v2
**crates/router/src/core/webhooks/incoming_v2.rs**
Add:
- function: pub::incoming_webhooks_wrapper
- function: private::incoming_webhooks_core
- function: private::payments_incoming_webhook_flow
- function: private::get_trackers_response_for_payment_get_operation
- function: private::verify_webhook_source_verification_call
- function: private::get_connector_by_connector_name
- function: private::fetch_mca_and_connector
**crates/router/src/core/webhooks/webhook_events.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::find_payment_attempt_by_profile_id_connector_transaction_id
**crates/router/src/events/outgoing_webhook_logs.rs**
Add:
- function: private::get_outgoing_webhook_event_content
- impl: impl OutgoingWebhookEventMetric for OutgoingWebhookContent
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- impl: impl Webhooks
**crates/router/src/routes/webhook_events.rs**
Modify existing code
**crates/router/src/routes/webhooks.rs**
Add:
- function: pub::receive_incoming_webhook
**crates/router/src/services/authentication.rs**
Add:
- function: private::authenticate_and_fetch
- struct: pub::MerchantIdAndProfileIdAuth
- impl: impl AuthenticateAndFetch<AuthenticationData, A> for MerchantIdAndProfileIdAuth
**crates/router/src/types/api/payments.rs**
Add:
- function: private::get_payment_intent_id
**crates/storage_impl/src/mock_db/payment_attempt.rs**
Add:
- function: private::find_payment_attempt_by_profile_id_connector_transaction_id
**crates/storage_impl/src/payments/payment_attempt.rs**
Add:
- function: private::find_payment_attempt_by_profile_id_connector_transaction_id
- function: private::find_payment_attempt_by_profile_id_connector_transaction_id
|
{"pr_number": 6551, "pr_title": "feat(router): add payment incoming webhooks support for v2", "merged_at": "2024-11-19T09:35:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "webhook"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs", "crates/api_models/src/webhooks.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/query/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/webhooks.rs", "crates/router/src/core/webhooks/incoming_v2.rs", "crates/router/src/core/webhooks/webhook_events.rs"], "types": ["crates/router/src/types/api/payments.rs"], "utils": ["crates/common_utils/src/events.rs", "crates/common_utils/src/id_type/global_id/payment.rs"], "other": ["crates/router/src/db/kafka_store.rs", "crates/router/src/events/outgoing_webhook_logs.rs", "crates/router/src/lib.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/webhook_events.rs", "crates/router/src/routes/webhooks.rs", "crates/router/src/services/authentication.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs"]}, "change_types": {"structs_added": 4, "functions_added": 28, "enums_added": 2, "fields_added": 147, "imports_added": 15, "conditionals_added": 4, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment_link): expose payment link configs for SDK UI rules and payment button
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR exposes customizations for payment links. Below configs are added -
- SDK UI rules - https://docs.hyperswitch.io/explore-hyperswitch/merchant-controls/integration-guide/web/customization#id-4.-rules
- Payment Link UI rules - similar to SDK UI rules, but for payment link template*
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Gives granular control to the payment link consumer for designing their UI.
## How did you test it?
Tested locally.
<details>
<summary>1. Add a payment link style ID</summary>
cURL
curl --location --request POST 'http://localhost:8080/account/merchant_1741095653/business_profile/pro_dgzCAaE0KhqCTj6cY5a7' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{"payment_link_config":{"allowed_domains":["*"],"business_specific_configs":{"style1":{"enabled_saved_payment_method":true,"theme":"#E71D36","logo":"https://hyperswitch.io/favicon.ico","sdk_ui_rules":{".Label":{"fontWeight":"700 !important","fontSize":"13px !important","color":"#003264 !important","opacity":"1 !important"}},"payment_link_ui_rules":{"#submit":{"color":"#003264","fontWeight":"700","fontSize":"18px","padding":"25px 0","borderRadius":"20px","backgroundColor":"#ffc439"},"#hyper-checkout-sdk":{"backgroundColor":"#003264"}}}}}}'
Response
{"merchant_id":"merchant_1741095653","profile_id":"pro_dgzCAaE0KhqCTj6cY5a7","profile_name":"IN_default","return_url":"https://google.com/success","enable_payment_response_hash":true,"payment_response_hash_key":"fVkaUtGhpJbDbwJ6bkDO1MX6yRgCNlJPSyaaMkOfe8izhPgWUGS8mdP8p95t5gqp","redirect_to_merchant_with_http_post":false,"webhook_details":{"webhook_version":"1.0.1","webhook_username":"random","webhook_password":"pass","webhook_url":"https://webhook.site/c5368f5d-882b-4d3a-b5be-f372294b6146","payment_created_enabled":true,"payment_succeeded_enabled":true,"payment_failed_enabled":true},"metadata":null,"routing_algorithm":null,"intent_fulfillment_time":900,"frm_routing_algorithm":null,"payout_routing_algorithm":null,"applepay_verified_domains":null,"session_expiry":900,"payment_link_config":{"domain_name":null,"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico","seller_name":null,"sdk_layout":null,"display_sdk_only":null,"enabled_saved_payment_method":true,"hide_card_nickname_field":null,"show_card_form_by_default":null,"transaction_details":null,"background_image":null,"details_layout":null,"payment_button_text":"Proceed to Payment!","custom_message_for_card_terms":"Hello","payment_button_colour":null,"skip_status_screen":null,"payment_button_text_colour":null,"background_colour":null,"sdk_ui_rules":{".Label":{"fontWeight":"700 !important","fontSize":"13px !important","opacity":"1 !important","backgroundColor":"red !important","color":"#003264 !important"}},"payment_link_ui_rules":null,"business_specific_configs":{"style2":{"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico","seller_name":null,"sdk_layout":null,"display_sdk_only":null,"enabled_saved_payment_method":true,"hide_card_nickname_field":null,"show_card_form_by_default":null,"transaction_details":null,"background_image":null,"details_layout":null,"payment_button_text":null,"custom_message_for_card_terms":null,"payment_button_colour":null,"skip_status_screen":null,"payment_button_text_colour":null,"background_colour":null,"sdk_ui_rules":null,"payment_link_ui_rules":null},"style1":{"theme":"#E71D36","logo":"https://hyperswitch.io/favicon.ico","seller_name":null,"sdk_layout":null,"display_sdk_only":null,"enabled_saved_payment_method":true,"hide_card_nickname_field":null,"show_card_form_by_default":null,"transaction_details":null,"background_image":null,"details_layout":null,"payment_button_text":null,"custom_message_for_card_terms":null,"payment_button_colour":null,"skip_status_screen":null,"payment_button_text_colour":null,"background_colour":null,"sdk_ui_rules":{".Label":{"color":"#003264 !important","opacity":"1 !important","fontWeight":"700 !important","fontSize":"13px !important"}},"payment_link_ui_rules":{"#submit":{"color":"#003264","fontSize":"18px","backgroundColor":"#ffc439","borderRadius":"20px","padding":"25px 0","fontWeight":"700"},"#hyper-checkout-sdk":{"backgroundColor":"#003264"}}}},"allowed_domains":["*"],"branding_visibility":null},"authentication_connector_details":null,"use_billing_as_payment_method_billing":true,"extended_card_info_config":null,"collect_shipping_details_from_wallet_connector":false,"collect_billing_details_from_wallet_connector":false,"always_collect_shipping_details_from_wallet_connector":false,"always_collect_billing_details_from_wallet_connector":false,"is_connector_agnostic_mit_enabled":true,"payout_link_config":null,"outgoing_webhook_custom_http_headers":null,"tax_connector_id":null,"is_tax_connector_enabled":false,"is_network_tokenization_enabled":true,"is_auto_retries_enabled":false,"max_auto_retries_enabled":null,"always_request_extended_authorization":null,"is_click_to_pay_enabled":true,"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}
</details>
<details>
<summary>2. Create a payment link</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_R70SBQ7gQzMiqsCrbSGMBTEtsKbNkgc8sXo5yHgpEA0mvT8BktGLXrn9zPOxLwpf' \
--data '{"customer_id":"cus_jJuzSZ5cVZ5mgBGGUNYs","profile_id":"pro_dgzCAaE0KhqCTj6cY5a7","customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"amount":100,"currency":"EUR","payment_link":true,"setup_future_usage":"off_session","capture_method":"automatic","session_expiry":100000,"return_url":"https://example.com","payment_link_config_id":"style1"}'
Response
{"payment_id":"pay_1QLObAU2blLbNSfehTJN","merchant_id":"merchant_1741095653","status":"requires_payment_method","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":null,"client_secret":"pay_1QLObAU2blLbNSfehTJN_secret_oRqjfv36rG6plNEBHvvQ","created":"2025-03-04T22:10:37.490Z","currency":"EUR","customer_id":"cus_jJuzSZ5cVZ5mgBGGUNYs","customer":{"id":"cus_jJuzSZ5cVZ5mgBGGUNYs","name":"John Nether","email":null,"phone":"6168205362","phone_country_code":"+1"},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":null,"payment_method_data":null,"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":null,"name":"John Nether","phone":"6168205362","return_url":"https://example.com/","authentication_type":null,"statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_jJuzSZ5cVZ5mgBGGUNYs","created_at":1741126237,"expires":1741129837,"secret":"epk_5255cf68bc6947db9fcf59f285eeb37b"},"manual_retry_allowed":null,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":{"link":"http://localhost:8080/payment_link/merchant_1741095653/pay_1QLObAU2blLbNSfehTJN?locale=en","secure_link":"http://localhost:8080/payment_link/s/merchant_1741095653/pay_1QLObAU2blLbNSfehTJN?locale=en","payment_link_id":"plink_Uve1VxVAdO7XJAkBQzMg"},"profile_id":"pro_dgzCAaE0KhqCTj6cY5a7","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-06T01:57:17.488Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-04T22:10:37.496Z","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}
<img width="646" alt="Screenshot 2025-03-05 at 3 41 38 AM" src="https://github.com/user-attachments/assets/5ceef6f4-e935-463d-904c-6855de2bd4a3" />
</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
### Note
**\* - EDIT 1**
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/admin.rs`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/payment_intent.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/lib.rs`
**4. Core Business Logic**
- `crates/router/src/core/payment_link.rs`
- `crates/router/src/core/payment_link/payment_link_initiate/payment_link.js`
- `crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js`
- ... and 2 more files
**5. Type Definitions**
- `crates/router/src/types/transformers.rs`
**6. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/router/src/routes/admin.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (32 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit 6a5ce266:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/lib.rs**
Modify existing code
**crates/router/src/core/payment_link.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/routes/admin.rs**
Modify existing code
**crates/router/src/routes/ephemeral_key.rs**
Modify existing code
**crates/router/src/routes/verification.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 7427, "pr_title": "feat(payment_link): expose payment link configs for SDK UI rules and payment button", "merged_at": "2025-03-05T17:28:25Z", "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.js", "crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js", "crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/router/src/routes/admin.rs", "crates/router/src/routes/ephemeral_key.rs", "crates/router/src/routes/verification.rs"]}, "change_types": {"fields_added": 32, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(payout): use billing address in payment_methods
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR adds capability for payouts to use billing address in payment_methods.
1. During first payout (with recurring: true) - payment_method entry created will store the billing address
2. During recurring payouts - stored billing address will be fetched and used
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies 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
This fixes the bug where it required address as a mandatory field for recurring payouts (payout using stored tokens).
## How did you test it?
Scenarios to test (for address)
1. Processing CIPT and using that token for processing payout
2. Processing a recurring payout and using that token for processing payout
<details>
<summary>1. Create payments CIT</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_nCYTBLS606xu5drbUngHWbjGv7PNWKuXbYzppYkoykcCnz4vFyEqbdW1hKW1BBUy' \
--data-raw '{"amount":4500,"currency":"EUR","confirm":true,"profile_id":"pro_XpJkLrIhn3boVv94ixmE","capture_method":"automatic","authentication_type":"three_ds","setup_future_usage":"off_session","customer_id":"cus_MQ79t5dcAGyQnVVXZ5vg","email":"abc@example.com","return_url":"https://google.com","payment_method":"card","payment_method_data":{"card":{"card_number":"4111111111111111","card_exp_month":"03","card_exp_year":"2030","card_cvc":"737"},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","zip":"94122","country":"IT","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"}},"metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","language":"en-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"session_expiry":2890}'
Response
{"payment_id":"pay_DeekxhJrZ9CWyCTQCq4r","merchant_id":"merchant_1756974399","status":"succeeded","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":0,"amount_received":4500,"connector":"adyen","client_secret":"pay_DeekxhJrZ9CWyCTQCq4r_secret_Ch5L75UesuEC9Err8YZU","created":"2025-09-04T09:36:22.282Z","currency":"EUR","customer_id":"cus_MQ79t5dcAGyQnVVXZ5vg","customer":{"id":"cus_MQ79t5dcAGyQnVVXZ5vg","name":"Albert Klaassen","email":"abc@example.com","phone":"6168205362","phone_country_code":"+1"},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":"CREDIT","card_network":"Visa","card_issuer":"JP Morgan","card_issuing_country":"INDIA","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":{"address":{"city":"San Fransico","country":"IT","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"}},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"abc@example.com","name":"Albert Klaassen","phone":"6168205362","return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_MQ79t5dcAGyQnVVXZ5vg","created_at":1756978582,"expires":1756982182,"secret":"epk_27ed6fdabc164aceb5e0aa888832c373"},"manual_retry_allowed":false,"connector_transaction_id":"WDV92WCPCC5FX875","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_DeekxhJrZ9CWyCTQCq4r_1","payment_link":null,"profile_id":"pro_XpJkLrIhn3boVv94ixmE","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_Z5SC1uhu0kS6KvrnsxNY","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-09-04T10:24:32.282Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_channel":null,"payment_method_id":"pm_zRVZxGagdzsBMg5LmYct","network_transaction_id":"900345051761757","payment_method_status":"active","updated":"2025-09-04T09:36:23.649Z","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":"GJ7C3STP34XQLV75","card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null,"enable_partial_authorization":null}
</details>
<details>
<summary>2. Process payout using stored payment_method_id</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_nCYTBLS606xu5drbUngHWbjGv7PNWKuXbYzppYkoykcCnz4vFyEqbdW1hKW1BBUy' \
--data '{"payout_method_id":"pm_zRVZxGagdzsBMg5LmYct","amount":1,"currency":"EUR","customer_id":"cus_MQ79t5dcAGyQnVVXZ5vg","phone_country_code":"+65","description":"Its my first payout request","connector":["adyen"],"entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true,"profile_id":"pro_XpJkLrIhn3boVv94ixmE"}'
Response
{"payout_id":"payout_uPw0KZVYyb3RnOrChh9Q","merchant_id":"merchant_1756974399","merchant_order_reference_id":null,"amount":1,"currency":"EUR","connector":"adyen","payout_type":"card","payout_method_data":{"card":{"card_issuer":"JP Morgan","card_network":"Visa","card_type":"CREDIT","card_issuing_country":"INDIA","bank_code":"JP_JPM","last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"joseph Doe"}},"billing":{"address":{"city":"San Fransico","country":"IT","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"auto_fulfill":true,"customer_id":"cus_MQ79t5dcAGyQnVVXZ5vg","customer":{"id":"cus_MQ79t5dcAGyQnVVXZ5vg","name":"Albert Klaassen","email":"abc@example.com","phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_uPw0KZVYyb3RnOrChh9Q_secret_lVBCc5ylHYJonPY9Zhb3","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_5EG2zvgrEvH6Lv8xm3Ni","status":"success","error_message":null,"error_code":null,"profile_id":"pro_XpJkLrIhn3boVv94ixmE","created":"2025-09-04T09:37:16.364Z","connector_transaction_id":"RWZXLHMQMCJXKN75","priority":null,"payout_link":null,"email":"abc@example.com","name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_zRVZxGagdzsBMg5LmYct"}
</details>
<details>
<summary>3. Create payout using raw details</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_Iikb8EKUsyOh2DtqlE3HmqD6xdzI47h94XHiKKHTgA5YVT1ng4iyMCqSCBgsUDf8' \
--data-raw '{"amount":100,"currency":"EUR","profile_id":"pro_tQvMhyOhPPzlg5agzwAM","customer":{"id":"cus_Z51PFM8B1iROSJcMzllP","email":"new_cust@example.com","name":"John Doe","phone":"999999999","phone_country_code":"+65"},"connector":["adyen"],"description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111 1111 1111 1111","expiry_month":"03","expiry_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"US","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"}},"entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}'
Response
{"payout_id":"payout_p9MwtbQ0ta4tItSgXqBf","merchant_id":"merchant_1756971567","merchant_order_reference_id":null,"amount":100,"currency":"EUR","connector":"adyen","payout_type":"card","payout_method_data":{"card":{"card_issuer":"JP Morgan","card_network":"Visa","card_type":"CREDIT","card_issuing_country":"INDIA","bank_code":"JP_JPM","last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"auto_fulfill":true,"customer_id":"cus_Z51PFM8B1iROSJcMzllP","customer":{"id":"cus_Z51PFM8B1iROSJcMzllP","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_p9MwtbQ0ta4tItSgXqBf_secret_HiUN8ag2hf8gWxZj3HuY","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_5fXDmw6DZLP3aod1Zhsn","status":"success","error_message":null,"error_code":null,"profile_id":"pro_tQvMhyOhPPzlg5agzwAM","created":"2025-09-04T07:41:23.654Z","connector_transaction_id":"GB85JNB87RXVS3V5","priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_cNt6gdwVpysyWzbHIDmo"}
</details>
<details>
<summary>4. Process payout using payout_method_id</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_Iikb8EKUsyOh2DtqlE3HmqD6xdzI47h94XHiKKHTgA5YVT1ng4iyMCqSCBgsUDf8' \
--data '{"payout_method_id":"pm_cNt6gdwVpysyWzbHIDmo","amount":1,"currency":"EUR","customer_id":"cus_Z51PFM8B1iROSJcMzllP","phone_country_code":"+65","description":"Its my first payout request","connector":["adyen"],"entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true,"profile_id":"pro_tQvMhyOhPPzlg5agzwAM"}'
Response
{"payout_id":"payout_NKBml9En5YOW4ZfPKoDI","merchant_id":"merchant_1756971567","merchant_order_reference_id":null,"amount":1,"currency":"EUR","connector":"adyen","payout_type":"card","payout_method_data":{"card":{"card_issuer":"JP Morgan","card_network":"Visa","card_type":"CREDIT","card_issuing_country":"INDIA","bank_code":"JP_JPM","last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe","origin_zip":null},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"auto_fulfill":true,"customer_id":"cus_Z51PFM8B1iROSJcMzllP","customer":{"id":"cus_Z51PFM8B1iROSJcMzllP","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_NKBml9En5YOW4ZfPKoDI_secret_fhKX0pr2SlIZjRDynimH","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_5fXDmw6DZLP3aod1Zhsn","status":"success","error_message":null,"error_code":null,"profile_id":"pro_tQvMhyOhPPzlg5agzwAM","created":"2025-09-04T07:44:05.254Z","connector_transaction_id":"LV4DQ6NDVV652VT5","priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_cNt6gdwVpysyWzbHIDmo"}
</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/routing.rs`
- `crates/router/src/core/payouts.rs`
- `crates/router/src/core/payouts/helpers.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (9 changes)
**Detailed Identifier Changes:**
Commit 831100c0:
Files to modify:
**crates/router/src/core/payments/routing.rs**
Modify existing code
**crates/router/src/core/payouts.rs**
Modify existing code
**crates/router/src/core/payouts/helpers.rs**
Add:
- function: pub::resolve_billing_address_for_payout
**crates/router/src/core/utils.rs**
Modify existing code
|
{"pr_number": 9277, "pr_title": "fix(payout): use billing address in payment_methods", "merged_at": "2025-09-08T11:39:06Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/routing.rs", "crates/router/src/core/payouts.rs", "crates/router/src/core/payouts/helpers.rs", "crates/router/src/core/utils.rs"]}, "change_types": {"functions_added": 1, "fields_added": 9, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(core): refund sync process scheduled time
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Before refund sync process tracker task was using pt_mapping_{connector} for sync retries (this is config name of Psync which was incorrect)
Fixes made in this PR -
- We are using pt_mapping_refund_sync_{connector}
- refund sync which was using retry_sync_task so made retry_refund_sync_task which will handle the refund task
- fix refund sync workflow being incorrectly scheduled for 2nd retry attempt instead of 1st retry attempt
- ConnectorPTMapping should also be read from db , previously we were always reading only from 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?
Create a process tracker config for Adyen connector
```
curl --location 'http://localhost:8080/configs/pt_mapping_refund_sync_adyen' \
--header 'Content-Type: application/json' \
--header 'api-key: _____' \
--data '{
"key": "pt_mapping_refund_sync_adyen",
"value": "{\"custom_merchant_mapping\":{},\"default_mapping\":{\"start_after\":180,\"frequencies\":[[20,2],[30,2],[40,2],[60,2],[2400,1],[43200,4],[86400,3],[345600,2]]},\"max_retries_count\":18}"
}'
```
Response
```
{
"key": "pt_mapping_refund_sync_adyen",
"value": "{\"custom_merchant_mapping\":{},\"default_mapping\":{\"start_after\":180,\"frequencies\":[[20,2],[30,2],[40,2],[60,2],[2400,1],[43200,4],[86400,3],[345600,2]]},\"max_retries_count\":18}"
}
```
Create a no 3ds card payment via Adyen
```
{
"amount": 1000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"metadata": {
"order_id": "ORD-12345",
"sdata": {
"customer_segment": "premium",
"purchase_platform": "web_store"
}
},
"routing": {
"type": "single",
"data": "adyen"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"merchant_order_reference_id": "order_narvar12",
"browser_info": {
"os_type": "macOS",
"language": "en-GB",
"time_zone": -330,
"ip_address": "103.159.11.202",
"os_version": "10.15.7",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
"color_depth": 24,
"device_model": "Macintosh",
"java_enabled": true,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1080,
"accept_language": "en",
"java_script_enabled": true
},
"profile_id": "{{payment_profile_id}}"
}
```
Response
```
{
"payment_id": "pay_PuKa9OvV1e3yrcdZcfEo",
"merchant_id": "merchant_1755523756",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "adyen",
"client_secret": "pay_PuKa9OvV1e3yrcdZcfEo_secret_V1Yu4MdVf3iEhwKygr0H",
"created": "2025-08-19T06:21:08.206Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "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": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null,
"origin_zip": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null,
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": 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": 1755584468,
"expires": 1755588068,
"secret": "epk_eadaf298af8f4d58b46ac00860f9e440"
},
"manual_retry_allowed": false,
"connector_transaction_id": "HH2TDB3NBZXRHBV5",
"frm_message": null,
"metadata": {
"sdata": {
"customer_segment": "premium",
"purchase_platform": "web_store"
},
"order_id": "ORD-12345"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": "pay_PuKa9OvV1e3yrcdZcfEo_1",
"payment_link": null,
"profile_id": "pro_IBcsy1G8u4AqtpDlpoQ6",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_ST0rQKrUA8r95Bvci4FV",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-19T06:36:08.206Z",
"fingerprint": null,
"browser_info": {
"os_type": "macOS",
"language": "en-GB",
"time_zone": -330,
"ip_address": "103.159.11.202",
"os_version": "10.15.7",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
"color_depth": 24,
"device_model": "Macintosh",
"java_enabled": true,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1080,
"accept_language": "en",
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-08-19T06:21:11.290Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": "order_narvar12",
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null
}
```
Create a Refund Request
```
{
"payment_id": "{{payment_id}}",
"amount": 600,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}
```
Response
```
{
"refund_id": "ref_ItP2mAScOD5yeWYmsgWA",
"payment_id": "pay_PuKa9OvV1e3yrcdZcfEo",
"amount": 600,
"currency": "USD",
"status": "pending",
"reason": "Customer returned product",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"error_message": null,
"error_code": null,
"unified_code": null,
"unified_message": null,
"created_at": "2025-08-19T06:21:25.378Z",
"updated_at": "2025-08-19T06:21:25.738Z",
"connector": "adyen",
"profile_id": "pro_IBcsy1G8u4AqtpDlpoQ6",
"merchant_connector_id": "mca_ST0rQKrUA8r95Bvci4FV",
"split_refunds": null,
"issuer_error_code": null,
"issuer_error_message": null
}
```
In db search for this refund id
`select * from refund where refund_id = 'ref_ItP2mAScOD5yeWYmsgWA';`
We will get internal_reference_id | refid_DFtahM9L64gRSkyzkibF
<img width="964" height="715" alt="Screenshot 2025-08-19 at 11 57 31 AM" src="https://github.com/user-attachments/assets/c237e56e-f6a2-4ad0-b82c-e462f3f90017" />
Using this internal_reference_id we will check in process_tracker table to check the scheduled time
`select * from process_tracker where id like '%refid_DFtahM9L64gRSkyzkibF%';`
We can scheduled time is 3min after updated_at as in config start_after time was set 180 sec
<img width="1124" height="349" alt="Screenshot 2025-08-19 at 11 57 58 AM" src="https://github.com/user-attachments/assets/59250474-a27c-4815-8598-ca8ade392121" />
After 3 min if we check process_tracker
scheduled time is 20sec min after updated_at as in config 1st frequency was set 20 sec
<img width="1252" height="344" alt="Screenshot 2025-08-19 at 12 01 19 PM" src="https://github.com/user-attachments/assets/650b5b2f-f16b-4eae-a8ab-9ddc513925a0" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/refunds.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (4 changes)
**Detailed Identifier Changes:**
Commit e9a8187d:
Files to modify:
**crates/router/src/core/refunds.rs**
Modify existing code
|
{"pr_number": 8930, "pr_title": "refactor(core): refund sync process scheduled time", "merged_at": "2025-08-22T13:26:14Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/refunds.rs"]}, "change_types": {"functions_added": 1, "fields_added": 4, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connector): [Noon] auth header
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Noon has updated there Authentication api
- The mode selector has been deprecated because there is no more segregation of authentication for TEST/LIVE environment via the authorization header,
the endpoint used will take care of routing the request to the relevant environment.
Current
Mode selector is mandatory in the authorization header to authenticate credentials:
• Key_test Base64(BusinessIdentifier.ApplicationIdentifier:ApplicationKey)
• Key_live Base64(BusinessIdentifier.ApplicationIdentifier:ApplicationKey)
New
Mode selector no more required, for both environments the new format is:
• Key Base64(BusinessIdentifier.ApplicationIdentifier:ApplicationKey
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
1. Create a Noon Payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_Q44fvQRgqucXVPYBqH7SuDJu2Mxr1QvhcDD3DC294pEMjSXTi3vvy8CI2msLiKjO' \
--data-raw '{
"amount": 390,
"currency": "AED",
"confirm": true,
"capture_method": "automatic",
"customer_id": "sammantest2722",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4000000000002701",
"card_exp_month": "01",
"card_exp_year": "2035",
"card_holder_name": "joseph Doe",
"card_cvc": "100"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "AE",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "____",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (iPhone NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "128.0.0.1"
},
"connector_metadata": {
"noon": {
"order_category": "pay"
}
},
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 390,
"account_name": "transaction_processing"
}
]
}'
```
Response
```
{
"payment_id": "pay_6FveKOlMd627skf71HZz",
"merchant_id": "postman_merchant_GHAction_2f8ca629-c8b2-4a0b-bcbd-7bf563aad333",
"status": "requires_customer_action",
"amount": 390,
"net_amount": 390,
"shipping_cost": null,
"amount_capturable": 390,
"amount_received": null,
"connector": "noon",
"client_secret": "pay_6FveKOlMd627skf71HZz_secret_Rga6hxuBO9r5VX5EvQAE",
"created": "2025-05-07T11:51:44.853Z",
"currency": "AED",
"customer_id": "sammantest2722",
"customer": {
"id": "sammantest2722",
"name": "Joseph Doe",
"email": "something@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "2701",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "400000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2035",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AE",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "____",
"country_code": "+91"
},
"email": null
},
"order_details": [
{
"brand": null,
"amount": 390,
"category": null,
"quantity": 1,
"tax_rate": null,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"total_tax_amount": null,
"requires_shipping": null
}
],
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_6FveKOlMd627skf71HZz/postman_merchant_GHAction_2f8ca629-c8b2-4a0b-bcbd-7bf563aad333/pay_6FveKOlMd627skf71HZz_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "sammantest2722",
"created_at": 1746618704,
"expires": 1746622304,
"secret": "epk_3c5e17e1540748e0bd25c7b3ff6e078d"
},
"manual_retry_allowed": null,
"connector_transaction_id": "212023029912",
"frm_message": null,
"metadata": null,
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": {
"order_category": "pay"
},
"braintree": null,
"adyen": null
},
"feature_metadata": null,
"reference_id": "pay_6FveKOlMd627skf71HZz_1",
"payment_link": null,
"profile_id": "pro_YntNRehGguMsFvDKQtyr",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_Le64ohGhH3eJbLsBjfbA",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-05-07T12:06:44.853Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "128.0.0.1",
"user_agent": "Mozilla/5.0 (iPhone NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-05-07T11:51:46.598Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null
}
```
Complete Payment using redirection
2. Psync
```
curl --location 'http://localhost:8080/payments/pay_6FveKOlMd627skf71HZz?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: _'
```
Response
```
{
"payment_id": "pay_6FveKOlMd627skf71HZz",
"merchant_id": "postman_merchant_GHAction_2f8ca629-c8b2-4a0b-bcbd-7bf563aad333",
"status": "succeeded",
"amount": 390,
"net_amount": 390,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 390,
"connector": "noon",
"client_secret": "pay_6FveKOlMd627skf71HZz_secret_Rga6hxuBO9r5VX5EvQAE",
"created": "2025-05-07T11:51:44.853Z",
"currency": "AED",
"customer_id": "sammantest2722",
"customer": {
"id": "sammantest2722",
"name": "Joseph Doe",
"email": "something@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "2701",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "400000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2035",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AE",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "_",
"country_code": "+91"
},
"email": null
},
"order_details": [
{
"brand": null,
"amount": 390,
"category": null,
"quantity": 1,
"tax_rate": null,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"total_tax_amount": null,
"requires_shipping": null
}
],
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "212023029912",
"frm_message": null,
"metadata": null,
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": {
"order_category": "pay"
},
"braintree": null,
"adyen": null
},
"feature_metadata": null,
"reference_id": "pay_6FveKOlMd627skf71HZz_1",
"payment_link": null,
"profile_id": "pro_YntNRehGguMsFvDKQtyr",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_Le64ohGhH3eJbLsBjfbA",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-05-07T12:06:44.853Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "128.0.0.1",
"user_agent": "Mozilla/5.0 (iPhone NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-05-07T11:51:58.623Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/noon.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 28b62e26:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/noon.rs**
Modify existing code
|
{"pr_number": 7977, "pr_title": "refactor(connector): [Noon] auth header", "merged_at": "2025-05-12T15:28:52Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/noon.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(xendit): Fix wasm changes
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Instead of merchant secret we were passing webhook_verification_token which caused the build to fail
This PR raises the fix for this
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 wasm changes for Xendit
## How did you test 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 need of test (approved by @JeevaRamu0104 )
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
|
{"pr_number": 7419, "pr_title": "fix(xendit): Fix wasm changes", "merged_at": "2025-03-06T10:30:04Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "webhook", "token"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(core): add payments post_session_tokens flow
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
hotfix for [PR](https://github.com/juspay/hyperswitch/pull/6202)
1. Add support for a new endpoint post_session_tokens which can be called before the confirm call.
Use Case
- In PayPal, after the session call, when we click the PayPal button, we need to create an order. Previously, this was done in the `/confirm` call, and in response, we received the `order_id` / `connector_transaction_id`. We would then send this information to the HS SDK, which forwarded it to PayPal. PayPal used this data to render their SDK, allowing the user to log in and modify the shipping address. The user would then click "Complete Purchase," triggering the OnApprove callback, which was handled by the /complete_authorize call.
- The /confirm call happens at the point of order creation, but we receive the shipping address after that. At that stage, we make a call to TaxJar, and the order's tax amount is added. However, since the /confirm call has already happened, we can't change/update the amount at that point. This was the reason for creating the new flow, where the order creation happens in the /post_session_tokens call, and the /confirm call occurs after tax calculation.
- After this refactoring, the CreateOrder step will be handled in the /post_session_tokens call, and the OnApprove action will be handled in the /confirm call.
2. Populate Dynamic Fields for Paypal
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
1. Create Merchant Account
```
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_1728546485",
"locker_id": "m0010",
"merchant_name": "NewAge Retailer",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
},
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"metadata": {
"city": "NY",
"unit": "245"
},
"primary_business_details": [
{
"country": "US",
"business": "food"
}
]
}'
```
2. Create API Key
```
curl --location 'http://localhost:8080/api_keys/merchant_1728540504' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"name": "API Key 1",
"description": null,
"expiration": "2025-09-23T01:02:03.000Z"
}'
```
3. Create MCA
```
curl --location 'http://localhost:8080/account/merchant_1728540504/connectors?=' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "paypal",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "_",
"key1": "_"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "paypal",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": false,
"installment_payment_enabled": false
},
{
"payment_method_type": "paypal",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": false,
"installment_payment_enabled": false
}
]
},
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "giropay",
"recurring_enabled": true,
"installment_payment_enabled": true,
"payment_experience": "redirect_to_url"
},
{
"payment_method_type": "ideal",
"recurring_enabled": true,
"installment_payment_enabled": true,
"payment_experience": "redirect_to_url"
},
{
"payment_method_type": "eps",
"recurring_enabled": true,
"installment_payment_enabled": true,
"payment_experience": "redirect_to_url"
},
{
"payment_method_type": "sofort",
"recurring_enabled": true,
"installment_payment_enabled": true,
"payment_experience": "redirect_to_url"
}
]
}
],
"metadata": {
"paypal_sdk": {
"client_id": "___"
}
},
"business_country": "US",
"business_label": "food"
}'
```
4. Create Payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_MTxKOCiP8GOiXv955xYCMuW0MUzl1anEbVVkxBBR87wfDUObqYqOsCqpogsFFnCd' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"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": "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"
}
}'
```
5. Create Session token
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_10cfee22267a4184a3d45665920788ea' \
--data '{
"payment_id": "pay_J3IXGvol8nNvUkSRTcwQ",
"wallets": [],
"client_secret": "pay_J3IXGvol8nNvUkSRTcwQ_secret_VN76rK4oCqTghQ1kwNcO"
}'
```
Response
```
{
"payment_id": "pay_mcVzUMZws5KmEKbGkZ0g",
"client_secret": "pay_mcVzUMZws5KmEKbGkZ0g_secret_RMWlmy1jSdlp9VOMX1qc",
"session_token": [
{
"wallet_name": "paypal",
"connector": "paypal",
"session_token": "ASKAGh2WXgqfQ5TzjpZzLsfhVGlFbjq5VrV5IOX8KXDD2N_XqkGeYNDkWyr_UXnfhXpEkABdmP284b_2",
"sdk_next_action": {
"next_action": "post_session_tokens"
}
}
]
}
```
In Response Check for Next action - It should be `post_session_tokens`
6. List Payment Methods for merchant - Check for required fields (shipping_details)
```
curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_J3IXGvol8nNvUkSRTcwQ_secret_VN76rK4oCqTghQ1kwNcO' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_10cfee22267a4184a3d45665920788ea'
```
Response
```
{
"redirect_url": "https://google.com/success",
"currency": "USD",
"payment_methods": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "paypal",
"payment_experience": [
{
"payment_experience_type": "invoke_sdk_client",
"eligible_connectors": [
"paypal"
]
},
{
"payment_experience_type": "redirect_to_url",
"eligible_connectors": [
"paypal"
]
}
],
"card_networks": null,
"bank_names": null,
"bank_debits": null,
"bank_transfers": null,
"required_fields": {
"shipping.address.country": {
"required_field": "shipping.address.country",
"display_name": "country",
"field_type": {
"user_shipping_address_country": {
"options": [
"ALL"
]
}
},
"value": "US"
},
"shipping.address.first_name": {
"required_field": "shipping.address.first_name",
"display_name": "shipping_first_name",
"field_type": "user_shipping_name",
"value": "PiX"
},
"shipping.address.zip": {
"required_field": "shipping.address.zip",
"display_name": "zip",
"field_type": "user_shipping_address_pincode",
"value": "94122"
},
"shipping.address.state": {
"required_field": "shipping.address.state",
"display_name": "state",
"field_type": "user_shipping_address_state",
"value": "California"
},
"shipping.address.city": {
"required_field": "shipping.address.city",
"display_name": "city",
"field_type": "user_shipping_address_city",
"value": "San Fransico"
},
"shipping.address.last_name": {
"required_field": "shipping.address.last_name",
"display_name": "shipping_last_name",
"field_type": "user_shipping_name",
"value": null
},
"shipping.address.line1": {
"required_field": "shipping.address.line1",
"display_name": "line1",
"field_type": "user_shipping_address_line1",
"value": "1467"
}
},
"surcharge_details": null,
"pm_auth_connector": null
}
]
},
],
"mandate_payment": null,
"merchant_name": "NewAge Retailer",
"show_surcharge_breakup_screen": false,
"payment_type": "normal",
"request_external_three_ds_authentication": false,
"collect_shipping_details_from_wallets": false,
"collect_billing_details_from_wallets": false,
"is_tax_calculation_enabled": false
}
```
7. Create Post Session Tokens for Paypal
```
curl --location 'http://localhost:8080/payments/pay_J3IXGvol8nNvUkSRTcwQ/post_session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_10cfee22267a4184a3d45665920788ea' \
--data '{
"client_secret": "pay_J3IXGvol8nNvUkSRTcwQ_secret_VN76rK4oCqTghQ1kwNcO",
"payment_method_type": "paypal",
"payment_method": "wallet"
}'
```
Response
```
{
"payment_id": "pay_mcVzUMZws5KmEKbGkZ0g",
"next_action": {
"type": "invoke_sdk_client",
"next_action_data": {
"next_action": "confirm",
"order_id": "2KW93090954330301"
}
}
}
```
In Response Check for Next action - It should be confirm
8. Confirm Request
```
curl 'http://localhost:8080/payments/pay_6oSZ2utmkjgdOlfrZ53E/confirm' \
-X 'POST' \
-H 'Content-Type: application/json' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Sec-Fetch-Mode: cors' \
-H 'x-payment-confirm-source: sdk' \
-H 'x-client-source: ExpressCheckoutElement' \
-H 'api-key: pk_dev_43922dfcb2694e09929891b0f4f7b6dc' \
-H 'x-browser-version: 605.1.15' \
--data-binary '{"client_secret":"pay_6oSZ2utmkjgdOlfrZ53E_secret_EFrF7Izc98NHygNyG51x","return_url":"http://localhost:9060","retry_action":"manual_retry","shipping":{"address":{"country":"US","state":"California","zip":"94588","first_name":"Jagan","city":"Pleasanton","last_name":"Elavarasan","line1":"4141"}},"payment_method":"wallet","payment_method_type":"paypal","payment_experience":"invoke_sdk_client","connector":["paypal"],"payment_method_data":{"wallet":{"paypal_sdk":{"token":""}}},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Safari/605.1.15","accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","language":"en-US","color_depth":24,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true},"payment_type":"normal"}'
```
Response
```{
"payment_id": "pay_6oSZ2utmkjgdOlfrZ53E",
"merchant_id": "merchant_1728844379",
"status": "succeeded",
"amount": 2999,
"net_amount": 2999,
"amount_capturable": 0,
"amount_received": 2999,
"connector": "paypal",
"client_secret": "pay_6oSZ2utmkjgdOlfrZ53E_secret_EFrF7Izc98NHygNyG51x",
"created": "2024-10-14T09:09:36.340Z",
"currency": "USD",
"customer_id": "hyperswitch_sdk_demo_id",
"customer": {
"id": "hyperswitch_sdk_demo_id",
"name": null,
"email": "hyperswitch_sdk_demo_id@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": "Hello this is description",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "Pleasanton",
"country": "US",
"line1": "4141",
"line2": "Amsterdam Ave",
"line3": "alsksoe",
"zip": "94588",
"state": "California",
"first_name": "Jagan",
"last_name": "Elavarasan"
},
"phone": {
"number": "5551234",
"country_code": "+1"
},
"email": "customer@email.us"
},
"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": "_",
"country_code": "+91"
},
"email": "swangi@getMaxListeners.com"
},
"order_details": [
{
"brand": null,
"amount": 2999,
"category": null,
"quantity": 1,
"product_id": null,
"product_name": "Apple iPhone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"requires_shipping": null
}
],
"email": "hyperswitch_sdk_demo_id@gmail.com",
"name": null,
"phone": null,
"return_url": "http://localhost:9060/",
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": "invoke_sdk_client",
"payment_method_type": "paypal",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "1SV0561343891340C",
"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_6oSZ2utmkjgdOlfrZ53E_1",
"payment_link": null,
"profile_id": "pro_03iBylVoOpuldQsVZKtO",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_frKbF7wxB3Rt7tAFbpJA",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-14T09:24:36.340Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": -330,
"ip_address": "::1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Safari/605.1.15",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1728,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1117,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-10-14T09:10:19.289Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
For end to end testing, we need to do the payment via SDK
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/events/payment.rs`
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/router_flow_types/payments.rs`
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
- ... and 1 more files
**4. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/connector_integration_v2_impls.rs`
- `crates/router/src/core/payments/flows.rs`
- ... and 6 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/default_implementations.rs`
- `crates/hyperswitch_connectors/src/default_implementations_v2.rs`
- `crates/router/src/connector/paypal.rs`
- ... and 2 more files
**6. Type Definitions**
- `crates/hyperswitch_interfaces/src/types.rs`
- `crates/router/src/types.rs`
- `crates/router/src/types/api/payments.rs`
- ... and 2 more files
**7. Utils**
- `crates/router/src/routes/lock_utils.rs`
**8. Configuration Files**
- `crates/router/src/configs/defaults.rs`
**9. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/api-reference/payments/payments--post-session-tokens.mdx`
- `api-reference/mint.json`
- ... and 10 more files
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (38 changes)
- Extend existing types with new fields (308 changes)
**Detailed Identifier Changes:**
Commit 635d70fd:
Files to modify:
**crates/api_models/src/events/payment.rs**
Add:
- function: private::get_api_event_type
- function: private::get_api_event_type
- impl: impl ApiEventMetric for PaymentsPostSessionTokensRequest
- impl: impl ApiEventMetric for PaymentsPostSessionTokensResponse
**crates/api_models/src/payments.rs**
Add:
- struct: pub::PaymentsPostSessionTokensRequest
- struct: pub::PaymentsPostSessionTokensResponse
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Add:
- impl: impl PaymentPostSessionTokensV2 for $connector
- impl: impl ConnectorIntegrationV2<
PostSessionTokens,
PaymentFlowData,
PaymentsPostSessionTokensData,
PaymentsResponseData,
> for $connector
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_flow_types/payments.rs**
Add:
- struct: pub::PostSessionTokens
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Add:
- struct: pub::PaymentsPostSessionTokensData
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/payments.rs**
Add:
- trait: private::PaymentPostSessionTokens
**crates/hyperswitch_interfaces/src/api/payments_v2.rs**
Add:
- trait: pub::PaymentPostSessionTokensV2
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/routes/payments.rs**
Add:
- function: pub::payments_post_session_tokens
**crates/router/src/configs/defaults.rs**
Modify existing code
**crates/router/src/connector/paypal.rs**
Add:
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::build_request
- function: private::get_request_body
- function: private::handle_response
- function: private::get_error_response
- impl: impl api::PaymentPostSessionTokens for Paypal
- impl: impl ConnectorIntegration<
api::PostSessionTokens,
types::PaymentsPostSessionTokensData,
types::PaymentsResponseData,
> for Paypal
**crates/router/src/connector/paypal/transformers.rs**
Remove:
- impl: impl ForeignTryFrom<(
types::ResponseRouterData<F, PaypalRedirectResponse, T, types::PaymentsResponseData>,
domain::PaymentMethodData,
)> for types::RouterData<F, T, types::PaymentsResponseData>
Add:
- function: private::from
- function: private::from
- function: private::from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- impl: impl From<&PaypalRouterData<&types::PaymentsPostSessionTokensRouterData>> for OrderRequestAmount
- impl: impl From<&PaypalRouterData<&types::PaymentsPostSessionTokensRouterData>> for ItemDetails
- impl: impl From<&PaypalRouterData<&types::PaymentsPostSessionTokensRouterData>> for ShippingAddress
- impl: impl TryFrom<&PaypalRouterData<&types::PaymentsPostSessionTokensRouterData>> for PaypalPaymentsRequest
- impl: impl TryFrom<
types::ResponseRouterData<
api::Authorize,
PaypalRedirectResponse,
types::PaymentsAuthorizeData,
types::PaymentsResponseData,
>,
> for types::PaymentsAuthorizeRouterData
**crates/router/src/connector/utils.rs**
Add:
- function: private::is_auto_capture
- trait: pub::PaymentsPostSessionTokensRequestData
- impl: impl PaymentsPostSessionTokensRequestData for types::PaymentsPostSessionTokensData
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/connector_integration_v2_impls.rs**
Add:
- impl: impl api::PaymentPostSessionTokensV2 for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegrationV2<
api::PostSessionTokens,
types::PaymentFlowData,
types::PaymentsPostSessionTokensData,
types::PaymentsResponseData,
> for connector::DummyConnector<T>
- impl: impl api::PaymentPostSessionTokensV2 for $connector
- impl: impl services::ConnectorIntegrationV2<
api::PostSessionTokens,
types::PaymentFlowData,
types::PaymentsPostSessionTokensData,
types::PaymentsResponseData,
> for $connector
**crates/router/src/core/payments/flows.rs**
Add:
- impl: impl api::PaymentPostSessionTokens for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
api::PostSessionTokens,
types::PaymentsPostSessionTokensData,
types::PaymentsResponseData,
> for connector::DummyConnector<T>
- mod: pub::post_session_tokens_flow
**crates/router/src/core/payments/flows/post_session_tokens_flow.rs**
Add:
- function: private::construct_router_data
- function: private::get_merchant_recipient_data
- function: private::decide_flows
- function: private::add_access_token
- function: private::build_flow_specific_connector_request
- impl: impl ConstructFlowSpecificData<
api::PostSessionTokens,
types::PaymentsPostSessionTokensData,
types::PaymentsResponseData,
> for PaymentData<api::PostSessionTokens>
- impl: impl Feature<api::PostSessionTokens, types::PaymentsPostSessionTokensData> for types::RouterData<
api::PostSessionTokens,
types::PaymentsPostSessionTokensData,
types::PaymentsResponseData,
>
**crates/router/src/core/payments/flows/session_flow.rs**
Modify existing code
**crates/router/src/core/payments/operations.rs**
Add:
- mod: pub::payment_post_session_tokens
**crates/router/src/core/payments/operations/payment_post_session_tokens.rs**
Add:
- function: private::get_trackers
- function: private::get_or_create_customer_details
- function: private::make_pm_data
- function: private::get_connector
- function: private::guard_payment_against_blocklist
- function: private::update_trackers
- function: private::validate_request
- struct: pub::PaymentPostSessionTokens
- impl: impl GetTracker<F, PaymentData<F>, api::PaymentsPostSessionTokensRequest> for PaymentPostSessionTokens
- impl: impl Domain<F, api::PaymentsPostSessionTokensRequest, PaymentData<F>> for PaymentPostSessionTokens
- impl: impl UpdateTracker<F, PaymentData<F>, api::PaymentsPostSessionTokensRequest> for PaymentPostSessionTokens
- impl: impl ValidateRequest<F, api::PaymentsPostSessionTokensRequest, PaymentData<F>> for PaymentPostSessionTokens
**crates/router/src/core/payments/operations/payment_response.rs**
Add:
- function: private::update_tracker
- impl: impl PostUpdateTracker<F, PaymentData<F>, types::PaymentsPostSessionTokensData> for PaymentResponse
**crates/router/src/core/payments/transformers.rs**
Add:
- function: private::generate_response
- function: private::try_from
- function: private::try_from
- impl: impl ToResponse<F, D, Op> for api::PaymentsPostSessionTokensResponse
- impl: impl TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsPostSessionTokensData
- impl: impl TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsPostSessionTokensData
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Add:
- function: pub::payments_post_session_tokens
- function: private::get_locking_input
- impl: impl GetLockingInput for payment_types::PaymentsPostSessionTokensRequest
**crates/router/src/services/api.rs**
Add:
- function: private::get_client_secret
- impl: impl Authenticate for api_models::payments::PaymentsPostSessionTokensRequest
**crates/router/src/services/authentication.rs**
Add:
- function: private::get_client_secret
- impl: impl ClientSecretFetch for payments::PaymentsPostSessionTokensRequest
**crates/router/src/types.rs**
Add:
- impl: impl Capturable for PaymentsPostSessionTokensData
**crates/router/src/types/api/payments.rs**
Modify existing code
**crates/router/src/types/api/payments_v2.rs**
Modify existing code
**crates/router_derive/src/macros/operation.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 6346, "pr_title": "feat(core): add payments post_session_tokens flow", "merged_at": "2024-10-17T08:59:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/payment.rs", "crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_flow_types/payments.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/types.rs"], "core_business": ["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/flows/post_session_tokens_flow.rs", "crates/router/src/core/payments/flows/session_flow.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/payment_post_session_tokens.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector/paypal.rs", "crates/router/src/connector/paypal/transformers.rs", "crates/router/src/connector/utils.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs", "crates/router/src/types.rs", "crates/router/src/types/api/payments.rs", "crates/router/src/types/api/payments_v2.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "config": ["crates/router/src/configs/defaults.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/api-reference/payments/payments--post-session-tokens.mdx", "api-reference/mint.json", "api-reference/openapi_spec.json", "crates/hyperswitch_interfaces/src/api/payments.rs", "crates/hyperswitch_interfaces/src/api/payments_v2.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/routes/payments.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs", "crates/router/src/services/api.rs", "crates/router/src/services/authentication.rs", "crates/router_derive/src/macros/operation.rs"]}, "change_types": {"structs_added": 5, "functions_added": 38, "fields_added": 308, "imports_added": 15}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix: Unified scarf setup
## 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 -->
The installation tracking system has been upgraded to capture more information, errors and behaviors during the installation period such as:
- User aborts
- Server failure errors
- Dependency errors
- Successful installations
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 using a mock server endpoint to verify the script captures all the errors and successes.
<img width="723" alt="Screenshot 2025-06-04 at 5 07 48 PM" src="https://github.com/user-attachments/assets/eb343199-f1ba-46d9-8347-45f632b631ee" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Configuration Files**
- `docker-compose.yml`
**2. Other**
- `.gitignore`
- `scripts/create_default_user.sh`
- `scripts/notify_scarf.sh`
- ... and 3 more files
**Code Patterns Applied:**
- Extend existing types with new fields (20 changes)
- Add conditional logic for feature flags or filtering (26 changes)
|
{"pr_number": 8238, "pr_title": "fix: Unified scarf setup", "merged_at": "2025-06-09T07:59:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"config": ["docker-compose.yml"], "other": [".gitignore", "scripts/create_default_user.sh", "scripts/notify_scarf.sh", "scripts/poststart_hook.sh", "scripts/prestart_hook.sh", "scripts/setup.sh"]}, "change_types": {"fields_added": 20, "conditionals_added": 26}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
ci(cypress): Add Paypal Mandates
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Add mandates flow to paypal which they started handling recently
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Test cases were failing in cypress automation
## How did you test it?
<img width="924" alt="image" src="https://github.com/user-attachments/assets/4351b47e-3276-4037-9078-a54c2c48dd9e">
(Bank redirects started throwing internal error after redirection which needs to be fixed )
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests/cypress/e2e/PaymentUtils/Commons.js`
- `cypress-tests/cypress/e2e/PaymentUtils/Paypal.js`
**Code Patterns Applied:**
- Extend existing types with new fields (190 changes)
|
{"pr_number": 6794, "pr_title": "ci(cypress): Add Paypal Mandates", "merged_at": "2024-12-13T03:40:31Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/PaymentUtils/Commons.js", "cypress-tests/cypress/e2e/PaymentUtils/Paypal.js"]}, "change_types": {"fields_added": 190}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(routing): Routing events core refactor
## 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 -->
- Refactored routing events in dynamic_routing core.
- have also added routing events for Euclid and Debit Routing
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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)?
-->
SR routing dynamo-
<img width="1490" alt="image" src="https://github.com/user-attachments/assets/4877f130-136f-4d75-bb71-fe8a17445e52" />
Elimination and Contract based on dynamo -
<img width="1728" alt="image" src="https://github.com/user-attachments/assets/ab090dae-8abb-4b02-99ce-a5a50aa9bf7d" />
<img width="1728" alt="image" src="https://github.com/user-attachments/assets/b0cabbf9-a911-494b-9f61-c28ff4613f7c" />
SR routing on DE -
<img width="1728" alt="image" src="https://github.com/user-attachments/assets/a7344a76-381b-4f03-95f9-a3744aea3d5c" />
Euclid DE evaluate rule
<img width="1539" alt="image" src="https://github.com/user-attachments/assets/f444dec7-097f-4b71-bf97-64f63cd2bdf8" />
<img width="1728" alt="image" src="https://github.com/user-attachments/assets/dca48eaf-9d38-4d6e-896a-8946a63cc8f7" />
Debit Routing DE -
<img width="1728" alt="image" src="https://github.com/user-attachments/assets/0dbbf853-909c-4ea8-9201-70e4d00e4d07" />
<img width="1728" alt="image" src="https://github.com/user-attachments/assets/16d2a113-b160-40cf-bfa2-5e346bc009ed" />
Hit the analytics API -
```
curl --location 'http://localhost:8080/analytics/v1/profile/routing_event_logs?type=Payment&payment_id=pay_6GDjoYAiko8BmxoThD0u' \
--header 'api-key: dev_BNOaWRzwyZ3hMAbhRNtp9t6Mx7ZSVyK5gPvd1bavl0FWehvrHlre1eMifYA244TE'
```
Response -
```
[{"merchant_id":"merchant_1749723893","profile_id":"pro_EfD8EtQQSPZxXStG6B7x","payment_id":"pay_6GDjoYAiko8BmxoThD0u","routable_connectors":"","payment_connector":null,"request_id":"01976967-fd01-7c03-be4b-2a4f20ebf510","flow":"DecisionEngine: Euclid Static Routing","url":"http://localhost:8000/routing/evaluate","request":"{\"created_by\":\"pro_EfD8EtQQSPZxXStG6B7x\",\"parameters\":{\"payment_type\":{\"type\":\"enum_variant\",\"value\":\"non_mandate\"},\"currency\":{\"type\":\"enum_variant\",\"value\":\"USD\"},\"card_bin\":{\"type\":\"str_value\",\"value\":\"424242\"},\"capture_method\":{\"type\":\"enum_variant\",\"value\":\"automatic\"},\"login_date\":{\"type\":\"metadata_variant\",\"value\":{\"key\":\"login_date\",\"value\":\"2019-09-10T10:11:12Z\"}},\"udf1\":{\"type\":\"metadata_variant\",\"value\":{\"key\":\"udf1\",\"value\":\"value1\"}},\"new_customer\":{\"type\":\"metadata_variant\",\"value\":{\"key\":\"new_customer\",\"value\":\"true\"}},\"billing_country\":{\"type\":\"enum_variant\",\"value\":\"Netherlands\"},\"authentication_type\":{\"type\":\"enum_variant\",\"value\":\"no_three_ds\"},\"amount\":{\"type\":\"number\",\"value\":6540},\"business_label\":{\"type\":\"str_value\",\"value\":\"default\"},\"payment_method\":{\"type\":\"enum_variant\",\"value\":\"card\"},\"payment_method_type\":{\"type\":\"enum_variant\",\"value\":\"credit\"}}}","response":"{\"status\":\"success\",\"output\":{\"type\":\"priority\",\"connectors\":[\"stripe\"]},\"evaluated_output\":[\"stripe\"],\"eligible_connectors\":[]}","error":null,"status_code":200,"created_at":"2025-06-13T13:08:32.175Z","method":"Rest (POST)","routing_engine":"decision_engine","routing_approach":null},{"merchant_id":"merchant_1749723893","profile_id":"pro_EfD8EtQQSPZxXStG6B7x","payment_id":"pay_6GDjoYAiko8BmxoThD0u","routable_connectors":"Stripe:\"mca_SdftCCtpClu32qA6oijC\",Adyen:\"mca_Du0BKvXFphUeC5CZ4vb8\"","payment_connector":null,"request_id":"01976967-fd01-7c03-be4b-2a4f20ebf510","flow":"DecisionEngine: SuccessRate decide_gateway","url":"http://localhost:8000/decide-gateway","request":"{\"paymentInfo\":{\"paymentId\":\"pay_6GDjoYAiko8BmxoThD0u\",\"amount\":6540,\"currency\":\"USD\",\"paymentType\":\"ORDER_PAYMENT\",\"metadata\":null,\"paymentMethodType\":\"UPI\",\"paymentMethod\":\"card\",\"cardIsin\":null},\"merchantId\":\"pro_EfD8EtQQSPZxXStG6B7x\",\"eligibleGatewayList\":[\"stripe:mca_SdftCCtpClu32qA6oijC\",\"adyen:mca_Du0BKvXFphUeC5CZ4vb8\"],\"rankingAlgorithm\":\"SR_BASED_ROUTING\",\"eliminationEnabled\":false}","response":"{\"gateway_priority_map\":{\"stripe:mca_SdftCCtpClu32qA6oijC\":0.995,\"adyen:mca_Du0BKvXFphUeC5CZ4vb8\":0.995},\"debit_routing_output\":null,\"routing_approach\":\"SR_SELECTION_V3_ROUTING\"}","error":null,"status_code":200,"created_at":"2025-06-13T13:08:32.184Z","method":"Rest (POST)","routing_engine":"decision_engine","routing_approach":"Exploitation"},{"merchant_id":"merchant_1749723893","profile_id":"pro_EfD8EtQQSPZxXStG6B7x","payment_id":"pay_6GDjoYAiko8BmxoThD0u","routable_connectors":"","payment_connector":"Stripe:\"mca_SdftCCtpClu32qA6oijC\"","request_id":"01976967-fd01-7c03-be4b-2a4f20ebf510","flow":"DecisionEngine: SuccessRate update_gateway_score","url":"http://localhost:8000/update-gateway-score","request":"{\"merchantId\":\"pro_EfD8EtQQSPZxXStG6B7x\",\"gateway\":\"stripe:mca_SdftCCtpClu32qA6oijC\",\"status\":\"CHARGED\",\"paymentId\":\"pay_6GDjoYAiko8BmxoThD0u\"}","response":"{\"message\":\"Success\"}","error":null,"status_code":200,"created_at":"2025-06-13T13:08:33.661Z","method":"Rest (POST)","routing_engine":"decision_engine","routing_approach":null}]
```

## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/open_router.rs`
- `crates/api_models/src/routing.rs`
**2. Core Business Logic**
- `crates/router/src/core/errors.rs`
- `crates/router/src/core/payments/routing.rs`
- `crates/router/src/core/payments/routing/utils.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (28 changes)
- Implement new functions (37 changes)
- Extend existing types with new fields (221 changes)
- Add conditional logic for feature flags or filtering (2 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit 4d36be87:
Files to modify:
**crates/api_models/src/open_router.rs**
Modify existing code
**crates/api_models/src/routing.rs**
Remove:
- struct: pub::BucketInformationEventResponse
- struct: pub::EliminationInformationEventResponse
- struct: pub::LabelWithStatusEliminationEventResponse
- struct: pub::EliminationEventResponse
- struct: pub::ScoreDataEventResponse
- struct: pub::CalContractScoreEventResponse
- struct: pub::CalGlobalSuccessRateConfigEventRequest
- struct: pub::CalGlobalSuccessRateEventRequest
- struct: pub::UpdateSuccessRateWindowConfig
- struct: pub::UpdateLabelWithStatusEventRequest
- struct: pub::UpdateSuccessRateWindowEventRequest
- struct: pub::UpdateSuccessRateWindowEventResponse
- struct: pub::LabelWithBucketNameEventRequest
- struct: pub::UpdateEliminationBucketEventRequest
- struct: pub::UpdateEliminationBucketEventResponse
- struct: pub::ContractLabelInformationEventRequest
- struct: pub::UpdateContractRequestEventRequest
- struct: pub::UpdateContractEventResponse
- enum: pub::UpdationStatusEventResponse
- enum: pub::EliminationUpdationStatusEventResponse
- enum: pub::ContractUpdationStatusEventResponse
**crates/router/src/core/errors.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Modify existing code
**crates/router/src/core/payments/routing/utils.rs**
Add:
- function: private::send_decision_engine_request
- struct: pub::SRApiClient
**crates/router/src/core/routing/helpers.rs**
Modify existing code
|
{"pr_number": 8323, "pr_title": "refactor(routing): Routing events core refactor", "merged_at": "2025-06-17T14:49:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/open_router.rs", "crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/errors.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/payments/routing/utils.rs", "crates/router/src/core/routing/helpers.rs"]}, "change_types": {"structs_added": 28, "functions_added": 37, "enums_added": 5, "fields_added": 221, "imports_added": 6, "conditionals_added": 2, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(refunds): Trigger refund outgoing webhooks in create and retrieve refund flows
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Trigger refund outgoing webhooks in create and retrieve refund 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)?
-->
Test cases :
1) Create a refund without configuring incoming webhooks, this should trigger outgoing webhook to merchant
2) If possible create a refund with processing and update the status by force sync, Upon status update it should trigger outgoing webhook to merchant.
Refund created with webhooks configured with immediate status = 'success'
<img width="1164" alt="Screenshot 2024-11-22 at 5 56 59 PM" src="https://github.com/user-attachments/assets/233f00db-1150-4d58-8f1d-4fc4904feb13">
outgoing webhook triggered for the same event.
<img width="1674" alt="Screenshot 2024-11-22 at 5 57 52 PM" src="https://github.com/user-attachments/assets/c20d998d-0b7e-458e-90d7-a3fdbc765dbb">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/refunds.rs`
**2. Utils**
- `crates/router/src/utils.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (11 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 420eaabf:
Files to modify:
**crates/router/src/core/refunds.rs**
Modify existing code
**crates/router/src/utils.rs**
Add:
- function: pub::trigger_refund_outgoing_webhook
- function: pub::trigger_refund_outgoing_webhook
|
{"pr_number": 6635, "pr_title": "feat(refunds): Trigger refund outgoing webhooks in create and retrieve refund flows", "merged_at": "2024-11-24T20:29:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "refund"]}, "hierarchy": {"core_business": ["crates/router/src/core/refunds.rs"], "utils": ["crates/router/src/utils.rs"]}, "change_types": {"functions_added": 2, "fields_added": 11, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(openapi): modify profile-delete auth to AdminAPIKey in API doc
## 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 update the API doc to display Admin API Key instead of API key for Profile - Delete.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Correct Information to be displayed in the API docs.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Cannot be tested.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Other**
- `api-reference/openapi_spec.json`
- `crates/openapi/src/routes/profile.rs`
**Detailed Identifier Changes:**
Commit b8f66155:
Files to modify:
**crates/openapi/src/routes/profile.rs**
Modify existing code
|
{"pr_number": 7697, "pr_title": "refactor(openapi): modify profile-delete auth to AdminAPIKey in API doc", "merged_at": "2025-04-03T08:06:32Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["api-reference/openapi_spec.json", "crates/openapi/src/routes/profile.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [STRIPE] Throwing Missing Required Field Error if connector_customer is not present
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
This Hotfix is for the following PRs:
1. [PR](https://github.com/juspay/hyperswitch/pull/8309)
2. [PR](https://github.com/juspay/hyperswitch/pull/8096)
## How did you test 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
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- The "recurring_enabled" field in payment method responses is now optional and may be absent or null, offering greater flexibility in API responses.
- **Bug Fixes**
- Improved handling of customer information in payment requests, allowing requests to proceed even if customer details are not provided.
<!-- 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. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_data.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/helpers.rs`
- `crates/router/src/core/payments/operations/payment_attempt_record.rs`
- ... and 11 more files
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs`
- ... and 4 more files
**4. Type Definitions**
- `crates/router/src/compatibility/stripe/payment_intents/types.rs`
- `crates/router/src/compatibility/stripe/setup_intents/types.rs`
- `crates/router/src/types.rs`
- ... and 1 more files
**5. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Extend existing types with new fields (10 changes)
- Add conditional logic for feature flags or filtering (2 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit ad8f9fe2:
Files to modify:
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_enums/src/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/trustpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/router/src/compatibility/stripe/payment_intents/types.rs**
Modify existing code
**crates/router/src/compatibility/stripe/setup_intents/types.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_attempt_record.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_capture_v2.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_get.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_session_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/proxy_payments_intent.rs**
Modify existing code
**crates/router/src/core/payments/payment_methods.rs**
Modify existing code
**crates/router/src/core/payments/retry.rs**
Modify existing code
**crates/router/src/core/revenue_recovery/transformers.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 8313, "pr_title": "fix(connector): [STRIPE] Throwing Missing Required Field Error if connector_customer is not present", "merged_at": "2025-06-11T13:24:52Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_attempt_record.rs", "crates/router/src/core/payments/operations/payment_capture_v2.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_get.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/payment_session_intent.rs", "crates/router/src/core/payments/operations/payment_update_intent.rs", "crates/router/src/core/payments/operations/proxy_payments_intent.rs", "crates/router/src/core/payments/payment_methods.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/revenue_recovery/transformers.rs", "crates/router/src/core/routing/helpers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/connectors/trustpay.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/utils.rs"], "types": ["crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs", "crates/router/src/types.rs", "crates/router/src/types/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/common_enums/src/transformers.rs", "migrations/2025-05-21-194538_modify_attemptstatus_and_intentstatus/down.sql", "migrations/2025-05-21-194538_modify_attemptstatus_and_intentstatus/up.sql"]}, "change_types": {"fields_added": 10, "conditionals_added": 2, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(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
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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
Sanity external 3DS flow with juspaythreedsserver
Authentication Request
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_gDExYn7XYQTbWDQxKYZY_secret_X8J46DUUuQ0HHeCk7lFb",
"device_channel": "BRW",
"threeds_method_comp_ind": "U"
}'
```
Response
```
{
"trans_status": "C",
"acs_url": "https://mock-three-ds-server-small-lake-1937.fly.dev/processor/mock/acs/trigger-otp?redirectUrl=http%3A%2F%2Flocalhost%3A8080%2Fpayments%2Fpay_gDExYn7XYQTbWDQxKYZY%2Fmerchant_1759833730%2Fauthorize%2Fcybersource",
"challenge_request": "eyJtZXNzYWdlVHlwZSI6IkNSZXEiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6ImJhMDRhYzE4LTZiZjEtNGQ3Yi1iMTE2LTYxNDQwYzY2MjY0YiIsImFjc1RyYW5zSUQiOiI0OTJhYzMyYy00OGZkLTQyYmMtOTA3NS01MTU3OGFhMWM2YjEiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMi4wIn0=",
"challenge_request_key": "creq",
"acs_reference_number": "492ac32c-48fd-42bc-9075-51578aa1c6b1",
"acs_trans_id": "492ac32c-48fd-42bc-9075-51578aa1c6b1",
"three_dsserver_trans_id": "ba04ac18-6bf1-4d7b-b116-61440c66264b",
"acs_signed_content": null,
"three_ds_requestor_url": "https://my.flowbirdapp.com/",
"three_ds_requestor_app_url": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types/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 a9f239d5:
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": 9717, "pr_title": "fix(router): make `endpoint_prefix` optional in three_ds_metadata for unified_authentication_service", "merged_at": "2025-10-07T16:44:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant"]}, "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"}
|
fix(nuvei): make `eci_provider` in applepay decrypt flow non mandatory 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 -->
Some cards have optional `eci_provider` which causes 4xx missing field error. Make that optional.
### Test :
### Request
```json
{
"amount": 6500,
"currency": "USD",
"email": "email4@gmail.com",
"customer_id": "hello5",
"capture_method": "automatic",
"confirm": true,
"return_url": "https://hyperswitch-demo-store.netlify.app/?isTestingMode=true&hyperswitchClientUrl=https://beta.hyperswitch.io/v1&hyperswitchCustomPodUri=&hyperswitchCustomBackendUrl=&publishableKey=pk_snd_e6c328fa58824247865647d532583e66&secretKey=snd_H0f0rZqfaXlv6kz81O6tQptd2e250u5vlFsA1L50ogMglapamZmDzJ7qRlj4mNlM&profileId=pro_PxNHqEwbZM6rbIfgClSg&environment=Sandbox",
"billing": {
"address": {
"zip": "560095",
"country": "US",
"first_name": "Sakil",
"last_name": "Mostak",
"line1": "Fasdf",
"line2": "Fasdf",
"city": "Fasdf"
}
},
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "eyJkYXRhIjoiSWRNbUFu***************d****************2NDQ5NDlmMWUxNGZiYmM4NTdiNjk5N2NkYWJlMzczZGEyOTI3ZmU5NzcifSwidmVyc2lvbiI6IkVDX3YxIn0=",
"payment_method": {
"display_name": "Visa 0492",
"network": "Visa",
"type": "debit"
},
"transaction_identifier": "85ea39d59610a6860eb723644949f1e14fbbc857b6997cdabe373da2927fe977"
}
}
},
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"connector": [
"nuvei"
],
"browser_info": {
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "en-US",
"color_depth": 24,
"screen_height": 1117,
"screen_width": 1728,
"ip_address": "192.168.1.1",
"time_zone": -330,
"java_enabled": true,
"java_script_enabled": true,
"device_model": "Macintosh",
"os_type": "macOS",
"os_version": "10.15.7"
},
"payment_type": "normal"
}
```
### response
```json
{
"payment_id": "pay_7wu0YSHTd8LFDE8KD2UN",
"merchant_id": "merchant_1758115709",
"status": "succeeded",
"amount": 6500,
"net_amount": 6500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6500,
"connector": "nuvei",
"client_secret": "pay_7wu0YSHTd8LFDE8KD2UN_secret_kIWxoLIlS4kexcOCmHz1",
"created": "2025-09-18T07:35:21.765Z",
"currency": "USD",
"customer_id": "hello5",
"customer": {
"id": "hello5",
"name": null,
"email": "email4@gmail.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "0492",
"card_network": "Visa",
"type": "debit"
}
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Fasdf",
"country": "US",
"line1": "Fasdf",
"line2": "Fasdf",
"line3": null,
"zip": "560095",
"state": null,
"first_name": "Sakil",
"last_name": "Mostak",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "email4@gmail.com",
"name": null,
"phone": null,
"return_url": "https://hyperswitch-demo-store.netlify.app/?isTestingMode=true&hyperswitchClientUrl=https://beta.hyperswitch.io/v1&hyperswitchCustomPodUri=&hyperswitchCustomBackendUrl=&publishableKey=pk_snd_e6c328fa58824247865647d532583e66&secretKey=snd_H0f0rZqfaXlv6kz81O6tQptd2e250u5vlFsA1L50ogMglapamZmDzJ7qRlj4mNlM&profileId=pro_PxNHqEwbZM6rbIfgClSg&environment=Sandbox",
"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": "hello5",
"created_at": 1758180921,
"expires": 1758184521,
"secret": "epk_228ed6b0222a461b9497d73df63c5e11"
},
"manual_retry_allowed": null,
"connector_transaction_id": "7110000000017082220",
"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": "8937234111",
"payment_link": null,
"profile_id": "pro_G0scDt6GAZBxs3brIkts",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_4ioDaxsfaPf9R3aZCrE6",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-09-18T07:50:21.765Z",
"fingerprint": null,
"browser_info": {
"os_type": "macOS",
"language": "en-US",
"time_zone": -330,
"ip_address": "192.168.1.1",
"os_version": "10.15.7",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15",
"color_depth": 24,
"device_model": "Macintosh",
"java_enabled": true,
"screen_width": 1728,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1117,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": "",
"payment_method_status": null,
"updated": "2025-09-18T07:35:25.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,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null
}
```
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test 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/nuvei/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit ecfaf425:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Modify existing code
|
{"pr_number": 9509, "pr_title": "fix(nuvei): make `eci_provider` in applepay decrypt flow non mandatory field", "merged_at": "2025-09-24T16:51:54Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(dynamic_routing): make the dynamo configs optional
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This pull request introduces changes to improve the handling of optional configurations for dynamic routing in the gRPC client module. The updates include modifying the `GrpcClientSettings` structure to use `Option` types, enhancing error handling, and simplifying connection establishment logic. Additionally, default implementations are added to certain structs to streamline initialization.
### Enhancements to dynamic routing configuration:
* [`crates/external_services/src/grpc_client.rs`](diffhunk://#diff-0129f28e4a26fac6ce00609c3a3542c380baabb72d04d977daa28f364ab319beL50-R51): Changed `dynamic_routing_client` in `GrpcClientSettings` to use `Option<DynamicRoutingClientConfig>` instead of a direct type, allowing for better handling of cases where the configuration might be absent.
* [`crates/external_services/src/grpc_client.rs`](diffhunk://#diff-0129f28e4a26fac6ce00609c3a3542c380baabb72d04d977daa28f364ab319beL72-R77): Updated connection establishment logic to use `async_map` for optional configurations, added error handling with `transpose`, and provided a default value when no connection is established.
### Improvements to struct initialization:
* [`crates/external_services/src/grpc_client/dynamic_routing.rs`](diffhunk://#diff-7b95c78b2ff78bd774ff3483d1565e28529f49d7cd3e819944cd6e14471e89f4L47-R47): Added a `Default` implementation to the `RoutingStrategy` struct, simplifying initialization when certain fields are optional.
### Simplification of dynamic routing checks:
* [`crates/external_services/src/grpc_client/health_check_client.rs`](diffhunk://#diff-66f886eb2cc6f5e4e295e28e98bd77c97d1769cf82c54dd2c440156cdd9b16f0L56-R60): Refactored logic to handle `DynamicRoutingClientConfig` as an `Option` type, simplifying pattern matching and reducing code duplication. [[1]](diffhunk://#diff-66f886eb2cc6f5e4e295e28e98bd77c97d1769cf82c54dd2c440156cdd9b16f0L56-R60) [[2]](diffhunk://#diff-66f886eb2cc6f5e4e295e28e98bd77c97d1769cf82c54dd2c440156cdd9b16f0L84-R88)
### Added utility for asynchronous operations:
* [`crates/external_services/src/grpc_client.rs`](diffhunk://#diff-0129f28e4a26fac6ce00609c3a3542c380baabb72d04d977daa28f364ab319beR13): Imported `AsyncExt` from `common_utils::ext_traits` to leverage its utilities for asynchronous operations like `async_map`.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 configuration level changes making the dynamo configs optional. CI checks should suffice
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/routing.rs`
- `crates/router/src/core/routing.rs`
- `crates/router/src/core/routing/helpers.rs`
**2. Other**
- `crates/external_services/src/grpc_client.rs`
- `crates/external_services/src/grpc_client/dynamic_routing.rs`
- `crates/external_services/src/grpc_client/health_check_client.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (8 changes)
**Detailed Identifier Changes:**
Commit 4048aa16:
Files to modify:
**crates/external_services/src/grpc_client.rs**
Modify existing code
**crates/external_services/src/grpc_client/dynamic_routing.rs**
Add:
- function: pub::get_dynamic_routing_connection
**crates/external_services/src/grpc_client/health_check_client.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Modify existing code
**crates/router/src/core/routing.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Modify existing code
|
{"pr_number": 8589, "pr_title": "refactor(dynamic_routing): make the dynamo configs optional", "merged_at": "2025-07-14T14:01:25Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/payments/routing.rs", "crates/router/src/core/routing.rs", "crates/router/src/core/routing/helpers.rs"], "other": ["crates/external_services/src/grpc_client.rs", "crates/external_services/src/grpc_client/dynamic_routing.rs", "crates/external_services/src/grpc_client/health_check_client.rs"]}, "change_types": {"functions_added": 1, "fields_added": 8}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [ADYEN] field type fixed for required fields
## 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 -->
Field type fixed for required fields, also enabled shift4 PMs in dashboard in this PR.
- permata_bank_transfer
- bca_bank_transfer
- bni_va
- bri_va
- cimb_va
- danamon_va
- mandiri_va
- seven_eleven
- mini_stop
- family_mart
- seicomart
- pay_easy
- lawson
- alfamart
- indomaret
- alma
for the above payment methods,
the required field should be
"billing.address.first_name" {
...
"field_type": "user_billing_name",
...
}
"billing.address.last_name" {
...
"field_type": "user_billing_name",
...
}
but it is like this,
"billing.address.first_name" {
...
"field_type": "user_full_name",
...
}
"billing.address.last_name" {
...
"field_type": "user_full_name",
...
}
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
```
curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_NdYUqAFWENVHNK2YIePP_secret_hhHvc1vUMPIC3djvufq9' \
--header 'Accept: */*' \
--header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'Connection: keep-alive' \
--header 'Origin: https://beta.hyperswitch.io' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: cross-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36' \
--header 'api-key: pk_dev_acfb02da5ee64c7f8fd2115e0f549000' \
--header 'baggage: sentry-environment=development,sentry-release=0.3,sentry-public_key=ed73ce2fc9cce508bb3de3356f4bc4b5,sentry-trace_id=7bd5946610904a008d7e91efe472cf9a,sentry-org_id=4508930163474432,sentry-sampled=false,sentry-sample_rand=0.4233596865403535,sentry-sample_rate=0.1' \
--header 'content-type: application/json' \
--header 'sec-ch-ua: "Not;A=Brand";v="99", "Google Chrome";v="139", "Chromium";v="139"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sentry-trace: 7bd5946610904a008d7e91efe472cf9a-8902a256417eaccf-0' \
--header 'x-browser-name: Chrome' \
--header 'x-browser-version: 139.0.0' \
--header 'x-client-platform: web' \
--header 'x-client-version: 0.125.0' \
--header 'x-payment-confirm-source: sdk'
```
```
{"redirect_url":"https://google.com/success","currency":"IDR","payment_methods":[{"payment_method":"voucher","payment_method_types":[{"payment_method_type":"indomaret","payment_experience":[{"payment_experience_type":"redirect_to_url","eligible_connectors":["adyen"]}],"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":null,"required_fields":{"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"billing_first_name","field_type":"user_billing_name","value":null},"billing.email":{"required_field":"payment_method_data.billing.email","display_name":"email","field_type":"user_email_address","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"billing_last_name","field_type":"user_billing_name","value":null}},"surcharge_details":null,"pm_auth_connector":null},{"payment_method_type":"alfamart","payment_experience":[{"payment_experience_type":"redirect_to_url","eligible_connectors":["adyen"]}],"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":null,"required_fields":{"billing.email":{"required_field":"payment_method_data.billing.email","display_name":"email","field_type":"user_email_address","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"billing_last_name","field_type":"user_billing_name","value":null},"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"billing_first_name","field_type":"user_billing_name","value":null}},"surcharge_details":null,"pm_auth_connector":null}]},{"payment_method":"wallet","payment_method_types":[{"payment_method_type":"google_pay","payment_experience":[{"payment_experience_type":"invoke_sdk_client","eligible_connectors":["adyen"]}],"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":null,"required_fields":{},"surcharge_details":null,"pm_auth_connector":null}]},{"payment_method":"crypto","payment_method_types":[{"payment_method_type":"crypto_currency","payment_experience":[{"payment_experience_type":"redirect_to_url","eligible_connectors":["adyen"]}],"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":null,"required_fields":null,"surcharge_details":null,"pm_auth_connector":null}]},{"payment_method":"card","payment_method_types":[{"payment_method_type":"debit","payment_experience":null,"card_networks":[{"card_network":"Visa","surcharge_details":null,"eligible_connectors":["adyen"]},{"card_network":"Mastercard","surcharge_details":null,"eligible_connectors":["adyen"]}],"bank_names":null,"bank_debits":null,"bank_transfers":null,"required_fields":{"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"card_holder_name","field_type":"user_full_name","value":null},"payment_method_data.card.card_exp_year":{"required_field":"payment_method_data.card.card_exp_year","display_name":"card_exp_year","field_type":"user_card_expiry_year","value":null},"payment_method_data.card.card_number":{"required_field":"payment_method_data.card.card_number","display_name":"card_number","field_type":"user_card_number","value":null},"payment_method_data.card.card_cvc":{"required_field":"payment_method_data.card.card_cvc","display_name":"card_cvc","field_type":"user_card_cvc","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"card_holder_name","field_type":"user_full_name","value":null},"payment_method_data.card.card_exp_month":{"required_field":"payment_method_data.card.card_exp_month","display_name":"card_exp_month","field_type":"user_card_expiry_month","value":null}},"surcharge_details":null,"pm_auth_connector":null},{"payment_method_type":"credit","payment_experience":null,"card_networks":[{"card_network":"Mastercard","surcharge_details":null,"eligible_connectors":["adyen"]},{"card_network":"Visa","surcharge_details":null,"eligible_connectors":["adyen"]}],"bank_names":null,"bank_debits":null,"bank_transfers":null,"required_fields":{"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"card_holder_name","field_type":"user_full_name","value":null},"payment_method_data.card.card_exp_year":{"required_field":"payment_method_data.card.card_exp_year","display_name":"card_exp_year","field_type":"user_card_expiry_year","value":null},"payment_method_data.card.card_number":{"required_field":"payment_method_data.card.card_number","display_name":"card_number","field_type":"user_card_number","value":null},"payment_method_data.card.card_cvc":{"required_field":"payment_method_data.card.card_cvc","display_name":"card_cvc","field_type":"user_card_cvc","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"card_holder_name","field_type":"user_full_name","value":null},"payment_method_data.card.card_exp_month":{"required_field":"payment_method_data.card.card_exp_month","display_name":"card_exp_month","field_type":"user_card_expiry_month","value":null}},"surcharge_details":null,"pm_auth_connector":null}]},{"payment_method":"bank_redirect","payment_method_types":[{"payment_method_type":"przelewy24","payment_experience":null,"card_networks":null,"bank_names":[],"bank_debits":null,"bank_transfers":null,"required_fields":null,"surcharge_details":null,"pm_auth_connector":null}]},{"payment_method":"bank_transfer","payment_method_types":[{"payment_method_type":"permata_bank_transfer","payment_experience":null,"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":{"eligible_connectors":["adyen"]},"required_fields":{"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"billing_first_name","field_type":"user_billing_name","value":null},"billing.email":{"required_field":"payment_method_data.billing.email","display_name":"email","field_type":"user_email_address","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"billing_last_name","field_type":"user_billing_name","value":null}},"surcharge_details":null,"pm_auth_connector":null},{"payment_method_type":"bni_va","payment_experience":null,"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":{"eligible_connectors":["adyen"]},"required_fields":{"billing.email":{"required_field":"payment_method_data.billing.email","display_name":"email","field_type":"user_email_address","value":null},"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"billing_first_name","field_type":"user_billing_name","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"billing_last_name","field_type":"user_billing_name","value":null}},"surcharge_details":null,"pm_auth_connector":null},{"payment_method_type":"bri_va","payment_experience":null,"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":{"eligible_connectors":["adyen"]},"required_fields":{"billing.email":{"required_field":"payment_method_data.billing.email","display_name":"email","field_type":"user_email_address","value":null},"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"billing_first_name","field_type":"user_billing_name","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"billing_last_name","field_type":"user_billing_name","value":null}},"surcharge_details":null,"pm_auth_connector":null},{"payment_method_type":"danamon_va","payment_experience":null,"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":{"eligible_connectors":["adyen"]},"required_fields":{"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"billing_first_name","field_type":"user_billing_name","value":null},"billing.email":{"required_field":"payment_method_data.billing.email","display_name":"email","field_type":"user_email_address","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"billing_last_name","field_type":"user_billing_name","value":null}},"surcharge_details":null,"pm_auth_connector":null},{"payment_method_type":"bca_bank_transfer","payment_experience":null,"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":{"eligible_connectors":["adyen"]},"required_fields":{"billing.email":{"required_field":"payment_method_data.billing.email","display_name":"email","field_type":"user_email_address","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"billing_last_name","field_type":"user_billing_name","value":null},"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"billing_first_name","field_type":"user_billing_name","value":null}},"surcharge_details":null,"pm_auth_connector":null},{"payment_method_type":"mandiri_va","payment_experience":null,"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":{"eligible_connectors":["adyen"]},"required_fields":{"billing.email":{"required_field":"payment_method_data.billing.email","display_name":"email","field_type":"user_email_address","value":null},"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"billing_first_name","field_type":"user_billing_name","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"billing_last_name","field_type":"user_billing_name","value":null}},"surcharge_details":null,"pm_auth_connector":null},{"payment_method_type":"cimb_va","payment_experience":null,"card_networks":null,"bank_names":null,"bank_debits":null,"bank_transfers":{"eligible_connectors":["adyen","adyen"]},"required_fields":{"billing.address.first_name":{"required_field":"payment_method_data.billing.address.first_name","display_name":"billing_first_name","field_type":"user_billing_name","value":null},"billing.address.last_name":{"required_field":"payment_method_data.billing.address.last_name","display_name":"billing_last_name","field_type":"user_billing_name","value":null},"billing.email":{"required_field":"payment_method_data.billing.email","display_name":"email","field_type":"user_email_address","value":null}},"surcharge_details":null,"pm_auth_connector":null}]}],"mandate_payment":null,"merchant_name":"NewAge Retailer","show_surcharge_breakup_screen":false,"payment_type":"normal","request_external_three_ds_authentication":false,"collect_shipping_details_from_wallets":false,"collect_billing_details_from_wallets":false,"is_tax_calculation_enabled":false}
```
No changes done for the connector, only PML response is modified in the PR.
<img width="691" height="726" alt="Screenshot 2025-09-04 at 3 00 36 PM" src="https://github.com/user-attachments/assets/9a02e251-6048-450d-bcae-9fba49a14077" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
- ... and 1 more files
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit b69ed069:
Files to modify:
**crates/payment_methods/src/configs/payment_connector_required_fields.rs**
Remove:
- function: private::billing_email_name_phone
Add:
- function: private::billing_email_billing_name
- function: private::billing_email_billing_name_phone
|
{"pr_number": 8997, "pr_title": "fix(connector): [ADYEN] field type fixed for required fields", "merged_at": "2025-09-17T12:12:59Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/payment_methods/src/configs/payment_connector_required_fields.rs"]}, "change_types": {"functions_added": 2, "fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore: enable `clippy::trivially_copy_pass_by_ref` lint and address it
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR enables and addresses the [`trivially_copy_pass_by_ref`](https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref) clippy lint. The lint helps identify places in code where types which implement the `Copy` trait are passed by reference, while it would be cheaper to pass them by value instead. In our case, most of these are enums, which are only 1 or 2 bytes. A similar reasoning applies to `Option<T>` parameters where `T: Copy`.
Note that the lint only identifies function parameters, but not fields in structs. For instance, some of our Kafka-related types, say [`KafkaRefund`](https://github.com/juspay/hyperswitch/blob/bea4b9e7f430c3d7fbb25be0b472d2afb01135ec/crates/router/src/services/kafka/refund.rs#L9-L36), still have fields that hold references to bools and enums which implement `Copy`.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
The lint helps identify places in code where types which implement the `Copy` trait are passed by reference, while it would be cheaper to pass them by value instead.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
I'd expect this PR to have no behavior changes, all our existing CI checks should pass, as before.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **refund** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/connector_enums.rs`
**2. Database Layer (Queries & Schema)**
- `crates/analytics/src/query.rs`
**3. Core Business Logic**
- `crates/analytics/src/api_event/core.rs`
- `crates/analytics/src/auth_events/core.rs`
- `crates/analytics/src/disputes/core.rs`
- ... and 34 more files
**4. External Connector Integration**
- `crates/analytics/src/payments/metrics/connector_success_rate.rs`
- `crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs`
- `crates/hyperswitch_connectors/src/connectors/cashtocode.rs`
- ... and 7 more files
**5. Type Definitions**
- `crates/common_utils/src/types.rs`
- `crates/router/src/types/api.rs`
**6. Utils**
- `crates/common_utils/src/id_type.rs`
- `crates/common_utils/src/id_type/global_id.rs`
- `crates/kgraph_utils/src/mca.rs`
- ... and 3 more files
**7. Configuration Files**
- `Cargo.toml`
- `crates/router_env/src/logger/config.rs`
**8. Other**
- `crates/analytics/src/api_event/metrics.rs`
- `crates/analytics/src/api_event/metrics/api_count.rs`
- `crates/analytics/src/api_event/metrics/latency.rs`
- ... and 92 more files
**Code Patterns Applied:**
- Implement new functions (39 changes)
- Extend existing types with new fields (141 changes)
- Add conditional logic for feature flags or filtering (71 changes)
- Modify database queries (9 changes)
**Detailed Identifier Changes:**
Commit d17d2fe0:
Files to modify:
**crates/analytics/src/api_event/core.rs**
Modify existing code
**crates/analytics/src/api_event/metrics.rs**
Modify existing code
**crates/analytics/src/api_event/metrics/api_count.rs**
Modify existing code
**crates/analytics/src/api_event/metrics/latency.rs**
Modify existing code
**crates/analytics/src/api_event/metrics/status_code_count.rs**
Modify existing code
**crates/analytics/src/auth_events/core.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/authentication_success_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/challenge_flow_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/challenge_success_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/frictionless_success_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/three_ds_sdk_count.rs**
Modify existing code
**crates/analytics/src/disputes/core.rs**
Modify existing code
**crates/analytics/src/disputes/metrics.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/dispute_status_metric.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/total_amount_disputed.rs**
Modify existing code
**crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs**
Modify existing code
**crates/analytics/src/frm/core.rs**
Modify existing code
**crates/analytics/src/frm/metrics.rs**
Modify existing code
**crates/analytics/src/frm/metrics/frm_blocked_rate.rs**
Modify existing code
**crates/analytics/src/frm/metrics/frm_triggered_attempts.rs**
Modify existing code
**crates/analytics/src/lib.rs**
Modify existing code
**crates/analytics/src/opensearch.rs**
Modify existing code
**crates/analytics/src/payment_intents/core.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/payment_intent_count.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/payments_success_rate.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs**
Modify existing code
**crates/analytics/src/payment_intents/metrics/total_smart_retries.rs**
Modify existing code
**crates/analytics/src/payments/core.rs**
Modify existing code
**crates/analytics/src/payments/distribution.rs**
Modify existing code
**crates/analytics/src/payments/distribution/payment_error_message.rs**
Modify existing code
**crates/analytics/src/payments/metrics.rs**
Modify existing code
**crates/analytics/src/payments/metrics/avg_ticket_size.rs**
Modify existing code
**crates/analytics/src/payments/metrics/connector_success_rate.rs**
Modify existing code
**crates/analytics/src/payments/metrics/payment_count.rs**
Modify existing code
**crates/analytics/src/payments/metrics/payment_processed_amount.rs**
Modify existing code
**crates/analytics/src/payments/metrics/payment_success_count.rs**
Modify existing code
**crates/analytics/src/payments/metrics/retries_count.rs**
Modify existing code
**crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs**
Modify existing code
**crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs**
Modify existing code
**crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs**
Modify existing code
**crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs**
Modify existing code
**crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs**
Modify existing code
**crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs**
Modify existing code
**crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs**
Modify existing code
**crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs**
Modify existing code
**crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs**
Modify existing code
**crates/analytics/src/payments/metrics/success_rate.rs**
Modify existing code
**crates/analytics/src/query.rs**
Modify existing code
**crates/analytics/src/refunds/core.rs**
Modify existing code
**crates/analytics/src/refunds/metrics.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/refund_count.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/refund_processed_amount.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/refund_success_count.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/refund_success_rate.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs**
Modify existing code
**crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs**
Modify existing code
**crates/analytics/src/sdk_events/core.rs**
Modify existing code
**crates/analytics/src/sdk_events/metrics.rs**
Modify existing code
**crates/analytics/src/sdk_events/metrics/average_payment_time.rs**
Modify existing code
**crates/analytics/src/sdk_events/metrics/load_time.rs**
Modify existing code
**crates/analytics/src/sdk_events/metrics/payment_attempts.rs**
Modify existing code
**crates/analytics/src/sdk_events/metrics/payment_data_filled_count.rs**
Modify existing code
**crates/analytics/src/sdk_events/metrics/payment_method_selected_count.rs**
Modify existing code
**crates/analytics/src/sdk_events/metrics/payment_methods_call_count.rs**
Modify existing code
**crates/analytics/src/sdk_events/metrics/sdk_initiated_count.rs**
Modify existing code
**crates/analytics/src/sdk_events/metrics/sdk_rendered_count.rs**
Modify existing code
**crates/api_models/src/connector_enums.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_enums/src/transformers.rs**
Modify existing code
**crates/common_utils/src/id_type.rs**
Modify existing code
**crates/common_utils/src/id_type/global_id.rs**
Modify existing code
**crates/common_utils/src/types.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cashtocode.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/rapyd.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldline.rs**
Modify existing code
**crates/kgraph_utils/src/mca.rs**
Modify existing code
**crates/router/src/bin/router.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
**crates/router/src/connector/paybox/transformers.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payment_link.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
**crates/router/src/core/payment_methods/utils.rs**
Modify existing code
**crates/router/src/core/payment_methods/vault.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/flows/session_flow.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_approve.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_cancel.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_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_reject.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_session.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_start.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_status.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
**crates/router/src/core/payments/operations/payments_incremental_authorization.rs**
Modify existing code
**crates/router/src/core/payments/operations/tax_calculation.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/payout_link.rs**
Modify existing code
**crates/router/src/core/payouts.rs**
Modify existing code
**crates/router/src/core/payouts/helpers.rs**
Modify existing code
**crates/router/src/core/routing.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/core/user/dashboard_metadata.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/metrics/bg_metrics_collector.rs**
Modify existing code
**crates/router/src/routes/routing.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Modify existing code
**crates/router/src/services/authorization.rs**
Modify existing code
**crates/router/src/services/authorization/permission_groups.rs**
Modify existing code
**crates/router/src/services/authorization/permissions.rs**
Modify existing code
**crates/router/src/services/authorization/roles.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/utils/user.rs**
Modify existing code
**crates/router/src/utils/user/dashboard_metadata.rs**
Modify existing code
**crates/router/tests/connectors/payeezy.rs**
Modify existing code
**crates/router_derive/src/macros/to_encryptable.rs**
Modify existing code
**crates/router_env/src/logger/config.rs**
Modify existing code
**crates/router_env/src/logger/formatter.rs**
Modify existing code
**crates/scheduler/src/utils.rs**
Modify existing code
**crates/storage_impl/src/lib.rs**
Modify existing code
**crates/storage_impl/src/lookup.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_intent.rs**
Modify existing code
**crates/storage_impl/src/payouts/payout_attempt.rs**
Modify existing code
**crates/storage_impl/src/payouts/payouts.rs**
Modify existing code
|
{"pr_number": 6724, "pr_title": "chore: enable `clippy::trivially_copy_pass_by_ref` lint and address it", "merged_at": "2024-12-05T15:09:29Z", "intent": {"feature_type": "refund", "action": "add_feature", "entities": ["refund"]}, "hierarchy": {"api_models": ["crates/api_models/src/connector_enums.rs"], "database": ["crates/analytics/src/query.rs"], "core_business": ["crates/analytics/src/api_event/core.rs", "crates/analytics/src/auth_events/core.rs", "crates/analytics/src/disputes/core.rs", "crates/analytics/src/frm/core.rs", "crates/analytics/src/payment_intents/core.rs", "crates/analytics/src/payments/core.rs", "crates/analytics/src/refunds/core.rs", "crates/analytics/src/sdk_events/core.rs", "crates/router/src/core/admin.rs", "crates/router/src/core/payment_link.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payment_methods/utils.rs", "crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/flows/session_flow.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_approve.rs", "crates/router/src/core/payments/operations/payment_cancel.rs", "crates/router/src/core/payments/operations/payment_complete_authorize.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_reject.rs", "crates/router/src/core/payments/operations/payment_session.rs", "crates/router/src/core/payments/operations/payment_start.rs", "crates/router/src/core/payments/operations/payment_status.rs", "crates/router/src/core/payments/operations/payment_update.rs", "crates/router/src/core/payments/operations/payments_incremental_authorization.rs", "crates/router/src/core/payments/operations/tax_calculation.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/payout_link.rs", "crates/router/src/core/payouts.rs", "crates/router/src/core/payouts/helpers.rs", "crates/router/src/core/routing.rs", "crates/router/src/core/routing/helpers.rs", "crates/router/src/core/user.rs", "crates/router/src/core/user/dashboard_metadata.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/analytics/src/payments/metrics/connector_success_rate.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs", "crates/hyperswitch_connectors/src/connectors/cashtocode.rs", "crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs", "crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs", "crates/hyperswitch_connectors/src/connectors/rapyd.rs", "crates/hyperswitch_connectors/src/connectors/worldline.rs", "crates/router/src/connector/adyen/transformers.rs", "crates/router/src/connector/paybox/transformers.rs", "crates/router/tests/connectors/payeezy.rs"], "types": ["crates/common_utils/src/types.rs", "crates/router/src/types/api.rs"], "utils": ["crates/common_utils/src/id_type.rs", "crates/common_utils/src/id_type/global_id.rs", "crates/kgraph_utils/src/mca.rs", "crates/router/src/utils/user.rs", "crates/router/src/utils/user/dashboard_metadata.rs", "crates/scheduler/src/utils.rs"], "config": ["Cargo.toml", "crates/router_env/src/logger/config.rs"], "other": ["crates/analytics/src/api_event/metrics.rs", "crates/analytics/src/api_event/metrics/api_count.rs", "crates/analytics/src/api_event/metrics/latency.rs", "crates/analytics/src/api_event/metrics/status_code_count.rs", "crates/analytics/src/auth_events/metrics.rs", "crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs", "crates/analytics/src/auth_events/metrics/authentication_success_count.rs", "crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs", "crates/analytics/src/auth_events/metrics/challenge_flow_count.rs", "crates/analytics/src/auth_events/metrics/challenge_success_count.rs", "crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs", "crates/analytics/src/auth_events/metrics/frictionless_success_count.rs", "crates/analytics/src/auth_events/metrics/three_ds_sdk_count.rs", "crates/analytics/src/disputes/metrics.rs", "crates/analytics/src/disputes/metrics/dispute_status_metric.rs", "crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs", "crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs", "crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs", "crates/analytics/src/disputes/metrics/total_amount_disputed.rs", "crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs", "crates/analytics/src/frm/metrics.rs", "crates/analytics/src/frm/metrics/frm_blocked_rate.rs", "crates/analytics/src/frm/metrics/frm_triggered_attempts.rs", "crates/analytics/src/lib.rs", "crates/analytics/src/opensearch.rs", "crates/analytics/src/payment_intents/metrics.rs", "crates/analytics/src/payment_intents/metrics/payment_intent_count.rs", "crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs", "crates/analytics/src/payment_intents/metrics/payments_success_rate.rs", "crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs", "crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs", "crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs", "crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs", "crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs", "crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs", "crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs", "crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs", "crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs", "crates/analytics/src/payment_intents/metrics/total_smart_retries.rs", "crates/analytics/src/payments/distribution.rs", "crates/analytics/src/payments/distribution/payment_error_message.rs", "crates/analytics/src/payments/metrics.rs", "crates/analytics/src/payments/metrics/avg_ticket_size.rs", "crates/analytics/src/payments/metrics/payment_count.rs", "crates/analytics/src/payments/metrics/payment_processed_amount.rs", "crates/analytics/src/payments/metrics/payment_success_count.rs", "crates/analytics/src/payments/metrics/retries_count.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs", "crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs", "crates/analytics/src/payments/metrics/success_rate.rs", "crates/analytics/src/refunds/metrics.rs", "crates/analytics/src/refunds/metrics/refund_count.rs", "crates/analytics/src/refunds/metrics/refund_processed_amount.rs", "crates/analytics/src/refunds/metrics/refund_success_count.rs", "crates/analytics/src/refunds/metrics/refund_success_rate.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs", "crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs", "crates/analytics/src/sdk_events/metrics.rs", "crates/analytics/src/sdk_events/metrics/average_payment_time.rs", "crates/analytics/src/sdk_events/metrics/load_time.rs", "crates/analytics/src/sdk_events/metrics/payment_attempts.rs", "crates/analytics/src/sdk_events/metrics/payment_data_filled_count.rs", "crates/analytics/src/sdk_events/metrics/payment_method_selected_count.rs", "crates/analytics/src/sdk_events/metrics/payment_methods_call_count.rs", "crates/analytics/src/sdk_events/metrics/sdk_initiated_count.rs", "crates/analytics/src/sdk_events/metrics/sdk_rendered_count.rs", "crates/common_enums/src/enums.rs", "crates/common_enums/src/transformers.rs", "crates/router/src/bin/router.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/metrics/bg_metrics_collector.rs", "crates/router/src/routes/routing.rs", "crates/router/src/services/authentication.rs", "crates/router/src/services/authorization.rs", "crates/router/src/services/authorization/permission_groups.rs", "crates/router/src/services/authorization/permissions.rs", "crates/router/src/services/authorization/roles.rs", "crates/router_derive/src/macros/to_encryptable.rs", "crates/router_env/src/logger/formatter.rs", "crates/storage_impl/src/lib.rs", "crates/storage_impl/src/lookup.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "crates/storage_impl/src/payments/payment_intent.rs", "crates/storage_impl/src/payouts/payout_attempt.rs", "crates/storage_impl/src/payouts/payouts.rs"]}, "change_types": {"functions_added": 39, "fields_added": 141, "imports_added": 1, "conditionals_added": 71, "database_queries": 9}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore: change serde value to strict type in payment intent domain and diesel model
## 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 -->
Changes in this PR.
* Changed the types of following fields in PaymentIntent Diesel and Domain models to appropriate Structs from `serde::Value`
* Renamed `struct AuthenticationDataV2 `to `AuthenticationData` and added v1 and v2feature flags
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
This PR only has refactor changes. Continuation of this PR https://github.com/juspay/hyperswitch/pull/6193.
Same test cases apply here as well.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/lib.rs`
- `crates/diesel_models/src/payment_intent.rs`
- `crates/diesel_models/src/types.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/lib.rs`
- `crates/hyperswitch_domain_models/src/payments.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`
- ... and 3 more files
**4. Core Business Logic**
- `crates/router/src/core/fraud_check/types.rs`
- `crates/router/src/core/payments/transformers.rs`
- `crates/router/src/core/utils.rs`
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/utils.rs`
- `crates/router/src/connector/adyen/transformers.rs`
- `crates/router/src/connector/riskified/transformers/api.rs`
- ... and 5 more files
**6. Utils**
- `crates/common_utils/src/hashing.rs`
**7. Configuration Files**
- `crates/common_enums/Cargo.toml`
**8. Other**
- `Cargo.lock`
- `crates/common_enums/src/enums.rs`
- `crates/common_enums/src/enums/payments.rs`
- ... and 20 more files
**Code Patterns Applied:**
- Define new data structures (4 changes)
- Implement new functions (25 changes)
- Extend existing types with new fields (92 changes)
- Add conditional logic for feature flags or filtering (5 changes)
**Detailed Identifier Changes:**
Commit a5ac69d1:
Files to modify:
**crates/api_models/src/payments.rs**
Remove:
- enum: pub::ProductType
**crates/common_enums/src/enums.rs**
Add:
- impl: impl masking::SerializableSecret for PaymentMethodType
- mod: private::payments
**crates/common_enums/src/enums/payments.rs**
Add:
- enum: pub::ProductType
**crates/common_utils/src/hashing.rs**
Modify existing code
**crates/diesel_models/src/lib.rs**
Add:
- mod: pub::types
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/diesel_models/src/types.rs**
Add:
- struct: pub::OrderDetailsWithAmount
- struct: pub::FeatureMetadata
- struct: pub::RedirectResponse
- impl: impl masking::SerializableSecret for OrderDetailsWithAmount
- impl: impl masking::SerializableSecret for FeatureMetadata
- impl: impl masking::SerializableSecret for RedirectResponse
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- function: private::convert_from
- function: private::convert_back
- function: private::convert_from
- function: private::convert_back
- function: private::convert_from
- function: private::convert_back
- function: private::convert_back
- function: private::convert_back
- function: private::convert_back
- impl: impl ApiModelToDieselModelConvertor<ApiFeatureMetadata> for FeatureMetadata
- impl: impl ApiModelToDieselModelConvertor<ApiRedirectResponse> for RedirectResponse
- impl: impl ApiModelToDieselModelConvertor<ApiOrderDetailsWithAmount> for OrderDetailsWithAmount
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/fraud_check.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/masking/src/strategy.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/analytics.rs**
Add:
- function: pub::server
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
**crates/router/src/connector/riskified/transformers/api.rs**
Modify existing code
**crates/router/src/connector/signifyd/transformers/api.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Modify existing code
**crates/router/src/core/fraud_check/types.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/db/kafka_store.rs**
Modify existing code
**crates/router/src/db/merchant_account.rs**
Modify existing code
**crates/router/src/routes/admin.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- function: pub::server
- function: pub::server
- function: pub::server
- function: pub::server
**crates/router/src/routes/cards_info.rs**
Modify existing code
**crates/router/src/routes/currency.rs**
Modify existing code
**crates/router/src/routes/disputes.rs**
Modify existing code
**crates/router/src/routes/files.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Modify existing code
**crates/router/src/routes/payout_link.rs**
Modify existing code
**crates/router/src/routes/payouts.rs**
Modify existing code
**crates/router/src/routes/profiles.rs**
Modify existing code
**crates/router/src/routes/routing.rs**
Add:
- function: pub::routing_create_config
- function: pub::routing_retrieve_config
**crates/router/src/routes/verification.rs**
Modify existing code
**crates/router/src/routes/verify_connector.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Modify existing code
**crates/router/tests/connectors/payme.rs**
Modify existing code
**crates/router/tests/connectors/zen.rs**
Modify existing code
|
{"pr_number": 6393, "pr_title": "chore: change serde value to strict type in payment intent domain and diesel model", "merged_at": "2024-11-08T07:49:50Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/lib.rs", "crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/types.rs"], "domain": ["crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_request_types/fraud_check.rs", "crates/hyperswitch_domain_models/src/types.rs"], "core_business": ["crates/router/src/core/fraud_check/types.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/adyen/transformers.rs", "crates/router/src/connector/riskified/transformers/api.rs", "crates/router/src/connector/signifyd/transformers/api.rs", "crates/router/src/connector/utils.rs", "crates/router/src/routes/verify_connector.rs", "crates/router/tests/connectors/payme.rs", "crates/router/tests/connectors/zen.rs"], "utils": ["crates/common_utils/src/hashing.rs"], "config": ["crates/common_enums/Cargo.toml"], "other": ["Cargo.lock", "crates/common_enums/src/enums.rs", "crates/common_enums/src/enums/payments.rs", "crates/masking/src/strategy.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/analytics.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/merchant_account.rs", "crates/router/src/routes/admin.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/cards_info.rs", "crates/router/src/routes/currency.rs", "crates/router/src/routes/disputes.rs", "crates/router/src/routes/files.rs", "crates/router/src/routes/payment_methods.rs", "crates/router/src/routes/payments.rs", "crates/router/src/routes/payout_link.rs", "crates/router/src/routes/payouts.rs", "crates/router/src/routes/profiles.rs", "crates/router/src/routes/routing.rs", "crates/router/src/routes/verification.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"structs_added": 4, "functions_added": 25, "enums_added": 1, "fields_added": 92, "imports_added": 26, "conditionals_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix: typos
## 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 fixes typos.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 typos in the repo.
closes https://github.com/juspay/hyperswitch/issues/8919
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
nothing 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 `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. API Request/Response Models**
- `crates/api_models/src/admin.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/routing/utils.rs`
**3. 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 50f0b97b:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs**
Modify existing code
**crates/router/src/core/payments/routing/utils.rs**
Modify existing code
|
{"pr_number": 8918, "pr_title": "fix: typos", "merged_at": "2025-08-13T10:55:54Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs"], "core_business": ["crates/router/src/core/payments/routing/utils.rs"], "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"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.