Skip to content

Commit

Permalink
Merge pull request #79 from hyperwallet/feature/HW-66771-V4-BankAccounts
Browse files Browse the repository at this point in the history
Changes for HW-66771 V4 Bank Accounts
  • Loading branch information
akalichety-hw committed Sep 11, 2020
2 parents ac57a04 + 558dce7 commit b480cc0
Show file tree
Hide file tree
Showing 17 changed files with 597 additions and 4 deletions.
Expand Up @@ -7,6 +7,7 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;
import java.util.List;

@JsonFilter(HyperwalletJsonConfiguration.INCLUSION_FILTER)
@XmlRootElement
Expand Down Expand Up @@ -79,6 +80,7 @@ public static enum Status {ACTIVATED, INVALID, DE_ACTIVATED}
private String stateProvince;
private String postalCode;
private String country;
private List<HyperwalletLink> links;

public String getToken() {
return token;
Expand Down Expand Up @@ -1234,4 +1236,25 @@ public HyperwalletBankAccount clearCountry() {
country = null;
return this;
}

public List<HyperwalletLink> getLinks() {
return links;
}

public void setLinks(List<HyperwalletLink> links) {
addField("links", links);
this.links = links;
}

public HyperwalletBankAccount links(List<HyperwalletLink> links) {
addField("links", links);
this.links = links;
return this;
}

public HyperwalletBankAccount clearLinks() {
clearField("links");
this.links = null;
return this;
}
}
Expand Up @@ -33,7 +33,6 @@ public enum Status {
private String notes;
private List<HyperwalletLink> links;


public String getToken() {
return token;
}
Expand Down
327 changes: 327 additions & 0 deletions src/test/java/com/hyperwallet/clientsdk/HyperwalletIT.java

Large diffs are not rendered by default.

@@ -1,13 +1,18 @@
package com.hyperwallet.clientsdk.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
* @author fkrauthan
*/
public class HyperwalletBankAccountTest extends BaseModelTest<HyperwalletBankAccount> {
protected HyperwalletBankAccount createBaseModel() {
HyperwalletBankAccount bankAccount = new HyperwalletBankAccount();
List<HyperwalletLink> hyperwalletLinkList = new ArrayList<>();
HyperwalletLink hyperwalletLink = new HyperwalletLink();
hyperwalletLinkList.add(hyperwalletLink);
bankAccount
.token("test-token")

Expand Down Expand Up @@ -74,7 +79,8 @@ protected HyperwalletBankAccount createBaseModel() {
.city("test-city")
.stateProvince("test-state-province")
.postalCode("test-postal-code")
.country("test-country");
.country("test-country")
.links(hyperwalletLinkList);

return bankAccount;
}
Expand Down
Expand Up @@ -24,8 +24,8 @@ protected HyperwalletStatusTransition createBaseModel() {
.fromStatus(HyperwalletStatusTransition.Status.LOCKED)
.toStatus(HyperwalletStatusTransition.Status.ACTIVATED)
.createdOn(new Date())
.links(hyperwalletLinkList)
.notes("test-notes");
.notes("test-notes")
.links(hyperwalletLinkList);
return transition;
}

Expand Down
12 changes: 12 additions & 0 deletions src/test/resources/integration/createBankAccount-request.txt
@@ -0,0 +1,12 @@
curl -X "POST" "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-c4292f1a-866f-4310-a289-b916853939de/bank-accounts" \
-u testuser@12345678:myAccPassw0rd \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "{
"transferMethodCountry": "US",
"transferMethodCurrency": "USD",
"type": "BANK_ACCOUNT",
"branchId": "021000021",
"bankAccountId": "1234",
"bankAccountPurpose": "SAVINGS"
}"
35 changes: 35 additions & 0 deletions src/test/resources/integration/createBankAccount-response.json
@@ -0,0 +1,35 @@
{
"token": "trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f",
"type": "BANK_ACCOUNT",
"status": "ACTIVATED",
"createdOn": "2020-09-08T15:01:07",
"transferMethodCountry": "US",
"transferMethodCurrency": "USD",
"bankName": "JPMORGAN CHASE BANK",
"branchId": "021000021",
"bankAccountId": "1599557466",
"bankAccountPurpose": "SAVINGS",
"userToken": "usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad",
"profileType": "INDIVIDUAL",
"firstName": "firstName",
"lastName": "lastName",
"dateOfBirth": "2000-09-08T15:01:07",
"gender": "MALE",
"phoneNumber": "605-555-1323",
"mobileNumber": "605-555-1323",
"governmentId": "444444444",
"addressLine1": "1234 IndividualAddress St",
"addressLine2": "1234 AddressLineTwo St",
"city": "Test1111",
"stateProvince": "CA",
"country": "US",
"postalCode": "12345",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad/bank-accounts/trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f"
}
]
}
@@ -0,0 +1,7 @@
curl -X "POST" "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-c4292f1a-866f-4310-a289-b916853939de/bank-accounts/trm-d69300ef-5011-486b-bd2e-bfd8b20fef26/status-transitions" \
-u testuser@12345678:myAccPassw0rd \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "{
"transition": "DE_ACTIVATED"
}"
16 changes: 16 additions & 0 deletions src/test/resources/integration/deactivateBankAccount-response.json
@@ -0,0 +1,16 @@
{
"token": "sts-1825afa2-61f1-4860-aa69-a65b9d14f556",
"createdOn": "2017-11-16T00:55:57",
"transition": "DE_ACTIVATED",
"fromStatus": "ACTIVATED",
"toStatus": "DE_ACTIVATED",
"notes": "Closing this account.",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-f695ef43-9614-4e17-9269-902c234616c3/bank-accounts/trm-d69300ef-5011-486b-bd2e-bfd8b20fef26/status-transitions/sts-1825afa2-61f1-4860-aa69-a65b9d14f556"
}
]
}
3 changes: 3 additions & 0 deletions src/test/resources/integration/getBankAccount-request.txt
@@ -0,0 +1,3 @@
curl -X "GET" "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad/bank-accounts/trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f" \
-u testuser@12345678:myAccPassw0rd \
-H "Accept: application/json"
35 changes: 35 additions & 0 deletions src/test/resources/integration/getBankAccount-response.json
@@ -0,0 +1,35 @@
{
"token": "trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f",
"type": "BANK_ACCOUNT",
"status": "DE_ACTIVATED",
"createdOn": "2020-09-08T15:01:07",
"transferMethodCountry": "US",
"transferMethodCurrency": "USD",
"bankName": "JPMORGAN CHASE BANK",
"branchId": "021000021",
"bankAccountId": "1599557466",
"bankAccountPurpose": "SAVINGS",
"userToken": "usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad",
"profileType": "INDIVIDUAL",
"firstName": "firstName",
"lastName": "lastName",
"dateOfBirth": "2000-09-08T15:01:07",
"gender": "MALE",
"phoneNumber": "605-555-1323",
"mobileNumber": "605-555-1323",
"governmentId": "444444444",
"addressLine1": "1234 IndividualAddress St",
"addressLine2": "1234 AddressLineTwo St",
"city": "Test1111",
"stateProvince": "CA",
"country": "US",
"postalCode": "12345",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad/bank-accounts/trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f"
}
]
}
@@ -0,0 +1,3 @@
curl -X "GET" "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad/bank-accounts/trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f/status-transitions" \
-u testuser@12345678:myAccPassw0rd \
-H "Accept: application/json"
@@ -0,0 +1,31 @@
{
"hasNextPage": false,
"hasPreviousPage": false,
"limit": 100,
"data": [
{
"token": "sts-1834b075-ee3c-4c00-b1dc-a517fe8a87ab",
"createdOn": "2020-09-08T15:01:58",
"transition": "DE_ACTIVATED",
"fromStatus": "ACTIVATED",
"toStatus": "DE_ACTIVATED",
"notes": "Deactivating card",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad/bank-accounts/trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f/status-transitions/sts-1834b075-ee3c-4c00-b1dc-a517fe8a87ab"
}
]
}
],
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad/bank-accounts/trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f/status-transitions?limit=100"
}
]
}
3 changes: 3 additions & 0 deletions src/test/resources/integration/listBankAccounts-request.txt
@@ -0,0 +1,3 @@
curl -X "GET" "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad/bank-accounts" \
-u testuser@12345678:myAccPassw0rd \
-H "Accept: application/json"
51 changes: 51 additions & 0 deletions src/test/resources/integration/listBankAccounts-response.json
@@ -0,0 +1,51 @@
{
"hasNextPage": false,
"hasPreviousPage": false,
"limit": 100,
"data": [
{
"token": "trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f",
"type": "BANK_ACCOUNT",
"status": "DE_ACTIVATED",
"verificationStatus": "NOT_REQUIRED",
"createdOn": "2020-09-08T15:01:07",
"transferMethodCountry": "US",
"transferMethodCurrency": "USD",
"bankName": "JPMORGAN CHASE BANK",
"branchId": "021000021",
"bankAccountId": "1599557466",
"bankAccountPurpose": "SAVINGS",
"userToken": "usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad",
"profileType": "INDIVIDUAL",
"firstName": "firstName",
"lastName": "lastName",
"dateOfBirth": "2000-09-08T15:01:07",
"gender": "MALE",
"phoneNumber": "605-555-1323",
"mobileNumber": "605-555-1323",
"governmentId": "444444444",
"addressLine1": "1234 IndividualAddress St",
"addressLine2": "1234 AddressLineTwo St",
"city": "Test1111",
"stateProvince": "CA",
"country": "US",
"postalCode": "12345",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad/bank-accounts/trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f"
}
]
}
],
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad/bank-accounts?limit=100"
}
]
}
7 changes: 7 additions & 0 deletions src/test/resources/integration/updateBankAccount-request.txt
@@ -0,0 +1,7 @@
curl -X "PUT" "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-c4292f1a-866f-4310-a289-b916853939de/bank-accounts/trm-950a3055-e54c-456f-beb2-c6f6d42eddce" \
-u testuser@12345678:myAccPassw0rd \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "{
"firstName": "FirstNameChanged"
}"
35 changes: 35 additions & 0 deletions src/test/resources/integration/updateBankAccount-response.json
@@ -0,0 +1,35 @@
{
"token": "trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f",
"type": "BANK_ACCOUNT",
"status": "ACTIVATED",
"createdOn": "2020-09-08T15:01:07",
"transferMethodCountry": "US",
"transferMethodCurrency": "USD",
"bankName": "JPMORGAN CHASE BANK",
"branchId": "021000021",
"bankAccountId": "1599557466",
"bankAccountPurpose": "SAVINGS",
"userToken": "usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad",
"profileType": "INDIVIDUAL",
"firstName": "FirstNameChanged",
"lastName": "lastName",
"dateOfBirth": "2000-09-08T15:01:07",
"gender": "MALE",
"phoneNumber": "605-555-1323",
"mobileNumber": "605-555-1323",
"governmentId": "444444444",
"addressLine1": "1234 IndividualAddress St",
"addressLine2": "1234 AddressLineTwo St",
"city": "Test1111",
"stateProvince": "CA",
"country": "US",
"postalCode": "12345",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://api.sandbox.hyperwallet.com/rest/v4/users/usr-321ad2c1-df3f-4a7a-bce4-3e88416b54ad/bank-accounts/trm-2bd0b56d-e111-4d12-bd24-d77fc02b9f4f"
}
]
}

0 comments on commit b480cc0

Please sign in to comment.