Dataset Viewer
prompt
stringlengths 83
247k
| response
stringlengths 121
36.1k
| metadata
stringlengths 314
42.3k
|
|---|---|---|
feat(connector): Added a new CaptureMethod SequentialAutomatic to Support CIT Mandates for Paybox
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
1) Added a new CaptureMethod : SequentialAutomatic -> does Auth and capture in two api calls one after the other
1. **For Paybox**:
- If the payment is a Customer-Initiated Transaction (CIT), two API calls will be made:
- First for Authorization (`Auth`)
- Followed by Capture (`Capture`)
- For all other payment types, `SequentialAutomatic` will function the same as `Automatic`.
2. **For other connectors**:
- `SequentialAutomatic` will behave the same as `Automatic`.
https://docs.google.com/document/d/1pokpfrBJGVrHGcyeTkfArAxdIo2ZBR3jNefSj5qbG6E/edit?tab=t.0
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
For Customer-Initiated Transactions (CIT) with Paybox, authorization and capture must be performed as two separate operations. Paybox does not support a combined authorization and capture in a single request. To avoid requiring the merchant to handle this process, we introduced a new capture method: SequentialAutomatic, which ensures that two API calls are made automatically.
## How did you test it?
1. **CIT Payment + 3DS Test**
- **Request**:
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_wmCOQW4LM2BHYugFWaU8crmipDtmGDsq0iozaQhe17CtM59tqCHSAtD8w646AkZU' \
--data '{
"amount": 501,
"currency": "EUR",
"confirm": true,
"capture_method": "sequential_automatic",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at":"1963-05-03T04:07:52.723Z",
"online": {
"ip_address":"127.0.0.1",
"user_agent": "amet irure esse"
}
},
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "5200000000000007",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "John T",
"card_cvc": "123"
}
},
"customer_id":"test_mit",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"setup_future_usage": "off_session"
}'
- **Response**:
{
"payment_id": "pay_Q75JaLo7wPiCAh8nrkZc",
"merchant_id": "postman_merchant_GHAction_3a560136-e947-4667-bb84-2f015fcc1196",
"status": "requires_customer_action",
"amount": 501,
"net_amount": 501,
"shipping_cost": null,
"amount_capturable": 501,
"amount_received": null,
"connector": "paybox",
"client_secret": "pay_Q75JaLo7wPiCAh8nrkZc_secret_Qa4XYmBSyuDUbaqKtJ7r",
"created": "2024-11-19T03:58:16.513Z",
"currency": "EUR",
"customer_id": "test_mit",
"customer": {
"id": "test_mit",
"name": "Joseph Doe",
"email": "something@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "sequential_automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0007",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_9qL6FgoOzIVLvviNRNwL",
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_Q75JaLo7wPiCAh8nrkZc/postman_merchant_GHAction_3a560136-e947-4667-bb84-2f015fcc1196/pay_Q75JaLo7wPiCAh8nrkZc_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "test_mit",
"created_at": 1731988696,
"expires": 1731992296,
"secret": "epk_e83b819668e84eb99ab249e855471ed8"
},
"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_hl5seUYAuPOk5MN8bSGO",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_DsQkwRcnsQVWJ7jbsSZl",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-19T04:13:16.513Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_vdP2g5rwDJBoKDubJPvQ",
"payment_method_status": "inactive",
"updated": "2024-11-19T03:58:17.469Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
1.1. **Payment Sync**
- **Request**:
curl --location 'http://localhost:8080/payments/pay_DMkbjecVspKCAf7Sjl2o' \
--header 'Accept: application/json' \
--header 'api-key: dev_wmCOQW4LM2BHYugFWaU8crmipDtmGDsq0iozaQhe17CtM59tqCHSAtD8w646AkZU'
- **Response**:
{
"payment_id": "pay_Q75JaLo7wPiCAh8nrkZc",
"merchant_id": "postman_merchant_GHAction_3a560136-e947-4667-bb84-2f015fcc1196",
"status": "succeeded",
"amount": 501,
"net_amount": 501,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 501,
"connector": "paybox",
"client_secret": "pay_Q75JaLo7wPiCAh8nrkZc_secret_Qa4XYmBSyuDUbaqKtJ7r",
"created": "2024-11-19T03:58:16.513Z",
"currency": "EUR",
"customer_id": "test_mit",
"customer": {
"id": "test_mit",
"name": "Joseph Doe",
"email": "something@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "sequential_automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0007",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_9qL6FgoOzIVLvviNRNwL",
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "0080164085",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_hl5seUYAuPOk5MN8bSGO",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_DsQkwRcnsQVWJ7jbsSZl",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-19T04:13:16.513Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_vdP2g5rwDJBoKDubJPvQ",
"payment_method_status": "active",
"updated": "2024-11-19T03:59:47.678Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
1.3. **MIT payment**
- **Request**
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_wmCOQW4LM2BHYugFWaU8crmipDtmGDsq0iozaQhe17CtM59tqCHSAtD8w646AkZU' \
--data-raw '{
"amount": 7100,
"currency": "EUR",
"confirm": true,
"customer_id": "test_mit",
"email": "guest@example.com",
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "pm_vdP2g5rwDJBoKDubJPvQ"
},
"payment_method": "card",
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
}
}'
-**Response**
{
"payment_id": "pay_DMkbjecVspKCAf7Sjl2o",
"merchant_id": "postman_merchant_GHAction_3a560136-e947-4667-bb84-2f015fcc1196",
"status": "succeeded",
"amount": 7100,
"net_amount": 7100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 7100,
"connector": "paybox",
"client_secret": "pay_DMkbjecVspKCAf7Sjl2o_secret_Ub8XUCMAUqgIdWYgDN2N",
"created": "2024-11-19T04:01:26.747Z",
"currency": "EUR",
"customer_id": "test_mit",
"customer": {
"id": "test_mit",
"name": "Joseph Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0007",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "John T",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"order_details": null,
"email": "guest@example.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "test_mit",
"created_at": 1731988886,
"expires": 1731992486,
"secret": "epk_d193d4bab05147aea937bdd6c5c84568"
},
"manual_retry_allowed": false,
"connector_transaction_id": "0080164087",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_hl5seUYAuPOk5MN8bSGO",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_DsQkwRcnsQVWJ7jbsSZl",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-19T04:16:26.747Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_vdP2g5rwDJBoKDubJPvQ",
"payment_method_status": "active",
"updated": "2024-11-19T04:01:28.480Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "SM@LpCp@L@C"
}
2. **CIT Payment + No3DS Test**
2.1 -**Request**
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_wmCOQW4LM2BHYugFWaU8crmipDtmGDsq0iozaQhe17CtM59tqCHSAtD8w646AkZU' \
--data '{
"amount": 501,
"currency": "EUR",
"confirm": true,
"capture_method": "sequential_automatic",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at":"1963-05-03T04:07:52.723Z",
"online": {
"ip_address":"127.0.0.1",
"user_agent": "amet irure esse"
}
},
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "5200000000000007",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "John T",
"card_cvc": "123"
}
},
"customer_id":"test_mit",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"setup_future_usage": "off_session"
}'
-**Response**
{
"payment_id": "pay_Adusyo4wM4lvxsG9G8Og",
"merchant_id": "postman_merchant_GHAction_3a560136-e947-4667-bb84-2f015fcc1196",
"status": "succeeded",
"amount": 501,
"net_amount": 501,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 501,
"connector": "paybox",
"client_secret": "pay_Adusyo4wM4lvxsG9G8Og_secret_zxcn25iSAsbZ8HKAIokb",
"created": "2024-11-19T04:08:34.637Z",
"currency": "EUR",
"customer_id": "test_mit",
"customer": {
"id": "test_mit",
"name": "Joseph Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "sequential_automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0007",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_R1rt2mhmfi7yN57PFJuO",
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "test_mit",
"created_at": 1731989314,
"expires": 1731992914,
"secret": "epk_6727367741724d5fbf3e027fe31653a2"
},
"manual_retry_allowed": false,
"connector_transaction_id": "0080164102",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_hl5seUYAuPOk5MN8bSGO",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_DsQkwRcnsQVWJ7jbsSZl",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-19T04:23:34.637Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_fjGE1FjOztrWm26w5gfS",
"payment_method_status": "active",
"updated": "2024-11-19T04:08:37.521Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "SM@LpCp@L@C"
}
2.2**MIT payment**
-**Request**
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_wmCOQW4LM2BHYugFWaU8crmipDtmGDsq0iozaQhe17CtM59tqCHSAtD8w646AkZU' \
--data-raw '{
"amount": 7100,
"currency": "EUR",
"confirm": true,
"customer_id": "test_mit",
"email": "guest@example.com",
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "pm_fjGE1FjOztrWm26w5gfS"
},
"payment_method": "card",
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
}
}'
-**Response**
{
"payment_id": "pay_ozT3qe38r1krdHLhyfDS",
"merchant_id": "postman_merchant_GHAction_3a560136-e947-4667-bb84-2f015fcc1196",
"status": "succeeded",
"amount": 7100,
"net_amount": 7100,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 7100,
"connector": "paybox",
"client_secret": "pay_ozT3qe38r1krdHLhyfDS_secret_RRTrzdf41k8C5J8CXFc4",
"created": "2024-11-19T04:09:39.712Z",
"currency": "EUR",
"customer_id": "test_mit",
"customer": {
"id": "test_mit",
"name": "Joseph Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": true,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "0007",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "520000",
"card_extended_bin": null,
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "John T",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "test",
"country": "US",
"line1": "here",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Washington",
"first_name": "One",
"last_name": "Two"
},
"phone": {
"number": "1234567890",
"country_code": "+1"
},
"email": "guest@example.com"
},
"order_details": null,
"email": "guest@example.com",
"name": "Joseph Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "test_mit",
"created_at": 1731989379,
"expires": 1731992979,
"secret": "epk_ad52b99e9b23445f8f7688e4941b84c2"
},
"manual_retry_allowed": false,
"connector_transaction_id": "0080164108",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_hl5seUYAuPOk5MN8bSGO",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_DsQkwRcnsQVWJ7jbsSZl",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-11-19T04:24:39.712Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": "pm_fjGE1FjOztrWm26w5gfS",
"payment_method_status": "active",
"updated": "2024-11-19T04:09:41.363Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "SM@LpCp@L@C"
}
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_response_types.rs`
**2. Core Business Logic**
- `crates/router/src/core/fraud_check/operation/fraud_check_post.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/flows.rs`
- ... and 5 more files
**3. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/airwallex.rs`
- `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/bambora.rs`
- ... and 69 more files
**4. Type Definitions**
- `crates/router/src/types.rs`
**5. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Implement new functions (14 changes)
- Extend existing types with new fields (97 changes)
- Add conditional logic for feature flags or filtering (7 changes)
- Modify database queries (3 changes)
**Detailed Identifier Changes:**
Commit e5dde6ac:
Files to modify:
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/airwallex.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bambora.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bamboraapac.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/billwerk.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/boku.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cashtocode.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/coinbase.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/deutschebank.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/dlocal.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/elavon.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiserv.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiservemea.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/forte.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/globepay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/gocardless.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/helcim.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/multisafepay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexinets.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexixpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/novalnet.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payeezy.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payu.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/powertranz.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/rapyd.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/shift4.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/square.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stax.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/tsys.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldline.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/zsl.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Add:
- function: pub::get_connector_metadata
- function: pub::get_connector_transaction_id
- function: pub::merge_transaction_responses
- impl: impl PaymentsResponseData
**crates/hyperswitch_interfaces/src/api.rs**
Modify existing code
**crates/router/src/connector/adyen.rs**
Modify existing code
**crates/router/src/connector/authorizedotnet.rs**
Modify existing code
**crates/router/src/connector/authorizedotnet/transformers.rs**
Modify existing code
**crates/router/src/connector/bankofamerica.rs**
Modify existing code
**crates/router/src/connector/bluesnap.rs**
Modify existing code
**crates/router/src/connector/braintree.rs**
Modify existing code
**crates/router/src/connector/checkout.rs**
Modify existing code
**crates/router/src/connector/checkout/transformers.rs**
Modify existing code
**crates/router/src/connector/cybersource.rs**
Modify existing code
**crates/router/src/connector/datatrans.rs**
Modify existing code
**crates/router/src/connector/dummyconnector.rs**
Modify existing code
**crates/router/src/connector/globalpay.rs**
Modify existing code
**crates/router/src/connector/klarna.rs**
Modify existing code
**crates/router/src/connector/nmi.rs**
Modify existing code
**crates/router/src/connector/noon.rs**
Modify existing code
**crates/router/src/connector/nuvei.rs**
Modify existing code
**crates/router/src/connector/opayo.rs**
Modify existing code
**crates/router/src/connector/paybox.rs**
Modify existing code
**crates/router/src/connector/paybox/transformers.rs**
Modify existing code
**crates/router/src/connector/payme.rs**
Modify existing code
**crates/router/src/connector/paypal.rs**
Modify existing code
**crates/router/src/connector/placetopay.rs**
Modify existing code
**crates/router/src/connector/stripe.rs**
Modify existing code
**crates/router/src/connector/stripe/transformers.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Add:
- function: private::is_cit_mandate_payment
- function: private::is_cit_mandate_payment
**crates/router/src/connector/wellsfargo.rs**
Modify existing code
**crates/router/src/connector/wellsfargo/transformers.rs**
Modify existing code
**crates/router/src/core/fraud_check/operation/fraud_check_post.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Add:
- function: pub::should_initiate_capture_flow
- function: pub::call_capture_request
- function: private::handle_post_capture_response
**crates/router/src/core/payments/flows/authorize_flow.rs**
Add:
- function: private::foreign_try_from
- function: private::process_capture_flow
- impl: impl ForeignTryFrom<types::RouterData<F, types::PaymentsAuthorizeData, types::PaymentsResponseData>> for types::PaymentsCaptureData
**crates/router/src/core/payments/flows/complete_authorize_flow.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/routing/transformers.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
|
{"pr_number": 6587, "pr_title": "feat(connector): Added a new CaptureMethod SequentialAutomatic to Support CIT Mandates for Paybox", "merged_at": "2024-12-05T14:03:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/fraud_check/operation/fraud_check_post.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/flows.rs", "crates/router/src/core/payments/flows/authorize_flow.rs", "crates/router/src/core/payments/flows/complete_authorize_flow.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/routing/transformers.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/airwallex.rs", "crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bambora.rs", "crates/hyperswitch_connectors/src/connectors/bamboraapac.rs", "crates/hyperswitch_connectors/src/connectors/billwerk.rs", "crates/hyperswitch_connectors/src/connectors/boku.rs", "crates/hyperswitch_connectors/src/connectors/cashtocode.rs", "crates/hyperswitch_connectors/src/connectors/coinbase.rs", "crates/hyperswitch_connectors/src/connectors/deutschebank.rs", "crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs", "crates/hyperswitch_connectors/src/connectors/dlocal.rs", "crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/elavon.rs", "crates/hyperswitch_connectors/src/connectors/fiserv.rs", "crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiservemea.rs", "crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiuu.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/forte.rs", "crates/hyperswitch_connectors/src/connectors/globepay.rs", "crates/hyperswitch_connectors/src/connectors/gocardless.rs", "crates/hyperswitch_connectors/src/connectors/helcim.rs", "crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs", "crates/hyperswitch_connectors/src/connectors/multisafepay.rs", "crates/hyperswitch_connectors/src/connectors/nexinets.rs", "crates/hyperswitch_connectors/src/connectors/nexixpay.rs", "crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/novalnet.rs", "crates/hyperswitch_connectors/src/connectors/payeezy.rs", "crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payu.rs", "crates/hyperswitch_connectors/src/connectors/powertranz.rs", "crates/hyperswitch_connectors/src/connectors/rapyd.rs", "crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs", "crates/hyperswitch_connectors/src/connectors/shift4.rs", "crates/hyperswitch_connectors/src/connectors/square.rs", "crates/hyperswitch_connectors/src/connectors/stax.rs", "crates/hyperswitch_connectors/src/connectors/tsys.rs", "crates/hyperswitch_connectors/src/connectors/worldline.rs", "crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldpay.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/zsl.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/adyen.rs", "crates/router/src/connector/authorizedotnet.rs", "crates/router/src/connector/authorizedotnet/transformers.rs", "crates/router/src/connector/bankofamerica.rs", "crates/router/src/connector/bluesnap.rs", "crates/router/src/connector/braintree.rs", "crates/router/src/connector/checkout.rs", "crates/router/src/connector/checkout/transformers.rs", "crates/router/src/connector/cybersource.rs", "crates/router/src/connector/datatrans.rs", "crates/router/src/connector/dummyconnector.rs", "crates/router/src/connector/globalpay.rs", "crates/router/src/connector/klarna.rs", "crates/router/src/connector/nmi.rs", "crates/router/src/connector/noon.rs", "crates/router/src/connector/nuvei.rs", "crates/router/src/connector/opayo.rs", "crates/router/src/connector/paybox.rs", "crates/router/src/connector/paybox/transformers.rs", "crates/router/src/connector/payme.rs", "crates/router/src/connector/paypal.rs", "crates/router/src/connector/placetopay.rs", "crates/router/src/connector/stripe.rs", "crates/router/src/connector/stripe/transformers.rs", "crates/router/src/connector/utils.rs", "crates/router/src/connector/wellsfargo.rs", "crates/router/src/connector/wellsfargo/transformers.rs"], "types": ["crates/router/src/types.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/hyperswitch_interfaces/src/api.rs", "migrations/2024-11-15-171347_add_capture_method_sequential_automatic/down.sql", "migrations/2024-11-15-171347_add_capture_method_sequential_automatic/up.sql"]}, "change_types": {"functions_added": 14, "fields_added": 97, "imports_added": 5, "conditionals_added": 7, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(analytics): retry implementation for forex crate call
## 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 -->
Implementing a retry logic for forex crate call with linear time increment in retry counter
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
`crates/router/src/core/currency.rs`
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
This was required as the Analytics API was returning 5xx when forex was returning error which would eventually resolve on retry
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
As soon as you hit the API of analytics
`curl --location 'http://localhost:8080/analytics/v1/org/metrics/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'authorization: Bearer token \
--data '[
{
"timeRange": {
"startTime": "2024-09-11T18:30:00Z",
"endTime": "2024-09-25T09:22:00Z"
},
"source": "BATCH",
"metrics": [
"payment_processed_amount"
],
"timeSeries": {
"granularity": "G_ONEDAY"
},
"delta": true
}
]'`
There is no change is response but how the evaluation of the request to give out response would change
Added logs for the same are added below

## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/currency.rs`
**2. Other**
- `crates/router/src/consts.rs`
**Code Patterns Applied:**
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit e93fce26:
Files to modify:
**crates/router/src/consts.rs**
Modify existing code
**crates/router/src/core/currency.rs**
Modify existing code
|
{"pr_number": 7280, "pr_title": "fix(analytics): retry implementation for forex crate call", "merged_at": "2025-03-20T14:26:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "token"]}, "hierarchy": {"core_business": ["crates/router/src/core/currency.rs"], "other": ["crates/router/src/consts.rs"]}, "change_types": {"imports_added": 1, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(webhook): add jwt authenticated endpoint to list unique webhook events for a profile
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR introduces a new JWT authenticated endpoint for listing unique webhook events for a profile. The endpoint URL is `/events/profile/list` and it will support only JWT authentication.
The profile ID and merchant ID will be extracted directly from JWT token. The router handler will call the existing `list_initial_delivery_attempts()` supporting other filtering constraints, same as in the existing endpoint.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
- List initial delivery attempts
```
curl --location 'http://localhost:8080/events/profile/list' \
--header 'Authorization: Bearer eyJBdXRob3JpemF0aW9uIjoicnJyIiwiYWxnIjoiSFMyNTYifQ.eyJ1c2VyX2lkIjoiZDk1NTcyN2ItNDQxYi1iNjVmLWE2NTA5ZWZiYjQ0YiIsIm1lcmNoYW50X2lkIjoibWVyY2hhbnRfMTczOTUyMDc2NSIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDAxMzYxNTUsIm9yZ19pZCI6Im9yZ19IY3gzRUlMcWVXSFhGN2V3bE91dyIsInByb2ZpbGVfaWQiOiJwcm9fWHpGb2lhaDFNbHNDbVJqY3ViUXEiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.UwdflL4JuswgoPSLDFEGkXg0IUHMdqiftn1HS5arGhc' \
--header 'Cookie: login_token=eyJBdXRob3JpemF0aW9uIjoicnJyIiwiYWxnIjoiSFMyNTYifQ.eyJ1c2VyX2lkIjoiZDk1NTcyN2ItNDQxYi1iNjVmLWE2NTA5ZWZiYjQ0YiIsIm1lcmNoYW50X2lkIjoibWVyY2hhbnRfMTczOTUyMDc2NSIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDAxMzYxNTUsIm9yZ19pZCI6Im9yZ19IY3gzRUlMcWVXSFhGN2V3bE91dyIsInByb2ZpbGVfaWQiOiJwcm9fWHpGb2lhaDFNbHNDbVJqY3ViUXEiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.UwdflL4JuswgoPSLDFEGkXg0IUHMdqiftn1HS5arGhc' \
--data ''
```
- Response
```
[{"event_id":"evt_019503a21ce676f186def372c1678519","merchant_id":"merchant_1739520765","profile_id":"pro_XzFoiah1MlsCmRjcubQq","object_id":"pay_qF1JybZlZBLKU1m42nua","event_type":"payment_succeeded","event_class":"payments","is_delivery_successful":false,"initial_attempt_id":"evt_019503a21ce676f186def372c1678519","created":"2025-02-14T08:45:10.758Z"},{"event_id":"evt_0195039d99d47f519cb63e7752618825","merchant_id":"merchant_1739520765","profile_id":"pro_XzFoiah1MlsCmRjcubQq","object_id":"ref_dU8Rx4P5Mz25wtT7xIKS","event_type":"refund_succeeded","event_class":"refunds","is_delivery_successful":false,"initial_attempt_id":"evt_0195039d99d47f519cb63e7752618825","created":"2025-02-14T08:40:15.060Z"},{"event_id":"evt_0195039d6d6e79c1a407f83fe42ad994","merchant_id":"merchant_1739520765","profile_id":"pro_XzFoiah1MlsCmRjcubQq","object_id":"pay_uqIiFNnnpEOci2zPypY7","event_type":"payment_succeeded","event_class":"payments","is_delivery_successful":false,"initial_attempt_id":"evt_0195039d6d6e79c1a407f83fe42ad994","created":"2025-02-14T08:40:03.694Z"}]
```
- List initial delivery attempts with constraints
```
curl --location 'http://localhost:8080/events/profile/list?limit=2&offset=1' \
--header 'Authorization: Bearer eyJBdXRob3JpemF0aW9uIjoicnJyIiwiYWxnIjoiSFMyNTYifQ.eyJ1c2VyX2lkIjoiZDk1NTcyN2ItNDQxYi1iNjVmLWE2NTA5ZWZiYjQ0YiIsIm1lcmNoYW50X2lkIjoibWVyY2hhbnRfMTczOTUyMDc2NSIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDAxMzYxNTUsIm9yZ19pZCI6Im9yZ19IY3gzRUlMcWVXSFhGN2V3bE91dyIsInByb2ZpbGVfaWQiOiJwcm9fWHpGb2lhaDFNbHNDbVJqY3ViUXEiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.UwdflL4JuswgoPSLDFEGkXg0IUHMdqiftn1HS5arGhc' \
--header 'Cookie: login_token=eyJBdXRob3JpemF0aW9uIjoicnJyIiwiYWxnIjoiSFMyNTYifQ.eyJ1c2VyX2lkIjoiZDk1NTcyN2ItNDQxYi1iNjVmLWE2NTA5ZWZiYjQ0YiIsIm1lcmNoYW50X2lkIjoibWVyY2hhbnRfMTczOTUyMDc2NSIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDAxMzYxNTUsIm9yZ19pZCI6Im9yZ19IY3gzRUlMcWVXSFhGN2V3bE91dyIsInByb2ZpbGVfaWQiOiJwcm9fWHpGb2lhaDFNbHNDbVJqY3ViUXEiLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.UwdflL4JuswgoPSLDFEGkXg0IUHMdqiftn1HS5arGhc' \
--data ''
```
- Response
```
[{"event_id":"evt_0195039d99d47f519cb63e7752618825","merchant_id":"merchant_1739520765","profile_id":"pro_XzFoiah1MlsCmRjcubQq","object_id":"ref_dU8Rx4P5Mz25wtT7xIKS","event_type":"refund_succeeded","event_class":"refunds","is_delivery_successful":false,"initial_attempt_id":"evt_0195039d99d47f519cb63e7752618825","created":"2025-02-14T08:40:15.060Z"},{"event_id":"evt_0195039d6d6e79c1a407f83fe42ad994","merchant_id":"merchant_1739520765","profile_id":"pro_XzFoiah1MlsCmRjcubQq","object_id":"pay_uqIiFNnnpEOci2zPypY7","event_type":"payment_succeeded","event_class":"payments","is_delivery_successful":false,"initial_attempt_id":"evt_0195039d6d6e79c1a407f83fe42ad994","created":"2025-02-14T08:40:03.694Z"}]
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/openapi/src/openapi.rs`
- ... and 4 more files
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (6 changes)
**Detailed Identifier Changes:**
Commit 70107990:
Files to modify:
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/routes/webhook_events.rs**
Add:
- function: pub::list_initial_webhook_delivery_attempts_with_jwtauth
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/webhook_events.rs**
Add:
- function: pub::list_initial_webhook_delivery_attempts_with_jwtauth
**crates/router/src/services/authorization/permissions.rs**
Modify existing code
|
{"pr_number": 7325, "pr_title": "refactor(webhook): add jwt authenticated endpoint to list unique webhook events for a profile", "merged_at": "2025-03-24T12:00:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "refund"]}, "hierarchy": {"other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/routes/webhook_events.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/webhook_events.rs", "crates/router/src/services/authorization/permissions.rs"]}, "change_types": {"functions_added": 2, "fields_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connectors): [Worldpayvantiv] add NTI flow and refactor sync flows
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
In this PR
1. We have implemented the CIT and MIT payments, only for - network transaction id flow
2. Completely refactored the status handling
3. Refactored Psync and Rsync flow.
Any payment operation triggered to Vantiv (if didn't cause an API failure) will be marked as pending initially and later payment status gets updated via sync calls.
Hotfix for https://github.com/juspay/hyperswitch/pull/8495
> Note: Psync after void will fail the payment - this is a known issue.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<details>
<summary>MCA Create</summary>
```curl
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_0e454918-80a7-4094-bcff-daa8e346b243/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_2HAFolGlYSsegZm3**********' \
--data '{
"connector_type": "payment_processor",
"connector_name": "worldpayvantiv",
"business_country": "US",
"business_label": "default",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "**************",
"key1": "**********",
"api_secret": "************"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "debit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"report_group" : "Hello",
"merchant_config_currency":"USD",
}
}'
```
Response
```
{"connector_type":"payment_processor","connector_name":"worldpayvantiv","connector_label":"worldpayvantiv_US_default","merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","connector_account_details":{"auth_type":"SignatureKey","api_key":"u8**************01","key1":"01*****81","api_secret":"qR***********Fr"},"payment_methods_enabled":[{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"affirm","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"afterpay_clearpay","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"klarna","payment_experience":"redirect_to_url","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"klarna","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"bank_redirect","payment_method_types":[{"payment_method_type":"ideal","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"bancontact_card","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"przelewy24","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"giropay","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"sofort","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"eps","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"bank_debit","payment_method_types":[{"payment_method_type":"ach","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"becs","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"sepa","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"bacs","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"bank_transfer","payment_method_types":[{"payment_method_type":"ach","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"bacs","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true},{"payment_method_type":"sepa","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"card","payment_method_types":[{"payment_method_type":"credit","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"card","payment_method_types":[{"payment_method_type":"debit","payment_experience":null,"card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"wallet","payment_method_types":[{"payment_method_type":"apple_pay","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"wallet","payment_method_types":[{"payment_method_type":"google_pay","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]}],"connector_webhook_details":null,"metadata":{"google_pay":{"merchant_info":{"merchant_name":"Narayan Bhat"},"allowed_payment_methods":[{"type":"CARD","parameters":{"allowed_auth_methods":["PAN_ONLY","CRYPTOGRAM_3DS"],"allowed_card_networks":["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]},"tokenization_specification":{"type":"PAYMENT_GATEWAY","parameters":{"gateway":"example","gateway_merchant_id":"{{gateway_merchant_id}}"}}}]},"report_group":"Hello","merchant_config_currency":"USD"},"test_mode":false,"disabled":false,"frm_configs":null,"business_country":"US","business_label":"default","business_sub_label":null,"applepay_verified_domains":null,"pm_auth_config":null,"status":"active","additional_merchant_data":null,"connector_wallets_details":null}
```
</details>
<details>
<summary> Mandates via NTI </summary>
0. Enable `is_connector_agnostic_mit_enabled` for your profile
1. Create a CIT with Vantiv
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{
"amount": 10,
"currency": "USD",
"confirm": true,
"description": "payments",
"connector": ["worldpayvantiv"],
"capture_method": "automatic",
"customer_id": "9ad5a4e4-80f1-494d-b081-8dc5497f0145",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceutâ",
"zip": "94122",
"country": "AR",
"first_name": "joseph",
"last_name": "Doe"
}
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "Joseph",
"card_cvc": "737"
}
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "2025-03-27T13:56:49.848Z",
"online": {
"ip_address": null,
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15"
}
},
"setup_future_usage": "off_session",
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "13.232.74.226"
},
"metadata": {"report_group": "test"}
}'
```
Response
```
{"payment_id":"pay_2lKP1TDqbxFSb4LeKczw","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_2lKP1TDqbxFSb4LeKczw_secret_kteL8nR3S6vFvyQ56mmG","created":"2025-06-30T09:47:06.353Z","currency":"USD","customer_id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","customer":{"id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","created_at":1751276826,"expires":1751280426,"secret":"epk_32a625084c354731b59c7d3accac3b70"},"manual_retry_allowed":false,"connector_transaction_id":"83997095739360411","frm_message":null,"metadata":{"report_group":"test"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_2lKP1TDqbxFSb4LeKczw","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:02:06.353Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":"pm_QH26P6o4MrXFv09GaAd7","payment_method_status":"inactive","updated":"2025-06-30T09:47:07.025Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
2. Do a Psync
```
curl --location 'http://localhost:8080/payments/pay_2lKP1TDqbxFSb4LeKczw?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY'
```
Response
```
{"payment_id":"pay_2lKP1TDqbxFSb4LeKczw","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"succeeded","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":10,"connector":"worldpayvantiv","client_secret":"pay_2lKP1TDqbxFSb4LeKczw_secret_kteL8nR3S6vFvyQ56mmG","created":"2025-06-30T09:47:06.353Z","currency":"USD","customer_id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","customer":{"id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"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":"83997095739360411","frm_message":null,"metadata":{"report_group":"test"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_2lKP1TDqbxFSb4LeKczw","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:02:06.353Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"13.232.74.226","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":"pm_QH26P6o4MrXFv09GaAd7","payment_method_status":"inactive","updated":"2025-06-30T09:49:15.019Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
3. Do a MIT payment with the same connector
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data-raw '{
"amount": 6500,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "ce5eae6b-563b-4f58-bd58-903d633a5a66",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://hyperswitch.io",
"off_session": true,
"recurring_details": {
"type": "payment_method_id",
"data": "pm_QH26P6o4MrXFv09GaAd7"
},
"connector": [
"worldpayvantiv"
],
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"browser_info": {
"ip_address": "129.0.0.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "en-US",
"color_depth": 32,
"screen_height": 1117,
"screen_width": 1728,
"time_zone": -330,
"java_enabled": true,
"java_script_enabled": true
}
}'
```
Response
```
{"payment_id":"pay_hzqIaJUelieO3OkgacKN","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":6500,"net_amount":6500,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_hzqIaJUelieO3OkgacKN_secret_6fYRsNwF8UdKNSvquyY7","created":"2025-06-30T09:52:21.261Z","currency":"USD","customer_id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","customer":{"id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","name":"John Doe","email":"guest@example.com","phone":"999999999","phone_country_code":"+65"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":true,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"guest@example.com","name":"John Doe","phone":"999999999","return_url":"https://hyperswitch.io/","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":"ce5eae6b-563b-4f58-bd58-903d633a5a66","created_at":1751277141,"expires":1751280741,"secret":"epk_676600b403cd43be8c4b57c7d96faafd"},"manual_retry_allowed":false,"connector_transaction_id":"84085052987747238","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_hzqIaJUelieO3OkgacKN","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:07:21.261Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"129.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_QH26P6o4MrXFv09GaAd7","payment_method_status":"active","updated":"2025-06-30T09:52:23.739Z","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":"saved_card","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}
```
6. Do a Psync
```
curl --location 'http://localhost:8080/payments/pay_hzqIaJUelieO3OkgacKN?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY'
```
response
```
{"payment_id":"pay_hzqIaJUelieO3OkgacKN","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"succeeded","amount":6500,"net_amount":6500,"shipping_cost":null,"amount_capturable":0,"amount_received":6500,"connector":"worldpayvantiv","client_secret":"pay_hzqIaJUelieO3OkgacKN_secret_6fYRsNwF8UdKNSvquyY7","created":"2025-06-30T09:52:21.261Z","currency":"USD","customer_id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","customer":{"id":"ce5eae6b-563b-4f58-bd58-903d633a5a66","name":"John Doe","email":"guest@example.com","phone":"999999999","phone_country_code":"+65"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":true,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"Joseph","last_name":null},"phone":null,"email":null}},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"guest@example.com","name":"John Doe","phone":"999999999","return_url":"https://hyperswitch.io/","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":"84085052987747238","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_hzqIaJUelieO3OkgacKN","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:07:21.261Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"129.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_QH26P6o4MrXFv09GaAd7","payment_method_status":"active","updated":"2025-06-30T09:53:49.963Z","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":"saved_card","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
</details>
<details>
<summary> Manual + Refund </summary>
1. Create a manual payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{
"amount": 10,
"currency": "USD",
"confirm": true,
"description": "payments",
"connector": ["worldpayvantiv"],
"capture_method": "manual",
"customer_id": "082c2d86-e9e2-481a-bd7e-1bd2e86575ba",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceutâ",
"zip": "94122",
"country": "AR",
"first_name": "joseph",
"last_name": "Doe"
}
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "Joseph",
"card_cvc": "737"
}
}
}'
```
Response
```
{"payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_uKMQNl7N9wfLvmtq7oJZ_secret_YqGIoiSGvX5aCT0GAM3F","created":"2025-06-30T09:57:16.636Z","currency":"USD","customer_id":"43dbe83d-b75c-496d-a546-59ce2c963322","customer":{"id":"43dbe83d-b75c-496d-a546-59ce2c963322","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"43dbe83d-b75c-496d-a546-59ce2c963322","created_at":1751277436,"expires":1751281036,"secret":"epk_456b8bb12f6b4a0a8019c6745dc3e615"},"manual_retry_allowed":false,"connector_transaction_id":"83997095739384098","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_uKMQNl7N9wfLvmtq7oJZ","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:12:16.636Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T09:57:18.185Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
2. Call Psync
```
curl --location 'http://localhost:8080/payments/pay_uKMQNl7N9wfLvmtq7oJZ?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY'
```
Response
```
{"payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"requires_capture","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_uKMQNl7N9wfLvmtq7oJZ_secret_YqGIoiSGvX5aCT0GAM3F","created":"2025-06-30T09:57:16.636Z","currency":"USD","customer_id":"43dbe83d-b75c-496d-a546-59ce2c963322","customer":{"id":"43dbe83d-b75c-496d-a546-59ce2c963322","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"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":"83997095739384098","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_uKMQNl7N9wfLvmtq7oJZ","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:12:16.636Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T09:58:32.411Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
3. Capture
```
curl --location 'http://localhost:8080/payments/pay_uKMQNl7N9wfLvmtq7oJZ/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{
"amount_to_capture": 10,
"statement_descriptor_name": "Joseph",
"statement_descriptor_suffix": "JS"
}'
```
Response
```
{"payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_uKMQNl7N9wfLvmtq7oJZ_secret_YqGIoiSGvX5aCT0GAM3F","created":"2025-06-30T09:57:16.636Z","currency":"USD","customer_id":"43dbe83d-b75c-496d-a546-59ce2c963322","customer":{"id":"43dbe83d-b75c-496d-a546-59ce2c963322","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"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":"83997095739385384","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_uKMQNl7N9wfLvmtq7oJZ","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:12:16.636Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T09:59:22.847Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
4. Call Psync
```
curl --location 'http://localhost:8080/payments/pay_uKMQNl7N9wfLvmtq7oJZ?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY'
```
Response
```
{"payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"succeeded","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":10,"connector":"worldpayvantiv","client_secret":"pay_uKMQNl7N9wfLvmtq7oJZ_secret_YqGIoiSGvX5aCT0GAM3F","created":"2025-06-30T09:57:16.636Z","currency":"USD","customer_id":"43dbe83d-b75c-496d-a546-59ce2c963322","customer":{"id":"43dbe83d-b75c-496d-a546-59ce2c963322","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"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":"83997095739385384","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_uKMQNl7N9wfLvmtq7oJZ","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:12:16.636Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T10:00:09.795Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
5. Create a refund
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{
"payment_id": "pay_uKMQNl7N9wfLvmtq7oJZ",
"amount": 10,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"split_refunds": {
"stripe_split_refund": {
"revert_platform_fee": true,
"revert_transfer": true
}
}
}'
```
Response
```
{"refund_id":"ref_ONP0iAUqRWqq6v7gSGWS","payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","amount":10,"currency":"USD","status":"pending","reason":"Customer returned product","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"error_message":null,"error_code":null,"unified_code":null,"unified_message":null,"created_at":"2025-06-30T10:01:00.032Z","updated_at":"2025-06-30T10:01:01.059Z","connector":"worldpayvantiv","profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","split_refunds":{"stripe_split_refund":{"revert_platform_fee":true,"revert_transfer":true}},"issuer_error_code":null,"issuer_error_message":null}
```
6. Call Rsync
```
{"refund_id":"ref_ONP0iAUqRWqq6v7gSGWS","payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","amount":10,"currency":"USD","status":"pending","reason":"Customer returned product","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"error_message":null,"error_code":null,"unified_code":null,"unified_message":null,"created_at":"2025-06-30T10:01:00.032Z","updated_at":"2025-06-30T10:01:01.059Z","connector":"worldpayvantiv","profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","split_refunds":{"stripe_split_refund":{"revert_platform_fee":true,"revert_transfer":true}},"issuer_error_code":null,"issuer_error_message":null}
```
Response
```
{"refund_id":"ref_ONP0iAUqRWqq6v7gSGWS","payment_id":"pay_uKMQNl7N9wfLvmtq7oJZ","amount":10,"currency":"USD","status":"succeeded","reason":"Customer returned product","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"error_message":null,"error_code":null,"unified_code":null,"unified_message":null,"created_at":"2025-06-30T10:01:00.032Z","updated_at":"2025-06-30T10:02:07.545Z","connector":"worldpayvantiv","profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","split_refunds":{"stripe_split_refund":{"revert_platform_fee":true,"revert_transfer":true}},"issuer_error_code":null,"issuer_error_message":null}
```
</details>
<details>
<summary>Void</summary>
1. Create a manual payment with vantiv
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{
"amount": 10,
"currency": "USD",
"confirm": true,
"description": "payments",
"connector": ["worldpayvantiv"],
"capture_method": "manual",
"customer_id": "fb640a0d-6001-4d8d-9f8d-c7365092fbb2",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceutâ",
"zip": "94122",
"country": "AR",
"first_name": "joseph",
"last_name": "Doe"
}
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "Joseph",
"card_cvc": "737"
}
}
}'
```
Response
```
{"payment_id":"pay_VYvdUN8QOKzzMYsJjsbL","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_VYvdUN8QOKzzMYsJjsbL_secret_PithWrAcFr0e4Kb3YBxW","created":"2025-06-30T10:05:18.411Z","currency":"USD","customer_id":"cd60638a-b1ee-420c-87e2-84a0cb417315","customer":{"id":"cd60638a-b1ee-420c-87e2-84a0cb417315","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cd60638a-b1ee-420c-87e2-84a0cb417315","created_at":1751277918,"expires":1751281518,"secret":"epk_b1782ed082fc40a7b7c1a3580dc68f8e"},"manual_retry_allowed":false,"connector_transaction_id":"83997095871395696","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_VYvdUN8QOKzzMYsJjsbL","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:20:18.411Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T10:05:20.952Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
2. Call Psync
```
curl --location 'http://localhost:8080/payments/pay_VYvdUN8QOKzzMYsJjsbL?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY'
```
Response
```
{"payment_id":"pay_VYvdUN8QOKzzMYsJjsbL","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"requires_capture","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":10,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_VYvdUN8QOKzzMYsJjsbL_secret_PithWrAcFr0e4Kb3YBxW","created":"2025-06-30T10:05:18.411Z","currency":"USD","customer_id":"cd60638a-b1ee-420c-87e2-84a0cb417315","customer":{"id":"cd60638a-b1ee-420c-87e2-84a0cb417315","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"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":"83997095871395696","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_VYvdUN8QOKzzMYsJjsbL","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:20:18.411Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T10:06:19.219Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
3. Void the payment
```
curl --location 'http://localhost:8080/payments/pay_VYvdUN8QOKzzMYsJjsbL/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_n7QiMoAbvyRDMYUD1YCqh0JOtSlKx4YbH55UG0WvPeOrKXOgdPLTsMikZcNjz6DY' \
--data '{"cancellation_reason":"requested_by_customer"}'
```
Response
```
{"payment_id":"pay_VYvdUN8QOKzzMYsJjsbL","merchant_id":"postman_merchant_GHAction_56a5457a-0ed4-46be-a355-f2f1e7665db0","status":"processing","amount":10,"net_amount":10,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_VYvdUN8QOKzzMYsJjsbL_secret_PithWrAcFr0e4Kb3YBxW","created":"2025-06-30T10:05:18.411Z","currency":"USD","customer_id":"cd60638a-b1ee-420c-87e2-84a0cb417315","customer":{"id":"cd60638a-b1ee-420c-87e2-84a0cb417315","name":null,"email":null,"phone":null,"phone_country_code":null},"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"30","card_holder_name":"Joseph","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"AR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"Ceutâ","first_name":"joseph","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":"requested_by_customer","error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"84085053114454037","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_VYvdUN8QOKzzMYsJjsbL","payment_link":null,"profile_id":"pro_s7S7h1rpBqt5v5y4ccvK","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_V5XFJarrAF5NstSv85Q2","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-06-30T10:20:18.411Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-06-30T10:07:15.673Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/configs.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs`
- `crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs`
**3. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**4. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (7 changes)
- Extend existing types with new fields (122 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit 699cead9:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs**
Remove:
- function: private::get_request_body
Add:
- function: private::get_auth_header
- function: private::validate_mandate_payment
- function: private::handle_vantiv_json_error_response
**crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs**
Remove:
- struct: pub::TransactionQuery
Add:
- function: private::get_processing_info
- struct: pub::VantivSyncErrorResponse
- struct: pub::VantivSyncResponse
- struct: pub::PaymentDetail
- enum: pub::VantivProcessingType
- enum: pub::PaymentStatus
**crates/hyperswitch_domain_models/src/configs.rs**
Modify existing code
|
{"pr_number": 8528, "pr_title": "feat(connectors): [Worldpayvantiv] add NTI flow and refactor sync flows", "merged_at": "2025-07-02T10:16:30Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/configs.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs", "crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 3, "functions_added": 7, "enums_added": 2, "fields_added": 122, "imports_added": 5, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add three_ds decision rule execute api
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
add three_ds decision rule execute api
This pull request introduces a new feature for executing 3DS decision rules, along with supporting changes across multiple modules. The changes include adding new structures for handling 3DS decision rule inputs and outputs, integrating these structures into the backend and frontend systems, and updating associated tests and documentation.
### New Feature: 3DS Decision Rule Execution
* **API endpoint addition**: Added a new OpenAPI endpoint for executing 3DS decision rules (`post /three_ds_decision_rule/execute`).
* **New module and structs**: Created `three_ds_decision_rule` module in `crates/api_models` with structs for handling request and response data (`ThreeDsDecisionRuleExecuteRequest` and `ThreeDsDecisionRuleExecuteResponse`).
* **Enum updates**: Added `ThreeDsDecisionRule` to `ApiEventsType` and implemented a method to retrieve decisions in `ThreeDSDecisionRule`. [[1]](diffhunk://#diff-77f0e8abb88015b6a88d517bd4b0eb801b98ed2ac5a4a0fac5be92d4927ee780R129) [[2]](diffhunk://#diff-ba82fa34317032bd0f1c62875d639baf1907373d06e34821bbbafab853f128f8R49-R56)
### Backend Integration
* **Backend input extension**: Enhanced `BackendInput` in `crates/euclid/src/backend/inputs.rs` to include new fields for acquirer, customer device, and issuer data.
* **Context handling**: Updated `Context` implementation in `crates/euclid/src/backend/vir_interpreter/types.rs` to process the new input fields and map them to `EuclidValue`.
### Frontend and Testing Updates
* **Frontend enums**: Added `ToSchema` trait to relevant enums in `crates/euclid/src/frontend/dir/enums.rs` for better schema integration. [[1]](diffhunk://#diff-a1285a70cb58ed604113326e553aad04ca7daa51716e67554e0b1cb68e66ec91R422) [[2]](diffhunk://#diff-a1285a70cb58ed604113326e553aad04ca7daa51716e67554e0b1cb68e66ec91R446)
* **Test updates**: Modified multiple tests in `crates/euclid/src/backend/vir_interpreter.rs` to include the new input fields (`acquirer_data`, `customer_device_data`, and `issuer_data`). [[1]](diffhunk://#diff-144ce8844bd410b8677d28c0381ca28321ac5efc329e25b6e73e1fa5d683e22dR156-R158) [[2]](diffhunk://#diff-144ce8844bd410b8677d28c0381ca28321ac5efc329e25b6e73e1fa5d683e22dR419-R421)
Tested wasm change - get_all_keys (Not to include 3DS Decision Keys)
<img width="1056" alt="image" src="https://github.com/user-attachments/assets/6b213979-030d-4364-a21e-7252b1444ca3" />
### Documentation and Configuration
* **API documentation**: Added a new page for the 3DS decision rule API in `api-reference/mint.json`.
* **Cargo.toml update**: Included `euclid` as a dependency in `crates/openapi/Cargo.toml`.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested Manually
**Create a Three DS Decision Rule using Routing Create Config API**
CURL
```
curl --location '{{BASE_URL}}/routing' \
--header 'api-key: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"name": "Three DS Decision Rule for exemption",
"description": "This is a three_ds_decision_rule",
"profile_id": "pro_grHb38qPPHB61ZxZQL4f",
"transaction_type": "three_ds_authentication",
"algorithm": {
"type": "three_ds_decision_rule",
"data": {
"defaultSelection": {
"decision": "no_three_ds"
},
"rules": [
{
"name": "rule_1",
"connectorSelection": {
"decision": "challenge_requested"
},
"statements": [
{
"condition": [
{
"lhs": "issuer_country",
"comparison": "equal",
"value": {
"type": "enum_variant",
"value": "Switzerland"
},
"metadata": {}
},
{
"lhs": "acquirer_country",
"comparison": "equal",
"value": {
"type": "enum_variant",
"value": "Switzerland"
},
"metadata": {}
}
]
}
]
}
],
"metadata": {}
}
}
}'
```
Response
```
{
"id": "routing_d4PK8mS800gJWAatPRGS",
"profile_id": "pro_grHb38qPPHB61ZxZQL4f",
"name": "Three DS Decision Rule for exemption",
"kind": "three_ds_decision_rule",
"description": "This is a three_ds_decision_rule",
"created_at": 1748276752,
"modified_at": 1748276752,
"algorithm_for": "three_ds_authentication",
"decision_engine_routing_id": null
}
```
**Call Execute API with appropriate Routing ID and Input Data**
CURL
```
curl --location '{{BASE_URL}}/three_ds_decision/execute' \
--header 'Content-Type: application/json' \
--header 'api-key: {{API_KEY}}' \
--data '{
"routing_id": "routing_d4PK8mS800gJWAatPRGS",
"payment": {
"amount": 1,
"currency": "AMD"
},
"issuer": {
"country": "Switzerland"
},
"acquirer": {
"country": "Switzerland"
}
}'
```
Response
```
{
"decision": "challenge_requested"
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --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/lib.rs`
- `crates/api_models/src/three_ds_decision_rule.rs`
**2. Core Business Logic**
- `crates/router/src/core.rs`
- `crates/router/src/core/payments/routing.rs`
- `crates/router/src/core/three_ds_decision_rule.rs`
- ... and 1 more files
**3. Type Definitions**
- `crates/common_types/src/three_ds_decision_rule_engine.rs`
- `crates/euclid/src/backend/vir_interpreter/types.rs`
- `crates/router_env/src/logger/types.rs`
**4. Utils**
- `crates/common_utils/src/events.rs`
- `crates/router/src/routes/lock_utils.rs`
**5. Configuration Files**
- `crates/openapi/Cargo.toml`
**6. Other**
- `Cargo.lock`
- `api-reference/api-reference/3ds-decision-rule/execute-a-3ds-decision-rule-based-on-the-provided-input.mdx`
- `api-reference/mint.json`
- ... and 16 more files
**Code Patterns Applied:**
- Define new data structures (12 changes)
- Implement new functions (16 changes)
- Extend existing types with new fields (126 changes)
- Add conditional logic for feature flags or filtering (9 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit e90a95de:
Files to modify:
**crates/api_models/src/lib.rs**
Add:
- mod: pub::three_ds_decision_rule
**crates/api_models/src/three_ds_decision_rule.rs**
Add:
- function: private::get_api_event_type
- function: private::get_api_event_type
- struct: pub::PaymentData
- struct: pub::PaymentMethodMetaData
- struct: pub::CustomerDeviceData
- struct: pub::IssuerData
- struct: pub::AcquirerData
- struct: pub::ThreeDsDecisionRuleExecuteRequest
- struct: pub::ThreeDsDecisionRuleExecuteResponse
- impl: impl common_utils::events::ApiEventMetric for ThreeDsDecisionRuleExecuteRequest
- impl: impl common_utils::events::ApiEventMetric for ThreeDsDecisionRuleExecuteResponse
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_types/src/three_ds_decision_rule_engine.rs**
Add:
- function: pub::get_decision
- impl: impl ThreeDSDecisionRule
**crates/common_utils/src/events.rs**
Modify existing code
**crates/euclid/benches/backends.rs**
Modify existing code
**crates/euclid/src/backend.rs**
Add:
- function: pub::get_output
- impl: impl BackendOutput<O>
**crates/euclid/src/backend/inputs.rs**
Add:
- struct: pub::AcquirerDataInput
- struct: pub::CustomerDeviceDataInput
- struct: pub::IssuerDataInput
**crates/euclid/src/backend/vir_interpreter.rs**
Modify existing code
**crates/euclid/src/backend/vir_interpreter/types.rs**
Modify existing code
**crates/euclid/src/frontend/dir/enums.rs**
Modify existing code
**crates/euclid_wasm/src/lib.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/routes.rs**
Add:
- mod: pub::three_ds_decision_rule
**crates/openapi/src/routes/three_ds_decision_rule.rs**
Add:
- function: pub::three_ds_decision_rule_execute
**crates/router/src/consts.rs**
Modify existing code
**crates/router/src/core.rs**
Add:
- mod: pub::three_ds_decision_rule
**crates/router/src/core/payments/routing.rs**
Modify existing code
**crates/router/src/core/three_ds_decision_rule.rs**
Add:
- function: pub::execute_three_ds_decision_rule
- struct: pub::Algorithm
- mod: pub::utils
**crates/router/src/core/three_ds_decision_rule/utils.rs**
Add:
- function: pub::apply_psd2_validations_during_execute
- function: private::foreign_from
- function: private::foreign_from
- function: private::foreign_from
- function: private::foreign_from
- function: private::foreign_from
- function: private::foreign_from
- impl: impl ForeignFrom<api_threedsecure::PaymentData> for dsl_inputs::PaymentInput
- impl: impl ForeignFrom<Option<api_threedsecure::PaymentMethodMetaData>> for dsl_inputs::PaymentMethodInput
- impl: impl ForeignFrom<api_threedsecure::CustomerDeviceData> for dsl_inputs::CustomerDeviceDataInput
- impl: impl ForeignFrom<api_threedsecure::IssuerData> for dsl_inputs::IssuerDataInput
- impl: impl ForeignFrom<api_threedsecure::AcquirerData> for dsl_inputs::AcquirerDataInput
- impl: impl ForeignFrom<api_threedsecure::ThreeDsDecisionRuleExecuteRequest> for dsl_inputs::BackendInput
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes.rs**
Add:
- mod: pub::three_ds_decision_rule
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- struct: pub::ThreeDsDecisionRule
- impl: impl ThreeDsDecisionRule
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/three_ds_decision_rule.rs**
Add:
- function: pub::execute_decision_rule
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 8148, "pr_title": "feat(router): add three_ds decision rule execute api", "merged_at": "2025-06-06T16:52:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/lib.rs", "crates/api_models/src/three_ds_decision_rule.rs"], "core_business": ["crates/router/src/core.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/three_ds_decision_rule.rs", "crates/router/src/core/three_ds_decision_rule/utils.rs"], "types": ["crates/common_types/src/three_ds_decision_rule_engine.rs", "crates/euclid/src/backend/vir_interpreter/types.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/events.rs", "crates/router/src/routes/lock_utils.rs"], "config": ["crates/openapi/Cargo.toml"], "other": ["Cargo.lock", "api-reference/api-reference/3ds-decision-rule/execute-a-3ds-decision-rule-based-on-the-provided-input.mdx", "api-reference/mint.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/euclid/benches/backends.rs", "crates/euclid/src/backend.rs", "crates/euclid/src/backend/inputs.rs", "crates/euclid/src/backend/vir_interpreter.rs", "crates/euclid/src/frontend/dir/enums.rs", "crates/euclid_wasm/src/lib.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/routes.rs", "crates/openapi/src/routes/three_ds_decision_rule.rs", "crates/router/src/consts.rs", "crates/router/src/lib.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/three_ds_decision_rule.rs"]}, "change_types": {"structs_added": 12, "functions_added": 16, "fields_added": 126, "imports_added": 20, "conditionals_added": 9, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(debit_routing): Handle missing merchant_business_country by defaulting to US
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
If the business profile does not have a country set, we cannot perform debit routing, because the merchant_business_country will be treated as the acquirer_country, which is used to determine whether a transaction is local or global in the open router. For now, since debit routing is only implemented for USD, we can safely assume the acquirer_country is US if not provided by the merchant.
Main branch pr https://github.com/juspay/hyperswitch/pull/8141
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/debit_routing.rs`
**Code Patterns Applied:**
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit b9636611:
Files to modify:
**crates/router/src/core/debit_routing.rs**
Modify existing code
|
{"pr_number": 8162, "pr_title": "refactor(debit_routing): Handle missing merchant_business_country by defaulting to US", "merged_at": "2025-05-28T07:10:06Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "transaction"]}, "hierarchy": {"core_business": ["crates/router/src/core/debit_routing.rs"]}, "change_types": {"conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypressV2): update cypress v2 framework to accommodate hyperswitch v2 changes
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR introduces multiple fixes for Cypress V2 at framework level. The fixes include:
- When Error is thrown, we would usually get `undefined` instead of valid error message. This [commit](https://github.com/juspay/hyperswitch/commit/3fdcbdbee3e45f2122135f024dec65c255c5a4f0) fixes that
- [Generate Organization names based on UUID](https://github.com/juspay/hyperswitch/commit/a006eee594f8f4466b56ec5b504fef1270144f5d)
- [Fix the MCA create call containing metadata](https://github.com/juspay/hyperswitch/commit/e3bc7c76f8a8a330f3aa95aa899bcb7164f14076)
- Refactoring
- Move `key_id` validations to a separate function to reduce duplicate code. Refer [here](https://github.com/juspay/hyperswitch/commit/413bfeb3932d0f24cfc36cdaba84a714ff444ba4) and [here](https://github.com/juspay/hyperswitch/commit/75c6e9bca50dcb96489cadbaf9f9f2b31bf973a8)
- [Move `isoTimeTomorrow` to RequestBodyUtils](https://github.com/juspay/hyperswitch/commit/0f815b5f43c914a2ffe8e93253d525ca409b9ba0)
- [Introduce Payment files](https://github.com/juspay/hyperswitch/commit/5eed97e1990bbeb503655973657ca8ee53d9353b)
- These files in here are empty but contain only structures
> [!IMPORTANT]
> It is recommended that the PR is reviewed based on commits instead of going through the file at a time
Payment tests have not been added, but only template example just to serve as a reference for devs working on v2 to fill in.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
I'm the motivation.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Ran Cypress V2 tests against Hyperswitch V2
<img width="369" alt="image" src="https://github.com/user-attachments/assets/9974dac6-266a-49a3-9b02-84a1f24181e4">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `prettier . --write`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Utils**
- `cypress-tests-v2/cypress/utils/RequestBodyUtils.js`
**2. Tests**
- `cypress-tests-v2/cypress/e2e/configs/Payment/Utils.js`
- `cypress-tests-v2/cypress/e2e/configs/Payment/_Reusable.js`
- `cypress-tests-v2/cypress/e2e/spec/Payment/0001-[No3DS]Payments.cy.js`
- ... and 5 more files
**Code Patterns Applied:**
- Extend existing types with new fields (16 changes)
- Add conditional logic for feature flags or filtering (8 changes)
|
{"pr_number": 6493, "pr_title": "ci(cypressV2): update cypress v2 framework to accommodate hyperswitch v2 changes", "merged_at": "2024-11-08T13:06:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"utils": ["cypress-tests-v2/cypress/utils/RequestBodyUtils.js"], "tests": ["cypress-tests-v2/cypress/e2e/configs/Payment/Utils.js", "cypress-tests-v2/cypress/e2e/configs/Payment/_Reusable.js", "cypress-tests-v2/cypress/e2e/spec/Payment/0001-[No3DS]Payments.cy.js", "cypress-tests-v2/cypress/e2e/spec/Payment/0002-[3DS]Payments.cy.js", "cypress-tests-v2/cypress/fixtures/organization.json", "cypress-tests-v2/cypress/support/commands.js", "cypress-tests-v2/package-lock.json", "cypress-tests-v2/package.json"]}, "change_types": {"fields_added": 16, "conditionals_added": 8}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
docs: simplify README
Updated Readme, made it leaner
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [x] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Changed readme content to make it lean and easier for Contributor to consume content
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with 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)?
-->
NA
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Other**
- `README.md`
|
{"pr_number": 6306, "pr_title": "docs: simplify README", "merged_at": "2024-10-16T09:34:00Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"other": ["README.md"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(env): update env for network tokenization service
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
update env for network tokenization service with webhook source verification key
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/tokenization.rs`
**2. Type Definitions**
- `crates/common_types/src/callback_mapper.rs`
**3. Configuration Files**
- `config/config.example.toml`
- `config/deployments/env_specific.toml`
**4. Other**
- `crates/common_enums/src/enums.rs`
**Detailed Identifier Changes:**
Commit 6c66c36a:
Files to modify:
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_types/src/callback_mapper.rs**
Modify existing code
**crates/router/src/core/payments/tokenization.rs**
Modify existing code
|
{"pr_number": 8472, "pr_title": "fix(env): update env for network tokenization service", "merged_at": "2025-06-27T10:30:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["webhook", "token"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/tokenization.rs"], "types": ["crates/common_types/src/callback_mapper.rs"], "config": ["config/config.example.toml", "config/deployments/env_specific.toml"], "other": ["crates/common_enums/src/enums.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(webhooks): add idempotent_event_id generation using URL-safe Base64 (no padding) and SHA256 digest
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This change updates the idempotent_event_id generation to first hash the base string with SHA256 and then encode it using URL-safe Base64 without padding. By doing this, the generated IDs are guaranteed to be short and deterministic, ensuring they always fit within the 64-character database column limit. This fix addresses the issue where long payment_ids combined with event types were exceeding the DB constraint and breaking the outgoing webhooks flow.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
The idempotent_event_id column is a combination of payment_id and event_type. The DB column length is limited to 64 characters. Since payment_id itself can be up to 64 characters long, appending event_type causes the field to exceed the limit, leading to database constraint violations.
Currently, this breaks the outgoing webhooks flow.
Additionally, during staggered deployments and rollback, the uniqueness of these IDs may cause dual webhook dispatches.
closes #8460
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Started the local Node.js Express webhook listener on port 3000 using the server.js script.
<details>
<summary>server.js script</summary>
```
mkdir -p /tmp/hs-webhooks && cd /tmp/hs-webhooks
npm init -y >/dev/null
npm i express >/dev/null
cat > server.js <<'JS'
const express = require('express');
const app = express();
app.use(express.json({ type: '*/*' }));
app.post('/webhooks/hs', (req, res) => {
console.log('---- Webhook received ----');
console.log('Headers:', req.headers);
console.log('Body:', JSON.stringify(req.body, null, 2));
res.sendStatus(200);
});
app.listen(3000, () => console.log('Webhook listener running on port 3000'));
JS
node server.js
```
</details>
2. **Merchant Creation**
<details>
<summary>Merchant creation Curl</summary>
```bash
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
"merchant_id": "merchant_1758029612",
"locker_id": "m0010",
"merchant_name": "worldpay",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name":"john",
"last_name":"Doe"
}
},
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url":"http://localhost:3000/webhooks/hs",
"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",
"merchant_name": "Acme Widgets LLC"
},
"primary_business_details": [
{
"country": "US",
"business": "default"
}
]
}'
```
</details>
After this when i created payment it created event with these idempotent_event_id.
<img width="533" height="165" alt="image" src="https://github.com/user-attachments/assets/6610ede4-6ffe-4de1-bde3-664ac00abec4" />
<details>
<summary>Manual Retry Curl</summary>
```
curl --location --request POST 'http://localhost:8080/events/merchant_1758190753/evt_01995ce5346575608391d7f8b825175d/retry' \
--header 'api-key: test_admin'
```
</details>
<img width="559" height="252" alt="image" src="https://github.com/user-attachments/assets/cb652d7b-5749-48f0-b2f7-78726411e789" />
For primary object id greater than 64 chars still generated idempotent_event_id will always be less than 64 characters in length.
<img width="831" height="33" alt="image" src="https://github.com/user-attachments/assets/3d7b838a-df61-401e-ac2c-fd7e5cd5b4c8" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --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/errors.rs`
- `crates/router/src/core/webhooks/outgoing.rs`
- `crates/router/src/core/webhooks/outgoing_v2.rs`
- ... and 2 more files
**2. Utils**
- `crates/common_utils/src/consts.rs`
**3. Other**
- `crates/router/src/workflows/outgoing_webhook_retry.rs`
**Code Patterns Applied:**
**Detailed Identifier Changes:**
Commit 0c38bc3d:
Files to modify:
**crates/common_utils/src/consts.rs**
Modify existing code
**crates/router/src/core/errors.rs**
Modify existing code
**crates/router/src/core/webhooks/outgoing.rs**
Modify existing code
**crates/router/src/core/webhooks/outgoing_v2.rs**
Modify existing code
**crates/router/src/core/webhooks/utils.rs**
Modify existing code
**crates/router/src/core/webhooks/webhook_events.rs**
Modify existing code
**crates/router/src/workflows/outgoing_webhook_retry.rs**
Modify existing code
|
{"pr_number": 9405, "pr_title": "fix(webhooks): add idempotent_event_id generation using URL-safe Base64 (no padding) and SHA256 digest", "merged_at": "2025-09-22T08:30:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/errors.rs", "crates/router/src/core/webhooks/outgoing.rs", "crates/router/src/core/webhooks/outgoing_v2.rs", "crates/router/src/core/webhooks/utils.rs", "crates/router/src/core/webhooks/webhook_events.rs"], "utils": ["crates/common_utils/src/consts.rs"], "other": ["crates/router/src/workflows/outgoing_webhook_retry.rs"]}, "change_types": {"imports_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat: add primary key not null query to generic filter function
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Since schema for both v1 and v2 can be unified, it paves way for a new bug.
In v1, while querying a record with a column that is common for both v1 and v2, the query may retrieve list of records belonging to both v1 and v2.
Now v1 application will be able to deserialise v1 records in the list without any problems. But v2 records would have few v1 required fields as null. This records will not be deserialized by the v1 application.
For example:
Lets say an orgnization has both v1 and v2 merchants.
Lets do merchant list by organization_id in v1. This will fetch all v1 and v2 merchant_accounts from the DB. Since merchant_id column will not be populated in v2 records, it will cause deserialization failure.
Fix:
In order to fix this problem, for all filter DB queries in application, we will add `AND PRIMARY_KEY IS NOT NULL` along with existing where clause. This way v2 created records will not be fetched in v1 application.
This will also make sure list endpoint in v2 application won't fail when backfill is not made.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Create a merchant in v1 (org and profile with be created internally)
```
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
"merchant_id": "merchant_1744289448",
"locker_id": "m0010",
"merchant_name": "NewAge Retailer",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
},
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"metadata": {
"city": "NY",
"unit": "245"
}
}'
```
Response:
```
{
"merchant_id": "merchant_1744288162",
"merchant_name": "NewAge Retailer",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "QzOPDGAfZ1NVNXim3qyyiJYjUXheuHY7IXoEQikHpN9iVnRFwM0D80qRqKdZI5l6",
"redirect_to_merchant_with_http_post": false,
"merchant_details": {
"primary_contact_person": "John Test",
"primary_phone": "sunt laborum",
"primary_email": "JohnTest@test.com",
"secondary_contact_person": "John Test2",
"secondary_phone": "cillum do dolor id",
"secondary_email": "JohnTest2@test.com",
"website": "www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": null,
"last_name": null
}
},
"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
},
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "pk_dev_0eccdc2b95184c13885ae712f851d1ec",
"metadata": {
"city": "NY",
"unit": "245",
"compatible_connector": null
},
"locker_id": "m0010",
"primary_business_details": [],
"frm_routing_algorithm": null,
"organization_id": "org_6QGW3lXGhurZmJ2rfo8A",
"is_recon_enabled": false,
"default_profile": "pro_nOKzSPRoENNiLTMXlEdP",
"recon_status": "not_requested",
"pm_collect_link_config": null,
"product_type": "orchestration"
}
```
2. Create a Merchant Account in v2 for the above Org.
```
curl --location 'localhost:8080/v2/merchant-accounts' \
--header 'x-organization-id: org_6QGW3lXGhurZmJ2rfo8A' \
--header 'Content-Type: application/json' \
--header 'Authorization: admin-api-key=test_admin' \
--data '{
"merchant_name": "cloth_seller"
}'
```
Response:
```
{
"id": "cloth_seller_5yMFtTAMqUQC4CyQwJD8",
"merchant_name": "cloth_seller",
"merchant_details": null,
"publishable_key": "pk_dev_a9e62e6b0c3a4c1584fd7ae89bab646d",
"metadata": null,
"organization_id": "org_6QGW3lXGhurZmJ2rfo8A",
"recon_status": "not_requested",
"product_type": "orchestration"
}
```
3. Do merchant list for org in V1.
```
curl --location 'http://localhost:8080/accounts/list?organization_id=org_6QGW3lXGhurZmJ2rfo8A' \
--header 'Accept: application/json' \
--header 'api-key: test_admin'
```
Response:
```
[
{
"merchant_id": "merchant_1744288162",
"merchant_name": "NewAge Retailer",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "QzOPDGAfZ1NVNXim3qyyiJYjUXheuHY7IXoEQikHpN9iVnRFwM0D80qRqKdZI5l6",
"redirect_to_merchant_with_http_post": false,
"merchant_details": {
"primary_contact_person": "John Test",
"primary_phone": "sunt laborum",
"primary_email": "JohnTest@test.com",
"secondary_contact_person": "John Test2",
"secondary_phone": "cillum do dolor id",
"secondary_email": "JohnTest2@test.com",
"website": "www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": null,
"last_name": null
}
},
"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
},
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "pk_dev_0eccdc2b95184c13885ae712f851d1ec",
"metadata": {
"city": "NY",
"unit": "245",
"compatible_connector": null
},
"locker_id": "m0010",
"primary_business_details": [],
"frm_routing_algorithm": null,
"organization_id": "org_6QGW3lXGhurZmJ2rfo8A",
"is_recon_enabled": false,
"default_profile": "pro_nOKzSPRoENNiLTMXlEdP",
"recon_status": "not_requested",
"pm_collect_link_config": null,
"product_type": "orchestration"
}
]
```
Only v1 merchants are being returned.
Response: (only v1 merchant list should be returned).
But in DB, there are v1 as well as v2 merchants.

DB query has the appropriate IS NOT NULL clause.

## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query.rs`
- `crates/diesel_models/src/query/generics.rs`
- `crates/diesel_models/src/query/utils.rs`
**Code Patterns Applied:**
- Implement new functions (11 changes)
- Extend existing types with new fields (1 changes)
- Modify database queries (3 changes)
**Detailed Identifier Changes:**
Commit 8738f190:
Files to modify:
**crates/diesel_models/src/query.rs**
Add:
- mod: private::utils
**crates/diesel_models/src/query/generics.rs**
Modify existing code
**crates/diesel_models/src/query/utils.rs**
Add:
- function: private::get_local_unique_key
- function: private::get_local_unique_key
- function: private::get_local_unique_key
- function: private::get_local_unique_key
- function: private::get_local_unique_key
- function: private::get_local_unique_key
- function: private::get_local_unique_key
- trait: pub::GetPrimaryKey
- trait: pub::CompositeKey
- impl: impl CompositeKey for <schema::payment_attempt::table as diesel::Table>::PrimaryKey
- impl: impl CompositeKey for <schema::refund::table as diesel::Table>::PrimaryKey
- impl: impl CompositeKey for <schema::customers::table as diesel::Table>::PrimaryKey
- impl: impl CompositeKey for <schema::blocklist::table as diesel::Table>::PrimaryKey
- impl: impl CompositeKey for <schema::incremental_authorization::table as diesel::Table>::PrimaryKey
- impl: impl CompositeKey for <schema_v2::incremental_authorization::table as diesel::Table>::PrimaryKey
- impl: impl CompositeKey for <schema_v2::blocklist::table as diesel::Table>::PrimaryKey
- mod: private::composite_key
|
{"pr_number": 7785, "pr_title": "feat: add primary key not null query to generic filter function", "merged_at": "2025-04-17T05:38:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"database": ["crates/diesel_models/src/query.rs", "crates/diesel_models/src/query/generics.rs", "crates/diesel_models/src/query/utils.rs"]}, "change_types": {"functions_added": 11, "fields_added": 1, "imports_added": 4, "database_queries": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): language consumption from locale in payment and payout links
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for https://github.com/juspay/hyperswitch/pull/7993
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Fix for https://github.com/juspay/hyperswitch/pull/7993
## How did you test it?
Same as specified in https://github.com/juspay/hyperswitch/pull/7993
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payment_link/locale.js`
**2. Configuration Files**
- `crates/router/locales/en-GB.yml`
- `crates/router/locales/fr-BE.yml`
**3. Other**
- `crates/router/src/services/api/generic_link_response/context.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (1 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 82c2c3ef:
Files to modify:
**crates/router/src/services/api/generic_link_response/context.rs**
Add:
- function: private::get_language
|
{"pr_number": 8018, "pr_title": "fix(core): language consumption from locale in payment and payout links", "merged_at": "2025-05-13T11:44:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/payment_link/locale.js"], "config": ["crates/router/locales/en-GB.yml", "crates/router/locales/fr-BE.yml"], "other": ["crates/router/src/services/api/generic_link_response/context.rs"]}, "change_types": {"functions_added": 2, "fields_added": 1, "imports_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
End of preview. Expand
in Data Studio
Rust Commit Dataset - Hyperswitch
Dataset Description
This dataset contains Rust commit messages paired with their corresponding code patches from the Hyperswitch repository.
Dataset Summary
- Total Examples: 1801
- Language: Rust
- Source: Hyperswitch GitHub repository
- Format: Prompt-response pairs for supervised fine-tuning (SFT)
Data Fields
prompt: The commit message describing the changeresponse: The git patch/diff showing the actual code changes
Example
{
"prompt": "fix: update payment status handling",
"response": "diff --git a/src/payment.rs b/src/payment.rs\n..."
}
Usage
from datasets import load_dataset
# Load dataset
dataset = load_dataset("archit11/hyperswitch-product-code-complete")
# Access train/test splits
train_data = dataset['train']
test_data = dataset['test']
# Example
print(train_data[0]['prompt'])
print(train_data[0]['response'])
Training
This dataset is designed for fine-tuning code generation models on Rust commit-to-patch generation tasks.
Example training command:
python train_sft.py \
--dataset archit11/hyperswitch-product-code-complete \
--model Qwen/Qwen3-4B \
--output_dir ./qwen-rust-sft \
--use_4bit \
--use_lora
Data Collection
The data was collected using PyDriller and tree-sitter for parsing Rust identifiers:
- Only commits with 20+ lines changed are included
- Rust-specific identifier tracking (functions, structs, enums, traits, impls, modules)
Citation
If you use this dataset, please cite the Hyperswitch repository:
@misc{hyperswitch2024,
title={Hyperswitch},
author={Juspay},
year={2024},
url={https://github.com/juspay/hyperswitch}
}
License
This dataset follows the same license as the Hyperswitch project.
- Downloads last month
- 18