Documentation
¶
Index ¶
- Constants
- type CitcallAsyncMiscallOtpRequest
- type CitcallMiscallOtpResponse
- type CitcallSmsOtpRequest
- type CitcallSmsOtpResponse
- type CitcallSmsOtpVerifyRequest
- type CitcallSmsOtpVerifyResponse
- type CitcallSmsRequest
- type CitcallSmsResponse
- type Client
- type EnvironmentType
- type FlexInt
- type SmsGateway
- func (gateway *SmsGateway) RequestMiscallOtp(req *CitcallAsyncMiscallOtpRequest) (response *CitcallMiscallOtpResponse, err error)
- func (gateway *SmsGateway) SendSms(req *CitcallSmsRequest) (response *CitcallSmsResponse, err error)
- func (gateway *SmsGateway) SendSmsOtp(req *CitcallSmsOtpRequest) (response *CitcallSmsOtpResponse, err error)
- func (gateway *SmsGateway) VerifySmsOtp(req *CitcallSmsOtpVerifyRequest) (response *CitcallSmsOtpVerifyResponse, err error)
Constants ¶
const ( CitcallOK = 0 CitcallWrongMethod = 99 CitcallAuthorizationFailed = 98 CitcallMissingParameter = 88 CitcallUserIDNotFound = 77 CitcallSenderIDClosed = 44 CitcallUnknownErrorOrFailed = 6 CitcallWrongPassword = 76 CitcallMaintenanceInProgress = 66 CitcallInsufficientAmount = 14 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CitcallAsyncMiscallOtpRequest ¶ added in v1.1.0
type CitcallAsyncMiscallOtpRequest struct {
MSISDN string `json:"msisdn"`
Gateway int `json:"gateway"`
ValidTime int `json:"valid_time"`
LimitTry int `json:"limit_try"`
}
CitcallAsyncMiscallOtpRequest cicall async miscall request
type CitcallMiscallOtpResponse ¶ added in v1.1.0
type CitcallMiscallOtpResponse struct {
ResponseCode FlexInt `json:"rc"`
TrxID string `json:"trxid"`
MSISDN string `json:"msisdn"`
Token string `json:"token"`
Gateway int `json:"gateway"`
ErrorStatus bool `json:"-"`
}
CitcallMiscallOtpResponse citcall MISCALLOTP Response
func (CitcallMiscallOtpResponse) Error ¶ added in v1.1.0
func (e CitcallMiscallOtpResponse) Error() string
type CitcallSmsOtpRequest ¶
type CitcallSmsOtpRequest struct {
SenderID string `json:"senderid"`
MSISDN string `json:"msisdn"`
Text string `json:"text"`
Token string `json:"token"`
ValidTime int `json:"valid_time"`
LimitTry int `json:"limit_try"`
}
CitcallSmsOtpRequest citcall SMSOTP Request
type CitcallSmsOtpResponse ¶
type CitcallSmsOtpResponse struct {
ResponseCode FlexInt `json:"rc"`
Info string `json:"info"`
SmsCount int `json:"sms_count"`
MSISDN string `json:"msisdn"`
Text string `json:"text"`
TrxID string `json:"trxid"`
Currency string `json:"currency"`
Price int `json:"price"`
Token string `json:"token"`
ErrorStatus bool `json:"-"`
}
CitcallSmsOtpResponse citcall SMSOTP Response
func (CitcallSmsOtpResponse) Error ¶
func (e CitcallSmsOtpResponse) Error() string
type CitcallSmsOtpVerifyRequest ¶
type CitcallSmsOtpVerifyRequest struct {
TrxID string `json:"trxid"`
MSISDN string `json:"msisdn"`
Token string `json:"token"`
}
CitcallSmsOtpVerifyRequest citcall SMSOTP Verify Request
type CitcallSmsOtpVerifyResponse ¶
type CitcallSmsOtpVerifyResponse struct {
ResponseCode FlexInt `json:"rc"`
Info string `json:"info"`
TrxID string `json:"trxid"`
TrxIDVerify string `json:"trxid_verify"`
Token string `json:"token"`
TokenVerify string `json:"token_verify"`
ErrorStatus bool `json:"-"`
}
CitcallSmsOtpVerifyResponse citcall SMSOTP Verify Response
func (CitcallSmsOtpVerifyResponse) Error ¶
func (e CitcallSmsOtpVerifyResponse) Error() string
type CitcallSmsRequest ¶ added in v1.1.2
type CitcallSmsRequest struct {
SenderID string `json:"senderid"`
MSISDN string `json:"msisdn"`
Text string `json:"text"`
}
CitcallSmsRequest citcall SMSOTP Request
type CitcallSmsResponse ¶ added in v1.1.2
type CitcallSmsResponse struct {
ResponseCode FlexInt `json:"rc"`
Info string `json:"info"`
SmsCount int `json:"sms_count"`
MSISDN string `json:"msisdn"`
Text string `json:"text"`
TrxID string `json:"trxid"`
Currency string `json:"currency"`
Price int `json:"price"`
Token int `json:"token"`
ErrorStatus bool `json:"-"`
}
CitcallSmsOtpResponse citcall SMSOTP Response
func (CitcallSmsResponse) Error ¶ added in v1.1.2
func (e CitcallSmsResponse) Error() string
type Client ¶
type Client struct {
APIEnvType EnvironmentType
SecretAPIKey string
LogLevel int
}
Client struct
func NewClient ¶
func NewClient() Client
NewClient : this function will always be called when the library is in use
func (*Client) ExecuteRequest ¶
ExecuteRequest : execute request
type EnvironmentType ¶
type EnvironmentType int8
EnvironmentType value
const ( // Sandbox : represent sandbox environment Sandbox EnvironmentType // Production : represent production environment Production )
func (EnvironmentType) CreateAsyncMiscallURL ¶ added in v1.1.0
func (e EnvironmentType) CreateAsyncMiscallURL() string
CreateAsyncMiscallURL : Create Asynchronous Miscall URL
func (EnvironmentType) CreateSmsOtpURL ¶
func (e EnvironmentType) CreateSmsOtpURL() string
CreateSmsOtpURL : Create SMSOTP URL
func (EnvironmentType) CreateSmsOtpVerifyURL ¶
func (e EnvironmentType) CreateSmsOtpVerifyURL() string
CreateSmsOtpVerifyURL : Create VERIFY URL
func (EnvironmentType) CreateSmsURL ¶ added in v1.1.2
func (e EnvironmentType) CreateSmsURL() string
type FlexInt ¶
type FlexInt int
A FlexInt is an int that can be unmarshalled from a JSON field that has either a number or a string value. E.g. if the json field contains an string "42", the FlexInt value will be "42".
func (*FlexInt) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface, which allows us to ingest values of any json type as an int and run our custom conversion
type SmsGateway ¶
type SmsGateway struct {
Client Client
}
SmsGateway struct
func (*SmsGateway) RequestMiscallOtp ¶ added in v1.1.0
func (gateway *SmsGateway) RequestMiscallOtp(req *CitcallAsyncMiscallOtpRequest) (response *CitcallMiscallOtpResponse, err error)
RequestMiscallOtp request miscall for OTP
func (*SmsGateway) SendSms ¶ added in v1.1.2
func (gateway *SmsGateway) SendSms(req *CitcallSmsRequest) (response *CitcallSmsResponse, err error)
SendSms send sms
func (*SmsGateway) SendSmsOtp ¶
func (gateway *SmsGateway) SendSmsOtp(req *CitcallSmsOtpRequest) (response *CitcallSmsOtpResponse, err error)
SendSmsOtp send sms for OTP
func (*SmsGateway) VerifySmsOtp ¶
func (gateway *SmsGateway) VerifySmsOtp(req *CitcallSmsOtpVerifyRequest) (response *CitcallSmsOtpVerifyResponse, err error)
VerifySmsOtp Verify SMS OTP