Yimaru-BackEnd/internal/ports/payment.go

24 lines
1.3 KiB
Go

package ports
import (
"Yimaru-Backend/internal/domain"
"context"
)
type PaymentStore interface {
CreatePayment(ctx context.Context, input domain.CreatePaymentInput) (*domain.Payment, error)
GetPaymentByID(ctx context.Context, id int64) (*domain.Payment, error)
GetPaymentBySessionID(ctx context.Context, sessionID string) (*domain.Payment, error)
GetPaymentByNonce(ctx context.Context, nonce string) (*domain.Payment, error)
GetPaymentByTransactionID(ctx context.Context, transactionID string) (*domain.Payment, error)
GetPaymentsByUserID(ctx context.Context, userID int64, limit, offset int32) ([]domain.Payment, error)
GetPendingPaymentsByUserID(ctx context.Context, userID int64) ([]domain.Payment, error)
UpdatePaymentStatus(ctx context.Context, id int64, status string) error
UpdatePaymentStatusBySessionID(ctx context.Context, sessionID, status, transactionID, paymentMethod string) error
UpdatePaymentStatusByNonce(ctx context.Context, nonce, status, transactionID, paymentMethod string) error
UpdatePaymentSessionID(ctx context.Context, id int64, sessionID, paymentURL string) error
LinkPaymentToSubscription(ctx context.Context, paymentID, subscriptionID int64) error
GetExpiredPendingPayments(ctx context.Context) ([]domain.Payment, error)
ExpirePayment(ctx context.Context, id int64) error
}