fix: payment_id and client_secret in session response (#199)

This commit is contained in:
Sangamesh Kulkarni
2022-12-23 00:57:27 +05:30
committed by GitHub
parent 9e0deac3c5
commit de30489ce3
3 changed files with 62 additions and 2 deletions

View File

@ -586,9 +586,12 @@ impl From<PaymentsSessionRequest> for PaymentsResponse {
}
impl From<PaymentsSessionRequest> for PaymentsSessionResponse {
fn from(_item: PaymentsSessionRequest) -> Self {
fn from(item: PaymentsSessionRequest) -> Self {
let client_secret: Secret<String, pii::ClientSecret> = Secret::new(item.client_secret);
Self {
session_token: vec![],
payment_id: item.payment_id,
client_secret,
}
}
}
@ -790,6 +793,8 @@ pub enum SessionToken {
#[derive(Default, Debug, serde::Serialize, Clone)]
pub struct PaymentsSessionResponse {
pub payment_id: String,
pub client_secret: Secret<String, pii::ClientSecret>,
pub session_token: Vec<SessionToken>,
}