| "description": "## Type of Change\r\n<!-- Put an `x` in the boxes that apply -->\r\n\r\n- [ ] Bugfix\r\n- [x] New feature\r\n- [ ] Enhancement\r\n- [ ] Refactoring\r\n- [ ] Dependency updates\r\n- [ ] Documentation\r\n- [ ] CI/CD\r\n\r\n## Description\r\n<!-- Describe your changes in detail -->\r\nIn Novalnet, particularly in SEPA Payment Method, the customer has the right to report a unauthorized transaction to the bank. The Bank refunds the amount (no questions asked) to the customer. The constraint being the dispute reporting has to be <=8 weeks from the original transaction date. During such an event, Novalnet sends a incoming webhook to the merchant with event.type = \"CHARGEBACK\" and transaction.payment_type = \"RETURN_DEBIT_SEPA\". Upon receiving this webhook, Hyperswitch marks the event as `DisputeLost` and sends back an outgoing webhook to the merchant. It also creates an entry in the Dispute table and marks the `DisputeStatus` as `DisputeLost`. \r\n\r\nRef: https://developer.novalnet.com/asynchronousnotification/parameterspassed\r\n\r\n### Additional Changes\r\n\r\n- [ ] This PR modifies the API contract\r\n- [ ] This PR modifies the database schema\r\n- [ ] This PR modifies application configuration/environment variables\r\n\r\n<!--\r\nProvide links to the files with corresponding changes.\r\n\r\nFollowing are the paths where you can find config files:\r\n1. `config`\r\n2. `crates/router/src/configs`\r\n3. `loadtest/config`\r\n-->\r\n\r\n\r\n## Motivation and Context\r\n<!--\r\nWhy is this change required? What problem does it solve?\r\nIf it fixes an open issue, please link to the issue here.\r\n\r\nIf you don't have an issue, we'd recommend starting with one first so the PR\r\ncan focus on the implementation (unless it is an obvious bug or documentation fix\r\nthat will have little conversation).\r\n-->\r\n\r\n\r\n## How did you test it?\r\n<!--\r\nDid you write an integration/unit/API test to verify the code changes?\r\nOr did you test this change manually (provide relevant screenshots)?\r\n-->\r\n\r\nNote: This PR cannot be tested in an hosted env. \r\n\r\nStep 1: Make a Payments Confirm Call to Novalnet - PM should be SEPA\r\n\r\ncURL: \r\n\r\n```\r\ncurl --location 'http://localhost:8080/payments' \\\r\n--header 'Content-Type: application/json' \\\r\n--header 'Accept: application/json' \\\r\n--header 'api-key: dev_Dc2yjDPcK0YWrjW8k3bgG8nYgupkj74xswTLMylYUZzeq2aaIX9ikOob1HU2daOr' \\\r\n--data-raw '{\r\n \"amount\": 1000,\r\n \"currency\": \"EUR\",\r\n \"confirm\": true,\r\n \"payment_link\": false,\r\n \"capture_method\": \"automatic\",\r\n \"capture_on\": \"2022-09-10T10:11:12Z\",\r\n \"amount_to_capture\": 1000,\r\n \"customer_id\": \"StripeCustomer\",\r\n \"email\": \"test.accepted@novalnet.de\",\r\n \"name\": \"John Doe\",\r\n \"phone\": \"999999999\",\r\n \"phone_country_code\": \"+1\",\r\n \"description\": \"Its my first payment request\",\r\n \"authentication_type\": \"three_ds\",\r\n \"return_url\": \"https://google.com\",\r\n \"payment_method\": \"bank_debit\",\r\n \"payment_method_type\": \"sepa\",\r\n \"payment_method_data\": {\r\n \"bank_debit\": {\r\n \"sepa_bank_debit\": {\r\n \"iban\": \"DE24300209002411761956\",\r\n \"bank_account_holder_name\": \"Joseph Doe\"\r\n }\r\n }\r\n },\r\n \"billing\": {\r\n \"address\": {\r\n \"line1\": \"1467\",\r\n \"line2\": \"CA\",\r\n \"line3\": \"CA\",\r\n \"city\": \"Musterhausen\",\r\n \"state\": \"California\",\r\n \"zip\": \"12345\",\r\n \"country\": \"DE\",\r\n \"first_name\": \"Max\",\r\n \"last_name\": \"Mustermann\"\r\n },\r\n \"email\": \"test.accepted@novalnet.de\",\r\n \"phone\": {\r\n \"number\": \"8056594427\",\r\n \"country_code\": \"+91\"\r\n }\r\n },\r\n \"shipping\": {\r\n \"address\": {\r\n \"line1\": \"Musterstr\",\r\n \"line2\": \"CA\",\r\n \"line3\": \"CA\",\r\n \"city\": \"Musterhausen\",\r\n \"state\": \"California\",\r\n \"zip\": \"94122\",\r\n \"country\": \"DE\",\r\n \"first_name\": \"joseph\",\r\n \"last_name\": \"Doe\"\r\n },\r\n \"phone\": {\r\n \"number\": \"8056594427\",\r\n \"country_code\": \"+91\"\r\n }\r\n },\r\n \"browser_info\": {\r\n \"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\",\r\n \"accept_header\": \"text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,\\/;q=0.8\",\r\n \"language\": \"nl-NL\",\r\n \"color_depth\": 24,\r\n \"ip_address\": \"103.77.139.95\",\r\n \"screen_height\": 723,\r\n \"screen_width\": 1536,\r\n \"time_zone\": 0,\r\n \"java_enabled\": true,\r\n \"java_script_enabled\": true\r\n },\r\n \"statement_descriptor_name\": \"joseph\",\r\n \"statement_descriptor_suffix\": \"JS\",\r\n \"metadata\": {\r\n \"udf1\": \"value1\",\r\n \"new_customer\": \"true\",\r\n \"login_date\": \"2019-09-10T10:11:12Z\"\r\n }\r\n}'\r\n```\r\n\r\nResponse: \r\n\r\n```\r\n{\r\n \"payment_id\": \"pay_omexSf0sym8f7fWIhdXC\",\r\n \"merchant_id\": \"merchant_1761743373\",\r\n \"status\": \"succeeded\",\r\n \"amount\": 1000,\r\n \"net_amount\": 1000,\r\n \"shipping_cost\": null,\r\n \"amount_capturable\": 0,\r\n \"amount_received\": 1000,\r\n \"connector\": \"novalnet\",\r\n \"client_secret\": \"pay_omexSf0sym8f7fWIhdXC_secret_1rVjZX4L4dDt2eHHd7dq\",\r\n \"created\": \"2025-10-29T13:09:50.423Z\",\r\n \"currency\": \"EUR\",\r\n \"customer_id\": \"StripeCustomer\",\r\n \"customer\": {\r\n \"id\": \"StripeCustomer\",\r\n \"name\": \"John Doe\",\r\n \"email\": \"test.accepted@novalnet.de\",\r\n \"phone\": \"999999999\",\r\n \"phone_country_code\": \"+1\"\r\n },\r\n \"description\": \"Its my first payment request\",\r\n \"refunds\": null,\r\n \"disputes\": null,\r\n \"mandate_id\": null,\r\n \"mandate_data\": null,\r\n \"setup_future_usage\": null,\r\n \"off_session\": null,\r\n \"capture_on\": null,\r\n \"capture_method\": \"automatic\",\r\n \"payment_method\": \"bank_debit\",\r\n \"payment_method_data\": {\r\n \"bank_debit\": {\r\n \"sepa\": {\r\n \"iban\": \"DE243************61956\",\r\n \"bank_account_holder_name\": \"Joseph Doe\"\r\n }\r\n },\r\n \"billing\": null\r\n },\r\n \"payment_token\": null,\r\n \"shipping\": {\r\n \"address\": {\r\n \"city\": \"Musterhausen\",\r\n \"country\": \"DE\",\r\n \"line1\": \"Musterstr\",\r\n \"line2\": \"CA\",\r\n \"line3\": \"CA\",\r\n \"zip\": \"94122\",\r\n \"state\": \"California\",\r\n \"first_name\": \"joseph\",\r\n \"last_name\": \"Doe\",\r\n \"origin_zip\": null\r\n },\r\n \"phone\": {\r\n \"number\": \"8056594427\",\r\n \"country_code\": \"+91\"\r\n },\r\n \"email\": null\r\n },\r\n \"billing\": {\r\n \"address\": {\r\n \"city\": \"Musterhausen\",\r\n \"country\": \"DE\",\r\n \"line1\": \"1467\",\r\n \"line2\": \"CA\",\r\n \"line3\": \"CA\",\r\n \"zip\": \"12345\",\r\n \"state\": \"California\",\r\n \"first_name\": \"Max\",\r\n \"last_name\": \"Mustermann\",\r\n \"origin_zip\": null\r\n },\r\n \"phone\": {\r\n \"number\": \"8056594427\",\r\n \"country_code\": \"+91\"\r\n },\r\n \"email\": \"test.accepted@novalnet.de\"\r\n },\r\n \"order_details\": null,\r\n \"email\": \"test.accepted@novalnet.de\",\r\n \"name\": \"John Doe\",\r\n \"phone\": \"999999999\",\r\n \"return_url\": \"https://google.com/\",\r\n \"authentication_type\": \"three_ds\",\r\n \"statement_descriptor_name\": \"joseph\",\r\n \"statement_descriptor_suffix\": \"JS\",\r\n \"next_action\": null,\r\n \"cancellation_reason\": null,\r\n \"error_code\": null,\r\n \"error_message\": null,\r\n \"unified_code\": null,\r\n \"unified_message\": null,\r\n \"payment_experience\": null,\r\n \"payment_method_type\": \"sepa\",\r\n \"connector_label\": null,\r\n \"business_country\": null,\r\n \"business_label\": \"default\",\r\n \"business_sub_label\": null,\r\n \"allowed_payment_method_types\": null,\r\n \"ephemeral_key\": {\r\n \"customer_id\": \"StripeCustomer\",\r\n \"created_at\": 1761743390,\r\n \"expires\": 1761746990,\r\n \"secret\": \"epk_af1162c279944f4fa1b8830a9765d9c2\"\r\n },\r\n \"manual_retry_allowed\": null,\r\n \"connector_transaction_id\": \"15250900088106237\",\r\n \"frm_message\": null,\r\n \"metadata\": {\r\n \"udf1\": \"value1\",\r\n \"login_date\": \"2019-09-10T10:11:12Z\",\r\n \"new_customer\": \"true\"\r\n },\r\n \"connector_metadata\": null,\r\n \"feature_metadata\": {\r\n \"redirect_response\": null,\r\n \"search_tags\": null,\r\n \"apple_pay_recurring_details\": null,\r\n \"gateway_system\": \"direct\",\r\n \"pix_qr_expiry_time\": null,\r\n \"boleto_additional_details\": null\r\n },\r\n \"reference_id\": \"15250900088106237\",\r\n \"payment_link\": null,\r\n \"profile_id\": \"pro_FG1OSXk8CHt5yIvQT8uF\",\r\n \"surcharge_details\": null,\r\n \"attempt_count\": 1,\r\n \"merchant_decision\": null,\r\n \"merchant_connector_id\": \"mca_z2Z5ExTgWqxSVzVt6OXW\",\r\n \"incremental_authorization_allowed\": false,\r\n \"authorization_count\": null,\r\n \"incremental_authorizations\": null,\r\n \"external_authentication_details\": null,\r\n \"external_3ds_authentication_attempted\": false,\r\n \"expires_on\": \"2025-10-29T13:24:50.423Z\",\r\n \"fingerprint\": null,\r\n \"browser_info\": {\r\n \"language\": \"nl-NL\",\r\n \"time_zone\": 0,\r\n \"ip_address\": \"103.77.139.95\",\r\n \"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\",\r\n \"color_depth\": 24,\r\n \"java_enabled\": true,\r\n \"screen_width\": 1536,\r\n \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8\",\r\n \"screen_height\": 723,\r\n \"java_script_enabled\": true\r\n },\r\n \"payment_channel\": null,\r\n \"payment_method_id\": null,\r\n \"network_transaction_id\": null,\r\n \"payment_method_status\": null,\r\n \"updated\": \"2025-10-29T13:09:51.675Z\",\r\n \"split_payments\": null,\r\n \"frm_metadata\": null,\r\n \"extended_authorization_applied\": null,\r\n \"request_extended_authorization\": null,\r\n \"capture_before\": null,\r\n \"merchant_order_reference_id\": null,\r\n \"order_tax_amount\": null,\r\n \"connector_mandate_id\": null,\r\n \"card_discovery\": null,\r\n \"force_3ds_challenge\": false,\r\n \"force_3ds_challenge_trigger\": false,\r\n \"issuer_error_code\": null,\r\n \"issuer_error_message\": null,\r\n \"is_iframe_redirection_enabled\": null,\r\n \"whole_connector_response\": null,\r\n \"enable_partial_authorization\": null,\r\n \"enable_overcapture\": null,\r\n \"is_overcapture_enabled\": null,\r\n \"network_details\": null,\r\n \"is_stored_credential\": null,\r\n \"mit_category\": null\r\n}\r\n```\r\n\r\nStep 2: Host HS BE in ngrok and Send a webhook from postman to Hyperswitch (hardcode `Ok(true)` in fn `verify_webhook_source` under the `IncomingWebhooks trait`.)\r\n\r\nNote: This is for testing in local\r\n\r\ncURL: \r\n\r\n```\r\ncurl --location 'https://8506ba5bb9af.ngrok-free.app/webhooks/merchant_1761743373/mca_z2Z5ExTgWqxSVzVt6OXW' \\\r\n--header 'Content-Type: application/json' \\\r\n--data '{\r\n \"event\": {\r\n \"checksum\": \"55602fc815b46b88368b6c9d80feb0e54a71c13098e2af8d5b9c9ffd2f787c56\",\r\n \"parent_tid\": 1234,\r\n \"tid\": 15250900088106237,\r\n \"type\": \"CHARGEBACK\"\r\n },\r\n \"result\": {\r\n \"status\": \"SUCCESS\",\r\n \"status_code\": 100,\r\n \"status_text\": \"Successful\"\r\n },\r\n \"transaction\": {\r\n \"amount\": 1000,\r\n \"currency\": \"EUR\",\r\n \"order_no\": \"pay_omexSf0sym8f7fWIhdXC_1\",\r\n \"payment_type\": \"RETURN_DEBIT_SEPA\",\r\n \"reason\": \"abc\",\r\n \"reason_code\": \"abcd\",\r\n \"status\": \"CONFIRMED\",\r\n \"status_code\": 100,\r\n \r\n \"tid\": 15250900088106237\r\n }\r\n}'\r\n```\r\n\r\nDB Screenshot of Dispute Table: \r\n\r\n<img width=\"1246\" height=\"148\" alt=\"Screenshot 2025-10-29 at 6 54 36\u202fPM\" src=\"https://github.com/user-attachments/assets/72f75f19-4cae-498d-8e2b-b1e203233349\" />\r\n\r\n\r\nProof of outgoing webhooks: \r\n<img width=\"1728\" height=\"966\" alt=\"Screenshot 2025-10-29 at 6 54 15\u202fPM\" src=\"https://github.com/user-attachments/assets/95a701a3-29c8-4288-ab18-a5a203b3bfb1\" />\r\n\r\n\r\n\r\n## Checklist\r\n<!-- Put an `x` in the boxes that apply -->\r\n\r\n- [x] I formatted the code `cargo +nightly fmt --all`\r\n- [x] I addressed lints thrown by `cargo clippy`\r\n- [x] I reviewed the submitted code\r\n- [x] I added unit tests for my changes where possible\r\n", |