-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathissue92_test.go
104 lines (99 loc) · 2.82 KB
/
issue92_test.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
package wire
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestFedWireMessage_verifyIssue92(t *testing.T) {
fwm := issue92FedWireMessage()
require.NoError(t, fwm.verify())
}
// this is the payload reported in issue 92 (bug in fwm validation)
func issue92FedWireMessage() *FEDWireMessage {
fwm := &FEDWireMessage{}
fwm.MessageDisposition = &MessageDisposition{
tag: TagMessageDisposition,
FormatVersion: FormatVersion,
TestProductionCode: EnvironmentTest,
}
fwm.SenderSupplied = &SenderSupplied{
tag: TagSenderSupplied,
FormatVersion: FormatVersion,
UserRequestCorrelation: "TESTDATA",
TestProductionCode: EnvironmentTest,
MessageDuplicationCode: MessageDuplicationOriginal,
}
fwm.TypeSubType = &TypeSubType{
tag: TagTypeSubType,
TypeCode: FundsTransfer,
SubTypeCode: BasicFundsTransfer,
}
fwm.InputMessageAccountabilityData = &InputMessageAccountabilityData{
tag: TagInputMessageAccountabilityData,
InputCycleDate: "20180922",
InputSource: "XYZ ABC",
InputSequenceNumber: "000001",
}
fwm.Amount = &Amount{
tag: TagAmount,
Amount: "000000000250",
}
fwm.SenderDepositoryInstitution = &SenderDepositoryInstitution{
tag: TagSenderDepositoryInstitution,
SenderABANumber: "000714895",
SenderShortName: "Fake Institution",
}
fwm.ReceiverDepositoryInstitution = &ReceiverDepositoryInstitution{
tag: TagReceiverDepositoryInstitution,
ReceiverABANumber: "000738119",
ReceiverShortName: "Fake Institution",
}
fwm.BusinessFunctionCode = &BusinessFunctionCode{
tag: TagBusinessFunctionCode,
BusinessFunctionCode: CustomerTransfer,
TransactionTypeCode: " ",
}
fwm.Charges = &Charges{
tag: TagCharges,
ChargeDetails: CDBeneficiary,
SendersChargesOne: "USD0",
SendersChargesTwo: "USD0",
SendersChargesThree: "USD0",
SendersChargesFour: "USD0",
}
fwm.InstructedAmount = &InstructedAmount{
tag: TagInstructedAmount,
CurrencyCode: "USD",
Amount: "000000000250",
}
fwm.ExchangeRate = &ExchangeRate{
tag: TagExchangeRate,
ExchangeRate: "1.3624055125",
}
fwm.Beneficiary = &Beneficiary{
tag: TagBeneficiary,
Personal: Personal{
IdentificationCode: SWIFTBICORBEIANDAccountNumber,
Identifier: "755756",
Name: "string",
Address: Address{
AddressLineOne: " ",
AddressLineTwo: " ",
AddressLineThree: " ",
},
},
}
fwm.Originator = &Originator{
tag: TagOriginator,
Personal: Personal{
IdentificationCode: SWIFTBICORBEIANDAccountNumber,
Identifier: "798260",
Name: "string",
Address: Address{
AddressLineOne: " ",
AddressLineTwo: " ",
AddressLineThree: " ",
},
},
}
return fwm
}