-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(core): Added integrity framework for Authorize and Sync flow with connector as Stripe #5109
feat(core): Added integrity framework for Authorize and Sync flow with connector as Stripe #5109
Conversation
…m/juspay/hyperswitch into change_core_amount_to_domain_type
…m/juspay/hyperswitch into change_core_amount_to_domain_type
…m/juspay/hyperswitch into change_core_amount_to_domain_type
…m/juspay/hyperswitch into change_core_amount_to_domain_type
…m/juspay/hyperswitch into change_core_amount_to_domain_type
crates/common_utils/src/errors.rs
Outdated
@@ -69,6 +69,14 @@ pub enum ValidationError { | |||
InvalidValue { message: String }, | |||
} | |||
|
|||
/// Integrity check errors. | |||
#[allow(missing_docs)] // Only to prevent warnings about struct fields not being documented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you not want to provide docs to fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provided docs
status: updated_attempt_status, | ||
connector: None, | ||
connector_transaction_id: connector_transaction_id.clone(), | ||
authentication_type: None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this update made as None?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had removed it while resolving merge conflicts my bad! Adding it back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from connector module stripe.rs
…ify-cypress * 'main' of github.com:juspay/hyperswitch: (22 commits) refactor: Adding millisecond to Kafka timestamp (#5202) chore(version): 2024.07.05.0 fix(user_auth_method): make id option in auth select (#5213) Docs: Updated API - ref for payments (#5172) feat(core): add merchant order reference id (#5197) feat(analytics): Refund status serialization issue for ckh analytics (#5199) fix(router): `override setup_future_usage` filed to on_session based on merchant config (#5195) feat(cypress): make tests forcefully skippable (#5176) feat(core): Added integrity framework for Authorize and Sync flow with connector as Stripe (#5109) ci(cypress): Update card number for adyen and status for paypal (#5192) refactor(cypress): error handling and add sync refunds in places where missing (#5128) feat(analytics): FRM Analytics (#4880) chore(version): 2024.07.04.0 feat(pm_auth): Added balance check for PM auth bank account (#5054) refactor(payment_methods): add appropriate missing logs (#5190) refactor(migrations): add commands to make file to run migrations for api v2 (#5169) chore(version): 2024.07.03.0 fix(event): Updated the ApiEventMetric (#5126) feat(router): add refunds manual-update api (#5094) refactor(payment_link): logs payment links logs coverage (#4918) ...
…h connector as Stripe (#5109) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Hrithikesh <[email protected]> Co-authored-by: Narayan Bhat <[email protected]>
Type of Change
Description
With this PR, we are implementing connector integrity checks for the authorize and sync flow. After receiving a response from the connector, we will validate on our end whether the data sent to the connector matches the data received from their end.
If the validation fails we will mark the transaction as processing so that if the connector fixes the response in sync, the status will move to respective terminal state.
At api level the response will be 5xx with connector_transaction_id in response for merchant to reference in case if integrity failures for both sync and authorize.
How did you test it?
Since its a blackbox scenario, we cannot test until and unless there is a error data from connectors end!
Local testing scenario
Scenario[1] Where Connector send wrong currency in both authorize and sync flow
Payments Create
#####Payments Sync
with force_sync as False
response
we should get error message as integrity check failed with status as processing.
with force_sync as true
Scenario[2] Where Connector send wrong currency in both authorize but fixes the same sync flow
#####Payments Create
Payments Sync
with force_sync true
Response
Status should move to succeeded!
Scenario[3] Where connector sends correct data in both authorize and sync flow
#####Payments Create
Response
#####Payments Sync
Response
Checklist
cargo +nightly fmt --all
cargo clippy