Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
1b44713
HW-52585 UI - Receipt Details
Jun 12, 2019
6f222bd
remove unnecessary configs
Jun 12, 2019
4d87981
formatted amounts
Jun 12, 2019
5ffbcb3
remove static
Jun 12, 2019
30d585a
fixed variable name
Jun 12, 2019
c692629
refactored methods
Jun 13, 2019
f7cf238
Merge remote-tracking branch 'remotes/origin/development' into featur…
Jun 13, 2019
8987e71
added 12-HR to 24-HR and vice-versa formatter
Jun 14, 2019
5c00306
granular code {^__^}
Jun 14, 2019
1241fdc
convention
Jun 14, 2019
8d9138a
fix amount and transfer amount reversed
Jun 14, 2019
9d743d1
Merge remote-tracking branch 'remotes/origin/development' into featur…
Jun 14, 2019
465ecb9
fix date localization formatting to receipt views
Jun 17, 2019
bf61a05
update background effect to use ripple, added todos for currency form…
Jun 17, 2019
8163d53
ui specs changes
Jun 17, 2019
cf23ee8
update notes value layout
Jun 17, 2019
83d424d
try remove lint exception
Jun 17, 2019
972dd0c
fixed lint
Jun 17, 2019
7ddf49d
by design decision removing binding classes into duplicate code
Jun 18, 2019
2be481e
synced with core sdk
Jun 18, 2019
7443ad6
fixing typo
fmattos-hw Jun 18, 2019
ff14349
revert rename
Jun 18, 2019
43b351f
Automation for receipt details and receipt network retry (#43)
skoong Jun 18, 2019
9a87a91
added finalizer identifiers
Jun 18, 2019
1127fc1
Merge branch 'development' into feature/HW-52585-ui-receipt-details
skoong Jun 18, 2019
ca29ad4
Updating response throttling
skoong Jun 18, 2019
2ac6d59
renamed receipts to user list specific
Jun 19, 2019
680b4c6
changed singletone to immutable data source factory
Jun 19, 2019
0f5e5d5
generalized view model so that we can reuse the user receipt view for…
Jun 19, 2019
4082b82
added data source for prepaid card and test equivalent unit test
Jun 19, 2019
109db66
initial integration of ppc and user receipts
Jun 19, 2019
5d28e64
Merge remote-tracking branch 'remotes/origin/development' into featur…
Jun 19, 2019
77ade14
fixed test
Jun 19, 2019
21175ff
removed extra import
Jun 21, 2019
7cf603c
local review
Jun 24, 2019
d8fa65b
Merge remote-tracking branch 'remotes/origin/development' into featur…
Jun 24, 2019
d4c97ea
change data
Jun 25, 2019
e47433c
fix javadocs
Jun 26, 2019
73fd500
removed unused exception in test
Jun 27, 2019
9383ef8
Implement UI tests for ppc receipts
skoong Jul 2, 2019
b05e594
Merge branches 'development' and 'task/HW-53039-receipt-ppc-ui-tests'…
skoong Jul 2, 2019
d03e02c
Removing unused response file
skoong Jul 3, 2019
1f2df89
Merge branch 'development' into task/HW-53039-receipt-ppc-ui-tests
skoong Jul 3, 2019
9cebd36
Merge branch 'development' into task/HW-53039-receipt-ppc-ui-tests
skoong Jul 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void testListReceipt_userHasMultipleTransactions() {
onView(withId(R.id.list_receipts)).check(matches(atPosition(0,
hasDescendant(withText(com.hyperwallet.android.ui.receipt.R.string.credit)))));
onView(withId(R.id.list_receipts)).check(
matches(atPosition(0, hasDescendant(withText("Payment")))));
matches(atPosition(0, hasDescendant(withText(R.string.payment)))));
onView(withId(R.id.list_receipts)).check(
matches(atPosition(0, hasDescendant(withText("+ 20.00")))));
onView(withId(R.id.list_receipts)).check(
Expand All @@ -120,7 +120,7 @@ public void testListReceipt_userHasMultipleTransactions() {
onView(withId(R.id.list_receipts)).check(matches(atPosition(1,
hasDescendant(withText(com.hyperwallet.android.ui.receipt.R.string.credit)))));
onView(withId(R.id.list_receipts)).check(
matches(atPosition(1, hasDescendant(withText("Payment")))));
matches(atPosition(1, hasDescendant(withText(R.string.payment)))));
onView(withId(R.id.list_receipts)).check(
matches(atPosition(1, hasDescendant(withText("+ 25.00")))));
onView(withId(R.id.list_receipts)).check(
Expand All @@ -130,7 +130,7 @@ public void testListReceipt_userHasMultipleTransactions() {
onView(withId(R.id.list_receipts)).check(matches(atPosition(2,
hasDescendant(withText(com.hyperwallet.android.ui.receipt.R.string.debit)))));
onView(withId(R.id.list_receipts)).check(
matches(atPosition(2, hasDescendant(withText("Card Activation Fee")))));
matches(atPosition(2, hasDescendant(withText(R.string.card_activation_fee)))));
onView(withId(R.id.list_receipts)).check(
matches(atPosition(2, hasDescendant(withText("- 1.95")))));
onView(withId(R.id.list_receipts)).check(
Expand All @@ -142,7 +142,7 @@ public void testListReceipt_userHasMultipleTransactions() {
onView(withId(R.id.list_receipts)).check(matches(atPosition(3,
hasDescendant(withText(com.hyperwallet.android.ui.receipt.R.string.debit)))));
onView(withId(R.id.list_receipts)).check(
matches(atPosition(3, hasDescendant(withText("Card Load")))));
matches(atPosition(3, hasDescendant(withText(R.string.transfer_to_prepaid_card)))));
onView(withId(R.id.list_receipts)).check(
matches(atPosition(3, hasDescendant(withText("- 18.05")))));
onView(withId(R.id.list_receipts)).check(
Expand Down Expand Up @@ -417,7 +417,7 @@ public void testListReceipt_checkDateTextOnLocaleChange() {
@Test
public void testListReceipt_displaysNetworkErrorDialogOnConnectionTimeout() {
mMockWebServer.getServer().enqueue(new MockResponse().setResponseCode(HTTP_OK).setBody(sResourceManager
.getResourceContent("receipt_debit_response.json")).throttleBody(512, 15, TimeUnit.SECONDS));
.getResourceContent("receipt_debit_response.json")).throttleBody(512, 10, TimeUnit.SECONDS));
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager
.getResourceContent("receipt_debit_response.json")).mock();
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_NO_CONTENT).withBody("").mock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.hyperwallet.android.model.paging.HyperwalletPageList;
import com.hyperwallet.android.model.receipt.Receipt;
import com.hyperwallet.android.model.receipt.ReceiptQueryParam;
import com.hyperwallet.android.ui.common.util.EspressoIdlingResource;
import com.hyperwallet.android.ui.common.viewmodel.Event;
import com.hyperwallet.android.util.DateUtil;

Expand Down Expand Up @@ -79,6 +80,7 @@ public void loadInitial(@NonNull final LoadInitialParams<Date> params,
.createdAfter(mCalendarYearBeforeNow.getTime())
.sortByCreatedOnDesc().build();

EspressoIdlingResource.increment();
getHyperwallet().listPrepaidCardReceipts(mToken, queryParam,
new HyperwalletListener<HyperwalletPageList<Receipt>>() {
@Override
Expand All @@ -93,12 +95,14 @@ public void onSuccess(@Nullable HyperwalletPageList<Receipt> result) {
// reset
mLoadInitialCallback = null;
mLoadInitialParams = null;
EspressoIdlingResource.decrement();
}

@Override
public void onFailure(HyperwalletException exception) {
mIsFetchingData.postValue(Boolean.FALSE);
mErrors.postValue(new Event<>(exception.getHyperwalletErrors()));
EspressoIdlingResource.decrement();
}

@Override
Expand Down Expand Up @@ -130,6 +134,7 @@ public void loadAfter(@NonNull final LoadParams<Date> params, @NonNull final Loa
.limit(params.requestedLoadSize)
.sortByCreatedOnDesc().build();

EspressoIdlingResource.increment();
getHyperwallet().listPrepaidCardReceipts(mToken, queryParam,
new HyperwalletListener<HyperwalletPageList<Receipt>>() {
@Override
Expand All @@ -144,12 +149,14 @@ public void onSuccess(@Nullable HyperwalletPageList<Receipt> result) {
// reset
mLoadAfterCallback = null;
mLoadAfterParams = null;
EspressoIdlingResource.decrement();
}

@Override
public void onFailure(HyperwalletException exception) {
mIsFetchingData.postValue(Boolean.FALSE);
mErrors.postValue(new Event<>(exception.getHyperwalletErrors()));
EspressoIdlingResource.decrement();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
import static org.mockito.Mockito.verify;

import static com.hyperwallet.android.model.receipt.Receipt.Entries.CREDIT;
import static com.hyperwallet.android.model.receipt.Receipt.Entries.DEBIT;
import static com.hyperwallet.android.model.receipt.Receipt.ReceiptTypes.ADJUSTMENT;
import static com.hyperwallet.android.model.receipt.Receipt.ReceiptTypes.DEPOSIT;
import static com.hyperwallet.android.model.receipt.Receipt.ReceiptTypes.PREPAID_CARD_SALE;

import androidx.paging.PageKeyedDataSource;

Expand Down Expand Up @@ -88,7 +90,7 @@ public void setUp() {

@Test
public void testLoadInitial_returnsReceipts() throws Exception {
String json = mExternalResourceManager.getResourceContent("prepaid_card_receipt_list.json");
String json = mExternalResourceManager.getResourceContent("prepaid_card_receipt_list_response.json");
JSONObject jsonObject = new JSONObject(json);
final HyperwalletPageList<Receipt> response = new HyperwalletPageList<>(jsonObject, Receipt.class);

Expand Down Expand Up @@ -118,9 +120,9 @@ public Object answer(InvocationOnMock invocation) {
List<Receipt> receipts = mListArgumentCaptor.getValue();
assertThat(receipts, Matchers.<Receipt>hasSize(7));
assertThat(receipts.get(0).getJournalId(), is("FISVL_5240220"));
assertThat(receipts.get(0).getType(), is(DEPOSIT));
assertThat(receipts.get(0).getType(), is(PREPAID_CARD_SALE));
assertThat(receipts.get(0).getCreatedOn(), is("2019-06-06T22:48:41"));
assertThat(receipts.get(0).getEntry(), is(CREDIT));
assertThat(receipts.get(0).getEntry(), is(DEBIT));
assertThat(receipts.get(0).getDestinationToken(), is("trm-2e02da75-a36c-4723-b613-0b64e6f582d9"));
assertThat(receipts.get(0).getAmount(), is("10.00"));
assertThat(receipts.get(0).getCurrency(), is("USD"));
Expand Down Expand Up @@ -245,7 +247,7 @@ public Object answer(InvocationOnMock invocation) {

@Test
public void testLoadAfter_returnsReceipts() throws Exception {
String json = mExternalResourceManager.getResourceContent("prepaid_card_receipt_list.json");
String json = mExternalResourceManager.getResourceContent("prepaid_card_receipt_list_response.json");
JSONObject jsonObject = new JSONObject(json);
final HyperwalletPageList<Receipt> response = new HyperwalletPageList<>(jsonObject, Receipt.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"data": [
{
"journalId": "FISVL_5240220",
"type": "DEPOSIT",
"createdOn": "2019-06-06T22:48:41",
"entry": "CREDIT",
"destinationToken": "trm-2e02da75-a36c-4723-b613-0b64e6f582d9",
"amount": "15.00",
"currency": "CAD",
"details": {
"cardNumber": "************0673"
}
}
],
"links": [
{
"params": {
"rel": "self"
},
"href": "https://qamaster-hyperwallet.aws.paylution.net/rest/v3/users/usr-e17ae43b-284d-4198-9585-f417943c624f/prepaid-cards/trm-2e02da75-a36c-4723-b613-0b64e6f582d9/receipts"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"data": [
{
"journalId": "FISA_5240222",
"type": "ADJUSTMENT",
"createdOn": "2019-06-01T22:49:17",
"entry": "DEBIT",
"sourceToken": "trm-2e02da75-a36c-4723-b613-0b64e6f582d9",
"amount": "8.90",
"currency": "USD",
"details": {
"cardNumber": "************0673"
}
}
],
"links": [
{
"params": {
"rel": "self"
},
"href": "https://qamaster-hyperwallet.aws.paylution.net/rest/v3/users/usr-e17ae43b-284d-4198-9585-f417943c624f/prepaid-cards/trm-2e02da75-a36c-4723-b613-0b64e6f582d9/receipts"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@
"data": [
{
"journalId": "FISVL_5240220",
"type": "DEPOSIT",
"type": "PREPAID_CARD_SALE",
"createdOn": "2019-06-06T22:48:41",
"entry": "CREDIT",
"entry": "DEBIT",
"destinationToken": "trm-2e02da75-a36c-4723-b613-0b64e6f582d9",
"amount": "10.00",
"fee": "3.00",
"currency": "USD",
"details": {
"cardNumber": "************0673"
"cardNumber": "************0673",
"clientPaymentId": "AOxXefx9",
"payeeName": "A Person",
"website": "https://api.sandbox.hyperwallet.com",
"notes": "Sample prepaid card payment for the period of June 15th, 2019 to July 23, 2019",
"charityName": "Sample Charity",
"checkNumber": "Sample Check Number"
}
},
{
Expand All @@ -27,7 +34,7 @@
{
"journalId": "FISA_5240222",
"type": "ADJUSTMENT",
"createdOn": "2019-06-06T22:49:17",
"createdOn": "2019-06-01T22:49:17",
"entry": "DEBIT",
"sourceToken": "trm-2e02da75-a36c-4723-b613-0b64e6f582d9",
"amount": "8.90",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"data": [
{
"journalId": "FISVL_5240220",
"type": "CARD_WAIVER_FEE",
"createdOn": "2019-06-06T22:48:41",
"entry": "CREDIT",
"destinationToken": "trm-2e02da75-a36c-4723-b613-0b64e6f582d9",
"amount": "15.00",
"currency": "CAD",
"details": {
"cardNumber": "************0673"
}
}
],
"links": [
{
"params": {
"rel": "self"
},
"href": "https://qamaster-hyperwallet.aws.paylution.net/rest/v3/users/usr-e17ae43b-284d-4198-9585-f417943c624f/prepaid-cards/trm-2e02da75-a36c-4723-b613-0b64e6f582d9/receipts"
}
]
}