rename to core
This commit is contained in:
48
core/racing/application/ports/IPaymentGateway.ts
Normal file
48
core/racing/application/ports/IPaymentGateway.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Application Port: IPaymentGateway
|
||||
*
|
||||
* Defines interface for payment processing.
|
||||
* Infrastructure will provide mock or real implementation.
|
||||
*/
|
||||
|
||||
import type { Money } from '../../domain/value-objects/Money';
|
||||
|
||||
export interface PaymentResult {
|
||||
success: boolean;
|
||||
transactionId?: string;
|
||||
error?: string;
|
||||
timestamp: Date;
|
||||
}
|
||||
|
||||
export interface RefundResult {
|
||||
success: boolean;
|
||||
refundId?: string;
|
||||
error?: string;
|
||||
timestamp: Date;
|
||||
}
|
||||
|
||||
export interface IPaymentGateway {
|
||||
/**
|
||||
* Process a payment
|
||||
*/
|
||||
processPayment(
|
||||
amount: Money,
|
||||
payerId: string,
|
||||
description: string,
|
||||
metadata?: Record<string, unknown>
|
||||
): Promise<PaymentResult>;
|
||||
|
||||
/**
|
||||
* Refund a payment
|
||||
*/
|
||||
refund(
|
||||
originalTransactionId: string,
|
||||
amount: Money,
|
||||
reason: string
|
||||
): Promise<RefundResult>;
|
||||
|
||||
/**
|
||||
* Verify payment status
|
||||
*/
|
||||
verifyPayment(transactionId: string): Promise<PaymentResult>;
|
||||
}
|
||||
Reference in New Issue
Block a user