Skip to content

Commit

Permalink
DTSERWFOUR-306 Tag/1.0.0 beta08 (#117)
Browse files Browse the repository at this point in the history
* Added Paper Check as a Transfer method
* Added support for update Transfer method
* Enhancements
  • Loading branch information
vwagh-hw authored Jan 27, 2021
1 parent 9805012 commit 7a40261
Show file tree
Hide file tree
Showing 42 changed files with 3,214 additions and 112 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

[1.0.0-beta08](https://github.com/hyperwallet/hyperwallet-android-sdk/releases/tag/1.0.0-beta08)
-------------------
* Added Paper Check as a Transfer method
* Added support for update Transfer method
* Enhancements

[1.0.0-beta07](https://github.com/hyperwallet/hyperwallet-android-sdk/releases/tag/1.0.0-beta07)
-------------------
* Added Venmo as a Transfer method
Expand Down
62 changes: 61 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We also provide an out-of-the-box [Hyperwallet Android UI SDK](https://github.c
To install Hyperwallet Core SDK, you just need to add the dependency into your build.gradle file in Android Studio (or Gradle). For example:

```bash
api 'com.hyperwallet.android:core-sdk:1.0.0-beta07'
api 'com.hyperwallet.android:core-sdk:1.0.0-beta08'
```

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

### Create Paper Check
```java
final PaperCheck paperCheck = new PaperCheck.Builder()
.transferMethodCountry("US")
.transferMethodCurrency("USD")
.build();

Hyperwallet.getDefault().createPaperCheck(paperCheck, listener);
// onSuccess: response (PaperCheck in this case) will contain information about the Paper Check created
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure
```

### Get Paper Check
```java
Hyperwallet.getDefault().getPaperCheck("trm-fake-token", listener);
// onSuccess: response (PaperCheck in this case) will contain information about the user’s Paper Check or null if not exist.
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure
```

### Update Paper Check
```java
final PaperCheck paperCheck = new PaperCheck
.Builder()
.token("trm-fake-token")
.build();

Hyperwallet.getDefault().updatePaperCheck(paperCheck, listener);
// Code to handle successful response or error
// onSuccess: response (PaperCheck in this case) will contain information about the user’s PaperCheck
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure of PaperCheck updating
```

### Deactivate Paper Check
```java
Hyperwallet.getDefault().deactivatePaperCheck("trm-fake-token", "deactivate Paper Check", listener);
// Code to handle successful response or error
// onSuccess: response (StatusTransition in this case) will contain information about the status transition
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure of Paper Check deactivation
```

### List Paper Check
```java
PaperCheckQueryParam queryParam = new PaperCheckQueryParam.Builder()
.status(ACTIVATED)
.build();
Hyperwallet.getDefault().listPaperChecks(queryParam, listener);
// onSuccess: response (PageList<PaperCheck>) will contain a PageList of PaperCheck or null if not exists
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure
```

### Create Bank Account
```java
final BankAccount bankAccount = new BankAccount.Builder()
Expand Down Expand Up @@ -463,6 +513,16 @@ result.getProcessingTime();
result.getFields();
result.getFields().getTransferMethodType();
```
### Update fields for a transfer method type
```java
TransferMethodUpdateConfigurationFieldQuery fieldQuery = new TransferMethodUpdateConfigurationFieldQuery(
"trmToken");
Hyperwallet.getDefault().retrieveTransferMethodUpdateConfigurationFields(fieldQuery, listener);
// onSuccess: response (TransferMethodUpdateConfigurationFieldResult)
// will contain a dataset of available Transfer Method Configuration Fields for the specified query
// onFailure: error (ErrorType) will contain Errors containing information about what caused the failure

result.getFields();
```
## License
The Hyperwallet Android Core SDK is open source and available under the [MIT](https://github.com/hyperwallet/hyperwallet-android-sdk/blob/master/LICENSE) license.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ allprojects {
mavenLocal()
}

project.version = "1.0.0-beta07"
project.version = "1.0.0-beta08"
}

task clean(type: Delete) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.json.JSONException;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -66,7 +67,12 @@ public static HyperwalletException toHyperwalletException(@NonNull final Excepti
if (exception instanceof HyperwalletGqlException) {
return (HyperwalletGqlException) exception;
} else if (exception instanceof HyperwalletRestException) {
return (HyperwalletRestException) exception;
HyperwalletRestException hyperwalletRestException = (HyperwalletRestException) exception;
if (hyperwalletRestException.getHttpCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
return hyperwalletRestException;
} else {
return initHyperwalletException(R.string.unexpected_exception, EC_UNEXPECTED_EXCEPTION, exception);
}
} else if (exception instanceof HyperwalletException) {
return (HyperwalletException) exception;
} else if (exception instanceof IOException) {
Expand Down
Loading

0 comments on commit 7a40261

Please sign in to comment.