Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
func NewService(httpClient *http.Client, httpRetries *httpx.RetryConfig, key, secret string) flows.AirtimeService
NewService creates a new DTOne airtime service
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a DTOne client, see https://dvs-api-doc.dtone.com/ for API docs
func (*Client) LookupMobileNumber ¶ added in v0.114.0
LookupMobileNumber see https://dvs-api-doc.dtone.com/#tag/Mobile-Number
func (*Client) Products ¶ added in v0.114.0
Products see https://dvs-api-doc.dtone.com/#tag/Products
func (*Client) TransactionSync ¶ added in v0.114.0
func (c *Client) TransactionSync(externalID string, productID int, mobileNumber string) (*Transaction, *httpx.Trace, error)
TransactionSync see https://dvs-api-doc.dtone.com/#tag/Transactions
type Operator ¶ added in v0.114.0
type Operator struct { ID int `json:"id"` Name string `json:"name"` Country struct { Name string `json:"name"` ISOCode string `json:"iso_code"` Regions []struct { Name string `json:"name"` Code string `json:"code"` } `json:"regions"` } `json:"country"` Identified bool `json:"identified"` }
Operator is a mobile operator
type Product ¶ added in v0.114.0
type Product struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Service struct { ID int `json:"id"` Name string `json:"name"` } `json:"service"` Operator struct { ID int `json:"id"` Name string `json:"name"` } `json:"operator"` Type string `json:"type"` Source struct { Amount decimal.Decimal `json:"amount"` Unit string `json:"unit"` UnitType string `json:"unit_type"` } `json:"source"` Destination struct { Amount decimal.Decimal `json:"amount"` Unit string `json:"unit"` UnitType string `json:"unit_type"` } `json:"destination"` }
Product is an available digital services product
type StatusCID ¶ added in v0.115.2
type StatusCID int
const ( // see https://dvs-api-doc.dtone.com/#section/Overview/Transactions StatusCIDCreated StatusCID = 1 StatusCIDConfirmed StatusCID = 2 StatusCIDRejected StatusCID = 3 StatusCIDCancelled StatusCID = 4 StatusCIDSubmitted StatusCID = 5 StatusCIDCompleted StatusCID = 7 StatusCIDReversed StatusCID = 8 StatusCIDDeclined StatusCID = 9 )
type Transaction ¶ added in v0.114.0
type Transaction struct { ID int64 `json:"id"` ExternalID string `json:"external_id"` CreationDate string `json:"creation_date"` ConfirmationExpirationDate string `json:"confirmation_expiration_date"` ConfirmationDate string `json:"confirmation_date"` Status struct { ID int `json:"id"` Message string `json:"message"` Class struct { ID StatusCID `json:"id"` Message string `json:"message"` } } `json:"status"` }
Transaction is a product sent to a beneficiary
Click to show internal directories.
Click to hide internal directories.