wip: service

This commit is contained in:
fPolic
2024-01-15 17:15:49 +01:00
parent 56752039cf
commit fbd3fedb68
2 changed files with 30 additions and 3 deletions
+21
View File
@@ -1,3 +1,24 @@
/**
* TODO
*/
export interface CreatePaymentCollectionDTO {}
export interface UpdatePaymentCollectionDTO {}
export interface CreatePaymentDTO {
amount: number
currency_code: string
provider_id: string
data: Record<string, unknown>
cart_id?: string
order_id?: string
customer_id?: string
}
export interface UpdatePaymentDTO {
cart_id?: string
order_id?: string
customer_id?: string
}
+9 -3
View File
@@ -2,7 +2,9 @@ import { IModuleService } from "../modules-sdk"
import { Context } from "../shared-context"
import {
CreatePaymentCollectionDTO,
CreatePaymentDTO,
UpdatePaymentCollectionDTO,
UpdatePaymentDTO,
} from "./mutations"
import {
FilterablePaymentCollectionProps,
@@ -67,8 +69,12 @@ export interface IPaymentModuleService extends IModuleService {
sharedContext?: Context
): Promise<PaymentCollectionDTO>
capturePayment(paymentId: string): Promise<PaymentDTO>
refundPayment(paymentId: string): Promise<PaymentDTO>
createPayment(data: CreatePaymentDTO): Promise<PaymentDTO>
createPayment()
capturePayment(paymentId: string, amount: number): Promise<PaymentDTO>
refundPayment(paymentId: string, amount: number): Promise<PaymentDTO>
updatePayment(data: UpdatePaymentDTO): Promise<PaymentDTO>
// TODO: PaymentSession methods
}