Skip to content

Payment order models — requests, responses, and enums #14

@rammrain

Description

@rammrain

Summary

Define all DTOs and enums needed for the payment order API.

Requirements

Enums

  • PaymentStatus: PENDING, PAID, VOIDED, PARTIALLY_REFUNDED, REFUNDED, CANCELED, ABANDONED, DECLINED, SETTLED, AUTHORIZED
  • PaymentMethodType: paymentInitiation, cardPayments, bnpl, hirePurchase
  • Currency: EUR, PLN (at minimum)
  • Locale: DE, EN, ET, FI, LT, LV, PL, RU

Request DTOs

  • CreateOrderRequest: merchant reference, amount, currency, payment method, bank code, locale, return URL, notification URL, billing address, line items
  • LineItem: description, quantity, unit price
  • Address: billing address fields

Response DTOs

  • CreateOrderResponse: payment URL, order UUID
  • OrderStatusResponse: order UUID, payment status, merchant reference, grand total, payment method type, payment intents
  • PaymentIntent: intent UUID, status, payment method type, amount, service fee

General

  • Null-safe — clearly indicate nullable fields
  • Jackson annotations for JSON serialization/deserialization

Refs

  • initial-docs/project1.md — order payload fields
  • initial-docs/project2.md — line items, statuses, currencies, locales, payment method types
  • initial-docs/project3.md — order response structure, payment intents

Testing

Unit tests for: serialization/deserialization round-trips, enum coverage, builder/constructor validation, null handling. Target near-perfect coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions