paytm

package
v0.0.0-...-3e1c22f Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(input []byte) (output []byte, err error)

Decrypt is function to decryption

func Encrypt

func Encrypt(input []byte) (output []byte, err error)

Encrypt is function to encryption

func GetChecksumFromArray

func GetChecksumFromArray(paramsMap map[string]string) (checksum string, err error)

GetChecksumFromArray is function to generate checksum key

func VerifyCheckum

func VerifyCheckum(paramsMap map[string]string, checksum string) (ok bool)

VerifyCheckum is function to verify checksum

Types

type Crypter

type Crypter struct {
	// contains filtered or unexported fields
}

Crypter is structure of paytm

func NewCrypter

func NewCrypter(key []byte, iv []byte) (*Crypter, error)

NewCrypter is function of paytm

func (*Crypter) Decrypt

func (c *Crypter) Decrypt(input []byte) ([]byte, error)

Decrypt is function of decryption key

func (*Crypter) Encrypt

func (c *Crypter) Encrypt(input []byte) ([]byte, error)

Encrypt is function of encryption algorithm

type IInitiateTransactionRequestHeaders

type IInitiateTransactionRequestHeaders struct {
	Version          string
	ChannelID        string
	RequestTimestamp string
	ClientID         string
	Signature        string
}

IInitiateTransactionRequestHeaders initiates transaction request headers.

type InitiateTransactionRequest

type InitiateTransactionRequest struct {
	Body struct {
		RequestType string `json:"requestType"`
		Mid         string `json:"mid"`
		WebsiteName string `json:"websiteName"`
		OrderID     string `json:"orderId"`
		TxnAmount   struct {
			Value    string `json:"value"`
			Currency string `json:"currency"`
		} `json:"txnAmount"`
		UserInfo struct {
			CustID string `json:"custId"`
		} `json:"userInfo"`
		CallbackURL string `json:"callbackUrl"`
	} `json:"body"`
	Head struct {
		ClientID         string `json:"clientId"`
		Version          string `json:"version"`
		RequestTimestamp int    `json:"requestTimestamp"`
		ChannelID        string `json:"channelId"`
		Signature        string `json:"signature"`
	} `json:"head"`
}

InitiateTransactionRequest initiates transaction request.

type InitiateTransactionResponse

type InitiateTransactionResponse struct {
	Head struct {
		ResponseTimestamp string `json:"responseTimestamp"`
		Version           string `json:"version"`
		ClientID          string `json:"clientId"`
		Signature         string `json:"signature"`
	} `json:"head"`
	Body struct {
		ResultInfo struct {
			ResultStatus string `json:"resultStatus"`
			ResultCode   string `json:"resultCode"`
			ResultMsg    string `json:"resultMsg"`
		} `json:"resultInfo"`
		TxnToken      string `json:"txnToken"`
		IsCouponValid bool   `json:"isCouponValid"`
		Authenticated bool   `json:"authenticated"`
	} `json:"body"`
}

InitiateTransactionResponse initiates transaction response.

type Paytm

type Paytm struct {
	MerchantMID             string
	MerchantKey             string
	MerchantWebsite         string
	TransactionStatusAPIURL string //https://securegw.paytm.in/order/status
	SendOTPAPIURL           string //https://accounts.paytm.com/signin/otp
}

Paytm represents payment.

func (*Paytm) AddMoney

func (p *Paytm) AddMoney()

AddMoney adds money.

func (*Paytm) CheckBalance

func (p *Paytm) CheckBalance()

CheckBalance checks balance.

func (*Paytm) InitiatePayment

func (p *Paytm) InitiatePayment()

InitiatePayment initiates payment.

func (*Paytm) RevokeAccess

func (p *Paytm) RevokeAccess()

RevokeAccess ceases access.

func (*Paytm) SendOTP

func (p *Paytm) SendOTP(mobileNo string, clientID string) (bool, SendOTPResponse, error)

SendOTP sends otp ... https://developer.paytm.com/docs/send-otp-api/

func (*Paytm) TransactionStatus

func (p *Paytm) TransactionStatus(orderID string, checksum string) (bool, TransactionStatus, error)

TransactionStatus returns transaction status ... https://developer.paytm.com/docs/transaction-status-api/

func (*Paytm) ValidateToken

func (p *Paytm) ValidateToken()

ValidateToken validates tokens.

func (*Paytm) VerifyOTP

func (p *Paytm) VerifyOTP(otp string, state string) (VerifyOTPResponse, error)

VerifyOTP verifies otp ... https://developer.paytm.com/docs/validate-otp-api/

type SendOTPRequest

type SendOTPRequest struct {
	Email        string `json:"email"`
	Phone        string `json:"phone"`
	ClientID     string `json:"clientId"`
	Scope        string `json:"scope"`
	ResponseType string `json:"responseType"`
}

SendOTPRequest represents send otp request.

type SendOTPResponse

type SendOTPResponse struct {
	Status       string `json:"status"`
	Message      string `json:"message"`
	ResponseCode string `json:"responseCode"`
	State        string `json:"state"`
}

SendOTPResponse represents send otp response.

type TransactionStatus

type TransactionStatus struct {
	TxnID        string `json:"TXNID"`
	BankTxnID    string `json:"BANKTXNID"`
	OrderID      string `json:"ORDERID"`
	TxnAmount    string `json:"TXNAMOUNT"`
	Status       string `json:"STATUS"`
	TxnType      string `json:"TXNTYPE"`
	GatewayName  string `json:"GATEWAYNAME"`
	RespCode     string `json:"RESPCODE"`
	RespMsg      string `json:"RESPMSG"`
	BankName     string `json:"BANKNAME"`
	MID          string `json:"MID"`
	PaymentMode  string `json:"PAYMENTMODE"`
	RefundAmount string `json:"REFUNDAMT"`
	TxnDate      string `json:"TXNDATE"`
}

TransactionStatus is function for check transaction status

type VerifyOTPRequest

type VerifyOTPRequest struct {
}

VerifyOTPRequest verifies otp request.

type VerifyOTPResponse

type VerifyOTPResponse struct {
}

VerifyOTPResponse verifies otp response.

Jump to

Keyboard shortcuts

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