Skip to content

Conversation

Hariharanpugazh
Copy link

Type of Change

  • New feature

Description

This PR adds Integrity Check support for the Cybersource connector across the following payment flows:

  • Authorize
  • Payment Sync (PSync)
  • Refund
  • Refund Sync (RSync)

The integrity check ensures that the amount and currency values returned by the connector match the values originally sent in the request. This verification helps maintain transaction accuracy and consistency between Hyperswitch and the connector.

Key Implementation Details

  • Added calls to the appropriate integrity helper functions from crates/hyperswitch_connectors/src/utils.rs:

    • get_authorise_integrity_object
    • get_sync_integrity_object
    • get_refund_integrity_object
    • get_capture_integrity_object (where applicable)
  • Attached the generated integrity object to each flow’s request before returning the response.

  • Ensured compatibility across both v1 and non-v1 feature flags.

  • Verified code formatting, linting, and successful build checks.

Additional Changes

  • None.

Motivation and Context

Integrity checks are critical to prevent data mismatches and ensure reliable reconciliation between Hyperswitch and external connectors.
This feature aligns Cybersource with other connectors (like Adyen, Stripe, and Razorpay) that already support similar validation.

Fixes: #9165

How did you test it?

  • Hardcoded mismatched amount and currency values locally to trigger and verify integrity check errors.
  • Ran cargo check, cargo +nightly fmt --all, and cargo clippy to confirm code quality and correctness.

Checklist

  • I formatted the code using cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed and tested all flows locally
  • All GitHub checks pass successfully

@Hariharanpugazh Hariharanpugazh requested a review from a team as a code owner October 12, 2025 03:51
Copy link

semanticdiff-com bot commented Oct 12, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/cybersource.rs  17% smaller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] : [CYBERSOURCE] Add Integrity Check Support for Authorize, PSync, Refund and RSync Flows

1 participant