Skip to content

feat(connectors): [worldpayvantiv] add connector mandate support #8546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 7, 2025

Conversation

AkshayaFoiger
Copy link
Contributor

@AkshayaFoiger AkshayaFoiger commented Jul 4, 2025

Type of Change

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

Description

Add connector mandate support for vantiv cards

Note: This feature has to be enabled at Vantiv

How did you test it?

Create a Customer Initiated Mandate
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_yd2YxRScbTZYwkJGCv6YdgFo3Hj2th1v8scxfbq8WdMo3EsTgxgTd4FbRLixw71c' \
--data '{
    "amount": 15000,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "customer_id": "hyperswitch_sdk_demo_id",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "5435101234510196", 
            "card_exp_month": "11",
            "card_exp_year": "50",
            
            "card_cvc": "987"
        }
    },
    "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"
}'

Response

{"payment_id":"pay_pKDE8WgeFLUV9hWxUlkf","merchant_id":"postman_merchant_GHAction_aad3d97c-40fb-4f4c-bc2a-dd683b156d5a","status":"processing","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_pKDE8WgeFLUV9hWxUlkf_secret_D2ivaJYROS8fkiKG2IzP","created":"2025-07-04T10:26:49.764Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":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":"hyperswitch_sdk_demo_id","created_at":1751624809,"expires":1751628409,"secret":"epk_2ab6628c91f84c7cac386b9ee784b5c8"},"manual_retry_allowed":false,"connector_transaction_id":"84085100193940137","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_pKDE8WgeFLUV9hWxUlkf","payment_link":null,"profile_id":"pro_sFS1d84BWdVLMu7kZqTD","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_bpcDnKfJlT6NY9v7PGYZ","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-04T10:41:49.764Z","fingerprint":null,"browser_info":null,"payment_method_id":"pm_H9GSPzY88jHtNhHnGOa1","payment_method_status":"inactive","updated":"2025-07-04T10:27:00.942Z","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":"2032317115030196","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}
Psync
{"payment_id":"pay_pKDE8WgeFLUV9hWxUlkf","merchant_id":"postman_merchant_GHAction_aad3d97c-40fb-4f4c-bc2a-dd683b156d5a","status":"succeeded","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":0,"amount_received":15000,"connector":"worldpayvantiv","client_secret":"pay_pKDE8WgeFLUV9hWxUlkf_secret_D2ivaJYROS8fkiKG2IzP","created":"2025-07-04T10:26:49.764Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":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":"84085100193940137","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_pKDE8WgeFLUV9hWxUlkf","payment_link":null,"profile_id":"pro_sFS1d84BWdVLMu7kZqTD","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_bpcDnKfJlT6NY9v7PGYZ","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-04T10:41:49.764Z","fingerprint":null,"browser_info":null,"payment_method_id":"pm_H9GSPzY88jHtNhHnGOa1","payment_method_status":"inactive","updated":"2025-07-04T10:28:40.597Z","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":"2032317115030196","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}
Create a Merchant Initiated Transaction
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_yd2YxRScbTZYwkJGCv6YdgFo3Hj2th1v8scxfbq8WdMo3EsTgxgTd4FbRLixw71c' \
--data '{
    "amount": 2500,
    "currency": "USD",
    "off_session": true,
    "confirm": true,
    "capture_method": "automatic",
    "recurring_details": {
        "type": "payment_method_id",
        "data": "pm_H9GSPzY88jHtNhHnGOa1"
    },
    
    "customer_id": "hyperswitch_sdk_demo_id",
    "connector": [
        "worldpayvantiv"
    ]
}'

Response

{"payment_id":"pay_iFoYl0jlYH9S8ICvmxwA","merchant_id":"postman_merchant_GHAction_aad3d97c-40fb-4f4c-bc2a-dd683b156d5a","status":"processing","amount":2500,"net_amount":2500,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_iFoYl0jlYH9S8ICvmxwA_secret_ipDVUhYazuFcfNrCH4dP","created":"2025-07-04T10:30:38.534Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":true,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":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":"hyperswitch_sdk_demo_id","created_at":1751625038,"expires":1751628638,"secret":"epk_206cfdc52eb34851b00ad367718368c0"},"manual_retry_allowed":false,"connector_transaction_id":"83997139237370330","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_iFoYl0jlYH9S8ICvmxwA","payment_link":null,"profile_id":"pro_sFS1d84BWdVLMu7kZqTD","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_bpcDnKfJlT6NY9v7PGYZ","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-04T10:45:38.534Z","fingerprint":null,"browser_info":null,"payment_method_id":"pm_H9GSPzY88jHtNhHnGOa1","payment_method_status":"active","updated":"2025-07-04T10:30:40.709Z","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":"2032317115030196","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}
Psync
{"payment_id":"pay_iFoYl0jlYH9S8ICvmxwA","merchant_id":"postman_merchant_GHAction_aad3d97c-40fb-4f4c-bc2a-dd683b156d5a","status":"succeeded","amount":2500,"net_amount":2500,"shipping_cost":null,"amount_capturable":0,"amount_received":2500,"connector":"worldpayvantiv","client_secret":"pay_iFoYl0jlYH9S8ICvmxwA_secret_ipDVUhYazuFcfNrCH4dP","created":"2025-07-04T10:30:38.534Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":true,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":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":"83997139237370330","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_iFoYl0jlYH9S8ICvmxwA","payment_link":null,"profile_id":"pro_sFS1d84BWdVLMu7kZqTD","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_bpcDnKfJlT6NY9v7PGYZ","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-04T10:45:38.534Z","fingerprint":null,"browser_info":null,"payment_method_id":"pm_H9GSPzY88jHtNhHnGOa1","payment_method_status":"active","updated":"2025-07-04T10:32:02.030Z","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

  • 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

Summary by CodeRabbit

  • New Features

    • Enhanced Worldpay Vantiv connector to support tokenized mandates and improved mandate handling.
    • Added support for tokenization data and improved processing of mandate-related payments and responses.
  • Bug Fixes

    • Improved error handling for missing card mandate information during payment authorization.
  • Refactor

    • Streamlined mandate information extraction for Paybox and Worldpay Vantiv connectors.
    • Updated internal data structures for cleaner and more flexible mandate and token data management.

@AkshayaFoiger AkshayaFoiger self-assigned this Jul 4, 2025
@AkshayaFoiger AkshayaFoiger requested a review from a team as a code owner July 4, 2025 10:32
@AkshayaFoiger AkshayaFoiger added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Jul 4, 2025
Copy link

semanticdiff-com bot commented Jul 4, 2025

@AkshayaFoiger AkshayaFoiger changed the base branch from main to vantiv-auth-reversal July 4, 2025 10:32
@AkshayaFoiger
Copy link
Contributor Author

@coderabbitai review

Copy link

coderabbitai bot commented Jul 4, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

coderabbitai bot commented Jul 4, 2025

Walkthrough

The changes refactor mandate information extraction for card payments by moving the CardMandateInfo struct and its extraction logic to a shared utility module, and updating connectors to use a new get_card_mandate_info method. Additionally, the Worldpay Vantiv connector is enhanced to support tokenization and improved mandate handling.

Changes

File(s) Change Summary
crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs Removed the CardMandateInfo struct and its extraction function. Updated mandate extraction in the TryFrom implementation to use the new get_card_mandate_info method on the request object.
crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs Added support for tokenization and improved mandate handling: introduced TokenizationData, VantivMandateDetail, and TokenResponse structs; updated Authorization, Sale, and response structs to support optional card and token fields; revised mandate processing logic and response mapping; added helper methods for card data extraction; and implemented secure handling of secret data.
crates/hyperswitch_connectors/src/utils.rs Introduced the CardMandateInfo struct and implemented the get_card_mandate_info method in the PaymentsAuthorizeRequestData trait and its implementation for PaymentsAuthorizeData, centralizing mandate info extraction logic and error handling.

Sequence Diagram(s)

sequenceDiagram
    participant Requester
    participant PayboxConnector
    participant Utils

    Requester->>PayboxConnector: Initiate Mandate Payment Authorization
    PayboxConnector->>Utils: get_card_mandate_info()
    Utils-->>PayboxConnector: CardMandateInfo or Error
    PayboxConnector-->>Requester: Proceed with authorization or error
Loading
sequenceDiagram
    participant Requester
    participant WorldpayVantivConnector
    participant Utils

    Requester->>WorldpayVantivConnector: Initiate Mandate Payment Authorization
    WorldpayVantivConnector->>Utils: get_card_mandate_info() (if needed)
    Utils-->>WorldpayVantivConnector: CardMandateInfo or Error
    WorldpayVantivConnector->>WorldpayVantivConnector: get_processing_info()
    WorldpayVantivConnector->>WorldpayVantivConnector: get_vantiv_card_data()
    WorldpayVantivConnector-->>Requester: Authorization request with tokenization/mandate info
    WorldpayVantivConnector-->>Requester: Response with tokenization/mandate info
Loading

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Clippy (1.86.0)
Updating crates.io index
Updating git repository `https://github.com/juspay/scylla-rust-driver.git`

error: failed to get scylla as a dependency of package masking v0.1.0 (/crates/masking)

Caused by:
failed to load source for dependency scylla

Caused by:
Unable to update https://github.com/juspay/scylla-rust-driver.git?rev=5700aa2847b25437cdd4fcf34d707aa90dca8b89#5700aa28

Caused by:
failed to create directory /usr/local/git/db/scylla-rust-driver-ef0999119a3c6829

Caused by:
Permission denied (os error 13)

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs (1)

540-588: Consider adding more specific error context.

The refactored function is well-structured and handles all mandate scenarios appropriately. However, when get_card_mandate_info() fails, it might be helpful to add context about which mandate scenario failed.

Consider wrapping the error with context:

-                let card_mandate_data = request.get_card_mandate_info()?;
+                let card_mandate_data = request.get_card_mandate_info()
+                    .change_context(errors::ConnectorError::MissingRequiredField { 
+                        field_name: "card_mandate_info" 
+                    })?;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 816564b and 4bd7747.

📒 Files selected for processing (3)
  • crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs (2 hunks)
  • crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs (18 hunks)
  • crates/hyperswitch_connectors/src/utils.rs (3 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: swangi-kumari
PR: juspay/hyperswitch#8199
File: crates/api_models/src/payments.rs:5633-5648
Timestamp: 2025-06-11T07:14:32.038Z
Learning: The absence of the `merchant_connector_details` field in the `PaymentsStatusRequest` struct (in `crates/api_models/src/payments.rs`) is intentional and should not be added, as per project owner guidance.
crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs (1)
Learnt from: swangi-kumari
PR: juspay/hyperswitch#8199
File: crates/api_models/src/payments.rs:5633-5648
Timestamp: 2025-06-11T07:14:32.038Z
Learning: The absence of the `merchant_connector_details` field in the `PaymentsStatusRequest` struct (in `crates/api_models/src/payments.rs`) is intentional and should not be added, as per project owner guidance.
crates/hyperswitch_connectors/src/utils.rs (1)

undefined

<retrieved_learning>
Learnt from: swangi-kumari
PR: #8199
File: crates/api_models/src/payments.rs:5633-5648
Timestamp: 2025-06-11T07:14:32.038Z
Learning: The absence of the merchant_connector_details field in the PaymentsStatusRequest struct (in crates/api_models/src/payments.rs) is intentional and should not be added, as per project owner guidance.
</retrieved_learning>

crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs (1)
Learnt from: swangi-kumari
PR: juspay/hyperswitch#8199
File: crates/api_models/src/payments.rs:5633-5648
Timestamp: 2025-06-11T07:14:32.038Z
Learning: The absence of the `merchant_connector_details` field in the `PaymentsStatusRequest` struct (in `crates/api_models/src/payments.rs`) is intentional and should not be added, as per project owner guidance.
⏰ Context from checks skipped due to timeout of 900000ms (5)
  • GitHub Check: Validate generated OpenAPI spec file
  • GitHub Check: Check wasm build
  • GitHub Check: Check compilation for V2 features
  • GitHub Check: Check compilation on MSRV toolchain (ubuntu-latest)
  • GitHub Check: Run Cypress tests
🔇 Additional comments (11)
crates/hyperswitch_connectors/src/utils.rs (3)

245-249: Well-structured mandate info struct with proper security handling.

The CardMandateInfo struct is well-designed with appropriate use of Secret<String> for sensitive card expiration data. The derive macros are appropriate for the intended use case.


1712-1712: Clean trait method signature for centralized mandate extraction.

The new trait method provides a clean interface for extracting mandate information across different payment connectors, promoting code reuse and consistency.


1948-1967: Excellent error handling and data extraction logic.

The implementation properly handles all edge cases:

  • Correctly extracts card expiration data from the nested structure
  • Provides specific error messages for missing required fields
  • Uses appropriate error types for different failure scenarios
  • Maintains security by preserving Secret<String> wrapper

The pattern matching and Option handling are idiomatic Rust code.

crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs (2)

27-27: LGTM: Clean import update for refactored mandate extraction.

The import changes correctly bring in the required CardMandateInfo and PaymentsAuthorizeRequestData trait for the centralized mandate extraction approach.


464-464: LGTM: Excellent refactoring to centralize mandate data extraction.

The change from manual mandate data extraction to using the get_card_mandate_info() trait method is a clean improvement that:

  • Centralizes mandate extraction logic in a shared utility
  • Reduces code duplication across connectors
  • Maintains proper error handling with the ? operator
  • Follows DRY principles and improves maintainability

This aligns well with the broader PR objective to standardize mandate handling across connectors.

crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs (6)

11-11: LGTM!

The imports are correctly added and necessary for the mandate functionality.

Also applies to: 18-18


235-240: LGTM!

The TokenizationData struct is well-designed with appropriate use of Secret<String> for sensitive fields.


242-247: LGTM!

The struct modifications properly implement the dual card/token payment support with appropriate serialization attributes.

Also applies to: 175-185, 199-209


2883-2920: LGTM!

Good extraction of card data logic into a helper function. The function correctly handles all payment method types and returns None for mandate payments where card data isn't needed.


789-798: LGTM!

The TokenResponse struct and its conversion to MandateReference are properly implemented. The use of expose() is appropriate here as the token needs to be accessible in the mandate reference.

Also applies to: 1176-1185


453-453: LGTM!

The integration of the helper function and mandate processing info is clean and correct.

Also applies to: 502-504, 518-520

deepanshu-iiitu
deepanshu-iiitu previously approved these changes Jul 4, 2025
@AkshayaFoiger AkshayaFoiger changed the base branch from vantiv-auth-reversal to main July 4, 2025 11:52
@AkshayaFoiger AkshayaFoiger dismissed deepanshu-iiitu’s stale review July 4, 2025 11:52

The base branch was changed.

@AkshayaFoiger AkshayaFoiger changed the base branch from main to vantiv-auth-reversal July 4, 2025 11:53
Base automatically changed from vantiv-auth-reversal to main July 4, 2025 14:15
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jul 7, 2025
Merged via the queue into main with commit de92973 Jul 7, 2025
17 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the vativ-tokenization branch July 7, 2025 12:08
pixincreate added a commit that referenced this pull request Jul 9, 2025
…ayload-webhooks

* 'main' of github.com:juspay/hyperswitch:
  refactor(connector): Move connector mappings and endpoints to dedicated modules (#8562)
  ci(cypress): fix `hipay` test cases (#8563)
  chore(version): 2025.07.09.0
  fix(payment_method): update entity id used for Vault to global customer id (#8380)
  refactor(routing): add conditional check for invoking DE routing flows (#8559)
  feat(connector): [AUTHIPAY] Integrate cards non 3ds payments (#8266)
  ci(cypress): add payu connector (#8567)
  feat(connector): [silverflow] template code (#8553)
  chore(version): 2025.07.08.0
  feat(cypress): [worldpayvantiv] add cypress test (#8234)
  feat(connectors): [worldpayvantiv] add connector mandate support  (#8546)
  feat(connector): [Celero] add Connector Template Code (#8489)
  feat(payment-methods): create payment_token in vault confirm / do payment-confirm with temp token from session (#8525)
  ci(cypress): Add Tsys,Square cypress test (#8543)
  chore(version): 2025.07.07.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants