| { |
| "number": 10112, |
| "title": "feat(revenue_recovery): Add account updater support in revenue recovery flow for worldpayvantiv connector", |
| "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\nThis pr enables the account updater support for revenue recovery for worldpay vantiv connector. Worldpay vantiv when account updater is enabled by the merchant at the connectors end, it response with the new account updater details in the response of authorize flow. So to consume this in Revenue recovery flow we need to propogate these details up the ladder till the function `call_proxy_api` in revenue recovery.\r\n\r\nWhen worldpay vantiv responds with the account updater we check for the payment method which should be `MANDATEPAYMENT`. If it is a mandate payment and it has account updater details we will respond with the updated token details. We will replace the source of the mandate reference from token response to account updater response and populate the same data in mandate_data in `PaymentConfirmData<>`\r\n\r\nToken update can have two cases:\r\n1. Expiry update: In this case token is same but its underlying details will change like expiry and token\r\n2. Token Update: In this case token will get changed completely\r\n\r\nBased on the Account updater it updates the datasource of revenue recovery.\r\n1. If it is an expiry change, it modifies the underlying details for that token\r\n2. If it is a new token, it set the old token is_active flag to false and insert the new token\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\n1. Create worldpay-vantiv mca \r\n```\r\ncurl --location 'http://localhost:8080/v2/connector-accounts' \\\r\n--header 'Content-Type: application/json' \\\r\n--header 'Accept: application/jso' \\\r\n--header 'x-merchant-id:{{merchant_id}}' \\\r\n--header 'x-profile-id: {{profile_id}}' \\\r\n--header 'Authorization: admin-api-key=test_admin' \\\r\n--header 'api-key: admin-api-key=test_admin' \\\r\n--data '{\r\n \"connector_type\": \"payment_processor\",\r\n \"connector_name\": \"worldpayvantiv\",\r\n \"connector_account_details\": { \r\n \"auth_type\": \"SignatureKey\",\r\n \"api_key\": \"api_key\", \r\n \"key1\": \"key1\", \r\n \"api_secret\": \"api_secret\" \r\n },\r\n \"payment_methods_enabled\": [\r\n {\r\n \"payment_method_type\": \"card\",\r\n \"payment_method_subtypes\": [\r\n {\r\n \"payment_method_subtype\": \"credit\",\r\n \"payment_experience\": null,\r\n \"card_networks\": [\r\n \"Visa\",\r\n \"Mastercard\"\r\n ],\r\n \"accepted_currencies\": null,\r\n \"accepted_countries\": null,\r\n \"minimum_amount\": -1,\r\n \"maximum_amount\": 68607706,\r\n \"recurring_enabled\": true,\r\n \"installment_payment_enabled\": true\r\n },\r\n {\r\n \"payment_method_subtype\": \"debit\",\r\n \"payment_experience\": null,\r\n \"card_networks\": [\r\n \"Visa\",\r\n \"Mastercard\"\r\n ],\r\n \"accepted_currencies\": null,\r\n \"accepted_countries\": null,\r\n \"minimum_amount\": -1,\r\n \"maximum_amount\": 68607706,\r\n \"recurring_enabled\": true,\r\n \"installment_payment_enabled\": true\r\n }\r\n ]\r\n }\r\n ],\r\n \"frm_configs\": null,\r\n \"connector_webhook_details\": {\r\n \"merchant_secret\": \"\"\r\n },\r\n \"metadata\": {\r\n \"report_group\": \"Hello\",\r\n \"merchant_config_currency\": \"USD\"\r\n },\r\n \"profile_id\": \"{{profile_id}}\"\r\n}'\r\n```\r\n\r\n2. get the mca id and create a custom billing connector \r\n```\r\ncurl --location 'http://localhost:8080/v2/connector-accounts' \\\r\n--header 'Content-Type: application/json' \\\r\n--header 'Accept: application/json' \\\r\n--header 'x-merchant-id: {{merchant_id}}' \\\r\n--header 'x-profile-id: {{profile_id}}' \\\r\n--header 'Authorization: admin-api-key=test_admin' \\\r\n--header 'api-key: admin-api-key=test_admin' \\\r\n--data '{\r\n \"connector_type\": \"billing_processor\",\r\n \"connector_name\": \"custombilling\",\r\n \"connector_account_details\": {\r\n \"auth_type\": \"NoKey\"\r\n },\r\n \"feature_metadata\" : {\r\n \"revenue_recovery\" : {\r\n \"max_retry_count\" : 9,\r\n \"billing_connector_retry_threshold\" : 0,\r\n \"billing_account_reference\" :{\r\n \"{{mca_id}}\" : \"{{mca_id}}\"\r\n },\r\n \"switch_payment_method_config\" : {\r\n \"retry_threshold\" : 0,\r\n \"time_threshold_after_creation\": 0\r\n }\r\n }\r\n },\r\n \"profile_id\": \"pro_ysFcMjSboSXPeTdujPAp\"\r\n}'\r\n```\r\n3. copy both mca_id and hit the recovery api\r\n```\r\ncurl --location 'http://localhost:8080/v2/payments/recovery' \\\r\n--header 'Authorization: api-key={{api_key))' \\\r\n--header 'x-profile-id: {{profile_id}}' \\\r\n--header 'x-merchant-id: {{merchant_id}}' \\\r\n--header 'Content-Type: application/json' \\\r\n--data '{\r\n \"amount_details\": {\r\n \"order_amount\": 10000,\r\n \"currency\": \"USD\"\r\n },\r\n \"merchant_reference_id\": \"100\",\r\n \"connector_transaction_id\": \"88313299929186\",\r\n \"connector_customer_id\": \"cus_002\",\r\n \"error\": {\r\n \"code\": \"110\",\r\n \"message\": \"Insufficient Funds\"\r\n },\r\n \"billing\": {\r\n \"address\": {\r\n \"state\": \"CA\",\r\n \"country\": \"US\"\r\n }\r\n },\r\n \"payment_method_type\": \"card\",\r\n \"payment_method_sub_type\": \"credit\",\r\n \"payment_method_data\": {\r\n \"primary_processor_payment_method_token\": \"2302174655617111\",\r\n \"additional_payment_method_info\": {\r\n \"card_issuer\": \"Bancorp Bank\",\r\n \"card_network\": \"Mastercard\",\r\n \"card_exp_year\": \"99\",\r\n \"card_exp_month\": \"08\",\r\n \"card_type\": \"credit\"\r\n }\r\n },\r\n \"billing_started_at\": \"2025-08-11T23:42:16Z\",\r\n \"transaction_created_at\": \"2025-05-24T23:16:49Z\",\r\n \"attempt_status\": \"failure\",\r\n \"enable_partial_authorization\": true,\r\n \"action\": \"schedule_failed_payment\", \r\n \"billing_merchant_connector_id\": \"{{billing_mca}}\",\r\n \"payment_merchant_connector_id\": \"{{payment_mca}}\"\r\n}'\r\n```\r\n4. After it hit the execute hit this redis api: \r\n```\r\ncurl --location '{{base_url}}/v2/recovery/data-backfill/redis-data/cus_002?key_type=Tokens' \\ \r\n--header 'Authorization: admin-api-key=test_admin'\r\n```\r\n5. The token which is mentioned in recovery api should have is_active flag as false and there should be a new entry for the updated token which looks like this: \r\n<img width=\"979\" height=\"181\" alt=\"Screenshot 2025-11-05 at 1 08 06\u202fPM\" src=\"https://github.com/user-attachments/assets/16066680-620c-4dda-b58f-5149cb1a833c\" />\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- [ ] I added unit tests for my changes where possible\r\n", |
| "author": "NISHANTH1221", |
| "created_at": "2025-11-04T06:46:49+00:00", |
| "merged_at": "2025-11-11T08:39:46+00:00", |
| "base_branch": "main", |
| "labels": [ |
| "C-feature" |
| ], |
| "url": "https://github.com/juspay/hyperswitch/pull/10112", |
| "commits": [ |
| { |
| "sha": "c9c52feaf8facabe0fbc2fbc4666cf7442103b69", |
| "message": "add account updater related changes to redis structure", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-10-29T16:29:49+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/c9c52feaf8facabe0fbc2fbc4666cf7442103b69" |
| }, |
| { |
| "sha": "3b273184cc7b0e213ef27a1ebe52c332b85842a0", |
| "message": "clippy warinings", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-10-29T16:40:22+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/3b273184cc7b0e213ef27a1ebe52c332b85842a0" |
| }, |
| { |
| "sha": "2fe4bcc0af2e8220eaf06a49c511cd94f78f8887", |
| "message": "worldpay vantiv changes", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-10-31T11:16:23+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/2fe4bcc0af2e8220eaf06a49c511cd94f78f8887" |
| }, |
| { |
| "sha": "403d625e431d48cdae99f5cff9ab1c60ee4b8cdb", |
| "message": "Merge branch 'main' into account_updater_revenue_recovery", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-10-31T11:18:35+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/403d625e431d48cdae99f5cff9ab1c60ee4b8cdb" |
| }, |
| { |
| "sha": "75e5d89e2e52470444d5b9da3f24f4ab1d848efe", |
| "message": "worldpay vantiv connector changes", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-04T06:27:58+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/75e5d89e2e52470444d5b9da3f24f4ab1d848efe" |
| }, |
| { |
| "sha": "a4dd18df86508e2bf63630fcde9b0c77968da9bb", |
| "message": "revert the version from v2 to v1", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-04T06:52:43+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/a4dd18df86508e2bf63630fcde9b0c77968da9bb" |
| }, |
| { |
| "sha": "37df089d0e28f9e0614670c568deed421ac15a84", |
| "message": "core changes", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-04T20:05:34+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/37df089d0e28f9e0614670c568deed421ac15a84" |
| }, |
| { |
| "sha": "b081732c341d1b0a3a814891ad747b9765223f5b", |
| "message": "Merge branch 'main' into account_updater_revenue_recovery", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-04T20:08:55+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/b081732c341d1b0a3a814891ad747b9765223f5b" |
| }, |
| { |
| "sha": "dd02f99af531de5b4ce87e265efae7c50566a6ea", |
| "message": "add await to function call", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-04T20:54:26+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/dd02f99af531de5b4ce87e265efae7c50566a6ea" |
| }, |
| { |
| "sha": "a18902f5fe9ef32589f905ad06113696aadf398b", |
| "message": "clippy issues", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-05T05:38:45+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/a18902f5fe9ef32589f905ad06113696aadf398b" |
| }, |
| { |
| "sha": "9f9d6ff94f799ef0c0be1fc3463e8653aca1baeb", |
| "message": "clippy issues", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-05T05:43:25+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/9f9d6ff94f799ef0c0be1fc3463e8653aca1baeb" |
| }, |
| { |
| "sha": "d0535b5fc7f1b1527654af700a38f005b29350cd", |
| "message": "formatter", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-05T06:13:45+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/d0535b5fc7f1b1527654af700a38f005b29350cd" |
| }, |
| { |
| "sha": "c87e08a37f33bfd3ad32f63d972686a7e3c4a029", |
| "message": "resolving comments", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-05T07:22:10+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/c87e08a37f33bfd3ad32f63d972686a7e3c4a029" |
| }, |
| { |
| "sha": "7b7a8cef58623a15606f40deb7eeaafe0e9dbb0b", |
| "message": "pass mandate reference in error response", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-06T13:15:31+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/7b7a8cef58623a15606f40deb7eeaafe0e9dbb0b" |
| }, |
| { |
| "sha": "e87c491003c13d2a49716330b0047f743874bef0", |
| "message": "formatter changes", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-06T14:02:45+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/e87c491003c13d2a49716330b0047f743874bef0" |
| }, |
| { |
| "sha": "07a3026e88cb6e5824975682c1d7ea44b3371455", |
| "message": "remove comma", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-06T18:43:35+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/07a3026e88cb6e5824975682c1d7ea44b3371455" |
| }, |
| { |
| "sha": "cca4ee455f5ffa7f1a165a123bc25c57242122a5", |
| "message": "chore: run formatter", |
| "author": "hyperswitch-bot[bot]", |
| "date": "2025-11-06T18:44:27+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/cca4ee455f5ffa7f1a165a123bc25c57242122a5" |
| }, |
| { |
| "sha": "2afbf59a10b2bc100470fe0ba9af479839a134c7", |
| "message": "Merge branch 'main' into account_updater_revenue_recovery", |
| "author": "CHALLA NISHANTH BABU", |
| "date": "2025-11-06T19:07:26+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/2afbf59a10b2bc100470fe0ba9af479839a134c7" |
| }, |
| { |
| "sha": "8b31ab36bb07198bf811f618012e7a4b79a8cc16", |
| "message": "remove comma", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T05:35:21+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/8b31ab36bb07198bf811f618012e7a4b79a8cc16" |
| }, |
| { |
| "sha": "b49fa6e8e54cb8e39907cdc547a0542bedce7206", |
| "message": "chore: run formatter", |
| "author": "hyperswitch-bot[bot]", |
| "date": "2025-11-07T05:36:20+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/b49fa6e8e54cb8e39907cdc547a0542bedce7206" |
| }, |
| { |
| "sha": "3328feb87270e1adccba7cb5f7692f08049d3b68", |
| "message": "add missing mandate refrence", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T05:40:44+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/3328feb87270e1adccba7cb5f7692f08049d3b68" |
| }, |
| { |
| "sha": "09b346a8f5b86229658a94e6c93c59a55361e93a", |
| "message": "add mandate reference in connector response", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T07:40:12+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/09b346a8f5b86229658a94e6c93c59a55361e93a" |
| }, |
| { |
| "sha": "eafded2a3f0f244a33c9e9ed24d687c71dcdc48c", |
| "message": "formatter changes", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T07:40:43+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/eafded2a3f0f244a33c9e9ed24d687c71dcdc48c" |
| }, |
| { |
| "sha": "977c59526e9ffeee1d8bd01af8845c93efe1ff3f", |
| "message": "remove mandate_reference from error response", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T09:28:42+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/977c59526e9ffeee1d8bd01af8845c93efe1ff3f" |
| }, |
| { |
| "sha": "a3c3975922a5c7185f193f918c5257de70ded850", |
| "message": "formatter changes", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T09:29:16+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/a3c3975922a5c7185f193f918c5257de70ded850" |
| }, |
| { |
| "sha": "ebffba69f8cfcd4d6a4ea91fb7d9461d58bf34b8", |
| "message": "pass correct information in worldpay vantiv", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T10:04:47+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/ebffba69f8cfcd4d6a4ea91fb7d9461d58bf34b8" |
| }, |
| { |
| "sha": "8a44773b9b157997bd0276962202fb4a23cc5261", |
| "message": "correct the logic in expiry update", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T10:48:21+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/8a44773b9b157997bd0276962202fb4a23cc5261" |
| }, |
| { |
| "sha": "e2383f4ea26f5108df81d36c2d8d651d6b1cee34", |
| "message": "adjusting logic to update the token with expiry updates", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T11:00:20+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/e2383f4ea26f5108df81d36c2d8d651d6b1cee34" |
| }, |
| { |
| "sha": "ee8de4cbffcf0a498f6ea1c45145e017b1e1747b", |
| "message": "chore: run formatter", |
| "author": "hyperswitch-bot[bot]", |
| "date": "2025-11-07T11:02:12+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/ee8de4cbffcf0a498f6ea1c45145e017b1e1747b" |
| }, |
| { |
| "sha": "e1feb4152a546295349be8f3b2f72a3c5dbf7b4a", |
| "message": "bugfix on updating the account updater history", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T11:36:42+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/e1feb4152a546295349be8f3b2f72a3c5dbf7b4a" |
| }, |
| { |
| "sha": "16d3076de9ff8400494967ebc2cd025e202888bc", |
| "message": "chore: run formatter", |
| "author": "hyperswitch-bot[bot]", |
| "date": "2025-11-07T11:39:51+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/16d3076de9ff8400494967ebc2cd025e202888bc" |
| }, |
| { |
| "sha": "2463d0e89e9a5a85dd829288980bc6d606e57b25", |
| "message": "revert version 2 to version 1", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T11:44:49+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/2463d0e89e9a5a85dd829288980bc6d606e57b25" |
| }, |
| { |
| "sha": "036c679caef1809920803da22767698dd54e1925", |
| "message": "Change default feature from 'v2' to 'v1'", |
| "author": "CHALLA NISHANTH BABU", |
| "date": "2025-11-07T12:01:34+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/036c679caef1809920803da22767698dd54e1925" |
| }, |
| { |
| "sha": "be489005fa82c14128f178d1f1166f79ff996887", |
| "message": "Merge branch 'main' into account_updater_revenue_recovery", |
| "author": "CHALLA NISHANTH BABU", |
| "date": "2025-11-07T12:07:03+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/be489005fa82c14128f178d1f1166f79ff996887" |
| }, |
| { |
| "sha": "58fa1e8afea6fae54f8400155b15573ac9ceb0ad", |
| "message": "Merge branch 'account_updater_revenue_recovery' of https://github.com/juspay/hyperswitch into account_updater_revenue_recovery", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T12:12:06+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/58fa1e8afea6fae54f8400155b15573ac9ceb0ad" |
| }, |
| { |
| "sha": "f55ec06a3810dc6acba4925b5af14a7ec6c2880d", |
| "message": "give return a strict type", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T13:37:17+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/f55ec06a3810dc6acba4925b5af14a7ec6c2880d" |
| }, |
| { |
| "sha": "51b1dd142a8e78fa60added4e7fe0bada4d88378", |
| "message": "formatter changes", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T13:37:38+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/51b1dd142a8e78fa60added4e7fe0bada4d88378" |
| }, |
| { |
| "sha": "6e263d33cbd6e083829e43686685594ced3b7763", |
| "message": "Merge branch 'main' into account_updater_revenue_recovery", |
| "author": "Nishanth Babu Challa", |
| "date": "2025-11-07T14:41:29+00:00", |
| "url": "https://github.com/juspay/hyperswitch/commit/6e263d33cbd6e083829e43686685594ced3b7763" |
| } |
| ] |
| } |