Documentation ¶
Index ¶
- Variables
- func Decrypt(encKey string, encryptedText string) ([]byte, []byte, error)
- func Encrypt(publicKey *rsa.PublicKey, sourceText []byte) (string, string, error)
- func SetMobilpayVars(...)
- type CB
- type EncriptedData
- type H
- type MResponse
- type MerchantsResponse
- type MerchantsResponseE
- type Request
Constants ¶
This section is empty.
Variables ¶
var Cert *rsa.PublicKey
Cert - parsed
var ConfirmURL = ""
ConfirmURL -
var MobilpayEndpoint = "http://sandboxsecure.mobilpay.ro"
MobilpayEndpoint - Mobilpay gateway
var PrivateKey *rsa.PrivateKey
PrivateKey - parsed
var PrivateKeyFile = "sandbox.LK1F-GMV1-YWRD-7J6T-QD55private.key" // mobilpay test sandbox key
PrivateKeyFile - Private key of the mobilpay merchant, used to decript the confirm response.
var PublicCer = "sandbox.LK1F-GMV1-YWRD-7J6T-QD55.public.cer" // mobilpay test sandbox cer
PublicCer - Public key used to encript the requests made to mobilpay.
var ReturnURL = ""
ReturnURL -
var Signature = "LK1F-GMV1-YWRD-7J6T-QD55"
Signature - merchant signature
Functions ¶
func SetMobilpayVars ¶
func SetMobilpayVars(mobilpayEndpoint, signature, privateKeyFile, publicKeyFile, confirmURL, returnURL string)
SetMobilpayVars -
Types ¶
type CB ¶
CB - contains the http cb method and depends on DBh *multidb.MultiDB handle
func (*CB) MobilpayConfirm ¶
func (o *CB) MobilpayConfirm(wr http.ResponseWriter, r *http.Request)
MobilpayConfirm - Confirms and logs the processing of the payment.
type EncriptedData ¶
EncriptedData - Contains the client data that needs to be POST'ed
type MResponse ¶
type MResponse struct {
Order orderM `xml:"order"`
}
MResponse - is the response decripted XML structure containing the aditional Mobilpay Order property.
type MerchantsResponse ¶
type MerchantsResponse struct {
CRC string `xml:"crc"`
}
MerchantsResponse -
type MerchantsResponseE ¶
type MerchantsResponseE struct {
CRC crc `xml:"crc"`
}
MerchantsResponseE - represents the ping back that the confirm endpoint will make with attributes that specify error.
ErrorType - 1 = temp error ; 2 = perm error ;
type Request ¶
type Request struct {
Order order `xml:"order"`
}
Request - Mobilpay XML request that gets marshalled by GetOrderEncriptedData
Mandatory fields: r.Order.Signature = "xxxx-xxxx-xxxx-xxxx-xxxx" r.Order.URL.Return = "" r.Order.URL.Confirm = "" r.Order.Invoice.ContactInfo.Billing.Type = "person" r.Order.Invoice.Currency = "RON" r.Order.Invoice.Amount = "3" r.Order.Type = "card" r.Order.ID = "1" r.Order.Invoice.Details = "CreditCard payment." r.Order.Invoice.ContactInfo.Billing.Fname = "Foo" r.Order.Invoice.ContactInfo.Billing.Lname = "Bar"