Documentation
¶
Overview ¶
Package tpv integrates redsys payments in Go.
Index ¶
Constants ¶
View Source
const ( EndpointProduction = "https://sis.redsys.es/sis/realizarPago" EndpointDebug = "https://sis-t.redsys.es:25443/sis/realizarPago" )
View Source
const ( TransactionTypeSimpleAuthorization = TransactionType(0) TransactionTypeRefund = TransactionType(3) )
View Source
const ( LangES = Lang("001") LangEN = Lang("002") LangCA = Lang("003") LangFR = Lang("004") LangDE = Lang("005") LangIT = Lang("007") LangPT = Lang("009") )
View Source
const ( StatusUnknown = Status("") StatusApproved = Status("approved") StatusCancelled = Status("cancelled") StatusRepeated = Status("repeated") )
View Source
const (
CurrencyEuros = Currency(978)
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Merchant ¶
type Merchant struct {
// Merchant code assigned by the bank.
Code string
// Merchant name to show in the receipt.
Name string
// Terminal number assigned by the bank.
Terminal int64
// Secret to sign transactions assigned by the bank.
Secret string
// URL where the notification will be sent.
URLNotification string
// Enable debug endpoint.
Debug bool
}
Merchant data
type Operation ¶
type Params ¶
type Params struct {
Response int64 `json:"-"`
Order string `json:"Ds_Order"`
Date string `json:"Ds_Date"`
Time string `json:"Ds_Hour"`
Country string `json:"Ds_Card_Country"`
AuthCode string `json:"Ds_AuthorisationCode"`
CardType string `json:"Ds_Card_Type"`
Data string `json:"Ds_MerchantData"`
RawResponse string `json:"Ds_Response"`
}
func ParseParams ¶
type Session ¶
type Session struct {
// Code of the session. It should have 4 digits and 8 characters.
Code string
// Two-letters code of the language. Use English if unknown, please.
Lang Lang
// Name of the client to show in the receipt.
Client string
// Amount in cents to pay.
Amount int32
// Product name to show in the receipt.
Product string
// URL to return to when the transaction is approved.
URLOK string
// URL to return to when the transaction is cancelled.
URLKO string
// Raw data that will be sent back in the confirmation.
Data string
// The transaction type, e.g a refund.
Type TransactionType
}
Session data
type Signed ¶
type Signed struct {
// Signature of the parameters.
Signature string
// Version of the signature.
SignatureVersion string
// Params to send.
Params string
// Output only. It will return the endpoint of the call.
Endpoint string
}
Signed TPV transaction to send to the bank.
type TransactionType ¶
type TransactionType int64
Click to show internal directories.
Click to hide internal directories.