Documentation
¶
Index ¶
- Constants
- func AddCallbackUrl(serverAddress, endpoint, callbackUrl string) error
- func NewAsanShp(prepaymentAmount, loanAmount, loanCount int64) asanShp
- func NewBillInfo(billID string, billPaymentID string) billInfo
- func NewMultiplexParameters() multiplexParameters
- type AdditionalParameter
- type IncomingRequest
- type InquiryResult
- type IranKish
- func (i *IranKish) CallbackHandler(wr http.ResponseWriter, r *http.Request)
- func (i *IranKish) IncomingCallbacks() <-chan IncomingRequest
- func (i *IranKish) MakePurchaseToken(paymentID, requestID string, amount int64, revertUri string, ...) (*MakeTokenResult, error)
- func (i *IranKish) SingleInquiryByReferenceNumber(referenceNumber string) (*InquiryResult, error)
- func (i *IranKish) SingleInquiryByToken(token string) (*InquiryResult, error)
- func (i *IranKish) VerifyPurchase(token, referenceNumber, auditNumber string) (*TransactionResult, error)
- type Logger
- type MakeTokenResult
- type Proxy
- type Response
- type TransactionResult
- type UserInput
Constants ¶
View Source
const ( IranKishShaparakUrl = "https://ikc.shaparak.ir" TokenUrl = "/api/v3/tokenization/make" RedirectUrl = IranKishShaparakUrl + "/iuiv3/IPG/Index/" ConfirmationUrl = "/api/v3/confirmation/purchase" InquiryUrl = "/api/v3/inquiry/single" )
View Source
const ( TransactionTypePurchase transactionType = "Purchase" TransactionTypeBill transactionType = "Bill" TransactionTypeAsnShpWPP transactionType = "AsanShpWPP" )
Variables ¶
This section is empty.
Functions ¶
func AddCallbackUrl ¶ added in v0.1.8
func NewAsanShp ¶ added in v0.0.6
func NewAsanShp(prepaymentAmount, loanAmount, loanCount int64) asanShp
func NewBillInfo ¶ added in v0.0.6
func NewMultiplexParameters ¶ added in v0.0.6
func NewMultiplexParameters() multiplexParameters
Types ¶
type AdditionalParameter ¶ added in v0.0.7
type IncomingRequest ¶ added in v0.0.6
type IncomingRequest struct { Request *http.Request Done chan bool // contains filtered or unexported fields }
func (*IncomingRequest) ParseUserInput ¶ added in v0.0.6
func (i *IncomingRequest) ParseUserInput() (*UserInput, error)
func (*IncomingRequest) WriteResponse ¶ added in v0.0.6
func (i *IncomingRequest) WriteResponse(statusCode int, data []byte)
type InquiryResult ¶ added in v0.2.13
type InquiryResult struct { ResponseCode string `json:"responseCode"` Description string `json:"description"` Status bool `json:"status"` Result json.RawMessage `json:"result"` TokenIdentity string `json:"tokenIdentity"` TerminalID string `json:"terminalId"` AcceptorID string `json:"acceptorId"` RetrievalReferenceNumber string `json:"retrievalReferenceNumber"` SystemTraceAuditNumber string `json:"systemTraceAuditNumber"` Amount int64 `json:"amount"` TransactionDate int64 `json:"transactionDate"` TransactionTime int64 `json:"transactionTime"` RequestID string `json:"requestId"` PaymentID string `json:"paymentId"` IsMultiplex bool `json:"isMultiplex"` IsVerified bool `json:"isVerified"` IsReversed bool `json:"isReversed"` MaskedPan string `json:"maskedPan"` SHA256OfPan string `json:"sha256OfPan"` TransactionType transactionType `json:"transactionType"` }
type IranKish ¶
type IranKish struct {
// contains filtered or unexported fields
}
func NewWithProxyHost ¶ added in v0.1.0
func (*IranKish) CallbackHandler ¶
func (i *IranKish) CallbackHandler(wr http.ResponseWriter, r *http.Request)
func (*IranKish) IncomingCallbacks ¶ added in v0.0.6
func (i *IranKish) IncomingCallbacks() <-chan IncomingRequest
func (*IranKish) MakePurchaseToken ¶ added in v0.0.6
func (i *IranKish) MakePurchaseToken( paymentID, requestID string, amount int64, revertUri string, params ...AdditionalParameter, ) (*MakeTokenResult, error)
func (*IranKish) SingleInquiryByReferenceNumber ¶ added in v0.2.13
func (i *IranKish) SingleInquiryByReferenceNumber(referenceNumber string) (*InquiryResult, error)
func (*IranKish) SingleInquiryByToken ¶ added in v0.2.13
func (i *IranKish) SingleInquiryByToken(token string) (*InquiryResult, error)
func (*IranKish) VerifyPurchase ¶ added in v0.0.6
func (i *IranKish) VerifyPurchase(token, referenceNumber, auditNumber string) (*TransactionResult, error)
type MakeTokenResult ¶
type MakeTokenResult struct { Token string `json:"token"` InitiateTimestamp int64 `json:"initiateTimeStamp"` ExpiryTimestamp int64 `json:"expiryTimeStamp"` TransactionType transactionType `json:"transactionType"` BillInfo interface{} `json:"billInfo"` // contains filtered or unexported fields }
func (*MakeTokenResult) RedirectForm ¶ added in v0.0.6
func (m *MakeTokenResult) RedirectForm() string
type Proxy ¶ added in v0.1.0
type Proxy struct {
// contains filtered or unexported fields
}
Proxy is to run a http proxy server to redirect requests
This is because there's IP limit on payment gateways Each payment gateway is only allowed to be accessed by specific ip addresses You can run this proxy server in an allowed IP address and initiate your gateway using WithProxy
func NewProxyWithMux ¶ added in v0.1.0
func (*Proxy) EnableCallbackUrls ¶ added in v0.1.2
EnableCallbackUrls by calling this method /add_callback_url endpoint will be activated
This is to proxy back callback (revert url) requests to specified endpoints
func (*Proxy) SetHomePageHandler ¶ added in v0.1.4
func (*Proxy) SetTargetUrl ¶ added in v0.1.6
SetTargetUrl is used to replace payment gateway's base url
type Response ¶ added in v0.0.6
type Response struct { ResponseCode string `json:"responseCode"` Description string `json:"description"` Status bool `json:"status"` Result json.RawMessage `json:"result"` }
type TransactionResult ¶ added in v0.0.6
type TransactionResult struct { ResponseCode string `json:"responseCode"` SystemTraceAuditNumber string `json:"systemTraceAuditNumber"` RetrievalReferenceNumber string `json:"retrievalReferenceNumber"` TransactionDate int64 `json:"transactionDate"` TransactionTime int64 `json:"transactionTime"` ProcessCode string `json:"processCode"` BillType string `json:"billType"` BillId string `json:"billId"` PaymentId string `json:"paymentId"` Amount string `json:"amount"` DuplicateVerify bool `json:"duplicateVerify"` // indicates if payment is already verified }
Click to show internal directories.
Click to hide internal directories.