Skip to content

Commit 7a40261

Browse files
authored
DTSERWFOUR-306 Tag/1.0.0 beta08 (#117)
* Added Paper Check as a Transfer method * Added support for update Transfer method * Enhancements
1 parent 9805012 commit 7a40261

Some content is hidden

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

42 files changed

+3214
-112
lines changed

CHANGELOG.md

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

4+
[1.0.0-beta08](https://github.com/hyperwallet/hyperwallet-android-sdk/releases/tag/1.0.0-beta08)
5+
-------------------
6+
* Added Paper Check as a Transfer method
7+
* Added support for update Transfer method
8+
* Enhancements
9+
410
[1.0.0-beta07](https://github.com/hyperwallet/hyperwallet-android-sdk/releases/tag/1.0.0-beta07)
511
-------------------
612
* Added Venmo as a Transfer method

README.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ We also provide an out-of-the-box [Hyperwallet Android UI SDK](https://github.c
2121
To install Hyperwallet Core SDK, you just need to add the dependency into your build.gradle file in Android Studio (or Gradle). For example:
2222

2323
```bash
24-
api 'com.hyperwallet.android:core-sdk:1.0.0-beta07'
24+
api 'com.hyperwallet.android:core-sdk:1.0.0-beta08'
2525
```
2626

2727
### Proguard
@@ -204,6 +204,56 @@ Hyperwallet.getDefault().listVenmoAccounts(queryParam, mListener);
204204
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure
205205
```
206206

207+
### Create Paper Check
208+
```java
209+
final PaperCheck paperCheck = new PaperCheck.Builder()
210+
.transferMethodCountry("US")
211+
.transferMethodCurrency("USD")
212+
.build();
213+
214+
Hyperwallet.getDefault().createPaperCheck(paperCheck, listener);
215+
// onSuccess: response (PaperCheck in this case) will contain information about the Paper Check created
216+
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure
217+
```
218+
219+
### Get Paper Check
220+
```java
221+
Hyperwallet.getDefault().getPaperCheck("trm-fake-token", listener);
222+
// onSuccess: response (PaperCheck in this case) will contain information about the user’s Paper Check or null if not exist.
223+
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure
224+
```
225+
226+
### Update Paper Check
227+
```java
228+
final PaperCheck paperCheck = new PaperCheck
229+
.Builder()
230+
.token("trm-fake-token")
231+
.build();
232+
233+
Hyperwallet.getDefault().updatePaperCheck(paperCheck, listener);
234+
// Code to handle successful response or error
235+
// onSuccess: response (PaperCheck in this case) will contain information about the user’s PaperCheck
236+
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure of PaperCheck updating
237+
```
238+
239+
### Deactivate Paper Check
240+
```java
241+
Hyperwallet.getDefault().deactivatePaperCheck("trm-fake-token", "deactivate Paper Check", listener);
242+
// Code to handle successful response or error
243+
// onSuccess: response (StatusTransition in this case) will contain information about the status transition
244+
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure of Paper Check deactivation
245+
```
246+
247+
### List Paper Check
248+
```java
249+
PaperCheckQueryParam queryParam = new PaperCheckQueryParam.Builder()
250+
.status(ACTIVATED)
251+
.build();
252+
Hyperwallet.getDefault().listPaperChecks(queryParam, listener);
253+
// onSuccess: response (PageList<PaperCheck>) will contain a PageList of PaperCheck or null if not exists
254+
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure
255+
```
256+
207257
### Create Bank Account
208258
```java
209259
final BankAccount bankAccount = new BankAccount.Builder()
@@ -463,6 +513,16 @@ result.getProcessingTime();
463513
result.getFields();
464514
result.getFields().getTransferMethodType();
465515
```
516+
### Update fields for a transfer method type
517+
```java
518+
TransferMethodUpdateConfigurationFieldQuery fieldQuery = new TransferMethodUpdateConfigurationFieldQuery(
519+
"trmToken");
520+
Hyperwallet.getDefault().retrieveTransferMethodUpdateConfigurationFields(fieldQuery, listener);
521+
// onSuccess: response (TransferMethodUpdateConfigurationFieldResult)
522+
// will contain a dataset of available Transfer Method Configuration Fields for the specified query
523+
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure
466524

525+
result.getFields();
526+
```
467527
## License
468528
The Hyperwallet Android Core SDK is open source and available under the [MIT](https://github.com/hyperwallet/hyperwallet-android-sdk/blob/master/LICENSE) license.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ allprojects {
2121
mavenLocal()
2222
}
2323

24-
project.version = "1.0.0-beta07"
24+
project.version = "1.0.0-beta08"
2525
}
2626

2727
task clean(type: Delete) {

core/src/main/java/com/hyperwallet/android/ExceptionMapper.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.json.JSONException;
3333

3434
import java.io.IOException;
35+
import java.net.HttpURLConnection;
3536
import java.util.ArrayList;
3637
import java.util.List;
3738

@@ -66,7 +67,12 @@ public static HyperwalletException toHyperwalletException(@NonNull final Excepti
6667
if (exception instanceof HyperwalletGqlException) {
6768
return (HyperwalletGqlException) exception;
6869
} else if (exception instanceof HyperwalletRestException) {
69-
return (HyperwalletRestException) exception;
70+
HyperwalletRestException hyperwalletRestException = (HyperwalletRestException) exception;
71+
if (hyperwalletRestException.getHttpCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
72+
return hyperwalletRestException;
73+
} else {
74+
return initHyperwalletException(R.string.unexpected_exception, EC_UNEXPECTED_EXCEPTION, exception);
75+
}
7076
} else if (exception instanceof HyperwalletException) {
7177
return (HyperwalletException) exception;
7278
} else if (exception instanceof IOException) {

0 commit comments

Comments
 (0)