use serde::{Serialize, Deserialize};
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PaymentResponseProcessorApiSchema {
pub name: Option<String>,
pub processor_merchant_id: Option<String>,
pub amount_refunded: Option<i64>,
pub amount_captured: Option<i64>,
}
impl std::fmt::Display for PaymentResponseProcessorApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum ThreeDSecureSkippedReasonCodeEnum {
#[serde(rename = "GATEWAY_UNAVAILABLE")]
GatewayUnavailable,
#[serde(rename = "DISABLED_BY_MERCHANT")]
DisabledByMerchant,
#[serde(rename = "NOT_SUPPORTED_BY_ISSUER")]
NotSupportedByIssuer,
#[serde(rename = "FAILED_TO_NEGOTIATE")]
FailedToNegotiate,
#[serde(rename = "UNKNOWN_ACS_RESPONSE")]
UnknownAcsResponse,
#[serde(rename = "3DS_SERVER_ERROR")]
ThreeDSecureSkippedReasonCodeEnum3DsServerError,
#[serde(rename = "ACQUIRER_NOT_CONFIGURED")]
AcquirerNotConfigured,
#[serde(rename = "ACQUIRER_NOT_PARTICIPATING")]
AcquirerNotParticipating,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct StatusReasonApiSchema {
pub code: Option<String>,
pub type_: String,
pub message: Option<String>,
pub decline_type: Option<String>,
}
impl std::fmt::Display for StatusReasonApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AddressApiSchema {
pub country_code: CountryCodeEnum,
pub city: String,
pub last_name: Option<String>,
pub first_name: Option<String>,
pub address_line1: String,
pub state: Option<String>,
pub address_line2: Option<String>,
pub postal_code: Option<String>,
}
impl std::fmt::Display for AddressApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct RefundPaymentPaymentsIdRefundPostRequired {
pub amount: serde_json::Value,
pub id: String,
pub reason: String,
pub order_id: String,
}
impl std::fmt::Display for RefundPaymentPaymentsIdRefundPostRequired {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CardNetworkEnum(pub String);
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct KlarnaTokenDetails {
pub type_: String,
pub brand: Option<String>,
pub expiry_date: Option<String>,
pub masked_number: Option<String>,
}
impl std::fmt::Display for KlarnaTokenDetails {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct OrderFeesApiSchema {
pub type_: Option<String>,
pub amount: serde_json::Value,
pub description: Option<String>,
}
impl std::fmt::Display for OrderFeesApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CheckoutPaymentMethodOptionsApiSchema {
pub vault_on_success: Option<bool>,
pub descriptor: Option<String>,
pub payment_type: Option<String>,
pub options: Option<serde_json::Value>,
}
impl std::fmt::Display for CheckoutPaymentMethodOptionsApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ErrorObject {
pub diagnostics_id: Option<String>,
pub error_id: Option<String>,
pub description: Option<String>,
pub validation_errors: Option<Vec<serde_json::Value>>,
}
impl std::fmt::Display for ErrorObject {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct KlarnaSessionDetailsApiSchema {
pub billing_address: KlarnaAddressApiSchema,
pub order_lines: Vec<serde_json::Value>,
pub recurring_description: Option<String>,
pub shipping_address: Option<KlarnaAddressApiSchema>,
pub locale: String,
pub token_details: Option<KlarnaTokenDetails>,
pub purchase_country: String,
pub purchase_currency: String,
}
impl std::fmt::Display for KlarnaSessionDetailsApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct VerifiedMerchantPaymentMethodTokenApiResponse {
pub is_verified: bool,
pub merchant_payment_method_token_api_response: MerchantPaymentMethodTokenApiResponse,
}
impl std::fmt::Display for VerifiedMerchantPaymentMethodTokenApiResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PaymentCaptureApiRequest {
pub final_: Option<bool>,
pub amount: Option<serde_json::Value>,
}
impl std::fmt::Display for PaymentCaptureApiRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CheckoutPaymentMethodOptionCardNetworkApiSchema {
pub card_network_type: Option<serde_json::Value>,
}
impl std::fmt::Display for CheckoutPaymentMethodOptionCardNetworkApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PaymentCancelApiRequest {
pub reason: Option<String>,
}
impl std::fmt::Display for PaymentCancelApiRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum BlockingPaymentActionTypeEnum {
#[serde(rename = "3DS_AUTHENTICATION")]
BlockingPaymentActionTypeEnum3DsAuthentication,
#[serde(rename = "USE_PRIMER_SDK")]
UsePrimerSdk,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CreateClientSideTokenClientSessionPostRequired {
pub order_id: String,
pub metadata: serde_json::Value,
pub currency_code: String,
pub customer_id: String,
pub order: OrderDetailsApiSchema,
pub customer: CheckoutCustomerDetailsApiSchema,
pub payment_method: CheckoutPaymentMethodOptionsApiSchema,
pub amount: serde_json::Value,
}
impl std::fmt::Display for CreateClientSideTokenClientSessionPostRequired {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct VerifiedMerchantPaymentMethodTokenListApiResponse {
pub data: Option<Vec<VerifiedMerchantPaymentMethodTokenApiResponse>>,
}
impl std::fmt::Display for VerifiedMerchantPaymentMethodTokenListApiResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum RecurringTransactionTypeEnum {
#[serde(rename = "FIRST_PAYMENT")]
FirstPayment,
#[serde(rename = "ECOMMERCE")]
Ecommerce,
#[serde(rename = "SUBSCRIPTION")]
Subscription,
#[serde(rename = "UNSCHEDULED")]
Unscheduled,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CoreApiApiCommonsSchemasAddessAddressApiSchema {
pub address_line1: Option<String>,
pub postal_code: Option<String>,
pub address_line2: Option<String>,
pub last_name: Option<String>,
pub state: Option<String>,
pub first_name: Option<String>,
pub city: Option<String>,
pub country_code: Option<CountryCodeEnum>,
}
impl std::fmt::Display for CoreApiApiCommonsSchemasAddessAddressApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct KlarnaAddressApiSchema {
pub address_line2: Option<String>,
pub email: Option<String>,
pub city: Option<String>,
pub first_name: Option<String>,
pub postal_code: Option<String>,
pub title: Option<String>,
pub last_name: Option<String>,
pub phone_number: Option<String>,
pub address_line1: Option<String>,
pub address_line3: Option<String>,
pub country_code: Option<CountryCodeEnum>,
pub state: Option<String>,
}
impl std::fmt::Display for KlarnaAddressApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PaymentCardTokenApiSchema {
pub cardholder_name: Option<String>,
pub is_network_tokenized: Option<bool>,
pub expiration_month: String,
pub network: Option<String>,
pub expiration_year: String,
pub first6_digits: Option<String>,
pub last4_digits: String,
pub bin_data: Option<BinDataApiSchema>,
}
impl std::fmt::Display for PaymentCardTokenApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum PrepaidReloadableEnum {
#[serde(rename = "RELOADABLE")]
Reloadable,
#[serde(rename = "NON_RELOADABLE")]
NonReloadable,
#[serde(rename = "NOT_APPLICABLE")]
NotApplicable,
#[serde(rename = "UNKNOWN")]
Unknown,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ThreeDSecureAuthenticationApiSchema {
pub protocol_version: Option<String>,
pub response_code: String,
pub challenge_issued: Option<bool>,
pub reason_text: Option<String>,
pub reason_code: Option<serde_json::Value>,
}
impl std::fmt::Display for ThreeDSecureAuthenticationApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct OrderShippingApiSchema {
pub amount: Option<serde_json::Value>,
}
impl std::fmt::Display for OrderShippingApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PaymentApiResponse {
pub payment_method: Option<PaymentResponsePaymentMethodOptionsApiSchema>,
pub order_id: Option<String>,
pub customer_id: Option<String>,
pub customer: Option<CustomerDetailsApiSchema>,
pub processor: Option<PaymentResponseProcessorApiSchema>,
pub transactions: Option<Vec<TransactionOverviewApiSchema>>,
pub date: Option<String>,
pub metadata: Option<serde_json::Value>,
pub order: Option<OrderDetailsApiSchema>,
pub id: Option<String>,
pub status_reason: Option<StatusReasonApiSchema>,
pub status: Option<String>,
pub currency_code: Option<String>,
pub amount: Option<serde_json::Value>,
pub required_action: Option<PaymentRequiredActionApiSchema>,
}
impl std::fmt::Display for PaymentApiResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct KlarnaCustomerTokenApiSchema {
pub klarna_customer_token: String,
pub session_data: KlarnaSessionDetailsApiSchema,
}
impl std::fmt::Display for KlarnaCustomerTokenApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct BinDataOptionalApiSchema {
pub network: Option<String>,
}
impl std::fmt::Display for BinDataOptionalApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum DeclineTypeEnum {
#[serde(rename = "SOFT_DECLINE")]
SoftDecline,
#[serde(rename = "HARD_DECLINE")]
HardDecline,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PaymentRefundApiRequest {
pub amount: Option<serde_json::Value>,
pub reason: Option<String>,
pub order_id: Option<String>,
}
impl std::fmt::Display for PaymentRefundApiRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum ProductTypeEnum {
#[serde(rename = "PHYSICAL")]
Physical,
#[serde(rename = "DIGITAL")]
Digital,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PaymentRequiredActionApiSchema {
pub name: String,
pub description: String,
pub client_token: Option<String>,
}
impl std::fmt::Display for PaymentRequiredActionApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct MerchantPaymentMethodTokenListApiResponse {
pub data: Option<Vec<MerchantPaymentMethodTokenApiResponse>>,
}
impl std::fmt::Display for MerchantPaymentMethodTokenListApiResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Currency(pub serde_json::Value);
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ClientSessionWarningsApiResponse {
pub code: Option<String>,
pub message: Option<String>,
pub type_: Option<String>,
}
impl std::fmt::Display for ClientSessionWarningsApiResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PaymentSummaryApiSchema {
pub order_id: String,
pub amount: i64,
pub id: String,
pub processor: Option<String>,
pub status: String,
pub metadata: Option<serde_json::Value>,
pub date: String,
pub currency_code: String,
}
impl std::fmt::Display for PaymentSummaryApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Error422Response {
pub error_object: ErrorObject,
}
impl std::fmt::Display for Error422Response {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PayPalOrderTokenApiSchema {
pub external_payer_info: Option<PayPalExternalPayerInfoApiSchema>,
pub paypal_status: Option<String>,
pub paypal_order_id: String,
}
impl std::fmt::Display for PayPalOrderTokenApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ClientSessionApiRequest {
pub customer_id: Option<String>,
pub order_id: Option<String>,
pub amount: Option<serde_json::Value>,
pub customer: Option<CheckoutCustomerDetailsApiSchema>,
pub order: Option<OrderDetailsApiSchema>,
pub payment_method: Option<CheckoutPaymentMethodOptionsApiSchema>,
pub currency_code: Option<String>,
pub metadata: Option<serde_json::Value>,
}
impl std::fmt::Display for ClientSessionApiRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Error400Response {
pub error_object: ErrorObject,
}
impl std::fmt::Display for Error400Response {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PaymentResumeApiRequest {
pub resume_token: String,
}
impl std::fmt::Display for PaymentResumeApiRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PaymentRequestPaymentMethodOptionsApiSchema {
pub descriptor: Option<String>,
pub vault_on_success: Option<bool>,
pub payment_type: Option<String>,
}
impl std::fmt::Display for PaymentRequestPaymentMethodOptionsApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CheckoutPaymentMethodOptionApiSchema {
pub surcharge: Option<CheckoutPaymentMethodOptionSurchargeApiSchema>,
}
impl std::fmt::Display for CheckoutPaymentMethodOptionApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct TransactionOverviewApiSchema {
pub processor_transaction_id: Option<String>,
pub date: String,
pub processor_status: Option<String>,
pub processor_merchant_id: String,
pub amount: serde_json::Value,
pub currency_code: String,
pub processor_name: Option<String>,
pub processor_status_reason: Option<StatusReasonApiSchema>,
pub transaction_type: Option<String>,
}
impl std::fmt::Display for TransactionOverviewApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum AccountFundingTypeEnum {
#[serde(rename = "CREDIT")]
Credit,
#[serde(rename = "DEBIT")]
Debit,
#[serde(rename = "PREPAID")]
Prepaid,
#[serde(rename = "CHARGE")]
Charge,
#[serde(rename = "DEFERRED_DEBIT")]
DeferredDebit,
#[serde(rename = "UNKNOWN")]
Unknown,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ClientSessionUpdateApiRequest {
pub order: Option<OrderDetailsApiSchema>,
pub order_id: Option<String>,
pub customer: Option<CheckoutCustomerDetailsApiSchema>,
pub payment_method: Option<CheckoutPaymentMethodOptionsApiSchema>,
pub currency_code: Option<String>,
pub amount: Option<serde_json::Value>,
pub metadata: Option<serde_json::Value>,
pub customer_id: Option<String>,
pub client_token: Option<String>,
}
impl std::fmt::Display for ClientSessionUpdateApiRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ClientSessionApiResponse {
pub customer: Option<CustomerDetailsApiSchema>,
pub customer_id: Option<String>,
pub order: Option<OrderDetailsApiSchema>,
pub order_id: Option<String>,
pub metadata: Option<serde_json::Value>,
pub amount: Option<serde_json::Value>,
pub payment_method: Option<CheckoutPaymentMethodOptionsApiSchema>,
pub currency_code: Option<String>,
}
impl std::fmt::Display for ClientSessionApiResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PaymentListApiResponse {
pub next_cursor: Option<String>,
pub data: Option<Vec<PaymentSummaryApiSchema>>,
pub prev_cursor: Option<String>,
}
impl std::fmt::Display for PaymentListApiResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PaymentResponsePaymentMethodOptionsApiSchema {
pub payment_method_token: Option<String>,
pub payment_method_type: Option<String>,
pub is_vaulted: Option<bool>,
pub descriptor: Option<String>,
pub analytics_id: Option<String>,
pub payment_method_data: Option<serde_json::Value>,
pub three_d_secure_authentication: Option<ThreeDSecureAuthenticationApiSchema>,
}
impl std::fmt::Display for PaymentResponsePaymentMethodOptionsApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CountryCodeEnum(pub serde_json::Value);
#[derive(Debug, Serialize, Deserialize)]
pub enum ThreeDSecureFailedReasonCodeEnum {
#[serde(rename = "UNKNOWN")]
Unknown,
#[serde(rename = "REJECTED_BY_ISSUER")]
RejectedByIssuer,
#[serde(rename = "CARD_AUTHENTICATION_FAILED")]
CardAuthenticationFailed,
#[serde(rename = "UNKNOWN_DEVICE")]
UnknownDevice,
#[serde(rename = "UNSUPPORTED_DEVICE")]
UnsupportedDevice,
#[serde(rename = "EXCEEDS_AUTHENTICATION_FREQUENCY_LIMIT")]
ExceedsAuthenticationFrequencyLimit,
#[serde(rename = "EXPIRED_CARD")]
ExpiredCard,
#[serde(rename = "INVALID_CARD_NUMBER")]
InvalidCardNumber,
#[serde(rename = "INVALID_TRANSACTION")]
InvalidTransaction,
#[serde(rename = "NO_CARD_RECORD")]
NoCardRecord,
#[serde(rename = "SECURITY_FAILURE")]
SecurityFailure,
#[serde(rename = "STOLEN_CARD")]
StolenCard,
#[serde(rename = "SUSPECTED_FRAUD")]
SuspectedFraud,
#[serde(rename = "TRANSACTION_NOT_PERMITTED_TO_CARDHOLDER")]
TransactionNotPermittedToCardholder,
#[serde(rename = "CARDHOLDER_NOT_ENROLLED_IN_SERVICE")]
CardholderNotEnrolledInService,
#[serde(rename = "TRANSACTION_TIMED_OUT_AT_THE_ACS")]
TransactionTimedOutAtTheAcs,
#[serde(rename = "LOW_CONFIDENCE")]
LowConfidence,
#[serde(rename = "MEDIUM_CONFIDENCE")]
MediumConfidence,
#[serde(rename = "HIGH_CONFIDENCE")]
HighConfidence,
#[serde(rename = "VERY_HIGH_CONFIDENCE")]
VeryHighConfidence,
#[serde(rename = "EXCEEDS_ACS_MAXIMUM_CHALLENGES")]
ExceedsAcsMaximumChallenges,
#[serde(rename = "NON_PAYMENT_NOT_SUPPORTED")]
NonPaymentNotSupported,
#[serde(rename = "THREE_RI_NOT_SUPPORTED")]
ThreeRiNotSupported,
#[serde(rename = "ACS_TECHNICAL_ISSUE")]
AcsTechnicalIssue,
#[serde(rename = "DECOUPLED_REQUIRED_BY_ACS")]
DecoupledRequiredByAcs,
#[serde(rename = "DECOUPLED_MAX_EXPIRY_EXCEEDED")]
DecoupledMaxExpiryExceeded,
#[serde(rename = "DECOUPLED_AUTHENTICATION_INSUFFICIENT_TIME")]
DecoupledAuthenticationInsufficientTime,
#[serde(rename = "AUTHENTICATION_ATTEMPTED_BUT_NOT_PERFORMED_BY_CARDHOLDER")]
AuthenticationAttemptedButNotPerformedByCardholder,
#[serde(rename = "ACS_TIMED_OUT")]
AcsTimedOut,
#[serde(rename = "INVALID_ACS_RESPONSE")]
InvalidAcsResponse,
#[serde(rename = "ACS_SYSTEM_ERROR_RESPONSE")]
AcsSystemErrorResponse,
#[serde(rename = "ERROR_GENERATING_CAVV")]
ErrorGeneratingCavv,
#[serde(rename = "PROTOCOL_VERSION_NOT_SUPPORTED")]
ProtocolVersionNotSupported,
#[serde(rename = "TRANSACTION_EXCLUDED_FROM_ATTEMPTS_PROCESSING")]
TransactionExcludedFromAttemptsProcessing,
#[serde(rename = "REQUESTED_PROGRAM_NOT_SUPPORTED")]
RequestedProgramNotSupported,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CheckoutCustomerDetailsApiSchema {
pub last_name: Option<String>,
pub email_address: Option<String>,
pub shipping_address: Option<CoreApiApiCommonsSchemasAddessAddressApiSchema>,
pub billing_address: Option<CoreApiApiCommonsSchemasAddessAddressApiSchema>,
pub tax_id: Option<String>,
pub first_name: Option<String>,
pub mobile_number: Option<String>,
pub national_document_id: Option<String>,
}
impl std::fmt::Display for CheckoutCustomerDetailsApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct MerchantPaymentMethodTokenApiResponse {
pub created_at: Option<String>,
pub deleted_at: Option<String>,
pub customer_id: Option<String>,
pub deleted: Option<bool>,
pub payment_method_type: Option<String>,
pub analytics_id: Option<String>,
pub payment_method_data: Option<serde_json::Value>,
pub default: Option<bool>,
pub description: Option<String>,
pub token: Option<String>,
pub token_type: Option<String>,
}
impl std::fmt::Display for MerchantPaymentMethodTokenApiResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum TransactionDeclineReasonV2Enum {
#[serde(rename = "ERROR")]
Error,
#[serde(rename = "INVALID_CARD_NUMBER")]
InvalidCardNumber,
#[serde(rename = "EXPIRED_CARD")]
ExpiredCard,
#[serde(rename = "LOST_OR_STOLEN_CARD")]
LostOrStolenCard,
#[serde(rename = "SUSPECTED_FRAUD")]
SuspectedFraud,
#[serde(rename = "UNKNOWN")]
Unknown,
#[serde(rename = "DECLINED")]
Declined,
#[serde(rename = "REFER_TO_CARD_ISSUER")]
ReferToCardIssuer,
#[serde(rename = "DO_NOT_HONOR")]
DoNotHonor,
#[serde(rename = "INSUFFICIENT_FUNDS")]
InsufficientFunds,
#[serde(rename = "WITHDRAWAL_LIMIT_EXCEEDED")]
WithdrawalLimitExceeded,
#[serde(rename = "ISSUER_TEMPORARILY_UNAVAILABLE")]
IssuerTemporarilyUnavailable,
#[serde(rename = "AUTHENTICATION_REQUIRED")]
AuthenticationRequired,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CheckoutPaymentMethodOptionSurchargeApiSchema {
pub amount: Option<i64>,
}
impl std::fmt::Display for CheckoutPaymentMethodOptionSurchargeApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct VaultPaymentMethodApiRequest {
pub customer_id: String,
pub verify: Option<bool>,
}
impl std::fmt::Display for VaultPaymentMethodApiRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum CardRegionRestrictionEnum {
#[serde(rename = "DOMESTIC_USE_ONLY")]
DomesticUseOnly,
#[serde(rename = "NONE")]
None,
#[serde(rename = "UNKNOWN")]
Unknown,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct OrderLineItemsProductDataApiSchema {
pub brand: Option<String>,
pub sku: Option<String>,
pub color: Option<String>,
pub global_trade_item_number: Option<String>,
pub weight_unit: Option<String>,
pub manufacturer_part_number: Option<String>,
pub weight: Option<f64>,
}
impl std::fmt::Display for OrderLineItemsProductDataApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ClientSessionWithTokenApiResponse {
pub amount: Option<serde_json::Value>,
pub order_id: Option<String>,
pub client_token_expiration_date: Option<String>,
pub client_token: Option<String>,
pub order: Option<OrderDetailsApiSchema>,
pub customer_id: Option<String>,
pub customer: Option<CustomerDetailsApiSchema>,
pub payment_method: Option<CheckoutPaymentMethodOptionsApiSchema>,
pub currency_code: Option<String>,
pub warnings: Option<ClientSessionWarningsApiResponse>,
pub metadata: Option<serde_json::Value>,
}
impl std::fmt::Display for ClientSessionWithTokenApiResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct IdealPayNlTokenApiSchema {
pub payment_method_config_id: String,
}
impl std::fmt::Display for IdealPayNlTokenApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ApayaCustomerTokenApiSchema {
pub mnc: Option<i64>,
pub mx: String,
pub mcc: Option<i64>,
}
impl std::fmt::Display for ApayaCustomerTokenApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PaymentCreationApiRequest {
pub order_id: Option<String>,
pub metadata: Option<serde_json::Value>,
pub payment_method: Option<PaymentRequestPaymentMethodOptionsApiSchema>,
pub amount: Option<serde_json::Value>,
pub customer_id: Option<String>,
pub currency_code: Option<String>,
pub payment_method_token: String,
pub customer: Option<CustomerDetailsApiSchema>,
pub order: Option<OrderDetailsApiSchema>,
}
impl std::fmt::Display for PaymentCreationApiRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct OrderDetailsApiSchema {
pub fees: Option<Vec<OrderFeesApiSchema>>,
pub country_code: Option<CountryCodeEnum>,
pub shipping: Option<OrderShippingApiSchema>,
pub line_items: Option<Vec<OrderLineItemsApiSchema>>,
}
impl std::fmt::Display for OrderDetailsApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PaymentMethodTypeEnum(pub String);
#[derive(Debug, Serialize, Deserialize)]
pub struct CheckoutPaymentMethodCardOptionApiSchema {
pub networks: Option<CheckoutPaymentMethodOptionCardNetworkApiSchema>,
}
impl std::fmt::Display for CheckoutPaymentMethodCardOptionApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum ThreeDSecureAuthResponseCodeEnum {
#[serde(rename = "NOT_PERFORMED")]
NotPerformed,
#[serde(rename = "SKIPPED")]
Skipped,
#[serde(rename = "AUTH_SUCCESS")]
AuthSuccess,
#[serde(rename = "AUTH_FAILED")]
AuthFailed,
#[serde(rename = "CHALLENGE")]
Challenge,
#[serde(rename = "METHOD")]
Method,
}
#[derive(Debug, Serialize, Deserialize)]
pub enum TransactionTypeEnum {
#[serde(rename = "SALE")]
Sale,
#[serde(rename = "REFUND")]
Refund,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CustomerDetailsApiSchema {
pub email_address: Option<String>,
pub first_name: Option<String>,
pub last_name: Option<String>,
pub billing_address: Option<CoreApiApiCommonsSchemasAddessAddressApiSchema>,
pub mobile_number: Option<String>,
pub shipping_address: Option<CoreApiApiCommonsSchemasAddessAddressApiSchema>,
pub tax_id: Option<String>,
pub national_document_id: Option<String>,
}
impl std::fmt::Display for CustomerDetailsApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct BinDataApiSchema {
pub issuer_currency_code: Option<Currency>,
pub network: String,
pub product_usage_type: String,
pub product_code: String,
pub issuer_country_code: Option<CountryCodeEnum>,
pub regional_restriction: String,
pub account_number_type: String,
pub account_funding_type: String,
pub issuer_name: Option<String>,
pub prepaid_reloadable_indicator: String,
pub product_name: String,
}
impl std::fmt::Display for BinDataApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PaymentSummaryProcessorApiSchema {
pub processor_merchant_id: Option<String>,
pub name: String,
}
impl std::fmt::Display for PaymentSummaryProcessorApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct GoCardlessMandateApiSchema {
pub gocardless_mandate_id: String,
}
impl std::fmt::Display for GoCardlessMandateApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PayPalExternalPayerInfoApiSchema {
pub last_name: Option<String>,
pub external_payer_id: Option<String>,
pub first_name: Option<String>,
pub email: Option<String>,
}
impl std::fmt::Display for PayPalExternalPayerInfoApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum CardAccountNumberTypeEnum {
#[serde(rename = "PRIMARY_ACCOUNT_NUMBER")]
PrimaryAccountNumber,
#[serde(rename = "NETWORK_TOKEN")]
NetworkToken,
#[serde(rename = "UNKNOWN")]
Unknown,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct KlarnaPaymentSessionApiSchema {
pub session_data: KlarnaSessionDetailsApiSchema,
pub klarna_authorization_token: String,
}
impl std::fmt::Display for KlarnaPaymentSessionApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum TokenTypeEnum {
#[serde(rename = "MULTI_USE")]
MultiUse,
#[serde(rename = "SINGLE_USE")]
SingleUse,
}
#[derive(Debug, Serialize, Deserialize)]
pub enum PaymentStatus {
#[serde(rename = "PENDING")]
Pending,
#[serde(rename = "FAILED")]
Failed,
#[serde(rename = "AUTHORIZED")]
Authorized,
#[serde(rename = "SETTLING")]
Settling,
#[serde(rename = "PARTIALLY_SETTLED")]
PartiallySettled,
#[serde(rename = "SETTLED")]
Settled,
#[serde(rename = "DECLINED")]
Declined,
#[serde(rename = "CANCELLED")]
Cancelled,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct OrderLineItemsApiSchema {
pub item_id: Option<String>,
pub quantity: Option<i64>,
pub tax_code: Option<String>,
pub name: Option<String>,
pub amount: serde_json::Value,
pub product_data: Option<OrderLineItemsProductDataApiSchema>,
pub product_type: Option<String>,
pub discount_amount: Option<serde_json::Value>,
pub tax_amount: Option<i64>,
pub description: Option<String>,
}
impl std::fmt::Display for OrderLineItemsApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PayPalBillingAgreementApiSchema {
pub shipping_address: Option<AddressApiSchema>,
pub external_payer_info: Option<PayPalExternalPayerInfoApiSchema>,
pub paypal_billing_agreement_id: String,
pub paypal_status: Option<String>,
}
impl std::fmt::Display for PayPalBillingAgreementApiSchema {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PaymentCardTokenApiSchemaPaymentMethodsApi {
pub account_funding_type: Option<String>,
pub last4_digits: String,
pub cardholder_name: Option<String>,
pub expiration_year: String,
pub expiration_month: String,
pub network_transaction_id: Option<String>,
pub network: Option<String>,
}
impl std::fmt::Display for PaymentCardTokenApiSchemaPaymentMethodsApi {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum PaymentStatusTypeEnum {
#[serde(rename = "APPLICATION_ERROR")]
ApplicationError,
#[serde(rename = "GATEWAY_REJECTED")]
GatewayRejected,
#[serde(rename = "ISSUER_DECLINED")]
IssuerDeclined,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct UpdateClientSideTokenClientSessionPatchRequired {
pub currency_code: String,
pub customer: CheckoutCustomerDetailsApiSchema,
pub amount: serde_json::Value,
pub metadata: serde_json::Value,
pub order: OrderDetailsApiSchema,
pub order_id: String,
pub customer_id: String,
pub client_token: String,
pub payment_method: CheckoutPaymentMethodOptionsApiSchema,
}
impl std::fmt::Display for UpdateClientSideTokenClientSessionPatchRequired {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub enum CardProductTypeEnum {
#[serde(rename = "CONSUMER")]
Consumer,
#[serde(rename = "BUSINESS")]
Business,
#[serde(rename = "GOVERNMENT")]
Government,
#[serde(rename = "UNKNOWN")]
Unknown,
}