Skip to main content
This module contains all payment-related models used for managing payment processing and payment method information.

Payment Status Models

PaymentStatusDTO

Enum defining the various states of a payment.
ValueDescription
processingPayment is being processed
completedPayment has been successfully processed
failedPayment processing failed
refundedPayment has been refunded

PaymentTypeDTO

Enum defining the type of payment processing used.
ValueDescription
externalPayment processed by external system
stripePayment processed through Stripe
storePayment handled directly by store

PaymentMethodTypeDTO

Enum defining the available payment method types.
ValueDescription
HandledByStorePayment will be handled by the store
PersistentCardSaved payment card for future use
TemporaryCardOne-time use payment card
TwintTwint mobile payment method
RevolutPayRevolut payment method

Payment Processing Models

PaymentDTO

Complete payment information for an order.
FieldTypeRequiredDescription
idstringYesUnique payment identifier
amountPriceDTOYesPayment amount
statusPaymentStatusDTOYesCurrent payment status
typePaymentTypeDTOYesPayment processing type
methodPaymentMethodTypeDTONoPayment method used
externalIdstringYesExternal payment system identifier
paymentMethodIdstringNoAssociated payment method ID

Payment Processing Flow

  1. Initiation: Payment is created with processing status
  2. Processing: Payment system processes the transaction
  3. Completion: Payment status updates to completed or failed
  4. Reconciliation: Payment is linked to order and customer

Payment Types

External Payments

  • Processed by third-party payment systems
  • Requires external ID for tracking
  • Status updates via webhooks

Stripe Payments

  • Processed through Stripe payment platform
  • Integrated payment method management
  • Real-time status updates

Store Payments

  • Handled directly by the store
  • Cash, card reader, or manual processing
  • Manual status management

Payment Method Models

PaymentMethodDTO

Payment method information stored for customers.
FieldTypeRequiredDescription
stripeIdstringYesStripe payment method identifier
isActivebooleanYesWhether payment method is active
customerIdstringYesAssociated customer identifier
idstringNoInternal payment method identifier
typestringNoPayment method type (e.g., “card”)
last4stringNoLast 4 digits of card
brandstringNoCard brand (e.g., “visa”, “mastercard”)
exp_monthnumberNoCard expiration month
exp_yearnumberNoCard expiration year
fundingstringNoCard funding type (e.g., “credit”, “debit”)
walletobjectNoDigital wallet information
countrystringNoCard issuing country
fingerprintstringNoCard fingerprint for duplicate detection

Payment Method Management

Card Information

Stored payment methods include detailed card information:
  • Brand: Visa, Mastercard, American Express, etc.
  • Type: Credit or debit card classification
  • Expiration: Month and year for validation
  • Country: Issuing country for compliance

Security Features

  • Tokenization: Card numbers are tokenized through Stripe
  • Fingerprinting: Duplicate card detection
  • PCI Compliance: Secure card data handling

Digital Wallets

Support for digital wallet payment methods:
  • Apple Pay
  • Google Pay
  • Samsung Pay
  • Other wallet providers

Payment Method Lifecycle

  1. Registration: Customer adds payment method
  2. Verification: Payment method is verified with issuer
  3. Storage: Tokenized payment method is stored
  4. Usage: Payment method is used for transactions
  5. Updates: Expiration dates and status are maintained
  6. Removal: Inactive methods are cleaned up

Payment Security

Tokenization

  • Card numbers are never stored directly
  • Stripe tokens represent payment methods
  • Tokens can be safely transmitted and stored

Compliance

  • PCI DSS compliance for card data handling
  • Strong customer authentication (SCA) support
  • Fraud detection and prevention

Customer Control

  • Customers can manage their payment methods
  • Easy addition and removal of payment methods
  • Control over default payment method
Payment methods are securely managed through Stripe’s tokenization system, ensuring PCI compliance and customer data protection.