Skip to content

Commit c0d8640

Browse files
authored
DTSERWFOUR-467 Tag/1.0.0 beta10 Release (#255)
* UI Enhancements * Bug fixes
1 parent 70fe1dd commit c0d8640

File tree

63 files changed

+1252
-125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1252
-125
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
[1.0.0-beta10](https://github.com/hyperwallet/hyperwallet-android-ui-sdk/releases/tag/1.0.0-beta10)
5+
-------------------
6+
* UI Enhancements
7+
* Bug fixes
8+
49
[1.0.0-beta09](https://github.com/hyperwallet/hyperwallet-android-ui-sdk/releases/tag/1.0.0-beta09)
510
-------------------
611
* UI Enhancements

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Note that this SDK is geared towards those who need both backend data and UI fea
1818
To install Hyperwallet UI SDK, you just need to add the dependencies into your build.gradle file in Android Studio (or Gradle). For example:
1919

2020
```bash
21-
api 'com.hyperwallet.android.ui:transfermethodui:1.0.0-beta09'
22-
api 'com.hyperwallet.android.ui:receiptui:1.0.0-beta09'
23-
api 'com.hyperwallet.android.ui:transferui:1.0.0-beta09'
21+
api 'com.hyperwallet.android.ui:transfermethodui:1.0.0-beta10'
22+
api 'com.hyperwallet.android.ui:receiptui:1.0.0-beta10'
23+
api 'com.hyperwallet.android.ui:transferui:1.0.0-beta10'
2424
```
2525

2626
### Proguard

balancerepository/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

balancerepository/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apply from: "$rootProject.projectDir/android-library.gradle"
2+
description = 'Hyperwallet Balance Repository SDK for Android to integrate with the Hyperwallet Platform'
3+
project.ext {
4+
mavenName = 'Hyperwallet Android Balance Repository SDK'
5+
}
6+
apply from: "$rootProject.projectDir/publish.gradle"
7+
8+
dependencies {
9+
testImplementation "org.robolectric:robolectric:$robolectricVersion"
10+
testImplementation "com.squareup.okhttp3:mockwebserver:$mockWebServerVersion"
11+
testImplementation project(':testutils')
12+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<manifest
2+
package="com.hyperwallet.android.ui.balance.repository"/>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2018 Hyperwallet
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
6+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
7+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
10+
* the Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
13+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
15+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
16+
* THE SOFTWARE.
17+
*/
18+
package com.hyperwallet.android.ui.balance.repository;
19+
20+
import androidx.annotation.NonNull;
21+
22+
import com.hyperwallet.android.model.Errors;
23+
import com.hyperwallet.android.model.balance.Balance;
24+
25+
import java.util.List;
26+
27+
public interface PrepaidCardBalanceRepository {
28+
/**
29+
* Load prepaid card balances
30+
*/
31+
void loadPrepaidCardBalances(String prepaidCardToken, @NonNull final LoadPrepaidCardBalanceCallback callback);
32+
33+
/**
34+
* Load prepaid card balance callback
35+
*/
36+
interface LoadPrepaidCardBalanceCallback {
37+
/**
38+
* On prepaid card balance list loaded
39+
*/
40+
void onPrepaidCardBalanceLoaded(@NonNull final List<Balance> balances);
41+
42+
/**
43+
* On error
44+
*/
45+
void onError(@NonNull final Errors errors);
46+
}
47+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2018 Hyperwallet
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
6+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
7+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
10+
* the Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
13+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
15+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
16+
* THE SOFTWARE.
17+
*/
18+
package com.hyperwallet.android.ui.balance.repository;
19+
20+
public class PrepaidCardBalanceRepositoryFactory {
21+
private static PrepaidCardBalanceRepositoryFactory sInstance;
22+
private PrepaidCardBalanceRepository mPrepaidCardBalanceRepository;
23+
24+
private PrepaidCardBalanceRepositoryFactory() {
25+
mPrepaidCardBalanceRepository = new PrepaidCardBalanceRepositoryImpl();
26+
}
27+
28+
public static synchronized PrepaidCardBalanceRepositoryFactory getInstance() {
29+
if (sInstance == null) {
30+
sInstance = new PrepaidCardBalanceRepositoryFactory();
31+
}
32+
return sInstance;
33+
}
34+
35+
public static void clearInstance() {
36+
sInstance = null;
37+
}
38+
39+
public PrepaidCardBalanceRepository getPrepaidCardBalanceRepository() {
40+
return mPrepaidCardBalanceRepository;
41+
}
42+
43+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright 2018 Hyperwallet
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
6+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
7+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
10+
* the Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
13+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
15+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
16+
* THE SOFTWARE.
17+
*/
18+
package com.hyperwallet.android.ui.balance.repository;
19+
20+
import android.os.Handler;
21+
22+
import androidx.annotation.NonNull;
23+
import androidx.annotation.Nullable;
24+
import androidx.annotation.VisibleForTesting;
25+
26+
import com.hyperwallet.android.Hyperwallet;
27+
import com.hyperwallet.android.exception.HyperwalletException;
28+
import com.hyperwallet.android.listener.HyperwalletListener;
29+
import com.hyperwallet.android.model.balance.Balance;
30+
import com.hyperwallet.android.model.balance.PrepaidCardBalanceQueryParam;
31+
import com.hyperwallet.android.model.paging.PageList;
32+
33+
import java.util.ArrayList;
34+
35+
public class PrepaidCardBalanceRepositoryImpl implements PrepaidCardBalanceRepository {
36+
37+
private final Handler mHandler = new Handler();
38+
private final int LIMIT = 100;
39+
40+
@VisibleForTesting
41+
Hyperwallet getHyperwallet() {
42+
return Hyperwallet.getDefault();
43+
}
44+
45+
46+
@Override
47+
public void loadPrepaidCardBalances(String prepaidCardToken,
48+
@NonNull final LoadPrepaidCardBalanceCallback callback) {
49+
PrepaidCardBalanceQueryParam queryParam = new PrepaidCardBalanceQueryParam.Builder()
50+
.limit(LIMIT)
51+
.sortByCurrencyAsc()
52+
.build();
53+
54+
getHyperwallet().listPrepaidCardBalances(prepaidCardToken, queryParam,
55+
new HyperwalletListener<PageList<Balance>>() {
56+
@Override
57+
public void onSuccess(@Nullable PageList<Balance> result) {
58+
callback.onPrepaidCardBalanceLoaded(
59+
result != null ? result.getDataList() : new ArrayList<Balance>());
60+
}
61+
62+
@Override
63+
public void onFailure(HyperwalletException exception) {
64+
callback.onError(exception.getErrors());
65+
}
66+
67+
@Override
68+
public Handler getHandler() {
69+
return mHandler;
70+
}
71+
});
72+
}
73+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright 2018 Hyperwallet
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
6+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
7+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
10+
* the Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
13+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
15+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
16+
* THE SOFTWARE.
17+
*/
18+
package com.hyperwallet.android.ui.balance.repository;
19+
20+
import androidx.annotation.NonNull;
21+
22+
import com.hyperwallet.android.model.Errors;
23+
import com.hyperwallet.android.model.balance.Balance;
24+
25+
import java.util.List;
26+
27+
/**
28+
* User balance repository
29+
*/
30+
public interface UserBalanceRepository {
31+
/**
32+
* Load user balances
33+
*
34+
* @param callback
35+
*/
36+
void loadUserBalances(@NonNull final LoadUserBalanceListCallback callback);
37+
38+
/**
39+
* Load User balance callback
40+
*/
41+
interface LoadUserBalanceListCallback {
42+
/**
43+
* User balance loaded callback
44+
*
45+
* @param balances
46+
*/
47+
void onUserBalanceListLoaded(@NonNull final List<Balance> balances);
48+
49+
/**
50+
* User balance load error
51+
*
52+
* @param errors
53+
*/
54+
void onError(@NonNull final Errors errors);
55+
}
56+
}

0 commit comments

Comments
 (0)