payment-poc/wspay/wspay.go

161 lines
5.0 KiB
Go
Raw Normal View History

2023-07-10 08:10:13 +00:00
package wspay
const AuthorisationForm = "https://formtest.wspay.biz/authorization.aspx"
2023-07-27 20:46:37 +00:00
type Form struct {
2023-07-10 08:10:13 +00:00
// required args
ShopID string
ShoppingCartID string
Version string
TotalAmount int64
ReturnURL string
ReturnErrorURL string
CancelURL string
Signature string
// optional args
Lang string
CustomerFirstName string
CustomerLastName string
CustomerAddress string
CustomerCity string
CustomerZIP string
CustomerCountry string
CustomerPhone string
PaymentPlan string
CreditCardName string
PaymentMethod string
IntAmount int64
IntCurrency string
ReturnMethod string
CurrencyCode int
}
2023-07-27 20:46:37 +00:00
type FormReturn struct {
2023-07-10 08:10:13 +00:00
CustomerFirstName string `form:"CustomerFirstname"`
CustomerSurname string `form:"CustomerSurname"`
CustomerAddress string `form:"CustomerAddress"`
CustomerCity string `form:"CustomerCity"`
CustomerZIP string `form:"CustomerZIP"`
CustomerCountry string `form:"CustomerCountry"`
CustomerPhone string `form:"CustomerPhone"`
CustomerEmail string `form:"CustomerEmail"`
ShoppingCartID string `form:"ShoppingCartID"`
Lang string `form:"Lang"`
DateTime string `form:"DateTime"` //yyyymmddHHMMss
Amount string `form:"Amount"` // eg. 123,43
ECI string `form:"ECI"`
STAN string `form:"STAN"`
Partner string `form:"Partner"`
WsPayOrderId string `form:"WsPayOrderId"`
PaymentType string `form:"PaymentType"`
CreditCardNumber string `form:"CreditCardNumber"` // masked number
PaymentPlan string `form:"PaymentPlan"`
ShopPostedPaymentPlan string `form:"ShopPostedPaymentPlan"`
ShopPostedLang string `form:"ShopPostedLang"`
ShopPostedCreditCardName string `form:"ShopPostedCreditCardName"`
Success int `form:"Success"`
ApprovalCode string `form:"ApprovalCode"`
ErrorMessage string `form:"ErrorMessage"`
ShopPostedPaymentMethod string `form:"ShopPostedPaymentMethod"`
Signature string `form:"Signature"`
}
2023-07-27 20:46:37 +00:00
type FormError struct {
2023-07-10 08:10:13 +00:00
CustomerFirstName string
CustomerSurname string
CustomerAddress string
CustomerCity string
CustomerZIP string
CustomerCountry string
CustomerPhone string
CustomerEmail string
ShoppingCartID string
Lang string
DateTime string //yyyymmddHHMMss
Amount string // eg. 123,43
ECI string
PaymentType string
PaymentPlan string
ShopPostedPaymentPlan string
ShopPostedLang string
ShopPostedCreditCardName string
Success int
ApprovalCode string
ErrorMessage string
ShopPostedPaymentMethod string
ErrorCodes string
Signature string
}
2023-07-27 20:46:37 +00:00
type FormCancel struct {
2023-07-10 08:10:13 +00:00
ResponseCode int
ShoppingCartID string
ApprovalCode string
Success int
Signature string
}
2023-07-27 20:46:37 +00:00
type CompletionRequest struct {
2023-07-10 08:10:13 +00:00
Version string
WsPayOrderId string
ShopId string
ApprovalCode string
STAN string
2023-07-27 10:09:38 +00:00
Amount int64
2023-07-10 08:10:13 +00:00
Signature string
}
2023-07-27 20:46:37 +00:00
type CompletionResponse struct {
2023-07-10 08:10:13 +00:00
WsPayOrderId string
ShopId string
ApprovalCode string
STAN string
ErrorMessage string
ActionSuccess string
Signature string
}
2023-07-27 20:46:37 +00:00
type StatusCheckRequest struct {
2023-07-10 08:10:13 +00:00
Version string
ShopId string
ShoppingCartId string
Signature string
}
2023-07-27 20:46:37 +00:00
type StatusCheckResponse struct {
2023-07-10 08:10:13 +00:00
WsPayOrderId string
Signature string
STAN string
ApprovalCode string
ShopID string
ShoppingCartID string
Amount string
CurrencyCode string
ActionSuccess string
Success string // deprecated
Authorized int
Completed int
Voided int
Refunded int
PaymentPlan string
Partner string
OnSite int
CreditCardName string
CreditCardNumber string
ECI string
CustomerFirstName string
CustomerLastName string
CustomerCity string
CustomerZIP string
CustomerCountry string
CustomerPhone string
CustomerEmail string
TransactionDateTime string //yyyymmddHHMMss
IsLessThan30DaysFromTransaction bool
CanBeCompleted bool
CanBeVoided bool
CanBeRefunded bool
ExpirationDate string
}