feat(core): Support skipping PSP tokenization in payment and mandate flows#10074
feat(core): Support skipping PSP tokenization in payment and mandate flows#10074likhinbopanna merged 8 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10074 +/- ##
=======================================
Coverage ? 6.49%
=======================================
Files ? 1238
Lines ? 309209
Branches ? 0
=======================================
Hits ? 20090
Misses ? 289119
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f6a659e to
ded0afc
Compare
94000ec to
7c150a0
Compare
ebcfe22 to
d148ec0
Compare
d687046 to
771abf3
Compare
5c3d826 to
26715fe
Compare
ShankarSinghC
left a comment
There was a problem hiding this comment.
We need to have a column in the payment attempt as well that can store the what type of tokenization was applied for the payment
For example,
tokenization: skip_psp is sent in the payment request, and this value is stored as is.
After running the application logic, it may turn out that the connector chosen for the payment does not support this feature.
In such a case, we need to override that feature to store_psp or do_default, and this updated value should be stored in the payment attempt.
This would also help in case of retries.
d7e608e to
c65f263
Compare
0cb833c to
1e1edfe
Compare
3172776 to
7f7078f
Compare
11e531a to
9fd3ff8
Compare
9fd3ff8 to
037c3a4
Compare
| if self.connector_mandate_id.is_some() { | ||
| Some(common_enums::Tokenization::TokenizeAtPsp) | ||
| } else { | ||
| Some(common_enums::Tokenization::SkipPsp) | ||
| } |
There was a problem hiding this comment.
Nit:
| if self.connector_mandate_id.is_some() { | |
| Some(common_enums::Tokenization::TokenizeAtPsp) | |
| } else { | |
| Some(common_enums::Tokenization::SkipPsp) | |
| } | |
| self.connector_mandate_id | |
| .map(|_| common_enums::Tokenization::TokenizeAtPsp) | |
| .unwrap_or(common_enums::Tokenization::SkipPsp) |
Type of Change
Description
Introduces a new enum
tokenizationallowing merchants to disable PSP-side token creation and rely solely on Hyperswitch-managed tokens.Applies to both payment and mandate flows.
Database
Added column to
payment_intentschema and models:tokenization -> Nullable<varchar>Connector Layer (Cybersource)
This is the functional part:
Adjusted
CybersourceZeroMandateRequestand authorization logic:Essentially:
Additional Changes
Motivation and Context
How did you test it?
CIT (Existing flow)
Response
CIT By passing "tokenization":"skip_psp", (We will not receive the ConnectorMandateDetails)
Response
MIT via the Received NTID
Response
Checklist
cargo +nightly fmt --allcargo clippy