Skip to content

Commit

Permalink
Fixes typos
Browse files Browse the repository at this point in the history
  • Loading branch information
regisbamba authored Apr 14, 2019
1 parent c065a7d commit e15a170
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ When you make a request with this library, you can get the results by subscribin
Eg: Getting the balance for your account.
```java
collections.getAccountBalance().subscribe(
new Consumer<AccountBalance>() {
@Override
public void accept(AccountBalance accountBalance) { // This function executes in case of success.
System.out.println(accountBalance.getAvailableBalance()); // 900
new Consumer<AccountBalance>() {
@Override
public void accept(AccountBalance accountBalance) { // This function executes in case of success.
System.out.println(accountBalance.getAvailableBalance()); // 900
}
}
);
Expand All @@ -69,16 +69,16 @@ You can also consume error events in case of the API request failed.
collections.createApiUser().subscribe(
new Consumer<AccountBalance>() {
@Override
public void accept(AccountBalance accountBalance) { // This function executes in case of success.
System.out.println(accountBalance.getAvailableBalance()); // 900
public void accept(AccountBalance accountBalance) { // This function executes in case of success.
System.out.println(accountBalance.getAvailableBalance()); // 900
}
},
new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception { // This function executes in case of errors.
RequestException e = (RequestException) throwable; // Cast the throwable to RequestException to get the HTTP code and message returned by the MoMo API.
System.out.println(e.getCode()); // 401
System.out.println(e.getMessage()); // Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription.
public void accept(Throwable throwable) throws Exception { // This function executes in case of errors.
RequestException e = (RequestException) throwable; // Cast the throwable to RequestException to get the HTTP code and message returned by the MoMo API.
System.out.println(e.getCode()); // 401
System.out.println(e.getMessage()); // Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription.
}
}
);
Expand All @@ -93,13 +93,13 @@ collections.getAccountBalance().subscribe(accountBalance -> { // This functi

```java
collections.getAccountBalance().subscribe(
accountBalance -> { // This function executes in case of success.
System.out.println(accountBalance.getAvailableBalance()); // 900
accountBalance -> { // This function executes in case of success.
System.out.println(accountBalance.getAvailableBalance()); // 900
},
throwable -> { // This function executes in case of error.
RequestException e = (RequestException) throwable; // Cast the throwable to RequestException to get the HTTP code and message returned by the MoMo API.
System.out.println(e.getCode()); // 401
System.out.println(e.getMessage()); // Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription.
throwable -> { // This function executes in case of error.
RequestException e = (RequestException) throwable; // Cast the throwable to RequestException to get the HTTP code and message returned by the MoMo API.
System.out.println(e.getCode()); // 401
System.out.println(e.getMessage()); // Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription.
}
);
```
Expand Down Expand Up @@ -247,8 +247,8 @@ Documentation: https://momodeveloper.mtn.com/docs/services/collection/operations

```java
collections.getAccountBalance().subscribe(accountBalance -> {
System.out.println(accountBalance.getAvailableBalance()); // 900
System.out.println(accountBalance.getCurrency()); // EUR
System.out.println(accountBalance.getAvailableBalance()); // 900
System.out.println(accountBalance.getCurrency()); // EUR
});
```

Expand Down

0 comments on commit e15a170

Please sign in to comment.