Documentation ¶
Index ¶
- Constants
- Variables
- func DrHandler(w http.ResponseWriter, r *http.Request)
- func GetBoolFromMaybeValue(rawVal interface{}) (bool, error)
- func IsUnknownValueMatch(rawVal interface{}) bool
- func MoHandler(w http.ResponseWriter, r *http.Request)
- func Output(content OutputFormat, formatType string) (string, error)
- func StartMockDrMoHandler(port int)
- type ApiError
- type ApiParams
- type AvParams
- type ChargeMobileParams
- type ChargeMobileResponse
- type ChargeMobileResponseWrapper
- type Client
- func (client *Client) AdultVerify(ctx context.Context, avParams *AvParams) (*SuccessAvResponse, error)
- func (client *Client) AvSolo(ctx context.Context, avParams *AvParams) (*SuccessAvSoloResponse, error)
- func (client *Client) ChargeMobile(ctx context.Context, chargeParams *ChargeMobileParams) (*ChargeMobileResponse, error)
- func (client *Client) ChargeSms(ctx context.Context, smsParams *SmsParams) (*SuccessChargeResponse, error)
- func (client *Client) KycSolo(ctx context.Context, kycParams *KycSoloParams) (*KycSoloResponseWrapper, error)
- func (client *Client) OperatorLookup(ctx context.Context, oplkParams *OperatorLookupParams) (*SuccessOperatorLookupResponse, error)
- func (client *Client) Refund(ctx context.Context, refundParams *RefundParams) (*RefundResponse, error)
- func (client *Client) SendBinSms(ctx context.Context, smsParams *SmsBinParams) (*SuccessResponse, error)
- func (client *Client) SendSms(ctx context.Context, smsParams *SmsParams) (*SuccessResponse, error)
- func (client *Client) SendWapPush(ctx context.Context, smsParams *SmsWapParams) (*SuccessWapResponse, error)
- func (c *Client) SetBaseAvSoloURL(baseAvSoloURL string) *Client
- func (c *Client) SetBaseKycSoloURL(baseKycSoloURL string) *Client
- func (c *Client) SetBaseRefundURL(baseRefundURL string) *Client
- func (c *Client) SetBaseURL(baseURL string) *Client
- func (c *Client) SetHttpClient(httpClient *http.Client) *Client
- type KycSoloParams
- type KycSoloResponseWrapper
- type OperatorLookupParams
- type OutputFormat
- type RefundParams
- type RefundResponse
- type RefundResponseWrapper
- type SmsBinParams
- type SmsParams
- type SmsWapParams
- type SuccessAvResponse
- type SuccessAvResponseWrapper
- type SuccessAvSoloResponse
- type SuccessAvSoloResponseWrapper
- type SuccessChargeResponse
- type SuccessChargeResponseWrapper
- type SuccessKycSoloResponse
- type SuccessOperatorLookupResponse
- type SuccessOperatorLookupResponseWrapper
- type SuccessResponse
- type SuccessResponseWrapper
- type SuccessWapResponse
- type SuccessWapResponseWrapper
Constants ¶
View Source
const ( AV_VERIFIED = "verified" AV_NOT_VERIFIED = "no_verified" AV_UNKNOWN = "unknown" AV_PENDING = "pending" )
View Source
const ( DEFAULT_URL = "https://sonar.fonix.io" DEFAULT_URL_AVSOLO = "https://avsolo.fonix.io" DEFAULT_URL_KYCSOLO = "https://kycsolo.fonix.io" DEFAULT_URL_REFUND = "https://refund.fonix.io" V2_SENDSMS = "v2/sendsms" V2_SENDSMSBIN = "v2/sendbinsms" V2_CHARGESMS = "v2/chargesms" V2_SENDWAPPUSH = "v2/sendwappush" V2_ADULTVERIFY = "v2/adultverify" V2_OPERATORLOOKUP = "v2/operator_lookup" V2_AVSOLO = "v2/avsolo" V2_KYCSOLO = "v2/kyc" V2_REFUND = "v2/refund" V2_CHARGEMOBILE = "v2/chargemobile" )
View Source
const ( DEFAULT_MO_PATH = "/mock/mosms" DEFAULT_DR_PATH = "/mock/drs" )
View Source
const ( REFUND_SUCCESS = "success" REFUND_FAILURE = "failure" REFUND_PENDING = "pending" )
View Source
const (
VERSION = "0.1.0"
)
Variables ¶
View Source
var ( //default timeout for requests is 15 seconds, can be changed by using custom http client // or you can change it via this VAr before creation of client. CLIENT_TIMEOUT = 15 * time.Second )
View Source
var (
ErrUnknownValue = errors.New("unknown value")
)
Functions ¶
func GetBoolFromMaybeValue ¶ added in v0.0.4
func IsUnknownValueMatch ¶ added in v0.0.4
func IsUnknownValueMatch(rawVal interface{}) bool
func StartMockDrMoHandler ¶ added in v0.0.6
func StartMockDrMoHandler(port int)
Types ¶
type ChargeMobileParams ¶ added in v0.0.9
type ChargeMobileParams struct { Numbers string Amount int Currency string RequestID string ChargeDescription string TimeToLive int ChargeSilent string //default to "no" Body string Dummy string SmsFallback string // only include if "yes" }
func (*ChargeMobileParams) ToParams ¶ added in v0.0.9
func (chargeParams *ChargeMobileParams) ToParams() string
type ChargeMobileResponse ¶ added in v0.0.9
type ChargeMobileResponse struct { TxGuid string `json:"txguid"` Numbers string `json:"numbers"` Encoding string `json:"encoding"` }
func (*ChargeMobileResponse) ToConsole ¶ added in v0.0.9
func (sr *ChargeMobileResponse) ToConsole() string
type ChargeMobileResponseWrapper ¶ added in v0.0.9
type ChargeMobileResponseWrapper struct {
Success *ChargeMobileResponse `json:"success"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AdultVerify ¶
func (*Client) ChargeMobile ¶ added in v0.0.9
func (client *Client) ChargeMobile(ctx context.Context, chargeParams *ChargeMobileParams) (*ChargeMobileResponse, error)
func (*Client) KycSolo ¶ added in v0.0.4
func (client *Client) KycSolo(ctx context.Context, kycParams *KycSoloParams) (*KycSoloResponseWrapper, error)
func (*Client) OperatorLookup ¶
func (client *Client) OperatorLookup(ctx context.Context, oplkParams *OperatorLookupParams) (*SuccessOperatorLookupResponse, error)
func (*Client) Refund ¶ added in v0.0.8
func (client *Client) Refund(ctx context.Context, refundParams *RefundParams) (*RefundResponse, error)
func (*Client) SendBinSms ¶
func (client *Client) SendBinSms(ctx context.Context, smsParams *SmsBinParams) (*SuccessResponse, error)
func (*Client) SendWapPush ¶
func (client *Client) SendWapPush(ctx context.Context, smsParams *SmsWapParams) (*SuccessWapResponse, error)
func (*Client) SetBaseAvSoloURL ¶ added in v0.0.3
func (*Client) SetBaseKycSoloURL ¶ added in v0.0.4
func (*Client) SetBaseRefundURL ¶ added in v0.0.8
type KycSoloParams ¶ added in v0.0.4
type KycSoloParams struct { Name string Surname string Number string HouseNumber string PostCode string DOB string RequestID string Dummy string }
func (*KycSoloParams) ToParams ¶ added in v0.0.4
func (kycParams *KycSoloParams) ToParams() string
type KycSoloResponseWrapper ¶ added in v0.0.4
type KycSoloResponseWrapper struct { CompletedData *SuccessKycSoloResponse `json:"completed"` PendingData *errorResponseContent `json:"pending"` }
type OperatorLookupParams ¶
func (*OperatorLookupParams) ToParams ¶
func (oplkParams *OperatorLookupParams) ToParams() string
type OutputFormat ¶ added in v0.0.5
type OutputFormat interface { //ToConsole(color bool) string ToConsole() string }
type RefundParams ¶ added in v0.0.8
func (*RefundParams) ToParams ¶ added in v0.0.8
func (refundParams *RefundParams) ToParams() string
type RefundResponse ¶ added in v0.0.8
type RefundResponse struct { Status string IfVersion string `json:"ifversion"` StatusCode string `json:"statuscode"` StatusText string `json:"statustext"` Guid string `json:"guid"` RequestID string `json:"requestid"` ChargeGuid string `json:"charge_guid"` RefundTime string `json:"refund_time"` RefundAmountInPence int `json:"refunded_amount_in_pence"` }
func (*RefundResponse) ToConsole ¶ added in v0.0.8
func (sr *RefundResponse) ToConsole() string
type RefundResponseWrapper ¶ added in v0.0.8
type RefundResponseWrapper struct { Success *RefundResponse `json:"success"` Failure *RefundResponse `json:"failure"` Pending *RefundResponse `json:"pending"` }
type SmsBinParams ¶
type SmsBinParams struct { Originator string Numbers string BinBody string Dummy string RequestID string }
func (*SmsBinParams) ToParams ¶
func (smsParams *SmsBinParams) ToParams() string
type SmsParams ¶
type SmsWapParams ¶
type SmsWapParams struct { Originator string Numbers string PushTitle string PushLink string Dummy string RequestID string }
func (*SmsWapParams) ToParams ¶
func (smsParams *SmsWapParams) ToParams() string
type SuccessAvResponse ¶
func (*SuccessAvResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessAvResponse) ToConsole() string
type SuccessAvResponseWrapper ¶
type SuccessAvResponseWrapper struct {
SuccessData SuccessAvResponse `json:"success"`
}
type SuccessAvSoloResponse ¶
type SuccessAvSoloResponse struct { Status string IfVersion string `json:"ifversion"` Operator string `json:"operator"` Guid string `json:"guid"` }
func (*SuccessAvSoloResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessAvSoloResponse) ToConsole() string
type SuccessAvSoloResponseWrapper ¶
type SuccessAvSoloResponseWrapper struct { VerifiedData *SuccessAvSoloResponse `json:"verified"` NotVerifiedData *SuccessAvSoloResponse `json:"not_verified"` UnknownData *SuccessAvSoloResponse `json:"unknown"` PendingData *SuccessAvSoloResponse `json:"pending"` }
type SuccessChargeResponse ¶
type SuccessChargeResponse struct { TxGuid string `json:"txguid"` Numbers string `json:"numbers"` Price string `json:"price"` Encoding string `json:"encoding"` }
func (*SuccessChargeResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessChargeResponse) ToConsole() string
type SuccessChargeResponseWrapper ¶
type SuccessChargeResponseWrapper struct {
SuccessData SuccessChargeResponse `json:"success"`
}
type SuccessKycSoloResponse ¶ added in v0.0.4
type SuccessKycSoloResponse struct { Guid string `json:"guid"` IfVersion string `json:"ifversion"` StatusCode string `json:"statuscode"` StatusText string `json:"statustext"` RequestID string `json:"requestid"` StatusTime string `json:"status_time"` FirstNameMatch interface{} `json:"first_name_match"` // match fields and is_Stole are weird string or bool types LastNameMatch interface{} `json:"last_name_match"` // this means end client needs to do a cast and see FullNameMatch interface{} `json:"full_name_match"` PostCodeMatch interface{} `json:"postcode_match"` HouseMatch interface{} `json:"house_match"` FullAddressMatch interface{} `json:"full_address_match"` BirthdayMatch interface{} `json:"birthday_match"` IsStolen interface{} `json:"is_stolen"` ContractType string `json:"contract_type"` }
type SuccessOperatorLookupResponse ¶
type SuccessOperatorLookupResponse struct { Mnc string `json:"mnc"` Mcc string `json:"mcc"` Operator string `json:"operator"` }
func (*SuccessOperatorLookupResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessOperatorLookupResponse) ToConsole() string
type SuccessOperatorLookupResponseWrapper ¶
type SuccessOperatorLookupResponseWrapper struct {
SuccessData SuccessOperatorLookupResponse `json:"success"`
}
type SuccessResponse ¶
type SuccessResponse struct { TxGuid string `json:"txguid"` Numbers string `json:"numbers"` SmsParts string `json:"smsparts"` Encoding string `json:"encoding"` }
func (*SuccessResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessResponse) ToConsole() string
type SuccessResponseWrapper ¶
type SuccessResponseWrapper struct {
SuccessData SuccessResponse `json:"success"`
}
type SuccessWapResponse ¶
type SuccessWapResponse struct { TxGuid string `json:"txguid"` Numbers string `json:"numbers"` SmsParts string `json:"smsparts"` }
func (*SuccessWapResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessWapResponse) ToConsole() string
type SuccessWapResponseWrapper ¶
type SuccessWapResponseWrapper struct {
SuccessData SuccessWapResponse `json:"success"`
}
Click to show internal directories.
Click to hide internal directories.