hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

feat(revenue_recovery): Add account updater support in revenue recovery flow for worldpayvantiv connector

Open NISHANTH1221 opened this issue 1 month ago • 2 comments

Type of Change

  • [ ] Bugfix
  • [x] New feature
  • [ ] Enhancement
  • [ ] Refactoring
  • [ ] Dependency updates
  • [ ] Documentation
  • [ ] CI/CD

Description

This 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.

When 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 reponse to account updater response and populate the same data in mandate_data in PaymentConfirmData<>

Additional Changes

  • [ ] This PR modifies the API contract
  • [ ] This PR modifies the database schema
  • [ ] This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Checklist

  • [ ] 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

NISHANTH1221 avatar Nov 04 '25 06:11 NISHANTH1221

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payments/operations/payment_update.rs  99% smaller
  crates/router/src/core/revenue_recovery/types.rs  72% smaller
  crates/hyperswitch_connectors/src/utils.rs  30% smaller
  crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs  11% smaller
  crates/hyperswitch_domain_models/src/router_data.rs  1% smaller
  crates/router/src/types/storage/revenue_recovery_redis_operation.rs  1% smaller
  crates/api_models/src/payments.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs  0% smaller
  crates/hyperswitch_domain_models/src/revenue_recovery.rs  0% smaller
  crates/hyperswitch_domain_models/src/router_response_types.rs  0% smaller
  crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs  0% smaller
  crates/router/src/core/payments.rs  0% smaller
  crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs  0% smaller
  crates/router/src/core/payments/operations/payment_confirm.rs  0% smaller
  crates/router/src/core/payments/operations/payment_create.rs  0% smaller
  crates/router/src/core/payments/operations/payment_response.rs  0% smaller
  crates/router/src/core/payments/operations/proxy_payments_intent.rs  0% smaller
  crates/router/src/core/payments/tokenization.rs  0% smaller
  crates/router/src/core/payments/transformers.rs  0% smaller
  crates/router/src/core/webhooks/recovery_incoming.rs  0% smaller

semanticdiff-com[bot] avatar Nov 04 '25 06:11 semanticdiff-com[bot]

Codecov Report

:x: Patch coverage is 0% with 504 lines in your changes missing coverage. Please review. :warning: Please upload report for BASE (main@7445ec7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
.../types/storage/revenue_recovery_redis_operation.rs 0.00% 195 Missing :warning:
...tors/src/connectors/worldpayvantiv/transformers.rs 0.00% 110 Missing :warning:
crates/router/src/core/revenue_recovery/types.rs 0.00% 94 Missing :warning:
crates/api_models/src/payments.rs 0.00% 47 Missing :warning:
...r/src/core/payments/operations/payment_response.rs 0.00% 40 Missing :warning:
...rswitch_domain_models/src/router_response_types.rs 0.00% 6 Missing :warning:
...rates/hyperswitch_domain_models/src/router_data.rs 0.00% 3 Missing :warning:
...ch_connectors/src/connectors/adyen/transformers.rs 0.00% 1 Missing :warning:
...h_connectors/src/connectors/paypal/transformers.rs 0.00% 1 Missing :warning:
...h_connectors/src/connectors/stripe/transformers.rs 0.00% 1 Missing :warning:
... and 6 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10112   +/-   ##
=======================================
  Coverage        ?    3.88%           
=======================================
  Files           ?     1224           
  Lines           ?   303926           
  Branches        ?        0           
=======================================
  Hits            ?    11805           
  Misses          ?   292121           
  Partials        ?        0           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Nov 04 '25 07:11 codecov[bot]