Documentation ¶
Index ¶
- func Decrypt(input []byte) (output []byte, err error)
- func Encrypt(input []byte) (output []byte, err error)
- func GetChecksumFromArray(paramsMap map[string]string) (checksum string, err error)
- func VerifyCheckum(paramsMap map[string]string, checksum string) (ok bool)
- type Crypter
- type IInitiateTransactionRequestHeaders
- type InitiateTransactionRequest
- type InitiateTransactionResponse
- type Paytm
- func (p *Paytm) AddMoney()
- func (p *Paytm) CheckBalance()
- func (p *Paytm) InitiatePayment()
- func (p *Paytm) RevokeAccess()
- func (p *Paytm) SendOTP(mobileNo string, clientID string) (bool, SendOTPResponse, error)
- func (p *Paytm) TransactionStatus(orderID string, checksum string) (bool, TransactionStatus, error)
- func (p *Paytm) ValidateToken()
- func (p *Paytm) VerifyOTP(otp string, state string) (VerifyOTPResponse, error)
- type SendOTPRequest
- type SendOTPResponse
- type TransactionStatus
- type VerifyOTPRequest
- type VerifyOTPResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetChecksumFromArray ¶
GetChecksumFromArray is function to generate checksum key
Types ¶
type Crypter ¶
type Crypter struct {
// contains filtered or unexported fields
}
Crypter is structure of paytm
func NewCrypter ¶
NewCrypter is function of paytm
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) InitiatePayment ¶
func (p *Paytm) InitiatePayment()
InitiatePayment initiates payment.
func (*Paytm) SendOTP ¶
SendOTP sends otp ... https://developer.paytm.com/docs/send-otp-api/
func (*Paytm) TransactionStatus ¶
TransactionStatus returns transaction status ... https://developer.paytm.com/docs/transaction-status-api/
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