apigw

package module
v0.0.0-...-4a1664a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

README

sf-apigw-v2

Smartfren API Gateway

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeMDN

func NormalizeMDN(mdn string) string

func ToDate

func ToDate(timestamp string) (t time.Time)

func ToTime

func ToTime(timestamp string) (t time.Time)

Types

type AddServiceMessage

type AddServiceMessage struct {
	MDN           string `json:"mdn,omitempty"`
	ServiceCode   string `json:"serviceCode,omitempty"`
	ServiceName   string `json:"serviceName,omitempty"`
	EffectiveDate string `json:"effectiveDate,omitempty"`
	ExpiryDate    string `json:"expireDate,omitempty"`
	TransactionID string `json:"transactionId,omitempty"`
	ReturnCode    string `json:"returnCode,omitempty"`
	ResultMsg     string `json:"resultMsg,omitempty"`
}

type Client

type Client struct {
	BaseURL   string
	SecretKey string
	KeyID     string
	Session   *http.Client
}

func New

func New(baseUrl, keyId, secretKey string, timeout int) *Client

func (*Client) Get

func (ws *Client) Get(uri, version string, request map[string]string) (response []byte, err error)

func (*Client) Post

func (ws *Client) Post(uri, version string, request []byte) (response []byte, err error)

func (*Client) SetProxy

func (ws *Client) SetProxy(uri string) error

func (*Client) SetTransport

func (ws *Client) SetTransport(proxyUri string)

func (*Client) SubmitRequest

func (ws *Client) SubmitRequest(req *http.Request, version string) (response []byte, err error)

type Customer

type Customer struct {
	Gw   *Client
	Data *fastjson.Value
	MDN  string
}

func NewCustomer

func NewCustomer(api *Client, mdn string) (s *Customer, err error)

func (*Customer) GetICCID

func (s *Customer) GetICCID() (iccid string, err error)

type Subscriber

type Subscriber struct {
	Gw   *Client
	Data *fastjson.Value
	MDN  string
}

func NewSubscriber

func NewSubscriber(api *Client, mdn string) (s *Subscriber, err error)

func (*Subscriber) AccountNumber

func (s *Subscriber) AccountNumber() string

func (*Subscriber) ActiveDate

func (s *Subscriber) ActiveDate() time.Time

func (*Subscriber) ActiveEndDate

func (s *Subscriber) ActiveEndDate() time.Time

func (*Subscriber) AddService

func (s *Subscriber) AddService(serviceCode string) (result AddServiceMessage, err error)

func (*Subscriber) Balance

func (s *Subscriber) Balance() int

func (*Subscriber) Balances

func (s *Subscriber) Balances() []*SubscriberBalance

func (*Subscriber) BirthDay

func (s *Subscriber) BirthDay() string

func (*Subscriber) BirthPlace

func (s *Subscriber) BirthPlace() string

func (*Subscriber) BonusBalance

func (s *Subscriber) BonusBalance() int

func (*Subscriber) CurrentUsage

func (s *Subscriber) CurrentUsage() int

func (*Subscriber) CustomerGrade

func (s *Subscriber) CustomerGrade() string

func (*Subscriber) CustomerName

func (s *Subscriber) CustomerName() string

func (*Subscriber) CustomerType

func (s *Subscriber) CustomerType() string

func (*Subscriber) DefaultPricePlan

func (s *Subscriber) DefaultPricePlan() string

func (*Subscriber) DefaultPricePlanCode

func (s *Subscriber) DefaultPricePlanCode() string

func (*Subscriber) DocAddress

func (s *Subscriber) DocAddress() string

func (*Subscriber) DocNumber

func (s *Subscriber) DocNumber() string

func (*Subscriber) DocType

func (s *Subscriber) DocType() string

func (*Subscriber) DueDate

func (s *Subscriber) DueDate() time.Time

func (*Subscriber) Email

func (s *Subscriber) Email() string

func (*Subscriber) FraudLocked

func (s *Subscriber) FraudLocked() string

func (*Subscriber) Gender

func (s *Subscriber) Gender() string

func (*Subscriber) ICCID

func (s *Subscriber) ICCID() string

func (*Subscriber) IMSI

func (s *Subscriber) IMSI() string

func (*Subscriber) LastPaymentDate

func (s *Subscriber) LastPaymentDate() time.Time

func (*Subscriber) MarketingCategory

func (s *Subscriber) MarketingCategory() string

func (*Subscriber) MotherMaidenName

func (s *Subscriber) MotherMaidenName() string

func (*Subscriber) NextState

func (s *Subscriber) NextState() string

func (*Subscriber) NextStateDate

func (s *Subscriber) NextStateDate() time.Time

func (*Subscriber) OfferId

func (s *Subscriber) OfferId() int

func (*Subscriber) OfferName

func (s *Subscriber) OfferName() string

func (*Subscriber) PUK1

func (s *Subscriber) PUK1() string

func (*Subscriber) PUK2

func (s *Subscriber) PUK2() string

func (*Subscriber) ProductCode

func (s *Subscriber) ProductCode() string

func (*Subscriber) ProductName

func (s *Subscriber) ProductName() string

func (*Subscriber) Query

func (s *Subscriber) Query() (err error)

func (*Subscriber) RemainingCreditLimit

func (s *Subscriber) RemainingCreditLimit() int

func (*Subscriber) Services

func (s *Subscriber) Services() []*SubscriberService

func (*Subscriber) SettlementMethod

func (s *Subscriber) SettlementMethod() string

func (*Subscriber) Status

func (s *Subscriber) Status() string

func (*Subscriber) TerminationDate

func (s *Subscriber) TerminationDate() time.Time

func (*Subscriber) TotalCreditLimit

func (s *Subscriber) TotalCreditLimit() int

type SubscriberBalance

type SubscriberBalance struct {
	AcctResID     int
	AcctResName   string
	BalType       int
	Balance       int
	EffectiveDate time.Time
	ExpiryDate    time.Time
}

type SubscriberService

type SubscriberService struct {
	ServiceCode   string
	ServiceName   string
	EffectiveDate time.Time
	ExpiryDate    time.Time
}

Jump to

Keyboard shortcuts

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