Documentation ¶
Index ¶
- func GetSuggestedAmount(operator *Operator, amount float64, tolerance float64) (float64, error)
- func GimmeString(i interface{}) (interface{}, error)
- func NormalizeNumber(number string) (string, error)
- func TestServer(handler func(http.ResponseWriter, *http.Request)) (*httptest.Server, *sling.Sling)
- func TestServerMux() (*httptest.Server, *http.ServeMux)
- type APIError
- type Country
- type Fx
- type JSTimestamp
- type OAuthRequest
- type Operator
- type OperatorsParams
- type RecipientPhone
- type ReloadlyError
- type SenderPhone
- type Service
- func (s *Service) Auth(clientId, clientSecret string) error
- func (s *Service) GetOAuthToken(clientId, clientSecret string) (*Token, error)
- func (s *Service) OperatorsAutoDetect(mobile, country string) (*Operator, error)
- func (s *Service) OperatorsByCountry(country string) ([]Operator, error)
- func (s *Service) ReAuth() error
- func (s *Service) Request(method, path string, params interface{}, resp interface{}) (*http.Response, error)
- func (s *Service) Sandbox()
- func (s *Service) SearchOperator(country, name string) (*Operator, error)
- func (s *Service) Topups() *TopupsService
- type SuggestedAmount
- type SuggestedAmountsMap
- type TestTransport
- type Timestamp
- type Token
- type TopupJob
- type TopupRequest
- type TopupResponse
- type TopupWorker
- type TopupWorkerResponse
- type TopupsService
- func (s *TopupsService) AutoDetect(country string) *TopupsService
- func (s *TopupsService) AutoFallback() *TopupsService
- func (s *TopupsService) FindOperator(country, name string) *TopupsService
- func (s *TopupsService) GetSetOperator() *Operator
- func (s *TopupsService) New() *TopupsService
- func (s *TopupsService) Operator(operator *Operator) *TopupsService
- func (s *TopupsService) SuggestedAmount(tolerance float64) *TopupsService
- func (s *TopupsService) Topup(mobile string, requested_amount float64) (*TopupResponse, error)
- type TransactionDate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSuggestedAmount ¶ added in v0.0.11
func GimmeString ¶ added in v0.0.9
func GimmeString(i interface{}) (interface{}, error)
func NormalizeNumber ¶ added in v0.0.11
func TestServer ¶
Types ¶
type APIError ¶
type APIError struct { ErrorCode string `json:"errorCode,omitempty"` Message string `json:"message,omitempty"` // TimeStamp *Timestamp `json:"timeStamp,omitempty"` InfoLink string `json:"infoLink,omitempty"` Path string `json:"path,omitempty"` StatusCode int `json:"statusCode,omitempty"` Details []map[string]string `json:"details,omitempty"` }
type JSTimestamp ¶
func (*JSTimestamp) UnmarshalJSON ¶
func (t *JSTimestamp) UnmarshalJSON(b []byte) error
type OAuthRequest ¶
type Operator ¶
type Operator struct { OperatorID int64 `json:"operatorId,omitempty"` Name string `json:"name,omitempty"` Bundle bool `json:"bundle,omitempty"` Data bool `json:"data,omitempty"` Pin bool `json:"pin,omitempty"` SupportsLocalAmounts bool `json:"supportsLocalAmounts,omitempty"` DenominationType string `json:"denominationType,omitempty"` SenderCurrencyCode string `json:"senderCurrencyCode,omitempty"` SenderCurrencySymbol string `json:"senderCurrencySymbol,omitempty"` DestinationCurrencyCode string `json:"destinationCurrencyCode,omitempty"` DestinationCurrencySymbol string `json:"destinationCurrencySymbol,omitempty"` Commission float64 `json:"commission,omitempty"` InternationalDiscount float64 `json:"internationalDiscount,omitempty"` LocalDiscount float64 `json:"localDiscount,omitempty"` MostPopularAmount float64 `json:"mostPopularAmount,omitempty"` MostPopularLocalAmount float64 `json:"mostPopularLocalAmount,omitempty"` MinAmount float64 `json:"minAmount,omitempty"` MaxAmount float64 `json:"maxAmount,omitempty"` LocalMinAmount float64 `json:"localMinAmount,omitempty"` LocalMaxAmount float64 `json:"localMaxAmount,omitempty"` Country Country `json:"country,omitempty"` Fx Fx `json:"fx,omitempty"` LogoUrls []string `json:"logoUrls,omitempty"` FixedAmounts []float64 `json:"fixedAmounts,omitempty"` // FixedAmountsDescriptions { // } `json:"fixedAmountsDescriptions,omitempty"` LocalFixedAmounts []float64 `json:"localFixedAmounts,omitempty"` // LocalFixedAmountsDescriptions struct { // } `json:"localFixedAmountsDescriptions,omitempty"` SuggestedAmounts []float64 `json:"suggestedAmounts,omitempty"` SuggestedAmountsMap SuggestedAmountsMap `json:"suggestedAmountsMap,omitempty"` }
type OperatorsParams ¶
type RecipientPhone ¶
type ReloadlyError ¶
func (ReloadlyError) Error ¶
func (e ReloadlyError) Error() string
type SenderPhone ¶
type Service ¶
type Service struct { Client *http.Client BaseUrl string AuthUrl string Token *Token // contains filtered or unexported fields }
func (*Service) GetOAuthToken ¶
func (*Service) OperatorsAutoDetect ¶
func (*Service) OperatorsByCountry ¶
func (*Service) SearchOperator ¶
func (*Service) Topups ¶ added in v0.0.6
func (s *Service) Topups() *TopupsService
type SuggestedAmount ¶
type SuggestedAmountsMap ¶
type SuggestedAmountsMap []SuggestedAmount
func (*SuggestedAmountsMap) UnmarshalJSON ¶
func (s *SuggestedAmountsMap) UnmarshalJSON(b []byte) error
type TestTransport ¶
type Timestamp ¶
func (*Timestamp) UnmarshalJSON ¶
type TopupJob ¶ added in v0.0.7
type TopupJob struct { Number string `csv:"number" json:"number" validate:"required"` Amount float64 `csv:"amount" json:"amount" validate:"required"` Country string `csv:"country" json:"country" validate:"required"` Tolerance float64 `csv:"tolerance,omitempty" json:"tolerance,omitempty"` Operator string `csv:"operator,omitempty" json:"operator,omitempty"` ID string `csv:"id,omitempty" json:"id,omitempty"` }
func (*TopupJob) UnmarshalJSON ¶ added in v0.0.9
type TopupRequest ¶
type TopupRequest struct { RecipientPhone *RecipientPhone `json:"recipientPhone,omitempty"` SenderPhone *SenderPhone `json:"senderPhone,omitempty"` OperatorID int64 `json:"operatorId,omitempty"` Amount float64 `json:"amount,omitempty"` CustomIdentifier string `json:"customIdentifier,omitempty"` }
type TopupResponse ¶
type TopupResponse struct { TransactionID int64 `csv:"transactionId" json:"transactionId,omitempty"` OperatorTransactionID string `csv:"operatorTransactionId" json:"operatorTransactionId,omitempty"` CustomIdentifier string `csv:"customIdentifier" json:"customIdentifier,omitempty"` RecipientPhone string `csv:"recipientPhone" json:"recipientPhone,omitempty"` RecipientEmail string `csv:"recipientEmail" json:"recipientEmail,omitempty"` SenderPhone string `csv:"senderPhone" json:"senderPhone,omitempty"` CountryCode string `csv:"countryCode" json:"countryCode,omitempty"` OperatorID int64 `csv:"operatorId" json:"operatorId,omitempty"` OperatorName string `csv:"operatorName" json:"operatorName,omitempty"` Discount float64 `csv:"discount" json:"discount,omitempty"` DiscountCurrencyCode string `csv:"discountCurrencyCode" json:"discountCurrencyCode,omitempty"` RequestedAmount float64 `csv:"requestedAmount" json:"requestedAmount,omitempty"` RequestedAmountCurrencyCode string `csv:"requestedAmountCurrencyCode" json:"requestedAmountCurrencyCode,omitempty"` DeliveredAmount float64 `csv:"deliveredAmount" json:"deliveredAmount,omitempty"` DeliveredAmountCurrencyCode string `csv:"deliveredAmountCurrencyCode" json:"deliveredAmountCurrencyCode,omitempty"` TransactionDate *TransactionDate `csv:"transactionDate" json:"transactionDate,omitempty"` }
type TopupWorker ¶ added in v0.0.6
type TopupWorker Service
func (*TopupWorker) Do ¶ added in v0.0.7
func (t *TopupWorker) Do(d *TopupJob) *TopupWorkerResponse
func (*TopupWorker) DoJob ¶ added in v0.0.7
func (t *TopupWorker) DoJob(d *TopupJob) (*TopupResponse, error)
func (*TopupWorker) Work ¶ added in v0.0.6
func (t *TopupWorker) Work(i interface{}) interface{}
type TopupWorkerResponse ¶ added in v0.0.7
type TopupWorkerResponse struct { *TopupResponse ErrorMessage string `csv:"errrorMessage" json:"errorMessage,omitempty"` ErrorCode string `csv:"errorCode" json:"errorCode,omitempty"` }
func (*TopupWorkerResponse) SetError ¶ added in v0.0.7
func (r *TopupWorkerResponse) SetError(err error) *TopupWorkerResponse
type TopupsService ¶ added in v0.0.6
type TopupsService struct { *Service // contains filtered or unexported fields }
func (*TopupsService) AutoDetect ¶ added in v0.0.6
func (s *TopupsService) AutoDetect(country string) *TopupsService
func (*TopupsService) AutoFallback ¶ added in v0.0.6
func (s *TopupsService) AutoFallback() *TopupsService
func (*TopupsService) FindOperator ¶ added in v0.0.6
func (s *TopupsService) FindOperator(country, name string) *TopupsService
func (*TopupsService) GetSetOperator ¶ added in v0.0.6
func (s *TopupsService) GetSetOperator() *Operator
func (*TopupsService) New ¶ added in v0.0.6
func (s *TopupsService) New() *TopupsService
func (*TopupsService) Operator ¶ added in v0.0.6
func (s *TopupsService) Operator(operator *Operator) *TopupsService
func (*TopupsService) SuggestedAmount ¶ added in v0.0.6
func (s *TopupsService) SuggestedAmount(tolerance float64) *TopupsService
func (*TopupsService) Topup ¶ added in v0.0.6
func (s *TopupsService) Topup(mobile string, requested_amount float64) (*TopupResponse, error)
type TransactionDate ¶ added in v0.0.7
func (*TransactionDate) MarshalCSV ¶ added in v0.0.7
func (t *TransactionDate) MarshalCSV() ([]byte, error)
func (*TransactionDate) MarshalJSON ¶ added in v0.0.7
func (t *TransactionDate) MarshalJSON() ([]byte, error)
func (*TransactionDate) UnmarshalJSON ¶ added in v0.0.7
func (t *TransactionDate) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.