Documentation ¶
Index ¶
- Constants
- func PointerToString(input *string) string
- func StringToPointer(input string) *string
- type AccountBalance
- type AccountBalanceResponse
- type AirtimeResponse
- type AirtimeTransaction
- type AirtimeTransferParams
- type BillAmountResponse
- type BillPayParams
- type BillPayResponse
- type BillSMS
- type BillTransaction
- type Biller
- type Client
- type Mode
- type Option
- type Response
Constants ¶
const ( // ModeCash payment from agent partner account ModeCash = Mode("cash") // ModeMoney send payment request ModeMoney = Mode("money") // ModeAccount make payment operation from afrikpay client ModeAccount = Mode("account") )
const ( // BillerEneoPostpay is used for postpaid bills of ENEO BillerEneoPostpay = Biller("eneopostpay") // BillerEneoPrepay is used for postpaid bills of ENEO BillerEneoPrepay = Biller("eneoprepay") // BillerCamwater is used for postpaid bills of Cameroon Water Corporation BillerCamwater = Biller("camwater") // BillerCanal is used for canal+ subscriptions BillerCanal = Biller("canal") // BillerUDS is used for bills of the University of Dschang BillerUDS = Biller("uds") )
const ( // BillSMSEnabled means you will receive a notification via SMS BillSMSEnabled = BillSMS("yes") // BillSMSDisabled means you will not receive a notification via SMS BillSMSDisabled = BillSMS("no") )
Variables ¶
This section is empty.
Functions ¶
func PointerToString ¶ added in v0.0.3
PointerToString converts a string to *string
func StringToPointer ¶ added in v0.0.3
StringToPointer converts a string to *string
Types ¶
type AccountBalance ¶ added in v0.0.2
type AccountBalance struct { Name string `json:"name"` MainBalance string `json:"mainbalance"` MainDeposit string `json:"maindeposit"` }
AccountBalance contains details about the account
type AccountBalanceResponse ¶ added in v0.0.2
type AccountBalanceResponse struct { Code int `json:"code"` Message string `json:"message"` Result *AccountBalance `json:"result,omitempty"` }
AccountBalanceResponse is the response when querying the account balance
func (AccountBalanceResponse) IsSuccessfull ¶ added in v0.0.2
func (response AccountBalanceResponse) IsSuccessfull() bool
IsSuccessfull determines if the transaction was successful
type AirtimeResponse ¶
type AirtimeResponse struct { Code int `json:"code"` Message string `json:"message"` Result *AirtimeTransaction `json:"result,omitempty"` }
AirtimeResponse is returned from airtime api requests
func (AirtimeResponse) IsSuccessful ¶ added in v0.0.3
func (response AirtimeResponse) IsSuccessful() bool
IsSuccessful determines if the transaction was successful
type AirtimeTransaction ¶
type AirtimeTransaction struct { OperatorID string `json:"operatorid"` TransactionID string `json:"txnid"` Status string `json:"status"` Date string `json:"date"` Ticket interface{} `json:"ticket,omitempty"` ReferenceID string `json:"referenceid"` ProcessingNumber string `json:"processingnumber"` }
AirtimeTransaction is the details for an aitime transaction
type AirtimeTransferParams ¶
type AirtimeTransferParams struct { Operator string PhoneNumber string PurchaseReference string Amount string Mode Mode }
AirtimeTransferParams parameters for airtime transfer request
type BillAmountResponse ¶ added in v0.0.4
type BillAmountResponse struct { Code int `json:"code"` Message string `json:"message"` Result *int `json:"result,omitempty"` }
BillAmountResponse is returned from bill amount api requests
func (BillAmountResponse) IsSuccessful ¶ added in v0.0.4
func (response BillAmountResponse) IsSuccessful() bool
IsSuccessful determines if the transaction was successful
type BillPayParams ¶ added in v0.0.3
type BillPayParams struct { Biller Biller BillID string Mode Mode Amount *string Provider *string Account *string Mobile *string Code *string SMS *BillSMS ProcessingNumber *string }
BillPayParams parameters for bill payment request
type BillPayResponse ¶ added in v0.0.4
type BillPayResponse struct { Code int `json:"code"` Message string `json:"message"` Result *BillTransaction `json:"result,omitempty"` }
BillPayResponse is returned from bill pay/status api requests
func (BillPayResponse) IsPending ¶ added in v0.0.6
func (response BillPayResponse) IsPending() bool
IsPending determines if the transaction is pending
func (BillPayResponse) IsSuccessful ¶ added in v0.0.4
func (response BillPayResponse) IsSuccessful() bool
IsSuccessful determines if the transaction was successful
type BillSMS ¶ added in v0.0.3
type BillSMS string
BillSMS determines if we want to receive a notification via SMS
type BillTransaction ¶ added in v0.0.3
type BillTransaction struct { OperatorID *string `json:"operatorid"` TransactionID string `json:"txnid"` Status string `json:"status"` Date string `json:"date"` ReferenceID interface{} `json:"referenceid"` ProcessingNumber string `json:"processingnumber"` }
BillTransaction is the details for a bill payment transaction
type Client ¶
type Client struct { Airtime *airtimeService Account *accountService Bill *billService // contains filtered or unexported fields }
Client is the afrikpay API client. Do not instantiate this client with Client{}. Use the New method instead.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is options for constructing a client
func WithAgentID ¶
WithAgentID sets the Agent ID for api calls
func WithAgentPassword ¶
WithAgentPassword sets the agent password
func WithAgentPlatform ¶
WithAgentPlatform sets the agent platform
func WithBaseURL ¶
WithBaseURL set's the base url for the afrikpay API
func WithHTTPClient ¶
WithHTTPClient sets the underlying HTTP client used for API requests. By default, http.DefaultClient is used.