Skip to content
Open
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
c247711
add api changes
prasunna09 Nov 18, 2025
5fac302
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Nov 18, 2025
735626a
code refactoring
prasunna09 Nov 19, 2025
bcf7f9c
Merge branch 'add-guest-checkout-api-changes' of github.com:juspay/hy…
prasunna09 Nov 19, 2025
a9281ce
chore: run formatter
hyperswitch-bot[bot] Nov 19, 2025
165aa8b
resolve pr comments
prasunna09 Nov 20, 2025
9ac717a
Merge branch 'add-guest-checkout-api-changes' of github.com:juspay/hy…
prasunna09 Nov 20, 2025
e48db50
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Nov 20, 2025
c06dc3d
Merge branch 'main' into add-guest-checkout-api-changes
prasunna09 Nov 20, 2025
f43c934
chore: run formatter
hyperswitch-bot[bot] Nov 20, 2025
3128a3a
fix clippy v2
prasunna09 Nov 20, 2025
2ecbdc8
Merge branch 'add-guest-checkout-api-changes' of github.com:juspay/hy…
prasunna09 Nov 20, 2025
4ad6b86
Merge branch 'main' into add-guest-checkout-api-changes
prasunna09 Nov 20, 2025
e334729
chore: run formatter
hyperswitch-bot[bot] Nov 20, 2025
0a579e5
fix clippy v2
prasunna09 Nov 20, 2025
efd5832
Merge branch 'add-guest-checkout-api-changes' of github.com:juspay/hy…
prasunna09 Nov 20, 2025
a58f3ab
empty commit
prasunna09 Nov 20, 2025
ffcd307
chore: run formatter
hyperswitch-bot[bot] Nov 20, 2025
646f912
Merge branch 'main' into add-guest-checkout-api-changes
prasunna09 Nov 27, 2025
7a74e16
add guest checkout core flow
prasunna09 Nov 30, 2025
5fb6557
chore: run formatter
hyperswitch-bot[bot] Nov 30, 2025
7477bce
code refactoring
prasunna09 Dec 1, 2025
dea6a98
Merge branch 'guest-checkout-core-changes' of github.com:juspay/hyper…
prasunna09 Dec 1, 2025
6dc430f
chore: run formatter
hyperswitch-bot[bot] Dec 1, 2025
9519c3e
code refactoring
prasunna09 Dec 2, 2025
4063cc9
Merge branch 'guest-checkout-core-changes' of github.com:juspay/hyper…
prasunna09 Dec 2, 2025
21d7653
fix code
prasunna09 Dec 3, 2025
6ddac76
fix code
prasunna09 Dec 3, 2025
e401640
Merge branch 'main' into guest-checkout-core-changes
prasunna09 Dec 4, 2025
31faffd
chore: run formatter
hyperswitch-bot[bot] Dec 4, 2025
26941cd
fix clippy v1
prasunna09 Dec 4, 2025
b24e69a
Merge branch 'guest-checkout-core-changes' of github.com:juspay/hyper…
prasunna09 Dec 4, 2025
fef11a8
fix clippy
prasunna09 Dec 4, 2025
0067704
add volatile pm id in proxy flow
prasunna09 Dec 9, 2025
f6e608e
add volataile pm id support in proxy
prasunna09 Dec 10, 2025
d9c7fd9
fix clippy
prasunna09 Dec 10, 2025
108eebf
chore: run formatter
hyperswitch-bot[bot] Dec 10, 2025
c2aa16f
fix clippy
prasunna09 Dec 10, 2025
2bc6a77
Merge branch 'temp-pm-id-support-in-proxy' of github.com:juspay/hyper…
prasunna09 Dec 10, 2025
afb4bd0
chore: run formatter
hyperswitch-bot[bot] Dec 10, 2025
64aa19c
resolve pr comments
prasunna09 Dec 15, 2025
f67d1ed
Merge branch 'main' into temp-pm-id-support-in-proxy
prasunna09 Dec 18, 2025
d9593fc
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Dec 18, 2025
b7ae83f
fix code
prasunna09 Dec 23, 2025
16db9a2
update encryption logic in pm core
prasunna09 Dec 28, 2025
84eee04
chore: run formatter
hyperswitch-bot[bot] Dec 28, 2025
b48ff51
fix clippy
prasunna09 Dec 28, 2025
abaebbd
Merge branch 'temp-pm-id-support-in-proxy' of github.com:juspay/hyper…
prasunna09 Dec 28, 2025
73c9501
chore: run formatter
hyperswitch-bot[bot] Dec 28, 2025
b667caf
fix toolchain check
prasunna09 Dec 28, 2025
32b46eb
Merge branch 'temp-pm-id-support-in-proxy' of github.com:juspay/hyper…
prasunna09 Dec 28, 2025
f9c96b2
Merge branch 'main' into temp-pm-id-support-in-proxy
prasunna09 Dec 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions crates/api_models/src/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub struct PaymentMethodCreate {
pub payment_method_type: api_enums::PaymentMethod,

/// This is a sub-category of payment method.
#[schema(value_type = PaymentMethodType,example = "google_pay")]
#[schema(value_type = PaymentMethodType,example = "credit")]
pub payment_method_subtype: api_enums::PaymentMethodType,

/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.
Expand All @@ -122,7 +122,7 @@ pub struct PaymentMethodCreate {
example = "12345_cus_01926c58bc6e77c09e809964e72af8c8",
value_type = String
)]
pub customer_id: id_type::GlobalCustomerId,
pub customer_id: Option<id_type::GlobalCustomerId>,

/// Payment method data to be passed
pub payment_method_data: PaymentMethodCreateData,
Expand All @@ -138,6 +138,10 @@ pub struct PaymentMethodCreate {
/// The network tokenization configuration if applicable
#[schema(value_type = Option<NetworkTokenization>)]
pub network_tokenization: Option<common_types::payment_methods::NetworkTokenization>,

/// The storage type for the payment method
#[schema(value_type = Option<StorageType>)]
pub storage_type: Option<common_enums::StorageType>,
}

#[cfg(feature = "v2")]
Expand Down Expand Up @@ -1060,7 +1064,7 @@ pub struct PaymentMethodResponse {
example = "12345_cus_01926c58bc6e77c09e809964e72af8c8",
value_type = String
)]
pub customer_id: id_type::GlobalCustomerId,
pub customer_id: Option<id_type::GlobalCustomerId>,

/// The type of payment method use for the payment.
#[schema(value_type = PaymentMethod, example = "card")]
Expand Down Expand Up @@ -1090,7 +1094,12 @@ pub struct PaymentMethodResponse {
/// The connector token details if available
pub connector_tokens: Option<Vec<ConnectorTokenDetails>>,

/// Network token details if available
pub network_token: Option<NetworkTokenResponse>,

/// The storage type for the payment method
#[schema(value_type = Option<StorageType>)]
pub storage_type: Option<common_enums::StorageType>,
}

#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
Expand Down Expand Up @@ -3304,6 +3313,10 @@ pub struct PaymentMethodSessionConfirmRequest {
/// The return url to which the customer should be redirected to after adding the payment method
#[schema(value_type = Option<String>)]
pub return_url: Option<common_utils::types::Url>,

/// The storage type for the payment method
#[schema(value_type = Option<StorageType>)]
pub storage_type: Option<common_enums::StorageType>,
}

#[cfg(feature = "v2")]
Expand Down Expand Up @@ -3361,6 +3374,8 @@ pub struct PaymentMethodSessionResponse {
/// The token-id created if there is tokenization_data present
#[schema(value_type = Option<String>, example = "12345_tok_01926c58bc6e77c09e809964e72af8c8")]
pub associated_token_id: Option<id_type::GlobalTokenId>,

pub storage_type: Option<common_enums::StorageType>,
}

#[cfg(feature = "v2")]
Expand Down
1 change: 1 addition & 0 deletions crates/api_models/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub struct ProxyRequest {
pub enum TokenType {
TokenizationId,
PaymentMethodId,
VolatilePaymentMethodId,
}

#[derive(Debug, ToSchema, Clone, Deserialize, Serialize)]
Expand Down
23 changes: 23 additions & 0 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10190,3 +10190,26 @@ pub enum VaultTokenType {
#[strum(serialize = "cryptogram")]
NetworkTokenCryptogram,
}

#[derive(
Clone,
Debug,
Copy,
Default,
Eq,
Hash,
PartialEq,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::EnumString,
ToSchema,
)]
#[router_derive::diesel_enum(storage_type = "text")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum StorageType {
Volatile,
#[default]
Persistent,
}
14 changes: 9 additions & 5 deletions crates/hyperswitch_domain_models/src/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use common_enums::enums::MerchantStorageScheme;
#[cfg(feature = "v1")]
use common_utils::crypto::OptionalEncryptableValue;
#[cfg(feature = "v2")]
use common_utils::{crypto::Encryptable, encryption::Encryption, types::keymanager::ToEncryptable};
use common_utils::{
crypto::Encryptable, encryption::Encryption, ext_traits::OptionExt,
types::keymanager::ToEncryptable,
};
use common_utils::{
errors::{CustomResult, ParsingError, ValidationError},
id_type, pii, type_name,
Expand Down Expand Up @@ -101,7 +104,8 @@ pub struct PaymentMethod {
pub id: id_type::GlobalPaymentMethodId,

/// The customer id against which the payment method is saved
pub customer_id: id_type::GlobalCustomerId,
/// It is made optional to support guest checkout tokenization
pub customer_id: Option<id_type::GlobalCustomerId>,

/// The merchant id against which the payment method is saved
pub merchant_id: id_type::MerchantId,
Expand Down Expand Up @@ -538,7 +542,7 @@ impl super::behaviour::Conversion for PaymentMethod {
type NewDstType = diesel_models::payment_method::PaymentMethodNew;
async fn convert(self) -> CustomResult<Self::DstType, ValidationError> {
Ok(Self::DstType {
customer_id: self.customer_id,
customer_id: self.customer_id.get_required_value("GlobalCustomerId")?,
merchant_id: self.merchant_id,
id: self.id,
created_at: self.created_at,
Expand Down Expand Up @@ -651,7 +655,7 @@ impl super::behaviour::Conversion for PaymentMethod {
.attach_printable("Error while deserializing External Vault Token Data")?;

Ok::<Self, error_stack::Report<common_utils::errors::CryptoError>>(Self {
customer_id: storage_model.customer_id,
customer_id: Some(storage_model.customer_id),
merchant_id: storage_model.merchant_id,
id: storage_model.id,
created_at: storage_model.created_at,
Expand Down Expand Up @@ -693,7 +697,7 @@ impl super::behaviour::Conversion for PaymentMethod {

async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> {
Ok(Self::NewDstType {
customer_id: self.customer_id,
customer_id: self.customer_id.get_required_value("GlobalCustomerId")?,
merchant_id: self.merchant_id,
id: self.id,
created_at: self.created_at,
Expand Down
Loading
Loading