-
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(payment_methods_session_v2): update flow of payment method session #7263
base: main
Are you sure you want to change the base?
Conversation
Changed Files
|
#[cfg(feature = "v2")] | ||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] | ||
pub struct PaymentMethodsSessionUpdate { | ||
pub id: common_utils::id_type::GlobalPaymentMethodSessionId, |
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.
do we need id
in the updatable struct?
@@ -1995,3 +2111,22 @@ impl pm_types::SavedPMLPaymentsInfo { | |||
Ok(()) | |||
} | |||
} | |||
|
|||
#[cfg(feature = "v2")] | |||
pub async fn payment_method_session_update_to_current_state( |
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.
can you add an impl function like this
impl AuthenticationUpdateInternal { |
db.update_payment_method_session( | ||
key_manager_state, | ||
&key_store, | ||
&payment_method_session_id, | ||
update_state_change.clone(), | ||
) |
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.
This function should take the update enum, then internally in the implementation we can convert the update enum to updateinternal and then insert into the db
crates/router/src/db/kafka_store.rs
Outdated
state: &KeyManagerState, | ||
key_store: &hyperswitch_domain_models::merchant_key_store::MerchantKeyStore, | ||
id: &id_type::GlobalPaymentMethodSessionId, | ||
payment_methods_session: hyperswitch_domain_models::payment_methods::PaymentMethodsSession, |
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.
instead of this taking the payment method session, it can take payment method session update enum, converting to the payment method session can be done internally. You can see how this logic has been implemented for updating the payment method
@ShivanshMathurJuspay can you attach the curl instead of screenshots? This helps in testing as well |
…perswitch into update_payment_methods_session
…perswitch into update_payment_methods_session
…perswitch into update_payment_methods_session
9d2f7a8
9166f48
Type of Change
Description
Payment Method Session update flow is implemented for the Payment Method Service where the PR reflects the changes of updating an already present payment-method-session without changing the TTL of the already present session id
Additional Changes
Motivation and Context
How did you test it?
Create Session
Retrieve Session ( before update )
Update Session
Retrieve Session ( post update )
Checklist
cargo +nightly fmt --all
cargo clippy