trueroute

package
v0.7.0-beta Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrurouteCodeInitial  = 1
	TrurouteCodeResponse = 2
	TrurouteCodeRelease  = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TruRouteRequest

type TruRouteRequest struct {
	XMLName xml.Name `xml:"ussd"`
	Type    int      `xml:"type"`
	Message string   `xml:"msg"`
	Session string   `xml:"sessionid"`
	Msisdn  string   `xml:"msisdn"`
}

TruRouteRequest XML struct for the request from a truroute services

See: https://github.com/saulchelewani/truroute-ussd-adapter/

type TruRouteResponse

type TruRouteResponse struct {
	XMLName xml.Name `xml:"ussd"`
	Type    int      `xml:"type"`
	Message string   `xml:"msg"`
	Premium struct {
		Cost int    `xml:"cost"`
		Ref  string `xml:"ref"`
	} `xml:"premium"`
	Msisdn string `xml:"msisdn"`
}

TruRouteResponse XML struct for the response from a truroute services

See: https://github.com/saulchelewani/truroute-ussd-adapter/blob/master/src/UssdServiceProvider.php

func (*TruRouteResponse) GetText

func (t *TruRouteResponse) GetText() string

GetText returns the response text

func (*TruRouteResponse) IsRelease

func (t *TruRouteResponse) IsRelease() bool

func (*TruRouteResponse) IsResponse

func (t *TruRouteResponse) IsResponse() bool

isResponse checks if the response is truly a success

type TrueRouteStep

type TrueRouteStep struct {
	*core.Step
}

func (*TrueRouteStep) ExecuteAsTruRouteRequest

func (s *TrueRouteStep) ExecuteAsTruRouteRequest(session *core.Session) (string, error)

ExecuteAsTruRouteRequest executes a step and returns the result of the request May return an empty string ("") upon failure

Jump to

Keyboard shortcuts

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