wip: session methods

This commit is contained in:
fPolic
2024-01-15 18:40:05 +01:00
parent fbd3fedb68
commit 66ec3d0931
3 changed files with 28 additions and 1 deletions

View File

@@ -63,6 +63,9 @@ export default class Payment {
@Property({ columnType: "text", nullable: true })
order_id: string | null
@Property({ columnType: "text", nullable: true })
order_edit_id: string | null
@Property({ columnType: "text", nullable: true })
customer_id: string | null

View File

@@ -14,11 +14,15 @@ export interface CreatePaymentDTO {
cart_id?: string
order_id?: string
order_edit_id?: string
customer_id?: string
}
export interface UpdatePaymentDTO {
cart_id?: string
order_id?: string
order_edit_id?: string
customer_id?: string
}
export interface CreatePaymentSessionDTO {}

View File

@@ -3,6 +3,7 @@ import { Context } from "../shared-context"
import {
CreatePaymentCollectionDTO,
CreatePaymentDTO,
CreatePaymentSessionDTO,
UpdatePaymentCollectionDTO,
UpdatePaymentDTO,
} from "./mutations"
@@ -69,6 +70,8 @@ export interface IPaymentModuleService extends IModuleService {
sharedContext?: Context
): Promise<PaymentCollectionDTO>
/* ********** PAYMENTS ********** */
createPayment(data: CreatePaymentDTO): Promise<PaymentDTO>
capturePayment(paymentId: string, amount: number): Promise<PaymentDTO>
@@ -76,5 +79,22 @@ export interface IPaymentModuleService extends IModuleService {
updatePayment(data: UpdatePaymentDTO): Promise<PaymentDTO>
// TODO: PaymentSession methods
/* ********** PAYMENT SESSIONS ********** */
createPaymentSession(
paymentCollectionId: string,
data: CreatePaymentSessionDTO
): Promise<PaymentCollectionDTO>
authorizePaymentSessions(
paymentCollectionId: string,
sessionIds: string[]
): Promise<PaymentCollectionDTO>
completePaymentSessions(
paymentCollectionId: string,
sessionIds: string[]
): Promise<PaymentCollectionDTO>
// TODO: PaymentSession set session
}