Skip to content

Commit e4da440

Browse files
committed
reverse fee, recurring payment updates, atm deposit simulation, related java tests
1 parent 933b61f commit e4da440

20 files changed

+422
-47
lines changed

schemas/counterparty/counterparty.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
"type": "object",
2020
"properties": {
2121
"type": {
22-
"type": "string"
22+
"type": "string",
23+
"enum": ["achCounterparty"],
24+
"default": "achCounterparty"
2325
},
2426
"id": {
2527
"$ref": "../types.json#/components/schemas/Identifier"

schemas/counterparty/createCounterparty.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
"type": "object",
1919
"properties": {
2020
"type": {
21-
"type": "string"
21+
"type": "string",
22+
"enum": ["achCounterparty"],
23+
"default": "achCounterparty"
2224
},
2325
"attributes": {
2426
"type": "object",

schemas/payment/createRecurringPayment.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"additionalProperties": false
146146
},
147147
"relationships": {
148-
"$ref": "./createPayment.json#/components/schemas/CreatePaymentRelationshipsWithCounterparty"
148+
"$ref": "./createPayment.json#/components/schemas/CreatePaymentRelationshipsWithCounterpartyAccount"
149149
}
150150
},
151151
"additionalProperties": false,
@@ -165,7 +165,15 @@
165165
{
166166
"$ref": "#/components/schemas/CreateRecurringCreditBookPayment"
167167
}
168-
]
168+
],
169+
"discriminator": {
170+
"propertyName": "type",
171+
"mapping": {
172+
"$recurringCreditAchPayment": "#/components/schemas/CreateRecurringCreditAchPayment",
173+
"recurringDebitAchPayment": "#/components/schemas/CreateRecurringDebitAchPayment",
174+
"recurringCreditBookPayment": "#/components/schemas/CreateRecurringCreditBookPayment"
175+
}
176+
}
169177
}
170178
},
171179
"additionalProperties": false,

schemas/payment/paymentsPaths.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,18 @@
652652
"description": "ID of the payment to disable"
653653
}
654654
],
655+
"requestBody": {
656+
"description": "Pass empty object in order for content-type to be aquired correctly",
657+
"required": true,
658+
"content": {
659+
"application/vnd.api+json": {
660+
"schema": {
661+
"type": "object",
662+
"nullable": true
663+
}
664+
}
665+
}
666+
},
655667
"description": "Disable Recurring Payment via API ",
656668
"responses": {
657669
"200": {
@@ -684,6 +696,18 @@
684696
"description": "ID of the payment to enable"
685697
}
686698
],
699+
"requestBody": {
700+
"description": "Pass empty object in order for content-type to be aquired correctly",
701+
"required": true,
702+
"content": {
703+
"application/vnd.api+json": {
704+
"schema": {
705+
"type": "object",
706+
"nullable": true
707+
}
708+
}
709+
}
710+
},
687711
"description": "Enable Recurring Payment via API ",
688712
"responses": {
689713
"200": {

schemas/relationships.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@
470470
"properties": {
471471
"type": {
472472
"type": "string",
473+
"enum": ["counterparty"],
473474
"default": "counterparty"
474475
},
475476
"id": {
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"components": {
3+
"schemas": {
4+
"CreateAtmDepositSimulationRelationships": {
5+
"allOf": [
6+
{
7+
"title": "Create Atm Deposit Simulation Relationships",
8+
"required": ["account"]
9+
},
10+
{
11+
"$ref": "../../relationships.json#/components/schemas/DepositAccountRelationship"
12+
}
13+
]
14+
},
15+
"CreateAtmDepositSimulationRequest": {
16+
"type": "object",
17+
"properties": {
18+
"data": {
19+
"type": "object",
20+
"properties": {
21+
"type": {
22+
"type": "string",
23+
"enum": ["atmTransaction"],
24+
"default": "atmTransaction"
25+
},
26+
"attributes": {
27+
"type": "object",
28+
"properties": {
29+
"amount": {
30+
"type": "number"
31+
},
32+
"atmName": {
33+
"type": "string"
34+
},
35+
"atmLocation": {
36+
"type": "string"
37+
},
38+
"last4Digits": {
39+
"type": "string",
40+
"minLength": 4,
41+
"maxLength": 4
42+
},
43+
"cardNetwork": {
44+
"type": "string",
45+
"enum": [
46+
"Visa",
47+
"Interlink",
48+
"Accel",
49+
"Allpoint",
50+
"Other"
51+
]
52+
},
53+
"surcharge": {
54+
"type": "number"
55+
}
56+
},
57+
"required": ["amount", "atmName", "last4Digits"]
58+
},
59+
"relationships": {
60+
"$ref": "#/components/schemas/CreateAtmDepositSimulationRelationships"
61+
}
62+
},
63+
"required": ["type", "attributes", "relationships"]
64+
}
65+
},
66+
"required": ["data"]
67+
}
68+
}
69+
}
70+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"createAtmDeposit": {
3+
"post": {
4+
"tags": ["unit"],
5+
"operationId": "createAtmDepositSimulation",
6+
7+
"summary": "Create Atm Deposit Simulation",
8+
"description": "Create Atm Deposit Simulation via API ",
9+
"requestBody": {
10+
"description": "Create Atm Deposit Simulation Request",
11+
"required": true,
12+
"content": {
13+
"application/vnd.api+json": {
14+
"schema": {
15+
"$ref": "./card/createAtmDepositSimulation.json#/components/schemas/CreateAtmDepositSimulationRequest"
16+
}
17+
}
18+
}
19+
},
20+
"responses": {
21+
"201": {
22+
"description": "Successful Response",
23+
"content": {
24+
"application/vnd.api+json": {
25+
"schema": {
26+
"$ref": "../account/accountPaths.json#/components/schemas/UnitDepositAccountResponse"
27+
}
28+
}
29+
}
30+
}
31+
}
32+
}
33+
}
34+
}

schemas/tax-forms/taxFormsPaths.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
"get": {
6767
"tags": ["unit"],
6868
"operationId": "getTaxForm",
69-
7069
"parameters": [
7170
{
7271
"schema": {

schemas/types.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,8 @@
669669
"properties": {
670670
"interval": {
671671
"type": "string",
672-
"enum": ["Montly"],
673-
"default": "Montly"
672+
"enum": ["Monthly"],
673+
"default": "Monthly"
674674
}
675675
},
676676
"required": ["interval"]

unit/e2e_tests/java/AccountTests.java

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,7 @@ public void UpdateAccountApiTest() throws ApiException {
110110
});
111111
}
112112

113-
public static DepositAccount CreateDepositAccount(UnitApi unitApi, Customer.TypeEnum customerType) throws ApiException {
114-
Customer customer;
115-
if(customerType == Customer.TypeEnum.INDIVIDUAL_CUSTOMER) { customer = CreateIndividualCustomer(unitApi); }
116-
else { customer = CreateBusinessCustomer(unitApi); }
117-
113+
public static DepositAccount CreateDepositAccount(UnitApi unitApi, Customer customer) throws ApiException {
118114
CreateDepositAccount cda = new CreateDepositAccount();
119115
CreateDepositAccountAttributes attributes = new CreateDepositAccountAttributes();
120116
attributes.setDepositProduct("checking");
@@ -142,11 +138,11 @@ public static DepositAccount CreateDepositAccount(UnitApi unitApi, Customer.Type
142138

143139
@Test
144140
public void CreateDepositAccountApiTest() throws ApiException {
145-
CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
141+
CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
146142
}
147143

148144
DepositAccount CreateAndCloseDepositAccount() throws ApiException {
149-
DepositAccount depositAccount = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
145+
DepositAccount depositAccount = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
150146
CloseAccountRequest closeAccountRequest = new CloseAccountRequest();
151147
CloseAccountRequestData closeAccountRequestData = new CloseAccountRequestData();
152148
CloseAccountRequestDataAttributes closeAccountRequestAttributes = new CloseAccountRequestDataAttributes();
@@ -174,7 +170,7 @@ public void ReopenDepositAccountApiTest() throws ApiException {
174170
}
175171

176172
private DepositAccount CreateAndFreezeDepositAccount() throws ApiException {
177-
DepositAccount depositAccount = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
173+
DepositAccount depositAccount = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
178174
FreezeAccountRequest freezeAccountRequest = new FreezeAccountRequest();
179175
FreezeAccountRequestData freezeAccountRequestData = new FreezeAccountRequestData();
180176
FreezeAccountRequestDataAttributes freezeAccountRequestDataAttributes = new FreezeAccountRequestDataAttributes();
@@ -202,14 +198,14 @@ public void UnfreezeDepositAccountApiTest() throws ApiException {
202198

203199
@Test
204200
public void GetDepositAccountLimitsApiTest() throws ApiException {
205-
DepositAccount depositAccount = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
201+
DepositAccount depositAccount = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
206202
UnitGetAccountLimitsResponse res = unitApi.getAccountLimits(depositAccount.getId());
207203
assert res.getData().getType().equals(Limits.TypeEnum.LIMITS);
208204
}
209205

210206
@Test
211207
public void GetDepositAccountAvailableProducts() throws ApiException {
212-
DepositAccount depositAccount = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
208+
DepositAccount depositAccount = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
213209
UnitDepositProductsResponse res = unitApi.getDepositProductsList(depositAccount.getId());
214210
res.getData().forEach(product -> {
215211
assert product.getType().equals(DepositProduct.TypeEnum.ACCOUNT_DEPOSIT_PRODUCT);
@@ -218,7 +214,7 @@ public void GetDepositAccountAvailableProducts() throws ApiException {
218214

219215
@Test
220216
public void GetDepositAccountBalanceHistory() throws ApiException {
221-
DepositAccount depositAccount = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
217+
DepositAccount depositAccount = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
222218
ListPageParameters pageParams = new ListPageParameters();
223219
pageParams.setLimit(20);
224220
GetAccountBalanceHistoryFilterParameter mainFilters = new GetAccountBalanceHistoryFilterParameter();
@@ -230,7 +226,7 @@ public void GetDepositAccountBalanceHistory() throws ApiException {
230226
}
231227

232228
DepositAccount CreateDepositAccountAndAddOwnersToIt (List<DepositAccountOwner> owners) throws ApiException {
233-
DepositAccount depositAccount = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
229+
DepositAccount depositAccount = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
234230
AddAccountOwnersRequest addAccountOwnersRequest = new AddAccountOwnersRequest();
235231
addAccountOwnersRequest.setData(owners);
236232
UnitDepositAccountResponse res = unitApi.addAccountOwners(depositAccount.getId(), addAccountOwnersRequest);
@@ -241,8 +237,8 @@ DepositAccount CreateDepositAccountAndAddOwnersToIt (List<DepositAccountOwner> o
241237
@Test
242238
public void AddDepositAccountOwnersApiTest() throws ApiException {
243239
List<DepositAccountOwner> owners = new ArrayList<DepositAccountOwner>();
244-
DepositAccount depositAccountOne = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
245-
DepositAccount depositAccountTwo = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
240+
DepositAccount depositAccountOne = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
241+
DepositAccount depositAccountTwo = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
246242
DepositAccountOwner ownerOne = new DepositAccountOwner();
247243
ownerOne.setId(depositAccountOne.getId());
248244
ownerOne.setType(DepositAccountOwner.TypeEnum.CUSTOMER);
@@ -257,8 +253,8 @@ public void AddDepositAccountOwnersApiTest() throws ApiException {
257253
@Test
258254
public void RemoveDepositAccountOwnersApiTest() throws ApiException {
259255
List<DepositAccountOwner> owners = new ArrayList<DepositAccountOwner>();
260-
DepositAccount depositAccountOne = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
261-
DepositAccount depositAccountTwo = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
256+
DepositAccount depositAccountOne = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
257+
DepositAccount depositAccountTwo = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
262258
DepositAccountOwner ownerOne = new DepositAccountOwner();
263259
ownerOne.setId(depositAccountOne.getId());
264260
ownerOne.setType(DepositAccountOwner.TypeEnum.CUSTOMER);
@@ -438,7 +434,7 @@ public void ReopenWalletAccountApiTest() throws ApiException {
438434
}
439435

440436
WalletAccount CreateAndFreezeWalletAccount() throws ApiException {
441-
DepositAccount walletAccount = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
437+
DepositAccount walletAccount = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
442438
FreezeAccountRequest freezeAccountRequest = new FreezeAccountRequest();
443439
FreezeAccountRequestData freezeAccountRequestData = new FreezeAccountRequestData();
444440
FreezeAccountRequestDataAttributes freezeAccountRequestDataAttributes = new FreezeAccountRequestDataAttributes();
@@ -466,7 +462,7 @@ public void UnfreezeWalletAccountApiTest() throws ApiException {
466462

467463
@Test
468464
public void GetWalletAccountLimitsApiTest() throws ApiException {
469-
DepositAccount depositAccount = CreateDepositAccount(unitApi, Customer.TypeEnum.INDIVIDUAL_CUSTOMER);
465+
DepositAccount depositAccount = CreateDepositAccount(unitApi, CreateIndividualCustomer(unitApi));
470466
UnitGetAccountLimitsResponse res = unitApi.getAccountLimits(depositAccount.getId());
471467
assert res.getData().getType().equals(Limits.TypeEnum.WALLET_LIMITS);
472468
}

0 commit comments

Comments
 (0)