diff --git a/README.md b/README.md index 1809978..832209f 100644 --- a/README.md +++ b/README.md @@ -67,12 +67,12 @@ collections.getAccountBalance().subscribe( You can also consume error events in case of the API request failed. ```java collections.createApiUser().subscribe( - new Consumer() { - @Override - public void accept(AccountBalance accountBalance) { // This function executes in case of success. + new Consumer() { + @Override + public void accept(AccountBalance accountBalance) { // This function executes in case of success. System.out.println(accountBalance.getAvailableBalance()); // 900 - } - }, + } + }, new Consumer() { @Override public void accept(Throwable throwable) throws Exception { // This function executes in case of errors. @@ -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. + 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. } ); ``` @@ -233,10 +233,10 @@ Documentation: https://momodeveloper.mtn.com/docs/services/collection/operations ```java collections.getRequestToPay(referenceId).subscribe( - requestToPay -> { - System.out.println(requestToPay.getFinancialTransactionId()); // 521734614 - System.out.println(requestToPay.getStatus()); // SUCCESSFUL - } + requestToPay -> { + System.out.println(requestToPay.getFinancialTransactionId()); // 521734614 + System.out.println(requestToPay.getStatus()); // SUCCESSFUL + } ); ``` @@ -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 }); ```