prompt
stringlengths 83
247k
| response
stringlengths 121
36.1k
| metadata
stringlengths 314
42.3k
|
|---|---|---|
fix(connector): [noon] address next_action_url being null for cards in 3ds payment
## 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 -->
ORIGINAL PR: https://github.com/juspay/hyperswitch/pull/7862
Fix Noon redirection.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## Clippy
<img width="1153" alt="Screenshot 2025-04-21 at 9 35 14 PM" src="https://github.com/user-attachments/assets/379bf7b3-a53c-4063-a195-33388981a40a" />
## How did you test it?
1. create payments for cards
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: _' \
--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": "[email protected]",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4000000000002701",
"card_exp_month": "01",
"card_exp_year": "2035",
"card_holder_name": "joseph Doe",
"card_cvc": "100"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "AE",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (iPhone NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "128.0.0.1"
},
"connector_metadata": {
"noon": {
"order_category": "pay"
}
},
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 390,
"account_name": "transaction_processing"
}
]
}'
```
Response
```
{
"payment_id": "pay_WEMpRS2dSPqvSDwcK7GI",
"merchant_id": "postman_merchant_GHAction_d454dc3a-a050-4353-81f2-4137042d2fa5",
"status": "requires_customer_action",
"amount": 390,
"net_amount": 390,
"shipping_cost": null,
"amount_capturable": 390,
"amount_received": null,
"connector": "noon",
"client_secret": "pay_WEMpRS2dSPqvSDwcK7GI_secret_tfiuX7BUmEEiD5cXnYSj",
"created": "2025-04-21T15:52:49.398Z",
"currency": "AED",
"customer_id": "sammantest2722",
"customer": {
"id": "sammantest2722",
"name": "Joseph Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "2701",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "INTL HDQTRS-CENTER OWNED",
"card_issuing_country": "UNITEDSTATES",
"card_isin": "400000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2035",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AE",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": [
{
"brand": null,
"amount": 390,
"category": null,
"quantity": 1,
"tax_rate": null,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"total_tax_amount": null,
"requires_shipping": null
}
],
"email": "[email protected]",
"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_WEMpRS2dSPqvSDwcK7GI/postman_merchant_GHAction_d454dc3a-a050-4353-81f2-4137042d2fa5/pay_WEMpRS2dSPqvSDwcK7GI_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": 1745250769,
"expires": 1745254369,
"secret": "epk_258b6242371e49de87b11ec760786ebd"
},
"manual_retry_allowed": null,
"connector_transaction_id": "201016052379",
"frm_message": null,
"metadata": null,
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": {
"order_category": "pay"
},
"braintree": null
},
"feature_metadata": null,
"reference_id": "pay_WEMpRS2dSPqvSDwcK7GI_1",
"payment_link": null,
"profile_id": "pro_vFAhahe8vxYUCVFfWJkD",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_vxFAhPLux0GKTVLZA3TZ",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-04-21T16:07:49.398Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "128.0.0.1",
"user_agent": "Mozilla/5.0 (iPhone NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-04-21T15:52:51.296Z",
"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
}
```
2. do retrieve
```
curl --location 'http://localhost:8080/payments/pay_WEMpRS2dSPqvSDwcK7GI?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: _'
```
Response
```
{
"payment_id": "pay_WEMpRS2dSPqvSDwcK7GI",
"merchant_id": "postman_merchant_GHAction_d454dc3a-a050-4353-81f2-4137042d2fa5",
"status": "succeeded",
"amount": 390,
"net_amount": 390,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 390,
"connector": "noon",
"client_secret": "pay_WEMpRS2dSPqvSDwcK7GI_secret_tfiuX7BUmEEiD5cXnYSj",
"created": "2025-04-21T15:52:49.398Z",
"currency": "AED",
"customer_id": "sammantest2722",
"customer": {
"id": "sammantest2722",
"name": "Joseph Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "2701",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "INTL HDQTRS-CENTER OWNED",
"card_issuing_country": "UNITEDSTATES",
"card_isin": "400000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "2035",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AE",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": [
{
"brand": null,
"amount": 390,
"category": null,
"quantity": 1,
"tax_rate": null,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"total_tax_amount": null,
"requires_shipping": null
}
],
"email": "[email protected]",
"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": "201016052379",
"frm_message": null,
"metadata": null,
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": {
"order_category": "pay"
},
"braintree": null
},
"feature_metadata": null,
"reference_id": "pay_WEMpRS2dSPqvSDwcK7GI_1",
"payment_link": null,
"profile_id": "pro_vFAhahe8vxYUCVFfWJkD",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_vxFAhPLux0GKTVLZA3TZ",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-04-21T16:07:49.398Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "128.0.0.1",
"user_agent": "Mozilla/5.0 (iPhone NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-04-21T15:52:59.993Z",
"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/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit a264bdea:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/noon/transformers.rs**
Modify existing code
|
{"pr_number": 7861, "pr_title": "fix(connector): [noon] address next_action_url being null for cards in 3ds payment", "merged_at": "2025-04-21T17:49:51Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/noon/transformers.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [BLUECODE] Added Bluecode Wallet QR Code Redirect Payment Method
## 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 Bluecode as a new wallet.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
MCA Create :
cURL :
```
curl --location 'http://localhost:8080/account/merchant_1753970617/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_LzO61A2VmE4jUsf5v7QlOyKaTNzNhPOJj2zDIfrKWeHsYKj2d3ozLjOIDcICBayB' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data '{
"connector_type": "payment_processor",
"connector_name": "bluecode",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": ""
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "bluecode",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"shop_name": "c2c_bluecode"
},
"connector_webhook_details": {
"merchant_secret": ""
},
"business_country": "US",
"business_label": "default"
}'
```
Payments Create :
cURL :
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_LzO61A2VmE4jUsf5v7QlOyKaTNzNhPOJj2zDIfrKWeHsYKj2d3ozLjOIDcICBayB' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data '{
"amount": 1,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"return_url": "https://duck.com",
"payment_method": "wallet",
"payment_method_type": "bluecode",
"payment_method_data": {
"wallet": {
"bluecode_redirect": {
}
}
},
"billing": {
"address": {
"first_name": "joseph",
"last_name": "Doe",
"line1": "1467",
"city": "San Fransico",
"country": "AT",
"zip": "94122"
}
}
}'
```
Response :
```
{
"payment_id": "pay_YmwRq8euCR1d3Z06bTiu",
"merchant_id": "merchant_1753892574",
"status": "requires_customer_action",
"amount": 1,
"net_amount": 1,
"shipping_cost": null,
"amount_capturable": 1,
"amount_received": null,
"connector": "bluecode",
"client_secret": "pay_YmwRq8euCR1d3Z06bTiu_secret_n5DdoJwxuRfffBMeR2Ga",
"created": "2025-07-30T16:25:43.534Z",
"currency": "EUR",
"customer_id": "abcdef",
"customer": {
"id": "abcdef",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AT",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "9123456789",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_YmwRq8euCR1d3Z06bTiu/merchant_1753892574/pay_YmwRq8euCR1d3Z06bTiu_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "bluecode",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "abcdef",
"created_at": 1753892743,
"expires": 1753896343,
"secret": "epk_bcd87058f1be45978789842956e9576d"
},
"manual_retry_allowed": null,
"connector_transaction_id": "FKT853GDY38FBD2GRALY",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "PPJ5MAEF8E7IS82BVOR4FVXZ7A",
"payment_link": null,
"profile_id": "pro_s1Di7VlqnUOmVqC6kE7L",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_v0GMYlanQEagnKHVQewV",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-30T16:40:43.534Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-07-30T16:25:45.094Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": 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
}
```
PSync (Post getting a webhook) - Happy case ( To test failed cases - cancel the QR code payment at the time of redirection from BC Sbx app)
cURL :
```
curl --location 'http://localhost:8080/payments/pay_YmwRq8euCR1d3Z06bTiu' \
--header 'Accept: application/json' \
--header 'api-key: dev_S3rn2ILcmEt0evQlJyhx97LTeTeEULjqqolFMHdzaKgzEvw34OsK8A86OSYWfIl4' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data ''
```
Response :
```
{
"payment_id": "pay_YmwRq8euCR1d3Z06bTiu",
"merchant_id": "merchant_1753892574",
"status": "succeeded",
"amount": 1,
"net_amount": 1,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1,
"connector": "bluecode",
"client_secret": "pay_YmwRq8euCR1d3Z06bTiu_secret_n5DdoJwxuRfffBMeR2Ga",
"created": "2025-07-30T16:25:43.534Z",
"currency": "EUR",
"customer_id": "abcdef",
"customer": {
"id": "abcdef",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AT",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "9123456789",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "bluecode",
"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": "FKT853GDY38FBD2GRALY",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "PPJ5MAEF8E7IS82BVOR4FVXZ7A",
"payment_link": null,
"profile_id": "pro_s1Di7VlqnUOmVqC6kE7L",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_v0GMYlanQEagnKHVQewV",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-30T16:40:43.534Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-07-30T16:26:21.164Z",
"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
}
```
Note: The Status will be updated only after getting a webhook
Redirect tab
<img width="1728" height="1117" alt="Screenshot 2025-07-25 at 11 29 35 PM" src="https://github.com/user-attachments/assets/81375d5c-986c-41dc-9ed5-421ceebf8983" />
Webhooks:
<img width="1916" height="328" alt="Screenshot 2025-08-01 at 1 48 12 PM" src="https://github.com/user-attachments/assets/1d90450e-6ba0-4aff-9819-8c9d46616d8b" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
**3. Core Business Logic**
- `crates/router/src/core/connector_validation.rs`
**4. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 37 more files
**5. Type Definitions**
- `crates/router/src/types/transformers.rs`
**6. Utils**
- `crates/kgraph_utils/src/mca.rs`
- `crates/kgraph_utils/src/transformers.rs`
- `crates/payment_methods/src/helpers.rs`
**7. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**8. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**9. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/common_enums/src/enums.rs`
- ... and 4 more files
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (9 changes)
- Extend existing types with new fields (139 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit c749bd9c:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::BluecodeQrRedirect
**crates/common_enums/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/connector_configs/src/connector.rs**
Modify existing code
**crates/euclid/src/frontend/dir/enums.rs**
Modify existing code
**crates/euclid/src/frontend/dir/lowering.rs**
Modify existing code
**crates/euclid/src/frontend/dir/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/aci/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bluecode.rs**
Remove:
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Bluecode
Add:
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Bluecode
**crates/hyperswitch_connectors/src/connectors/bluecode/transformers.rs**
Remove:
- enum: pub::BluecodePaymentStatus
Add:
- function: private::try_from
- struct: pub::BluecodeMetadataObject
- impl: impl TryFrom<&Option<common_utils::pii::SecretSerdeValue>> for BluecodeMetadataObject
**crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/boku/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/klarna.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/noon/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payme/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/square/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/zen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- struct: pub::BluecodeQrRedirect
**crates/kgraph_utils/src/mca.rs**
Modify existing code
**crates/kgraph_utils/src/transformers.rs**
Modify existing code
**crates/payment_methods/src/configs/payment_connector_required_fields.rs**
Modify existing code
**crates/payment_methods/src/helpers.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Modify existing code
**crates/router/src/core/connector_validation.rs**
Modify existing code
**crates/router/src/types/api/connector_mapping.rs**
Modify existing code
**crates/router/src/types/connector_transformers.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 8762, "pr_title": "feat(connector): [BLUECODE] Added Bluecode Wallet QR Code Redirect Payment Method", "merged_at": "2025-08-01T12:54:52Z", "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"], "core_business": ["crates/router/src/core/connector_validation.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/aci/transformers.rs", "crates/hyperswitch_connectors/src/connectors/adyen.rs", "crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs", "crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bluecode.rs", "crates/hyperswitch_connectors/src/connectors/bluecode/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs", "crates/hyperswitch_connectors/src/connectors/boku/transformers.rs", "crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/klarna.rs", "crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs", "crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs", "crates/hyperswitch_connectors/src/connectors/noon/transformers.rs", "crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payme/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs", "crates/hyperswitch_connectors/src/connectors/square/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/zen/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs", "crates/router/src/connector/utils.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/src/types/connector_transformers.rs"], "types": ["crates/router/src/types/transformers.rs"], "utils": ["crates/kgraph_utils/src/mca.rs", "crates/kgraph_utils/src/transformers.rs", "crates/payment_methods/src/helpers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/common_enums/src/enums.rs", "crates/common_enums/src/transformers.rs", "crates/euclid/src/frontend/dir/enums.rs", "crates/euclid/src/frontend/dir/lowering.rs", "crates/euclid/src/frontend/dir/transformers.rs"]}, "change_types": {"structs_added": 5, "functions_added": 9, "enums_added": 1, "fields_added": 139, "imports_added": 10, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [NMI] Add mandates flow
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Mandate payments support has been added to NMI.
https://support.nmi.com/hc/en-gb/articles/13923047779729-Using-the-Customer-Vault
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
https://github.com/juspay/hyperswitch/discussions/8291 https://github.com/juspay/hyperswitch/issues/8653
## How did you test 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 and added relevant cypress tests.
CIT:
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_6Qh8tlhJxGnzCnYSgZLYUcZg3se94a12xetjLpMLCE3srm2F6E3szTR3vJ8IRzxA' \
--data-raw '{
"amount": 1122,
"currency": "USD",
"confirm": true,
"profile_id": "pro_prQtzjS2YNKFt8NTnPhS",
"authentication_type": "no_three_ds",
"email": "[email protected]",
"customer_id": "vaily",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4532111111111112",
"card_exp_month": "10",
"card_exp_year": "25",
"card_cvc": "123"
}
},
"setup_future_usage": "off_session",
"customer_acceptance": {
"acceptance_type": "online"
}
}'
```
Response:
```
{
"payment_id": "pay_VosL2oOd5lEpfI5PFdAF",
"merchant_id": "merchant_1754040245",
"status": "succeeded",
"amount": 1122,
"net_amount": 1122,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1122,
"connector": "nmi",
"client_secret": "pay_VosL2oOd5lEpfI5PFdAF_secret_pwdKA6SfrJQA90LvmvQD",
"created": "2025-08-01T10:36:17.871Z",
"currency": "USD",
"customer_id": "vaily",
"customer": {
"id": "vaily",
"name": null,
"email": "[email protected]",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1112",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "453211",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_4z27khJu7gCT1bLHEHse",
"shipping": null,
"billing": null,
"order_details": null,
"email": "[email protected]",
"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": "vaily",
"created_at": 1754044577,
"expires": 1754048177,
"secret": "epk_554d3664984344ca9fe39c48ff4ff5ef"
},
"manual_retry_allowed": false,
"connector_transaction_id": "10979926051",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_VosL2oOd5lEpfI5PFdAF_1",
"payment_link": null,
"profile_id": "pro_prQtzjS2YNKFt8NTnPhS",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_PbTIQbItUvYnnqZyRRrC",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-01T10:51:17.871Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_MFTGiuZQ7jQOCCsyzy8p",
"payment_method_status": "active",
"updated": "2025-08-01T10:36:20.930Z",
"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": "212727464",
"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
}
```
MIT:
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_6Qh8tlhJxGnzCnYSgZLYUcZg3se94a12xetjLpMLCE3srm2F6E3szTR3vJ8IRzxA' \
--data '{
"amount": 1212,
"currency": "USD",
"confirm": true,
"capture_method": "manual",
"customer_id": "vaily2",
"recurring_details": {
"type": "payment_method_id",
"data": "pm_A6hbrqOFGArsNKgjkC9g"
},
"off_session": true
}'
```
Response:
```
{
"payment_id": "pay_vi4nShu5q4lHUEMgOnr3",
"merchant_id": "merchant_1754040245",
"status": "requires_capture",
"amount": 1212,
"net_amount": 1212,
"shipping_cost": null,
"amount_capturable": 1212,
"amount_received": null,
"connector": "nmi",
"client_secret": "pay_vi4nShu5q4lHUEMgOnr3_secret_j3hvcXvZE1amCwsXIEqZ",
"created": "2025-08-01T11:40:10.511Z",
"currency": "USD",
"customer_id": "vaily2",
"customer": {
"id": "vaily2",
"name": null,
"email": "[email protected]",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": "manual",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1112",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "453211",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "[email protected]",
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "vaily2",
"created_at": 1754048410,
"expires": 1754052010,
"secret": "epk_a9715d624aea41ec9f9428eaaaf8a6a6"
},
"manual_retry_allowed": false,
"connector_transaction_id": "10980179170",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_vi4nShu5q4lHUEMgOnr3_1",
"payment_link": null,
"profile_id": "pro_prQtzjS2YNKFt8NTnPhS",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_PbTIQbItUvYnnqZyRRrC",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-01T11:55:10.511Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_A6hbrqOFGArsNKgjkC9g",
"payment_method_status": "active",
"updated": "2025-08-01T11:40:13.459Z",
"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": "1452310032",
"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
}
```
Zero Dollar CIT:
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_uOYRh8w3a91uu4wD3LFPEXGKB1TqAk6Vi1weDW4da6jde8CnAIK9pjlmixcwDqmk' \
--data-raw '{
"amount": 0,
"currency": "USD",
"confirm": true,
"profile_id": "null",
"authentication_type": "no_three_ds",
"email": "[email protected]",
"customer_id": "email",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4532111111111112",
"card_exp_month": "10",
"card_exp_year": "25",
"card_cvc": "123"
}
},
"setup_future_usage": "off_session",
"customer_acceptance": {
"acceptance_type": "online"
},
"payment_type": "setup_mandate"
}'
```
Response:
```
{
"payment_id": "pay_ZMLElkI1TmhSqv7gIOO5",
"merchant_id": "merchant_1754412298",
"status": "succeeded",
"amount": 0,
"net_amount": 0,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "nmi",
"client_secret": "pay_ZMLElkI1TmhSqv7gIOO5_secret_u5yYt4m3R8cDkutUIEV5",
"created": "2025-08-05T16:46:39.306Z",
"currency": "USD",
"customer_id": "email",
"customer": {
"id": "email",
"name": null,
"email": "[email protected]",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1112",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "453211",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_QK0QtaO95lHS7dKGUTDd",
"shipping": null,
"billing": null,
"order_details": null,
"email": "[email protected]",
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "email",
"created_at": 1754412399,
"expires": 1754415999,
"secret": "epk_3d19001aea854585ac6ac597d4c31854"
},
"manual_retry_allowed": false,
"connector_transaction_id": "10996495844",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_ZMLElkI1TmhSqv7gIOO5_1",
"payment_link": null,
"profile_id": "pro_IR3qBTXCy9Mf2JnwgGx9",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_a2TxMLhdzJcO8xG0qDSD",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-05T17:01:39.305Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": "pm_w2iyEnG6GTv00S35UfKn",
"network_transaction_id": null,
"payment_method_status": "active",
"updated": "2025-08-05T16:46:42.940Z",
"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": "231615292",
"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
}
```
Cypress Tests:
<img width="561" height="861" alt="image" src="https://github.com/user-attachments/assets/16711370-5966-47aa-8f55-f553edbc5370" />
<img width="342" height="674" alt="image" src="https://github.com/user-attachments/assets/268e8139-4d0c-4ab3-be4d-beadcae15835" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/nmi.rs`
- `crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs`
**2. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Nmi.js`
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (137 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 6d235d78:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/nmi.rs**
Add:
- function: private::validate_mandate_payment
**crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs**
Remove:
- impl: impl TryFrom<&SetupMandateRouterData> for NmiPaymentsRequest
Add:
- struct: pub::NmiValidateRequest
|
{"pr_number": 8652, "pr_title": "feat(connector): [NMI] Add mandates flow", "merged_at": "2025-08-05T10:47:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/nmi.rs", "crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Nmi.js"]}, "change_types": {"structs_added": 2, "functions_added": 1, "fields_added": 137, "imports_added": 1, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [Cybersource] change commerce indicator for discover cards in apple pay
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
commerce indicator for discover card in applepay is changed since the payments are failing in production for cybersource
Note: This is hotifx against [#6690](https://github.com/juspay/hyperswitch/pull/6690)
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 for Cybersource:
- Create a Payment with Applepay:
```
{
"amount": 650,
"currency": "USD",
"confirm": true,
"amount_to_capture": 650,
"customer_id": "test_fb",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"email": "[email protected]",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "{{payment_data}}",
"payment_method": {
"display_name": "MasterCard 7599",
"network": "MasterCard",
"type": "credit"
},
"transaction_identifier": "{{transaction_identifier}}"
}
},
"billing": {
"address": {
"line1": "jhkdsa",
"zip": "10000",
"last_name": "chikke",
"city": "adf",
"country": "US",
"first_name": "srujan",
"state": "Alabama"
},
"email": "[email protected]"
}
}
}
```
- The payment should `succeed`
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/cybersource/transformers.rs`
**Detailed Identifier Changes:**
Commit 344a8829:
Files to modify:
**crates/router/src/connector/cybersource/transformers.rs**
Modify existing code
|
{"pr_number": 6728, "pr_title": "fix(connector): [Cybersource] change commerce indicator for discover cards in apple pay", "merged_at": "2024-12-03T10:39:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "card"]}, "hierarchy": {"connectors": ["crates/router/src/connector/cybersource/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(subscription): make invoice as an id type
This pull request introduces a new strongly-typed `InvoiceId` identifier and integrates it throughout the codebase to improve type safety and consistency for invoice-related operations. The changes affect both the common utilities and the invoice models, updating struct fields and constructors to use the new type instead of raw strings.
**Invoice ID type integration:**
* Added a new `InvoiceId` type in `common_utils::id_type` and made it available for use throughout the codebase. [[1]](diffhunk://#diff-d949a6c528436f8ab1a851147e7467d525cba63b395b253d1dec17101a971fa1R10) [[2]](diffhunk://#diff-d949a6c528436f8ab1a851147e7467d525cba63b395b253d1dec17101a971fa1R51)
* Updated the `InvoiceNew` and `Invoice` structs in `crates/diesel_models/src/invoice.rs` to use `InvoiceId` and `SubscriptionId` types for their respective fields, replacing previous usage of `String`. [[1]](diffhunk://#diff-cc8ce5ad039d65f1b8644286fe6abb6e8fae401fdb8e5f43f3984efdf2803696L11-R12) [[2]](diffhunk://#diff-cc8ce5ad039d65f1b8644286fe6abb6e8fae401fdb8e5f43f3984efdf2803696L37-R38)
* Modified the `InvoiceNew::new` constructor to automatically generate an `InvoiceId` using the new type, removing the need to pass an ID as a string argument. [[1]](diffhunk://#diff-cc8ce5ad039d65f1b8644286fe6abb6e8fae401fdb8e5f43f3984efdf2803696L65-R65) [[2]](diffhunk://#diff-cc8ce5ad039d65f1b8644286fe6abb6e8fae401fdb8e5f43f3984efdf2803696R78)
**Event type extension:**
* Added a new `Invoice` variant to the `ApiEventsType` enum to support invoice-related events.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
This can't be tested as it adds id type for invoice for which there is no external facing api.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **connector_integration** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/invoice.rs`
**2. Utils**
- `crates/common_utils/src/events.rs`
- `crates/common_utils/src/id_type.rs`
- `crates/common_utils/src/id_type/invoice.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (5 changes)
**Detailed Identifier Changes:**
Commit 3a4bc986:
Files to modify:
**crates/common_utils/src/events.rs**
Modify existing code
**crates/common_utils/src/id_type.rs**
Add:
- mod: private::invoice
**crates/common_utils/src/id_type/invoice.rs**
Add:
- function: private::get_api_event_type
- impl: impl crate::events::ApiEventMetric for InvoiceId
**crates/diesel_models/src/invoice.rs**
Modify existing code
|
{"pr_number": 9488, "pr_title": "refactor(subscription): make invoice as an id type", "merged_at": "2025-09-24T13:09:43Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": []}, "hierarchy": {"database": ["crates/diesel_models/src/invoice.rs"], "utils": ["crates/common_utils/src/events.rs", "crates/common_utils/src/id_type.rs", "crates/common_utils/src/id_type/invoice.rs"]}, "change_types": {"functions_added": 1, "fields_added": 5, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(vsaas): enable onboarding of Standard Merchant Accounts in Platform Organization
## 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 -->
### Summary
This PR enhances the merchant onboarding system by allowing **Platform Organizations** to onboard and manage **Standard Merchant Accounts**, in addition to the existing **Platform Merchant Account** and **Connected Merchant Accounts**.
### Background
Until now, a Platform Organization contained:
- A single **Platform Merchant Account**
- Other accounts as **Connected Merchant Accounts**
### Key Changes
- Updated merchant account creation logic to allow creating **Standard Merchant Accounts** in platform organizations
- Added organization validation when using Fallback API Key for `Organization Retrieve` and `Organization Update` APIs.
- Restricted creation of platform organization under an ENV.
### 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).
-->
To enable maintaining separate standalone merchant accounts in an organization with platform merchant capabilities.
## How did you test 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 Platform Organization and Platform Merchant:
Request:
```bash
curl --location 'http://localhost:8080/user/create_platform' \
--header 'cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMzgwZTNiMzAtYzU4Mi00YWU5LTkwZGItYjQ0YTVhYTNlOGVjIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxNzc5OTIxIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0OTEwNTE5Mywib3JnX2lkIjoib3JnX2lxdFFoY245YTRZV2owNVp1NENUIiwicHJvZmlsZV9pZCI6InByb19ybEl6aU1XNXhtdFNjOTI3WXRnayIsInRlbmFudF9pZCI6InB1YmxpYyJ9.Tg8EXphM7jV1yC3DdoNlfa-1pGMIAv0-ZPshOaNVDzA' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDNiNjMwMDAtMmMwOS00OWVhLTlkYzItMjRhNWNhOTJmZWM3IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQ4MzM4MDIxIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0OTExNzQyNywib3JnX2lkIjoib3JnX0NDdDQyRElkSWtyWDYyTXEzRjQxIiwicHJvZmlsZV9pZCI6InByb18wVnZVZ2YzbnRHN0Nwc3pSdktPWiIsInRlbmFudF9pZCI6InB1YmxpYyJ9.bhM7ccmFRjHKlWQ99diZBrI68k91UIAJjoZ3vh_8wMY' \
--data '{
"organization_name": "Platform Org"
}'
```
Expected Response:
```json
{
"org_id": "org_f4sSAyBcjVzF2y0kNVBr",
"org_name": "Platform Org",
"org_type": "platform",
"merchant_id": "merchant_1748946337",
"merchant_account_type": "platform"
}
```
### Create Merchant (Admin API):
Request:
```bash
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_YchtwHauMbGFYcGKE6pSnwnTZq5xY8nH5rnhngBROK0W9beGOOUPfJ6gvHFETfnM' \
--data-raw '{
"merchant_id": "merchant_1748954645",
"locker_id": "m0010",
"merchant_name": "Connected Merchant",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "[email protected]",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "[email protected]",
"secondary_phone": "cillum do dolor id",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name":"john",
"last_name":"Doe"
}
},
"organization_id": "org_f4sSAyBcjVzF2y0kNVBr",
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url":"https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"parent_merchant_id":"merchant_123",
"metadata": {
"city": "NY",
"unit": "245"
},
"primary_business_details": [
{
"country": "US",
"business": "default"
}
],
"merchant_account_type": "standard"
}'
```
Expected Response:
```json
{
"merchant_id": "merchant_1748954658",
"merchant_name": "Connected Merchant",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "ORSBBtzGCHe5xTQWyjU2VxEqEEC223hCzS5dOSHHUgOse74jmi8aDRqR6556hrxu",
"redirect_to_merchant_with_http_post": false,
"merchant_details": {
"primary_contact_person": "John Test",
"primary_phone": "sunt laborum",
"primary_email": "[email protected]",
"secondary_contact_person": "John Test2",
"secondary_phone": "cillum do dolor id",
"secondary_email": "[email protected]",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "john",
"last_name": "Doe"
}
},
"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
},
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "pk_dev_1541e0af88014d4092be7e323bfc7b3a",
"metadata": {
"city": "NY",
"unit": "245",
"compatible_connector": null
},
"locker_id": "m0010",
"primary_business_details": [
{
"country": "US",
"business": "default"
}
],
"frm_routing_algorithm": null,
"organization_id": "org_f4sSAyBcjVzF2y0kNVBr",
"is_recon_enabled": false,
"default_profile": "pro_wXPSR3hvAgWC9dx4B4QB",
"recon_status": "not_requested",
"pm_collect_link_config": null,
"product_type": "orchestration",
"merchant_account_type": "standard"
}
```
### User Create Merchant API:
Request:
```bash
curl --location 'http://localhost:8080/user/create_merchant' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDNiNjMwMDAtMmMwOS00OWVhLTlkYzItMjRhNWNhOTJmZWM3IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQ4OTQ2MzM3Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0OTExOTIzNSwib3JnX2lkIjoib3JnX2Y0c1NBeUJjalZ6RjJ5MGtOVkJyIiwicHJvZmlsZV9pZCI6InByb19QeEhmUzh1S2dYQWZOd2FkeFRudCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.TP03f06-NGhUjsfLTajO0TyK1OHLKE1Dq-DDQqyhRM0' \
--data '{
"company_name": "Standard Merchant 2",
"product_type": "orchestration",
"merchant_account_type": "standard"
}'
```
Expected Response:
```json
{
"merchant_id": "merchant_1748954749",
"merchant_name": "Standard Merchant 2",
"product_type": "orchestration",
"merchant_account_type": "standard",
"version": "v1"
}
```
## Test Cases for Merchant Account Creation
### OrganizationType::Standard
| `merchant_account_type` in request | Expected Behavior | Outcome |
|------------------------------------|-------------------------------|-----------------------------------|
| `None` | Treated as `Standard` | Standard Merchant account is created |
| `Standard` | Accepted | Standard Merchant account is created |
| `Connected` | Not allowed | Rejected with 400 (must be Standard) |
---
## OrganizationType::Platform (Platform merchant already exists)
(Platform Merchant can only be created when creating a Platform Organization)
| `merchant_account_type` in request | `allow_connected_merchants` | Expected Behavior | Outcome |
|------------------------------------|------------------------------|----------------------------------|------------------------------------------------|
| `None` | `any` | Defaults to `Standard` | Standard merchant account is created |
| `Standard` | `any` | Accepted | Standard merchant account is created |
| `Connected` | `true` | Accepted | Connected merchant account is created |
| `Connected` | `false` | Not allowed | Rejected with 400 (Connected not allowed) |
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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/user.rs`
**2. Core Business Logic**
- `crates/router/src/core/admin.rs`
**3. Type Definitions**
- `crates/router/src/types/domain/user.rs`
**4. Utils**
- `crates/router/src/utils/user.rs`
**5. Tests**
- `config/deployments/integration_test.toml`
**6. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 4 more files
**7. Other**
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- `crates/common_enums/src/enums/accounts.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (18 changes)
- Add conditional logic for feature flags or filtering (6 changes)
**Detailed Identifier Changes:**
Commit cb3aba8d:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/user.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_enums/src/enums/accounts.rs**
Add:
- enum: pub::MerchantAccountRequestType
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Modify existing code
**crates/router/src/configs/validations.rs**
Add:
- function: pub::validate
- impl: impl super::settings::Platform
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Remove:
- struct: pub::AdminApiAuthWithApiKeyFallback
Add:
- struct: pub::AdminApiAuthWithApiKeyFallback
**crates/router/src/types/domain/user.rs**
Modify existing code
**crates/router/src/utils/user.rs**
Modify existing code
|
{"pr_number": 8231, "pr_title": "feat(vsaas): enable onboarding of Standard Merchant Accounts in Platform Organization", "merged_at": "2025-06-06T20:02:49Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs", "crates/api_models/src/user.rs"], "core_business": ["crates/router/src/core/admin.rs"], "types": ["crates/router/src/types/domain/user.rs"], "utils": ["crates/router/src/utils/user.rs"], "tests": ["config/deployments/integration_test.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/settings.rs", "crates/router/src/configs/validations.rs"], "other": ["api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/common_enums/src/enums/accounts.rs", "crates/openapi/src/openapi.rs", "crates/router/src/routes/app.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"structs_added": 1, "functions_added": 1, "enums_added": 1, "fields_added": 18, "imports_added": 2, "conditionals_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): populate card network in the network transaction id based MIT flow
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
In the PG agnostic MIT flow (card details with network transaction id) the card network is being passed a null in the response. As the card network fetched form the card info lookup is not being used.
Additionally this pr also contains the changes to include the `network_transaction_id_supported_connectors` in `production.toml`. And pass internet as the commerce_indicator for discover cards in cybersource.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
-> Create merchant account and merchant connector account
-> enable `is_connector_agnostic_mit_enabled` flag
```
curl --location 'http://localhost:8080/account/merchant_1732783890/business_profile/pro_lNl3x8up5RJTzGLgq0cC' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"is_connector_agnostic_mit_enabled": true
}'
```
```
{
"merchant_id": "merchant_1732783890",
"profile_id": "pro_lNl3x8up5RJTzGLgq0cC",
"profile_name": "US_default",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "EHpgSu6g2VWesxu9L3tPGXVI7XuL1lqZ4CAwjYH3PUHr6VTiO1gyVuPsLSQoCGCO",
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": null,
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"metadata": null,
"routing_algorithm": null,
"intent_fulfillment_time": 900,
"frm_routing_algorithm": null,
"payout_routing_algorithm": null,
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"extended_card_info_config": null,
"collect_shipping_details_from_wallet_connector": false,
"collect_billing_details_from_wallet_connector": false,
"always_collect_shipping_details_from_wallet_connector": false,
"always_collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": true,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null,
"tax_connector_id": null,
"is_tax_connector_enabled": false,
"is_network_tokenization_enabled": false,
"is_auto_retries_enabled": false,
"max_auto_retries_enabled": null
}
```
-> Create a payment with `"setup_future_usage": "off_session",`
```
{
"amount": 100,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "cu_{{$timestamp}}",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "name name",
"card_cvc": "737"
}
},
"setup_future_usage": "off_session",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX",
"last_name": "ss"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "125.0.0.1"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {},
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 0,
"account_name": "transaction_processing"
}
]
}
```
```
{
"payment_id": "pay_fnfBuSFwvwVMzmk0OZM3",
"merchant_id": "merchant_1732784068",
"status": "succeeded",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 100,
"connector": "cybersource",
"client_secret": "pay_fnfBuSFwvwVMzmk0OZM3_secret_VoTLxuhAVA1mYPyTQyN4",
"created": "2024-11-28T08:55:25.492Z",
"currency": "USD",
"customer_id": "cu_1732784125",
"customer": {
"id": "cu_1732784125",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "STRIPE PAYMENTS UK LIMITED",
"card_issuing_country": "UNITEDKINGDOM",
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "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": "token_hrw68v72wmWkd6uDjNCl",
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": "ss"
},
"phone": null,
"email": null
},
"order_details": [
{
"brand": null,
"amount": 0,
"category": null,
"quantity": 1,
"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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cu_1732784125",
"created_at": 1732784125,
"expires": 1732787725,
"secret": "epk_06284b9a905f4c3aa196b00ad8112174"
},
"manual_retry_allowed": false,
"connector_transaction_id": "7327841265636354504951",
"frm_message": null,
"metadata": {},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_fnfBuSFwvwVMzmk0OZM3_1",
"payment_link": null,
"profile_id": "pro_ENrgK0m9AXuOtOMzxFju",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_N3lWoDG7yvB9rbvJFyrb",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-28T09:10:25.492Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "125.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_qUyvJqDRB16ItLjiBATM",
"payment_method_status": "active",
"updated": "2024-11-28T08:55:27.234Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "27F62F9C4E44ACD0E063AF598E0A7075"
}
```

-> Create a payment for the same customer
```
curl --location 'http://localhost:8080/payments' \
--header 'Accept: application/json' \
--header 'api-key: dev_JZ5SfN6HmdFyVadqiq6iO6cZD9JDnWNT0bVhEEbOFLbw9NXkYNNr3MaXXTpVjFEY' \
--header 'Content-Type: application/json' \
--data '{
"amount": 10000,
"currency": "USD",
"capture_method": "automatic",
"authentication_type": "three_ds",
"confirm": false,
"setup_future_usage": "off_session",
"customer_id": "cu_1732784125"
}'
```
```
{
"payment_id": "pay_Nxx6173Q7F2ES49eeMYr",
"merchant_id": "merchant_1732784068",
"status": "requires_payment_method",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_Nxx6173Q7F2ES49eeMYr_secret_2qPhrFGrz8F4ODupztNl",
"created": "2024-11-28T08:58:33.763Z",
"currency": "USD",
"customer_id": "cu_1732784125",
"customer": {
"id": "cu_1732784125",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cu_1732784125",
"created_at": 1732784313,
"expires": 1732787913,
"secret": "epk_9ed01dde281f46a0966f1c0d779f6099"
},
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_ENrgK0m9AXuOtOMzxFju",
"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-11-28T09:13:33.763Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-11-28T08:58:33.784Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
-> List customer pml with the client_secret
```
curl --location 'http://localhost:8080/customers/payment_methods?client_secret=pay_Nxx6173Q7F2ES49eeMYr_secret_2qPhrFGrz8F4ODupztNl' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_2cbdf84777ed4b15827d8bc8e6b19622'
```
```
{
"customer_payment_methods": [
{
"payment_token": "token_GN84Zv1iv1sbEpE9Fupv",
"payment_method_id": "pm_qUyvJqDRB16ItLjiBATM",
"customer_id": "cu_1732784125",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_issuer": "STRIPE PAYMENTS UK LIMITED",
"payment_method_issuer_code": null,
"recurring_enabled": true,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": "Visa",
"issuer_country": "UNITEDKINGDOM",
"last4_digits": "4242",
"expiry_month": "03",
"expiry_year": "2030",
"card_token": null,
"card_holder_name": "name name",
"card_fingerprint": null,
"nick_name": null,
"card_network": "Visa",
"card_isin": "424242",
"card_issuer": "STRIPE PAYMENTS UK LIMITED",
"card_type": "CREDIT",
"saved_to_locker": true
},
"metadata": null,
"created": "2024-11-28T08:55:27.197Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": false,
"last_used_at": "2024-11-28T08:55:27.197Z",
"default_payment_method_set": true,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "name",
"last_name": "name"
},
"phone": null,
"email": null
}
}
],
"is_guest_customer": false
}
```
-> Confirm the payment
```
curl --location 'http://localhost:8080/payments/pay_Nxx6173Q7F2ES49eeMYr/confirm' \
--header 'api-key: pk_dev_2cbdf84777ed4b15827d8bc8e6b19622' \
--header 'Content-Type: application/json' \
--data-raw '{
"payment_token": "token_GN84Zv1iv1sbEpE9Fupv",
"payment_method_type": "credit",
"payment_method": "card",
"client_secret": "pay_Nxx6173Q7F2ES49eeMYr_secret_2qPhrFGrz8F4ODupztNl",
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "[email protected]"
}
}'
```
```
{
"payment_id": "pay_Nxx6173Q7F2ES49eeMYr",
"merchant_id": "merchant_1732784068",
"status": "succeeded",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10000,
"connector": "cybersource",
"client_secret": "pay_Nxx6173Q7F2ES49eeMYr_secret_2qPhrFGrz8F4ODupztNl",
"created": "2024-11-28T08:58:33.763Z",
"currency": "USD",
"customer_id": "cu_1732784125",
"customer": {
"id": "cu_1732784125",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "STRIPE PAYMENTS UK LIMITED",
"card_issuing_country": "UNITEDKINGDOM",
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_GN84Zv1iv1sbEpE9Fupv",
"shipping": null,
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "[email protected]"
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "7327843962556379004951",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_Nxx6173Q7F2ES49eeMYr_1",
"payment_link": null,
"profile_id": "pro_ENrgK0m9AXuOtOMzxFju",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_N3lWoDG7yvB9rbvJFyrb",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-28T09:13:33.763Z",
"fingerprint": null,
"browser_info": {
"language": null,
"time_zone": null,
"ip_address": "::1",
"user_agent": null,
"color_depth": null,
"java_enabled": null,
"screen_width": null,
"accept_header": null,
"screen_height": null,
"java_script_enabled": null
},
"payment_method_id": "pm_qUyvJqDRB16ItLjiBATM",
"payment_method_status": "active",
"updated": "2024-11-28T08:59:56.654Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
-> Create a cit with stripe and perform the recurring with cybersource
```
{
"amount": 100,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "cu_{{$timestamp}}",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "name name",
"card_cvc": "737"
}
},
"setup_future_usage": "off_session",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX",
"last_name": "ss"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "125.0.0.1"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {},
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 0,
"account_name": "transaction_processing"
}
]
}
```
```
{
"payment_id": "pay_mKYKX3ChuavzS7atiqrC",
"merchant_id": "merchant_1732786757",
"status": "succeeded",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 100,
"connector": "stripe",
"client_secret": "pay_mKYKX3ChuavzS7atiqrC_secret_aI23DBV8qxTNg2WPESAt",
"created": "2024-11-28T09:41:01.957Z",
"currency": "USD",
"customer_id": "cu_1732786862",
"customer": {
"id": "cu_1732786862",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "STRIPE PAYMENTS UK LIMITED",
"card_issuing_country": "UNITEDKINGDOM",
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": null,
"payment_checks": {
"cvc_check": "pass",
"address_line1_check": "pass",
"address_postal_code_check": "pass"
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": "ss"
},
"phone": null,
"email": null
},
"order_details": [
{
"brand": null,
"amount": 0,
"category": null,
"quantity": 1,
"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": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cu_1732786862",
"created_at": 1732786861,
"expires": 1732790461,
"secret": "epk_2ee23c3779a54e56b9c15816e56d47af"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3QQ4DaEOqOywnAIx00EgTOEA",
"frm_message": null,
"metadata": {},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3QQ4DaEOqOywnAIx00EgTOEA",
"payment_link": null,
"profile_id": "pro_LHl9xKTts4FUwsDgPIAA",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_PohIcY4T0yRYB4FRQpsG",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-28T09:56:01.957Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "125.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_GuFw64hE9GdwBaAdu60R",
"payment_method_status": "active",
"updated": "2024-11-28T09:41:04.190Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "pm_1QQ4DaEOqOywnAIxeM9Q73Pt"
}
```
-> Create payment for same customer
```
curl --location 'http://localhost:8080/payments' \
--header 'Accept: application/json' \
--header 'api-key: dev_vEvPY8nOxGDtjC1IfIgOVDVouV4bfDK1MPyTB2vqPCDjf3QTSaW4lP0UkjDORWi1' \
--header 'Content-Type: application/json' \
--data '{
"amount": 10000,
"currency": "USD",
"capture_method": "automatic",
"authentication_type": "three_ds",
"confirm": false,
"setup_future_usage": "off_session",
"customer_id": "cu_1732786862"
}'
```
```
{
"payment_id": "pay_PiKxSAcgYv1SCRuTgbNW",
"merchant_id": "merchant_1732786757",
"status": "requires_payment_method",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_PiKxSAcgYv1SCRuTgbNW_secret_6PMdd9eOqqYm0XyBvRCs",
"created": "2024-11-28T09:41:24.895Z",
"currency": "USD",
"customer_id": "cu_1732786862",
"customer": {
"id": "cu_1732786862",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cu_1732786862",
"created_at": 1732786884,
"expires": 1732790484,
"secret": "epk_89b1364c0b6048d9aba374bfee2c68e6"
},
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_LHl9xKTts4FUwsDgPIAA",
"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-11-28T09:56:24.895Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-11-28T09:41:24.934Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
-> Customer pml
```
curl --location 'http://localhost:8080/customers/payment_methods?client_secret=pay_PiKxSAcgYv1SCRuTgbNW_secret_6PMdd9eOqqYm0XyBvRCs' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_c7c7295d08b54d589459ec0e8de731aa'
```
```
{
"customer_payment_methods": [
{
"payment_token": "token_WTkWv5zRyilJVfcZFZB4",
"payment_method_id": "pm_GuFw64hE9GdwBaAdu60R",
"customer_id": "cu_1732786862",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_issuer": "STRIPE PAYMENTS UK LIMITED",
"payment_method_issuer_code": null,
"recurring_enabled": true,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": "Visa",
"issuer_country": "UNITEDKINGDOM",
"last4_digits": "4242",
"expiry_month": "03",
"expiry_year": "2030",
"card_token": null,
"card_holder_name": "name name",
"card_fingerprint": null,
"nick_name": null,
"card_network": "Visa",
"card_isin": "424242",
"card_issuer": "STRIPE PAYMENTS UK LIMITED",
"card_type": "CREDIT",
"saved_to_locker": true
},
"metadata": null,
"created": "2024-11-28T09:41:04.160Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": false,
"last_used_at": "2024-11-28T09:41:04.160Z",
"default_payment_method_set": true,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "name",
"last_name": "name"
},
"phone": null,
"email": null
}
}
],
"is_guest_customer": false
}
```
-> Confirm with cybersource
```
curl --location 'http://localhost:8080/payments/pay_PiKxSAcgYv1SCRuTgbNW/confirm' \
--header 'api-key: pk_dev_c7c7295d08b54d589459ec0e8de731aa' \
--header 'Content-Type: application/json' \
--data-raw '{
"payment_token": "token_WTkWv5zRyilJVfcZFZB4",
"payment_method_type": "credit",
"payment_method": "card",
"client_secret": "pay_PiKxSAcgYv1SCRuTgbNW_secret_6PMdd9eOqqYm0XyBvRCs",
"routing": {
"type": "single",
"data": {
"connector": "cybersource",
"merchant_connector_id": "mca_XcYZAcIAg28iKuSfTVOm"
}
},
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "[email protected]"
}
}'
```
```
{
"payment_id": "pay_PiKxSAcgYv1SCRuTgbNW",
"merchant_id": "merchant_1732786757",
"status": "succeeded",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10000,
"connector": "cybersource",
"client_secret": "pay_PiKxSAcgYv1SCRuTgbNW_secret_6PMdd9eOqqYm0XyBvRCs",
"created": "2024-11-28T09:41:24.895Z",
"currency": "USD",
"customer_id": "cu_1732786862",
"customer": {
"id": "cu_1732786862",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "STRIPE PAYMENTS UK LIMITED",
"card_issuing_country": "UNITEDKINGDOM",
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_WTkWv5zRyilJVfcZFZB4",
"shipping": null,
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "[email protected]"
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "7327869509776879404951",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_PiKxSAcgYv1SCRuTgbNW_1",
"payment_link": null,
"profile_id": "pro_LHl9xKTts4FUwsDgPIAA",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_XcYZAcIAg28iKuSfTVOm",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-28T09:56:24.895Z",
"fingerprint": null,
"browser_info": {
"language": null,
"time_zone": null,
"ip_address": "::1",
"user_agent": null,
"color_depth": null,
"java_enabled": null,
"screen_width": null,
"accept_header": null,
"screen_height": null,
"java_script_enabled": null
},
"payment_method_id": "pm_GuFw64hE9GdwBaAdu60R",
"payment_method_status": "active",
"updated": "2024-11-28T09:42:31.429Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
-> Psync
```
curl --location 'http://localhost:8080/payments/pay_PiKxSAcgYv1SCRuTgbNW?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_vEvPY8nOxGDtjC1IfIgOVDVouV4bfDK1MPyTB2vqPCDjf3QTSaW4lP0UkjDORWi1'
```
```
{
"payment_id": "pay_PiKxSAcgYv1SCRuTgbNW",
"merchant_id": "merchant_1732786757",
"status": "succeeded",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10000,
"connector": "cybersource",
"client_secret": "pay_PiKxSAcgYv1SCRuTgbNW_secret_6PMdd9eOqqYm0XyBvRCs",
"created": "2024-11-28T09:41:24.895Z",
"currency": "USD",
"customer_id": "cu_1732786862",
"customer": {
"id": "cu_1732786862",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "STRIPE PAYMENTS UK LIMITED",
"card_issuing_country": "UNITEDKINGDOM",
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_WTkWv5zRyilJVfcZFZB4",
"shipping": null,
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "[email protected]"
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "7327869509776879404951",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_PiKxSAcgYv1SCRuTgbNW_1",
"payment_link": null,
"profile_id": "pro_LHl9xKTts4FUwsDgPIAA",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_XcYZAcIAg28iKuSfTVOm",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-28T09:56:24.895Z",
"fingerprint": null,
"browser_info": {
"language": null,
"time_zone": null,
"ip_address": "::1",
"user_agent": null,
"color_depth": null,
"java_enabled": null,
"screen_width": null,
"accept_header": null,
"screen_height": null,
"java_script_enabled": null
},
"payment_method_id": "pm_GuFw64hE9GdwBaAdu60R",
"payment_method_status": "active",
"updated": "2024-11-28T09:42:31.429Z",
"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. External Connector Integration**
- `crates/router/src/connector/cybersource/transformers.rs`
**3. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 6a207017:
Files to modify:
**crates/router/src/connector/cybersource/transformers.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
|
{"pr_number": 6690, "pr_title": "fix(router): populate card network in the network transaction id based MIT flow", "merged_at": "2024-11-29T10:25:16Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/helpers.rs"], "connectors": ["crates/router/src/connector/cybersource/transformers.rs"], "config": ["config/config.example.toml", "config/deployments/production.toml"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat: add resources and granular permission groups for reconciliation
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Described in #6524
This PR includes below changes
- Extending resources enum (for specifying the resource being consumed from the dashboard)
- Extending granular permission groups for recon
- Populating `acl` field in the recon token
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Helps maintain and configure permissions for recon module granularly.
## How did you test it?
- Verify the generated recon token has `acl`
- `GET /verify_token` response to have `acl`
<details>
<summary>Check /verify_token response</summary>
cURL
curl --location --request GET 'http://localhost:8080/recon/verify_token' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiZGJjMzJmMmYtYmI5Ni00MDI0LTliYTUtNjhkOTc3MzM0N2U5IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzMxOTk2NjQ4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjE4MzU4Miwib3JnX2lkIjoib3JnX0htMmY5dERZM2lGN0ZRckZUYUxKIiwicHJvZmlsZV9pZCI6InByb19GY0NaN1c4MllZVmNXMU1DSjZIOCIsInRlbmFudF9pZCI6InB1YmxpYyIsImFjbCI6IntcInJlY29uX2ZpbGVzXCI6XCJSV1wiLFwicmVjb25fY29uZmlnXCI6XCJSV1wiLFwicmVjb25fdG9rZW5cIjpcIlJXXCIsXCJyZWNvbl9yZXBvcnRzXCI6XCJSV1wiLFwicmVjb25fdXBsb2FkXCI6XCJSV1wiLFwicnVuX3JlY29uXCI6XCJSV1wiLFwicmVjb25fYW5kX3NldHRsZW1lbnRfYW5hbHl0aWNzXCI6XCJSXCJ9In0.wvS97F0dXwY7Y5uKSk8PEqHOhoAAPlR0coX_kIGyM2I'
Response
{
"merchant_id": "merchant_1731996648",
"user_email": "[email protected]",
"acl": "{\"recon_reports\":\"RW\",\"recon_files\":\"RW\",\"run_recon\":\"RW\",\"recon_and_settlement_analytics\":\"R\",\"recon_token\":\"RW\",\"recon_upload\":\"RW\",\"recon_config\":\"RW\"}"
}
</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/enums.rs`
- `crates/api_models/src/events/recon.rs`
- `crates/api_models/src/events/user.rs`
- ... and 2 more files
**2. Core Business Logic**
- `crates/router/src/core/recon.rs`
- `crates/router/src/core/user.rs`
**3. Type Definitions**
- `crates/router/src/services/email/types.rs`
**4. Other**
- `crates/common_enums/src/enums.rs`
- `crates/router/src/routes/app.rs`
- `crates/router/src/routes/recon.rs`
- ... and 7 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (75 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit fa21ef89:
Files to modify:
**crates/api_models/src/enums.rs**
Add:
- function: private::from
- enum: pub::ReconPermissionScope
- impl: impl From<PermissionScope> for ReconPermissionScope
**crates/api_models/src/events/recon.rs**
Add:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for VerifyTokenResponse
**crates/api_models/src/events/user.rs**
Remove:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for VerifyTokenResponse
**crates/api_models/src/recon.rs**
Add:
- struct: pub::VerifyTokenResponse
**crates/api_models/src/user.rs**
Remove:
- struct: pub::VerifyTokenResponse
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/router/src/core/recon.rs**
Add:
- function: pub::verify_recon_token
**crates/router/src/core/user.rs**
Remove:
- function: pub::verify_token
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/recon.rs**
Modify existing code
**crates/router/src/routes/user.rs**
Remove:
- function: pub::verify_recon_token
**crates/router/src/services/authentication.rs**
Add:
- function: private::authenticate_and_fetch
- function: pub::new_token
- struct: pub::UserFromTokenWithRoleInfo
- struct: pub::ReconToken
- impl: impl AuthenticateAndFetch<UserFromTokenWithRoleInfo, A> for JWTAuth
- impl: impl ReconToken
**crates/router/src/services/authorization/info.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**
Add:
- function: pub::get_recon_acl
**crates/router/src/services/authorization/roles/predefined_roles.rs**
Modify existing code
**crates/router/src/services/email/types.rs**
Modify existing code
|
{"pr_number": 6591, "pr_title": "feat: add resources and granular permission groups for reconciliation", "merged_at": "2024-12-04T09:55:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "token"]}, "hierarchy": {"api_models": ["crates/api_models/src/enums.rs", "crates/api_models/src/events/recon.rs", "crates/api_models/src/events/user.rs", "crates/api_models/src/recon.rs", "crates/api_models/src/user.rs"], "core_business": ["crates/router/src/core/recon.rs", "crates/router/src/core/user.rs"], "types": ["crates/router/src/services/email/types.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/recon.rs", "crates/router/src/routes/user.rs", "crates/router/src/services/authentication.rs", "crates/router/src/services/authorization/info.rs", "crates/router/src/services/authorization/permission_groups.rs", "crates/router/src/services/authorization/permissions.rs", "crates/router/src/services/authorization/roles.rs", "crates/router/src/services/authorization/roles/predefined_roles.rs"]}, "change_types": {"structs_added": 3, "functions_added": 8, "enums_added": 1, "fields_added": 75, "imports_added": 7, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connector): [STRIPE] Remove sofort bank redirect from stripe
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Removed sofort bank redirect from Stripe, as Stripe has deprecated sofort.
Also added configs for Stripe Ach and Multibanco.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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 with sofort.
Test currencies in Ach and Multibanco for stripe to test the configs.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] 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
**2. Tests**
- `config/deployments/integration_test.toml`
- `cypress-tests/cypress/e2e/configs/Payment/Stripe.js`
- `cypress-tests/cypress/e2e/configs/Routing/Stripe.js`
- ... and 1 more files
**3. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
**Detailed Identifier Changes:**
Commit 8ec56e5b:
Files to modify:
**crates/router/src/connector/stripe/transformers.rs**
Remove:
- enum: pub::BankSpecificData
|
{"pr_number": 7733, "pr_title": "refactor(connector): [STRIPE] Remove sofort bank redirect from stripe", "merged_at": "2025-04-09T15:01:09Z", "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", "crates/router/src/connector/stripe/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "cypress-tests/cypress/e2e/configs/Payment/Stripe.js", "cypress-tests/cypress/e2e/configs/Routing/Stripe.js", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"functions_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payments): Add audit events for PaymentStatus update
## Type of Change
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR adds an Audit event for the PaymentStatus operation.
### Additional Changes
- [x] This PR modifies the files below
- `crates/router/src/core/payments/operations/payment_status.rs`
- `crates/router/src/events/audit_events.rs`
## Motivation and Context
This PR fixes #4677
## How did you test it
- Hit the `Payments - Create` endpoint
```bash
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--data-raw '{
"amount": 10000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 10000,
"customer_id": "StripeCustomer",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"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",
"feature_metadata": {
"search_tags": ["Bangalore", "Chennai"]
},
"metadata": {
"data2": "camel",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"profile_id": "pro_v5sFoHe80OeiUlIonocM"
}'
```
- Response:
```json
{
"payment_id": "pay_JGFz7HS3yFZMtA7w82db",
"merchant_id": "merchant_1726046328",
"status": "succeeded",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10000,
"connector": "stripe_test",
"client_secret": "pay_JGFz7HS3yFZMtA7w82db_secret_1zvdrFCjs1ZepqjgS4Vw",
"created": "2024-12-16T07:12:44.627Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "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": 1734333164,
"expires": 1734336764,
"secret": "epk_44a2e5c540904c0dbd3e3cdff81c9180"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pay_88KleFv1IFJndrZFwEgK",
"frm_message": null,
"metadata": {
"data2": "camel",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": [
"1259195bb05bb44ea78ab60b26a54065183f91b3c5b3c2c074cadcf521305a79",
"9bff7b14d0a57a00d98f5eb742418a50b3bdfe5993f16b4219bfa31989bdf80f"
]
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_v5sFoHe80OeiUlIonocM",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_NNsdIEb1AjEOkyALerP6",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-16T07:27:44.627Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-16T07:12:45.719Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
- Now hit the `Payments - Retrieve` endpoint.
```bash
curl --location 'http://localhost:8080/payments/pay_JGFz7HS3yFZMtA7w82db' \
--header 'Accept: application/json' \
--header 'api-key: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF'
```
- Response:
```bash
{
"payment_id": "pay_JGFz7HS3yFZMtA7w82db",
"merchant_id": "merchant_1726046328",
"status": "succeeded",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10000,
"connector": "stripe_test",
"client_secret": "pay_JGFz7HS3yFZMtA7w82db_secret_1zvdrFCjs1ZepqjgS4Vw",
"created": "2024-12-16T07:12:44.627Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+1"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "pay_88KleFv1IFJndrZFwEgK",
"frm_message": null,
"metadata": {
"data2": "camel",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": [
"1259195bb05bb44ea78ab60b26a54065183f91b3c5b3c2c074cadcf521305a79",
"9bff7b14d0a57a00d98f5eb742418a50b3bdfe5993f16b4219bfa31989bdf80f"
]
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_v5sFoHe80OeiUlIonocM",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_NNsdIEb1AjEOkyALerP6",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-16T07:27:44.627Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-16T07:12:45.719Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Audit log will get generated and can be viewed in hyperswitch-audit-events topic in kafka with `PaymentStatus` event-type.
<img width="1092" alt="Screenshot 2024-12-16 at 12 44 57 PM" src="https://github.com/user-attachments/assets/964bbd78-93ff-41c1-87d6-3e47d7eb7c56" />
## Checklist
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/operations/payment_status.rs`
**2. Other**
- `crates/router/src/events/audit_events.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit ae00a103:
Files to modify:
**crates/router/src/core/payments/operations/payment_status.rs**
Modify existing code
**crates/router/src/events/audit_events.rs**
Modify existing code
|
{"pr_number": 6520, "pr_title": "feat(payments): Add audit events for PaymentStatus update", "merged_at": "2024-12-16T12:08:46Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/payment_status.rs"], "other": ["crates/router/src/events/audit_events.rs"]}, "change_types": {"fields_added": 2}, "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.