Yimaru-BackEnd/internal/services/chapa/port.go
2025-11-06 16:37:41 +03:00

29 lines
1.5 KiB
Go

package chapa
import (
"context"
"github.com/SamuelTariku/FortuneBet-Backend/internal/domain"
)
// type ChapaPort interface {
// HandleChapaTransferWebhook(ctx context.Context, req domain.ChapaWebHookTransfer) error
// HandleChapaPaymentWebhook(ctx context.Context, req domain.ChapaWebHookPayment) error
// WithdrawUsingChapa(ctx context.Context, userID int64, req domain.ChapaWithdrawRequest) error
// DepositUsingChapa(ctx context.Context, userID int64, req domain.ChapaDepositRequest) (string, error)
// GetSupportedBanks() ([]domain.ChapaSupportedBank, error)
// }
type ChapaStore interface {
InitializePayment(request domain.ChapaInitDepositRequest) (domain.ChapaDepositResponse, error)
ManualVerifTransaction(ctx context.Context, txRef string) (*domain.ChapaTransferVerificationResponse, error)
FetchSupportedBanks(ctx context.Context) ([]domain.Bank, error)
CreateWithdrawal(userID string, amount float64, accountNumber, bankCode string) (*domain.ChapaWithdrawal, error)
HandleVerifyDepositWebhook(ctx context.Context, transfer domain.ChapaWebhookTransfer) error
HandleVerifyWithdrawWebhook(ctx context.Context, payment domain.ChapaWebhookPayment) error
GetPaymentReceiptURL(ctx context.Context, chapaRef string) (string, error)
GetAllTransfers(ctx context.Context) ([]domain.Transfer, error)
GetAccountBalance(ctx context.Context, currencyCode string) ([]domain.Balance, error)
InitiateSwap(ctx context.Context, amount float64, from, to string) (*domain.SwapResponse, error)
}