-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathstructs.go
37 lines (35 loc) · 1.89 KB
/
structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package redsys
// MerchantParametersResponse struct to read Redsys API responses
type MerchantParametersResponse struct {
Date string `json:"Ds_Date"`
Hour string `json:"Ds_Hour"`
SecurePayment string `json:"Ds_SecurePayment"`
CardCountry string `json:"Ds_Card_Country,omitempty"`
Amount string `json:"Ds_Amount"`
Currency string `json:"Ds_Currency"`
Order string `json:"Ds_Order"`
MerchantCode string `json:"Ds_MerchantCode"`
Terminal string `json:"Ds_Terminal"`
Response string `json:"Ds_Response"`
MerchantData string `json:"Ds_MerchantData"`
TransactionType string `json:"Ds_TransactionType"`
ConsumerLanguage string `json:"Ds_ConsumerLanguage,omitempty"`
AuthorisationCode string `json:"Ds_AuthorisationCode,omitempty"`
}
// MerchantParametersRequest struct to construct Redsys API requests
type MerchantParametersRequest struct {
// Optional fields are tagged with omitempty
MerchantMerchantCode string `json:"Ds_Merchant_MerchantCode"`
MerchantTerminal string `json:"Ds_Merchant_Terminal"`
MerchantTransactionType string `json:"Ds_Merchant_TransactionType"`
MerchantAmount string `json:"Ds_Merchant_Amount"`
MerchantCurrency string `json:"Ds_Merchant_Currency"`
MerchantOrder string `json:"Ds_Merchant_Order"`
MerchantMerchantUrl string `json:"Ds_Merchant_MerchantURL,omitempty"`
MerchantProductDescription string `json:"Ds_Merchant_ProductDescription,omitempty"`
MerchantTitular string `json:"Ds_Merchant_Titular,omitempty"`
MerchantUrlOK string `json:"Ds_Merchant_UrlOK,omitempty"`
MerchantUrlKO string `json:"Ds_Merchant_UrlKO,omitempty"`
MerchantMerchantName string `json:"Ds_Merchant_MerchantName,omitempty"`
MerchantConsumerLanguage string `json:"Ds_Merchant_ConsumerLanguage,omitempty"`
}