Skip to content

Conversation

kurayami07734
Copy link

@kurayami07734 kurayami07734 commented Oct 11, 2025

Type of Change

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

Description

Added integrity check in PSync and RSync flows.

Note

I have only added request integrity check to Authorize and Capture flows, as the response body returned
by Redsys does not contain the amount or currency.

Additional Changes

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

Motivation and Context

Closes #9220

How did you test it?

Note

I was not able to get any Redsys credentials to test the code from my side,
@bsayak03 told me he will test it on his side

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
I was unable to run clippy because my cargo build kept failing
     error: failed to run custom build command for `grpc-api-types v0.1.0 (https://github.com/juspay/connector-service?rev=f719688943adf7bc17bb93dcb43f27485c17a96e#f7196889)`

Caused by:
 process didn't exit successfully: `/home/ghidora/hyperswitch/target/debug/build/grpc-api-types-0414af7d2bbc1720/build-script-build` (exit status: 1)
 --- stderr
 g2h: Incompatible dependency `axum`: expected `0.8.3`, found `0.7.9`
 Error: Custom { kind: Other, error: "protoc failed: payment.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.\n" }

…nd Capture

RedsysResponse struct does not contain the amount and currency in the response
bodies. So only added integrity checks to request body.
Added integrity checks to PSync and Rsync handle_response functions.
Also added helper function to extract amount and currency from
RedsysSyncResponse
Copy link

semanticdiff-com bot commented Oct 11, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/common_utils/src/types.rs  98% smaller
  crates/hyperswitch_connectors/src/connectors/redsys.rs  5% smaller
  crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs  0% smaller

@kurayami07734 kurayami07734 marked this pull request as ready for review October 13, 2025 04:47
@kurayami07734 kurayami07734 requested review from a team as code owners October 13, 2025 04:47
@kurayami07734
Copy link
Author

@bsayak03 Let me know once you have tested and reviewed this PR

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] : [REDSYS] Add Integrity Check Support for Authorize, PSync, Refund and RSync Flows

1 participant