feat(payment): PaymentCollection CRUD (#6124)
This commit is contained in:
@@ -3,6 +3,34 @@ import { OperatorMap } from "../dal/utils"
|
||||
|
||||
/* ********** PAYMENT COLLECTION ********** */
|
||||
|
||||
/**
|
||||
* @enum
|
||||
*
|
||||
* The payment collection's status.
|
||||
*/
|
||||
export enum PaymentCollectionStatus {
|
||||
/**
|
||||
* The payment collection isn't paid.
|
||||
*/
|
||||
NOT_PAID = "not_paid",
|
||||
/**
|
||||
* The payment collection is awaiting payment.
|
||||
*/
|
||||
AWAITING = "awaiting",
|
||||
/**
|
||||
* The payment collection is authorized.
|
||||
*/
|
||||
AUTHORIZED = "authorized",
|
||||
/**
|
||||
* Some of the payments in the payment collection are authorized.
|
||||
*/
|
||||
PARTIALLY_AUTHORIZED = "partially_authorized",
|
||||
/**
|
||||
* The payment collection is canceled.
|
||||
*/
|
||||
CANCELED = "canceled",
|
||||
}
|
||||
|
||||
export interface PaymentCollectionDTO {
|
||||
/**
|
||||
* The ID of the Payment Collection
|
||||
|
||||
@@ -1,15 +1,29 @@
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
import { PaymentCollectionStatus } from "./common"
|
||||
|
||||
/**
|
||||
* Payment Collection
|
||||
*/
|
||||
export interface CreatePaymentCollectionDTO {
|
||||
region_id: string
|
||||
currency_code: string
|
||||
amount: number
|
||||
|
||||
metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface UpdatePaymentCollectionDTO
|
||||
extends Partial<CreatePaymentCollectionDTO> {}
|
||||
extends Partial<CreatePaymentCollectionDTO> {
|
||||
id: string
|
||||
|
||||
authorized_amount?: number
|
||||
refunded_amount?: number
|
||||
completed_at?: number
|
||||
status?: PaymentCollectionStatus
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment
|
||||
*/
|
||||
|
||||
export interface CreatePaymentDTO {
|
||||
amount: number
|
||||
@@ -30,6 +44,10 @@ export interface UpdatePaymentDTO {
|
||||
customer_id?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment Session
|
||||
*/
|
||||
|
||||
export interface CreatePaymentSessionDTO {
|
||||
amount: number
|
||||
currency_code: string
|
||||
|
||||
Reference in New Issue
Block a user