Versions in this module Expand all Collapse all v1 v1.1.2 Jun 11, 2026 Changes in this version type WebhookEvent + TransactionRef string type WebhookTransactionBody + Email string + MerchantAmount int64 + MerchantID string v1.1.1 Jun 11, 2026 Changes in this version type InitiatePaymentResponse + Amount int64 + AuthorizedChannels []string + CallbackURL string + IsRecurring bool + MerchantInfo MerchantInfo + type MerchantInfo struct + MerchantID string + MerchantName string type VerifyTransactionResponse + Email string + MerchantAmount int64 + MerchantEmail string + MerchantName string + TransactionType string v1.1.0 Jun 11, 2026 v1.0.0 Jun 11, 2026 Changes in this version + const DefaultTimeout + const ProductionBaseURL + const SandboxBaseURL + const Version + var ErrBadRequest = &Error + var ErrForbidden = &Error + var ErrInvalidSignature = fmt.Errorf("squad: webhook signature validation failed") + var ErrNotFound = &Error + var ErrUnauthorized = &Error + func FromCents(cents int64) float64 + func FromKobo(kobo int64) float64 + func GenerateIdempotencyKey() (string, error) + func IsBadRequest(err error) bool + func IsNotFound(err error) bool + func IsUnauthorized(err error) bool + func NGN(naira float64) int64 + func USD(dollars float64) int64 + func VerifySignature(payload []byte, signature string, secret string) bool + func WithIdempotencyKey(ctx context.Context, key string) context.Context + type AccountLookupResponse struct + AccountName string + AccountNumber string + BankCode string + BankName string + type BuyAirtimeParams struct + Amount int64 + Network string + PhoneNumber string + TransactionRef string + type BuyCableParams struct + Amount int64 + PackageCode string + Provider string + SmartCardNumber string + TransactionRef string + type BuyDataParams struct + Network string + PhoneNumber string + PlanCode string + TransactionRef string + type BuyElectricityParams struct + Amount int64 + BillerCode string + MeterNumber string + MeterType string + PhoneNumber string + TransactionRef string + type CablePackage struct + Amount int64 + CycleType string + PackageCode string + PackageName string + type CablePackagesResponse struct + Packages []CablePackage + type ChargeToken struct + ExpiryMonth int + ExpiryYear int + Token string + type Client struct + Disputes *DisputeService + SubMerchants *SubMerchantService + Transactions *TransactionService + Transfers *TransferService + VAS *VASService + VirtualAccounts *VirtualAccountService + func New(secretKey string, opts ...Option) *Client + type CreateSubMerchantParams struct + AccountName string + AccountNumber string + BankCode string + DisplayName string + Email string + MobileNumber string + type CreateVirtualAccountParams struct + Address string + BVN string + BeneficiaryAccount string + CustomerIdentifier string + DOB string + Email string + FirstName string + Gender string + LastName string + MiddleName string + MobileNum string + type CustomerInfo struct + CustomerEmail string + CustomerName string + CustomerPhone string + MerchantID string + type DataPlan struct + Amount int64 + Network string + PlanCode string + PlanName string + Validity string + type DataPlansResponse struct + Plans []DataPlan + type DeleteSubMerchantResponse struct + MerchantID string + Message string + Status string + type Dispute struct + Amount int64 + CreatedAt string + Currency string + CustomerEmail string + CustomerName string + DueDate string + MerchantResponse string + Reason string + Status string + TicketID string + TransactionRef string + UpdatedAt string + type DisputeActionResponse struct + Message string + Status string + TicketID string + type DisputeEvidence struct + EvidenceURL string + FileName string + TicketID string + UploadedAt string + type DisputeListParams struct + EndDate string + Page int + PerPage int + StartDate string + Status string + type DisputeListResponse struct + Disputes []Dispute + Page int + PerPage int + Total int + type DisputeService struct + func (s *DisputeService) AcceptDispute(ctx context.Context, ticketID string) (*DisputeActionResponse, error) + func (s *DisputeService) All(ctx context.Context, params *DisputeListParams) *Iter[Dispute] + func (s *DisputeService) GetAllDisputes(ctx context.Context, params *DisputeListParams) (*DisputeListResponse, error) + func (s *DisputeService) GetDisputeDetail(ctx context.Context, ticketID string) (*Dispute, error) + func (s *DisputeService) GetDisputeEvidence(ctx context.Context, ticketID string) (*DisputeEvidence, error) + func (s *DisputeService) RejectDispute(ctx context.Context, ticketID string) (*DisputeActionResponse, error) + func (s *DisputeService) UploadEvidence(ctx context.Context, ticketID string, fileData []byte, fileName string) (*EvidenceUploadResponse, error) + type ElectricityBiller struct + BillerCode string + BillerName string + MeterTypes []string + type ElectricityBillersResponse struct + Billers []ElectricityBiller + type ElectricityResponse struct + ElectricityToken string + MeterNumber string + Units string + type Error struct + Code string + HTTPStatus int + Message string + Status int + func (e *Error) Error() string + func (e *Error) Is(target error) bool + type EventType string + const EventDisputeOpened + const EventDisputeResolved + const EventTransactionFailed + const EventTransactionSuccess + const EventTransferFailed + const EventTransferReversed + const EventTransferSuccess + const EventVirtualAccountCredit + type EvidenceUploadResponse struct + FileName string + Status string + TicketID string + UploadURL string + type FundsTransferParams struct + AccountName string + AccountNumber string + Amount int64 + BankCode string + Currency string + Remark string + TransactionRef string + type InitiatePaymentParams struct + Amount int64 + CallbackURL string + ChargeToken *ChargeToken + Currency string + CustomerName string + Email string + InitiatorCustomerID string + IsRecurring bool + Metadata map[string]any + PassCharge bool + PaymentChannels []string + PlanCode string + TransactionRef string + type InitiatePaymentResponse struct + AppliedFee float64 + CheckoutURL string + Currency string + MerchantAmount float64 + TotalAmount float64 + TransactionRef string + type IntraTransferParams struct + Amount int64 + Narration string + ReceiverIdentifier string + SenderIdentifier string + TransactionRef string + type Iter struct + func (i *Iter[T]) Err() error + func (i *Iter[T]) Item() T + func (i *Iter[T]) Next() bool + type Logger interface + Error func(msg string, fields ...any) + Info func(msg string, fields ...any) + func StdLogger() Logger + type MissedWebhookParams struct + Action string + Page int + PerPage int + type MissedWebhookResponse struct + Page int + PerPage int + Total int + Transactions []VerifyTransactionResponse + type Option func(*config) + func WithAfterResponse(fn func(*http.Request, *http.Response, time.Duration)) Option + func WithAutoIdempotency() Option + func WithBaseURL(url string) Option + func WithBeforeRequest(fn func(*http.Request)) Option + func WithHTTPClient(hc *http.Client) Option + func WithLogger(l Logger) Option + func WithProduction() Option + func WithSandbox() Option + func WithTimeout(d time.Duration) Option + func WithUserAgent(ua string) Option + type RefundTransactionParams struct + Amount int64 + GatewayTransactionRef string + RRN string + ReasonForRefund string + RefundType string + TransactionRef string + type RefundTransactionResponse struct + AmountRefunded int64 + GatewayRef string + RefundStatus string + TransactionRef string + type SMSResponse struct + MessageID string + Recipients []string + Status string + TransactionRef string + type SendSMSParams struct + Body string + From string + To []string + TransactionRef string + type SimulateResponse struct + Status string + TransactionRef string + type SimulateVirtualAccountParams struct + Amount float64 + VirtualAccountNumber string + type SubMerchant struct + AccountName string + AccountNumber string + BankCode string + BankName string + CreatedAt string + DisplayName string + Email string + ID string + MerchantID string + Status string + UpdatedAt string + type SubMerchantListParams struct + Page int + PerPage int + type SubMerchantListResponse struct + Merchants []SubMerchant + Page int + PerPage int + Total int + type SubMerchantService struct + func (s *SubMerchantService) All(ctx context.Context, params *SubMerchantListParams) *Iter[SubMerchant] + func (s *SubMerchantService) Create(ctx context.Context, params *CreateSubMerchantParams) (*SubMerchant, error) + func (s *SubMerchantService) Delete(ctx context.Context, merchantID string) (*DeleteSubMerchantResponse, error) + func (s *SubMerchantService) Get(ctx context.Context, merchantID string) (*SubMerchant, error) + func (s *SubMerchantService) List(ctx context.Context, params *SubMerchantListParams) (*SubMerchantListResponse, error) + type TransactionService struct + func (s *TransactionService) AllMissedWebhooks(ctx context.Context, params *MissedWebhookParams) *Iter[VerifyTransactionResponse] + func (s *TransactionService) GetMissedWebhookTransactions(ctx context.Context, params *MissedWebhookParams) (*MissedWebhookResponse, error) + func (s *TransactionService) GetUSSDbanks(ctx context.Context) (*USSDbanksResponse, error) + func (s *TransactionService) InitiatePayment(ctx context.Context, params *InitiatePaymentParams) (*InitiatePaymentResponse, error) + func (s *TransactionService) RefundTransaction(ctx context.Context, params *RefundTransactionParams) (*RefundTransactionResponse, error) + func (s *TransactionService) VerifyTransaction(ctx context.Context, transactionRef string) (*VerifyTransactionResponse, error) + type TransferListParams struct + EndDate string + Page int + PerPage int + StartDate string + Status string + type TransferListResponse struct + Page int + PerPage int + Total int + Transfers []TransferStatusResponse + type TransferResponse struct + AccountName string + AccountNumber string + Amount int64 + BankCode string + BankName string + CreatedAt string + Fee float64 + Status string + TransactionRef string + type TransferService struct + func (s *TransferService) AccountLookup(ctx context.Context, bankCode, accountNumber string) (*AccountLookupResponse, error) + func (s *TransferService) All(ctx context.Context, params *TransferListParams) *Iter[TransferStatusResponse] + func (s *TransferService) FundsTransfer(ctx context.Context, params *FundsTransferParams) (*TransferResponse, error) + func (s *TransferService) GetAllTransactions(ctx context.Context, params *TransferListParams) (*TransferListResponse, error) + func (s *TransferService) GetTransactionStatus(ctx context.Context, transactionRef string) (*TransferStatusResponse, error) + func (s *TransferService) IntraTransfer(ctx context.Context, params *IntraTransferParams) (*TransferResponse, error) + type TransferStatusResponse struct + Amount int64 + Fee float64 + ResponseCode string + ResponseMessage string + Status string + TransactionRef string + UpdatedAt string + type USSDBank struct + BankCode string + BankName string + USSD string + type USSDbanksResponse struct + Banks []USSDBank + type UpdateVirtualAccountParams struct + BVN string + CustomerIdentifier string + FirstName string + LastName string + MiddleName string + MobileNum string + type VASService struct + func (s *VASService) BuyAirtime(ctx context.Context, params *BuyAirtimeParams) (*VASTransactionResponse, error) + func (s *VASService) BuyCable(ctx context.Context, params *BuyCableParams) (*VASTransactionResponse, error) + func (s *VASService) BuyData(ctx context.Context, params *BuyDataParams) (*VASTransactionResponse, error) + func (s *VASService) BuyElectricity(ctx context.Context, params *BuyElectricityParams) (*ElectricityResponse, error) + func (s *VASService) GetCablePackages(ctx context.Context, cableProvider string) (*CablePackagesResponse, error) + func (s *VASService) GetDataPlans(ctx context.Context, networkProvider string) (*DataPlansResponse, error) + func (s *VASService) GetElectricityBillers(ctx context.Context) (*ElectricityBillersResponse, error) + func (s *VASService) SendSMS(ctx context.Context, params *SendSMSParams) (*SMSResponse, error) + type VASTransactionResponse struct + Amount int64 + CreatedAt string + Network string + PhoneNumber string + Status string + TransactionRef string + type VerifyTransactionResponse struct + Amount int64 + Channel string + ChargeToken *ChargeToken + CreatedAt string + Currency string + Customer CustomerInfo + Fee float64 + IsRecurring bool + Meta map[string]any + SettlementAmount float64 + Status string + TransactionRef string + UpdatedAt string + type VirtualAccount struct + BeneficiaryAccount string + CreatedAt string + CustomerIdentifier string + Email string + FirstName string + LastName string + MiddleName string + MobileNum string + UniqueID string + UpdatedAt string + VirtualAccountNumber string + type VirtualAccountService struct + func (s *VirtualAccountService) AllTransactions(ctx context.Context, customerIdentifier string, params *VirtualAccountTxParams) *Iter[VirtualAccountTransaction] + func (s *VirtualAccountService) Create(ctx context.Context, params *CreateVirtualAccountParams) (*VirtualAccount, error) + func (s *VirtualAccountService) GetTransactions(ctx context.Context, customerIdentifier string, params *VirtualAccountTxParams) (*VirtualAccountTxResponse, error) + func (s *VirtualAccountService) Query(ctx context.Context, virtualAccountNumber string) (*VirtualAccount, error) + func (s *VirtualAccountService) Simulate(ctx context.Context, params *SimulateVirtualAccountParams) (*SimulateResponse, error) + func (s *VirtualAccountService) Update(ctx context.Context, params *UpdateVirtualAccountParams) (*VirtualAccount, error) + type VirtualAccountTransaction struct + Amount int64 + CreatedAt string + Currency string + SenderAccountNumber string + SenderBank string + SenderName string + Status string + TransactionRef string + type VirtualAccountTxParams struct + Action string + EndDate string + Page int + PerPage int + StartDate string + type VirtualAccountTxResponse struct + Page int + PerPage int + Total int + Transactions []VirtualAccountTransaction + type WebhookDisputeBody struct + Amount int64 + CreatedAt string + Reason string + Status string + TicketID string + TransactionRef string + type WebhookEvent struct + Body json.RawMessage + Event EventType + func ParseWebhook(payload []byte, signature string, secret string) (*WebhookEvent, error) + func (e *WebhookEvent) ParseBody() (any, error) + type WebhookRouter struct + func NewWebhookRouter(secret string) *WebhookRouter + func (r *WebhookRouter) OnDisputeOpened(fn func(context.Context, *WebhookDisputeBody) error) *WebhookRouter + func (r *WebhookRouter) OnDisputeResolved(fn func(context.Context, *WebhookDisputeBody) error) *WebhookRouter + func (r *WebhookRouter) OnError(fn func(http.ResponseWriter, *http.Request, error)) *WebhookRouter + func (r *WebhookRouter) OnTransactionFailed(fn func(context.Context, *WebhookTransactionBody) error) *WebhookRouter + func (r *WebhookRouter) OnTransactionSuccess(fn func(context.Context, *WebhookTransactionBody) error) *WebhookRouter + func (r *WebhookRouter) OnTransferFailed(fn func(context.Context, *WebhookTransferBody) error) *WebhookRouter + func (r *WebhookRouter) OnTransferReversed(fn func(context.Context, *WebhookTransferBody) error) *WebhookRouter + func (r *WebhookRouter) OnTransferSuccess(fn func(context.Context, *WebhookTransferBody) error) *WebhookRouter + func (r *WebhookRouter) OnUnknown(fn func(context.Context, *WebhookEvent) error) *WebhookRouter + func (r *WebhookRouter) OnVirtualAccountCredit(fn func(context.Context, *WebhookVirtualAccountBody) error) *WebhookRouter + func (r *WebhookRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) + type WebhookTransactionBody struct + Amount int64 + Channel string + ChargeToken *ChargeToken + CreatedAt string + Currency string + CustomerEmail string + CustomerName string + GatewayRef string + IsRecurring bool + Meta map[string]any + Status string + TransactionRef string + type WebhookTransferBody struct + AccountName string + AccountNumber string + Amount int64 + BankCode string + CreatedAt string + Status string + TransactionRef string + type WebhookVirtualAccountBody struct + Amount int64 + CreatedAt string + Currency string + CustomerIdentifier string + SenderBank string + SenderName string + TransactionRef string + VirtualAccountNumber string