-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat(payment-methods): create payment_token in vault confirm / do payment-confirm with temp token from session #8525
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
Conversation
Changed Files
|
@@ -12,7 +12,7 @@ pub struct PaymentMethodSession { | |||
pub return_url: Option<common_utils::types::Url>, | |||
#[serde(with = "common_utils::custom_serde::iso8601")] | |||
pub expires_at: time::PrimitiveDateTime, | |||
pub associated_payment_methods: Option<Vec<common_utils::id_type::GlobalPaymentMethodId>>, | |||
pub associated_payment_methods: Option<Vec<String>>, |
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.
we can have a type for this instead of string
associated_payment_methods: Some(vec![parent_payment_method_token.clone()]) | ||
}; | ||
|
||
vault::insert_cvc_using_payment_token( |
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.
vault::insert_cvc_using_payment_token( | |
vault::insert_cvc_using_payment_method_token( |
.attach_printable("Failed to get redis connection")?; | ||
|
||
let key = format!( | ||
"pm_token_{}_{}_hyperswitch_cvc", |
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.
"pm_token_{}_{}_hyperswitch_cvc", | |
"pm_token_{}_{}_card_cvc", |
|
||
let payload = payload_to_be_encrypted | ||
.encode_to_string_of_json() | ||
.change_context(errors::ApiErrorResponse::InternalServerError)?; |
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.
please add attach printable
Some(fullfillment_time), | ||
) | ||
.await | ||
.change_context(errors::StorageError::KVError) |
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.
is this change_context needed?
.attach_printable("Failed to get redis connection")?; | ||
|
||
let key = format!( | ||
"pm_token_{}_{}_hyperswitch_cvc", |
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.
"pm_token_{}_{}_hyperswitch_cvc", | |
"pm_token_{}_{}_card_cvc", |
would be addressing these nits in a separate pr 👍 |
…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
Type of Change
Description
Additional Changes
payment token are present in payment method session response
Motivation and Context
How did you test it?
Tested through Postman (Hyperswitch v2):
Create a customer:
Create an Payment Intent:
Create a Payment Method Session:
Confirm the session and collect the payment_method_token from associated_payment_methods:
Confirm the payment with the payment_method_token:
Checklist
cargo +nightly fmt --all
cargo clippy