add pay
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

This commit is contained in:
guwandyk committed 2026-09-19 03:54:40 +05:00
1 parent 848a07324f
commit 6c7c402390
16 files changed
+891 -324

No files matched your search

+10 -1
View File
@@ -16,10 +16,19 @@ var ErrAmountNotSet = errors.New("order has no requested amount")
// what the order's amount_usd converts to at the current rate.
var ErrAmountExceedsMax = errors.New("amount exceeds the order's requested amount")
// ErrPaymentNotFound is returned when a callback references a payment
// attempt id that doesn't exist.
var ErrPaymentNotFound = errors.New("payment attempt not found")
type Repository interface {
// OwnerInfo returns the order's owner/branch so the handler can run
// rbac.GuardOrder without importing cards/visamaster.
OwnerInfo(ctx context.Context, orderID int64) (userID *int64, branchID int64, err error)
Quote(ctx context.Context, orderID int64) (PaymentQuoteDTO, error)
Pay(ctx context.Context, orderID int64, dto PayOrderDTO) (PaymentResultDTO, error)
// Pay registers the payout with GBÜS and returns the hosted-payment-page
// URL - it does not know the final outcome yet, see HandleCallback.
Pay(ctx context.Context, orderID int64, dto PayOrderDTO) (PaymentInitResultDTO, error)
// HandleCallback verifies a payment attempt's real outcome with GBÜS
// (never trusting the callback request itself) and finalizes it.
HandleCallback(ctx context.Context, paymentID int64) (PaymentResultDTO, error)
}