-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcategory_error_codes.go
executable file
·90 lines (80 loc) · 2.29 KB
/
category_error_codes.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package processout
import (
"bytes"
"encoding/json"
"io"
"net/http"
"net/url"
"strings"
"time"
"gopkg.in/processout.v5/errors"
)
// CategoryErrorCodes represents the CategoryErrorCodes API object
type CategoryErrorCodes struct {
// Generic is the generic error codes.
Generic *[]string `json:"generic,omitempty"`
// Service is the service related error codes.
Service *[]string `json:"service,omitempty"`
// Gateway is the gateway related error codes.
Gateway *[]string `json:"gateway,omitempty"`
// Card is the card related error codes.
Card *[]string `json:"card,omitempty"`
// Check is the check related error codes.
Check *[]string `json:"check,omitempty"`
// Shipping is the shipping related error codes.
Shipping *[]string `json:"shipping,omitempty"`
// Customer is the customer related error codes.
Customer *[]string `json:"customer,omitempty"`
// Payment is the payment related error codes.
Payment *[]string `json:"payment,omitempty"`
// Refund is the refund related error codes.
Refund *[]string `json:"refund,omitempty"`
// Wallet is the wallet related error codes.
Wallet *[]string `json:"wallet,omitempty"`
// Request is the request related error codes.
Request *[]string `json:"request,omitempty"`
client *ProcessOut
}
// SetClient sets the client for the CategoryErrorCodes object and its
// children
func (s *CategoryErrorCodes) SetClient(c *ProcessOut) *CategoryErrorCodes {
if s == nil {
return s
}
s.client = c
return s
}
// Prefil prefills the object with data provided in the parameter
func (s *CategoryErrorCodes) Prefill(c *CategoryErrorCodes) *CategoryErrorCodes {
if c == nil {
return s
}
s.Generic = c.Generic
s.Service = c.Service
s.Gateway = c.Gateway
s.Card = c.Card
s.Check = c.Check
s.Shipping = c.Shipping
s.Customer = c.Customer
s.Payment = c.Payment
s.Refund = c.Refund
s.Wallet = c.Wallet
s.Request = c.Request
return s
}
// dummyCategoryErrorCodes is a dummy function that's only
// here because some files need specific packages and some don't.
// It's easier to include it for every file. In case you couldn't
// tell, everything is generated.
func dummyCategoryErrorCodes() {
type dummy struct {
a bytes.Buffer
b json.RawMessage
c http.File
d strings.Reader
e time.Time
f url.URL
g io.Reader
}
errors.New(nil, "", "")
}