Documentation
¶
Index ¶
- type AccountDetails
- type AccountResponse
- type Client
- type Customer
- type InitializeTransactionInput
- type Logger
- type Metadata
- type Response
- type TransactionInput
- type TransactionService
- type TransferRequest
- type TransferResponse
- type TransferService
- type VirtualAccountRequest
- type VirtualAccountResponse
- type VirtualAccountService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountDetails ¶ added in v0.1.1
type AccountResponse ¶ added in v0.1.1
type Client ¶
type Client struct {
// Services supported by the Sarepay API.
// Miscellaneous actions are directly implemented on the Client object
Transaction *TransactionService
VirtualAccount *VirtualAccountService
Transfer *TransferService
LoggingEnabled bool
Log Logger
// contains filtered or unexported fields
}
Client manages communication with the Sarepay API
type InitializeTransactionInput ¶
type InitializeTransactionInput struct {
Key string `json:"key,omitempty"`
Token string `json:"token,omitempty"`
Amount int `json:"amount,omitempty"`
Currency string `json:"currency,omitempty"`
FeeBearer string `json:"feeBearer,omitempty"`
DefaultPaymentMethod string `json:"defaultPaymentMethod"`
PaymentMethods []string `json:"paymentMethods,omitempty"`
Customer Customer `json:"customer,omitempty"`
ContainerID string `json:"containerId,omitempty"`
Metadata Metadata `json:"metadata"`
Reference string `json:"reference,omitempty"`
}
type Logger ¶
type Logger interface {
Printf(format string, v ...interface{})
}
Logger interface for custom loggers
type TransactionInput ¶
type TransactionService ¶
type TransactionService service
TransactionService handles operations related to transactions For more details see
func (*TransactionService) Initialize ¶
func (s *TransactionService) Initialize(txn *TransactionInput) (Response, error)
Initialize initiates a transaction process For more details see https://documenter.getpostman.com/view/28866628/2s9Y5bRh7W#678924c7-250b-460b-b870-8dbd68c4de16
type TransferRequest ¶ added in v0.1.1
type TransferResponse ¶ added in v0.1.1
type TransferResponse struct {
Success bool `json:"success"`
Data struct {
Reference string `json:"reference"`
Amount string `json:"amount"`
Charge string `json:"charge"`
Status string `json:"status"`
RecipientName string `json:"recipient_name"`
RecipientBankCode string `json:"recipient_bank_code"`
RecipientAccountNumber string `json:"recipient_account_number"`
ProcessorReference *string `json:"processor_reference"` // Use *string to handle null values
MerchantReference string `json:"merchant_reference"`
} `json:"data"`
Message string `json:"message"`
}
type TransferService ¶ added in v0.1.1
type TransferService service
func (*TransferService) AccountLookup ¶ added in v0.1.1
func (s *TransferService) AccountLookup(txn *AccountDetails) (AccountResponse, error)
Account Lookup
func (*TransferService) ProcessTransfer ¶ added in v0.1.1
func (s *TransferService) ProcessTransfer(txn *TransferRequest) (TransferResponse, error)
Process Transfer For more details see https://documenter.getpostman.com/view/28866628/2s9Y5bRh7W#678924c7-250b-460b-b870-8dbd68c4de16
func (*TransferService) VerifyTransfer ¶ added in v0.1.1
func (s *TransferService) VerifyTransfer(reference string) (TransferResponse, error)
Verify Transfer
type VirtualAccountRequest ¶ added in v0.1.1
type VirtualAccountRequest struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
OtherName string `json:"other_name"`
Bvn string `json:"bvn"`
Dob string `json:"dob"`
PhoneNumber string `json:"phone_number"`
BusinessType string `json:"business_type"`
Type string `json:"type"`
Currency string `json:"currency"`
}
type VirtualAccountResponse ¶ added in v0.1.1
type VirtualAccountResponse struct {
Data struct {
AccountNumber string `json:"account_number"`
AccountName string `json:"account_name"`
AccountReference string `json:"account_reference"`
Bank string `json:"bank"`
Status string `json:"status"`
Type string `json:"type"`
ExpiresAt string `json:"expires_at"`
ValidityType string `json:"validity_type"`
} `json:"data"`
}
type VirtualAccountService ¶ added in v0.1.1
type VirtualAccountService service
func (*VirtualAccountService) GeneratePermanentAccount ¶ added in v0.1.1
func (s *VirtualAccountService) GeneratePermanentAccount(txn *VirtualAccountRequest) (VirtualAccountResponse, error)
Generates virtual account number For more details see https://documenter.getpostman.com/view/28866628/2s9Y5bRh7W#678924c7-250b-460b-b870-8dbd68c4de16