airtime

package
v0.0.0-...-94a151a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AirtimeResponse

type AirtimeResponse struct {
	NumSent       int     `json:"numSent"`
	TotalAmount   string  `json:"totalAmount"`
	TotalDiscount string  `json:"totalDiscount"`
	ErrorMessage  string  `json:"errorMessage"`
	Responses     []Entry `json:"responses"`
}

AirtimeResponse is the response from the api

type Entry

type Entry struct {
	ErrorMessage string `json:"errorMessage"`
	PhoneNumber  string `json:"phoneNumber"`
	Amount       string `json:"amount"`
	Discount     string `json:"discount"`
	Status       string `json:"status"`
	RequestID    string `json:"requestId"`
}

Entry is the entry for each airtime response

type Service

type Service struct {
	Username string
	APIKey   string
	Env      string
}

Service is the airtime service

func NewService

func NewService(username, apiKey, env string) Service

NewService returns a new service

func (Service) Send

func (service Service) Send(phoneNumber, amount string) (*AirtimeResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL