-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspecs.go
169 lines (167 loc) · 4.59 KB
/
specs.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/**
* @author Jose Nidhin
*/
package main
import (
"github.com/moov-io/iso8583"
"github.com/moov-io/iso8583/encoding"
"github.com/moov-io/iso8583/field"
"github.com/moov-io/iso8583/padding"
"github.com/moov-io/iso8583/prefix"
)
var Spec1 *iso8583.MessageSpec = &iso8583.MessageSpec{
Name: "ISO 8583 ASCII Test Spec 1",
Fields: map[int]field.Field{
0: field.NewString(&field.Spec{
Length: 4,
Description: "Message Type Indicator",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
1: field.NewBitmap(&field.Spec{
Description: "Bitmap",
Enc: encoding.BytesToASCIIHex,
Pref: prefix.Hex.Fixed,
}),
2: field.NewNumeric(&field.Spec{
Length: 19,
Description: "Primary Account Number",
Enc: encoding.ASCII,
Pref: prefix.ASCII.LL,
}),
3: field.NewString(&field.Spec{
Length: 6,
Description: "Processing Code",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
4: field.NewNumeric(&field.Spec{
Length: 12,
Description: "Transaction Amount",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
Pad: padding.Left('0'),
}),
7: field.NewString(&field.Spec{
Length: 10,
Description: "Transmission Date & Time",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
11: field.NewNumeric(&field.Spec{
Length: 6,
Description: "Systems Trace Audit Number (STAN)",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
Pad: padding.Left('0'),
}),
12: field.NewString(&field.Spec{
Length: 6,
Description: "Local Transaction Time",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
13: field.NewString(&field.Spec{
Length: 4,
Description: "Local Transaction Date",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
15: field.NewString(&field.Spec{
Length: 4,
Description: "Settlement Date",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
17: field.NewString(&field.Spec{
Length: 4,
Description: "Capture Date",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
25: field.NewString(&field.Spec{
Length: 2,
Description: "Point of Service Condition Code",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
32: field.NewString(&field.Spec{
Length: 99,
Description: "Acquiring Institution Identification Code",
Enc: encoding.ASCII,
Pref: prefix.ASCII.LL,
}),
37: field.NewString(&field.Spec{
Length: 12,
Description: "Retrieval Reference Number",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
38: field.NewString(&field.Spec{
Length: 6,
Description: "Authorization Identification Response",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
39: field.NewString(&field.Spec{
Length: 2,
Description: "Response Code",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
41: field.NewString(&field.Spec{
Length: 16,
Description: "Card Acceptor Terminal Identification",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
43: field.NewString(&field.Spec{
Length: 40,
Description: "Card Acceptor Name/Location",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
48: field.NewString(&field.Spec{
Length: 99,
Description: "Additional Data - Retailer Data",
Enc: encoding.ASCII,
Pref: prefix.ASCII.LL,
}),
49: field.NewString(&field.Spec{
Length: 3,
Description: "Transaction Currency Code",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
54: field.NewString(&field.Spec{
Length: 99,
Description: "Additional Amounts",
Enc: encoding.ASCII,
Pref: prefix.ASCII.LL,
}),
58: field.NewString(&field.Spec{
Length: 999,
Description: "Loyalty Data",
Enc: encoding.ASCII,
Pref: prefix.ASCII.LLL,
}),
63: field.NewString(&field.Spec{
Length: 999,
Description: "POS Additional Data",
Enc: encoding.ASCII,
Pref: prefix.ASCII.LLL,
}),
70: field.NewString(&field.Spec{
Length: 3,
Description: "Network Management Information Code",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
90: field.NewString(&field.Spec{
Length: 99,
Description: "Original Data Elements",
Enc: encoding.ASCII,
Pref: prefix.ASCII.Fixed,
}),
},
}