payzengo

package module
v0.0.0-...-c58ad90 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2018 License: BSD-2-Clause Imports: 11 Imported by: 0

README

payzengo

Go support for the PayZen online payment solution provided by lyra


site:=payzengo.PayzenSite{
	Site:            "TEST",
	SiteID:          11111111,
  CertificateDev: "22222",
  CertificateProd: "22222",
  }
confPayzen := (&payzengo.PaymentConfig{
	SiProduction: true,
	Site:         site,
	ReturnMode:   "POST",
})


amount:=100
transactionid:=4000 // unique transaction id
orderid:=1000
clientid:=1
  
p, err := payzengo.GetNewPaiement(confPayzen, time.Now(), amount, transactionid, orderid, clientid)
if err != nil {
	log.Println(err)
}
p.SetData("custom_form_var", "hop")
paymentForm:= p.GetForm("<input type=submit/><script>payzenform.submit();</script>"))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackInfo

type CallbackInfo struct {
	Site       *PayzenSite
	Production bool
	Valid      bool
}

func CallbackCheck

func CallbackCheck(r *http.Request) *CallbackInfo

type PaymentConfig

type PaymentConfig struct {
	Site                   *PayzenSite
	SiHMAC                 bool
	Currency               vars.Currency
	PaymentType            vars.PaymentType
	ActionMode             vars.ActionMode
	SiProduction           bool
	URLSuccess             string
	URLRefused             string
	URLCancel              string
	URLError               string
	URLReturn              string
	Language               vars.Language
	AvailableLanguages     []vars.Language
	ReturnMode             vars.ReturnMode
	PageAction             vars.PageAction
	Version                string
	RedirectErrorMessage   string
	RedirectErrorTimeout   string
	RedirectSuccessTimeout string
	RedirectSuccessMessage string
}

func (*PaymentConfig) SetAutomaticReturn

func (p *PaymentConfig) SetAutomaticReturn(msg string, timeout int, msgerror string, timeouterror int) *PaymentConfig

type PaymentError

type PaymentError int

PaymentError retour d'erreur sur le module de paiement

const (
	PaymentErrorBadTransactionID PaymentError = iota
)

func (PaymentError) Error

func (pe PaymentError) Error() string

type PayzenPaiement

type PayzenPaiement interface {
	GetSignature() string
	GetForm(string) string
	SetData(string, string)
}

func GetNewPaiement

func GetNewPaiement(payzenConfig *PaymentConfig, dt time.Time, amountCents uint64, transactionID, orderID, clientID int) (PayzenPaiement, error)

type PayzenSite

type PayzenSite struct {
	Site            string
	SiteID          uint64
	CertificateDev  string
	CertificateProd string
}

func GetCertificate

func GetCertificate(siteid uint64, SiProduction bool) (string, *PayzenSite)

func GetSite

func GetSite(siteid uint64) (*PayzenSite, bool)

func (*PayzenSite) GetCertificate

func (site *PayzenSite) GetCertificate(SiProduction bool) string

func (*PayzenSite) Register

func (site *PayzenSite) Register() *PayzenSite

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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