mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
fix(core): add ephemeral key to payment_create response when customer_id is mentioned (#1133)
This commit is contained in:
14
crates/api_models/src/ephemeral_key.rs
Normal file
14
crates/api_models/src/ephemeral_key.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use serde;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, Eq, PartialEq, ToSchema)]
|
||||
pub struct EphemeralKeyCreateResponse {
|
||||
/// customer_id to which this ephemeral key belongs to
|
||||
pub customer_id: String,
|
||||
/// time at which this ephemeral key was created
|
||||
pub created_at: i64,
|
||||
/// time at which this ephemeral key would expire
|
||||
pub expires: i64,
|
||||
/// ephemeral key
|
||||
pub secret: String,
|
||||
}
|
||||
@ -6,6 +6,7 @@ pub mod cards_info;
|
||||
pub mod customers;
|
||||
pub mod disputes;
|
||||
pub mod enums;
|
||||
pub mod ephemeral_key;
|
||||
#[cfg(feature = "errors")]
|
||||
pub mod errors;
|
||||
pub mod files;
|
||||
|
||||
@ -7,7 +7,9 @@ use router_derive::Setter;
|
||||
use time::PrimitiveDateTime;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use crate::{admin, disputes, enums as api_enums, refunds};
|
||||
use crate::{
|
||||
admin, disputes, enums as api_enums, ephemeral_key::EphemeralKeyCreateResponse, refunds,
|
||||
};
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum PaymentOp {
|
||||
@ -1190,6 +1192,9 @@ pub struct PaymentsResponse {
|
||||
/// Allowed Payment Method Types for a given PaymentIntent
|
||||
#[schema(value_type = Option<Vec<PaymentMethodType>>)]
|
||||
pub allowed_payment_method_types: Option<Vec<api_enums::PaymentMethodType>>,
|
||||
|
||||
/// ephemeral_key for the customer_id mentioned
|
||||
pub ephemeral_key: Option<EphemeralKeyCreateResponse>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Deserialize, ToSchema)]
|
||||
|
||||
Reference in New Issue
Block a user