feat(braintree): Sessions flow for braintree and klarna (#121)

This commit is contained in:
Narayan Bhat
2022-12-13 12:35:17 +05:30
committed by GitHub
parent eb4fe6f46b
commit 7dca6f1e5a
19 changed files with 606 additions and 31 deletions

View File

@ -532,13 +532,8 @@ impl From<PaymentsStartRequest> for PaymentsResponse {
impl From<PaymentsSessionRequest> for PaymentsResponse {
fn from(item: PaymentsSessionRequest) -> Self {
let payment_id = match item.payment_id {
PaymentIdType::PaymentIntentId(id) => Some(id),
_ => None,
};
Self {
payment_id,
payment_id: Some(item.payment_id),
..Default::default()
}
}
@ -664,11 +659,12 @@ pub struct PaymentsRetrieveRequest {
pub struct ConnectorSessionToken {
pub connector_name: String,
pub session_token: String,
pub session_id: Option<String>,
}
#[derive(Default, Debug, serde::Deserialize, Clone)]
pub struct PaymentsSessionRequest {
pub payment_id: PaymentIdType,
pub payment_id: String,
pub client_secret: String,
}