Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Commit

Permalink
Update Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PatilShreyas committed Dec 9, 2019
1 parent 78ab930 commit 9324c45
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
Expand Up @@ -8,6 +8,5 @@ public interface PaymentStatusListener {
void onTransactionSubmitted();
void onTransactionFailed();
void onTransactionCancelled();

void onAppNotFound();
}
29 changes: 27 additions & 2 deletions README.md
Expand Up @@ -4,7 +4,8 @@

## Introduction
Hello Everyone, I have developed this Android library to ***easily implement UPI Payment Integration in Android app.*** <br>
UPI apps are *required to be installed already before using this library* because, internally this API calls UPI apps for payment processing. Before using it, make sure that your device is having atleast one UPI app installed. Otherwise it will unable to process the payments. <br>
- UPI apps are *required to be installed already before using this library* because, internally this API calls UPI apps for payment processing.
- Before using it, make sure that your device is having atleast one UPI app installed. Otherwise it will unable to process the payments. <br>
This API is in beta, there are lot of improvements are still needed.

## Demo
Expand All @@ -31,7 +32,7 @@ In your `build.gradle` file of app module, add below dependency to import this l

```gradle
dependencies {
implementation 'com.shreyaspatil:EasyUpiPayment:1.1'
implementation 'com.shreyaspatil:EasyUpiPayment:2.0'
}
```

Expand Down Expand Up @@ -101,6 +102,23 @@ You can see below code, these are minimum and mandatory calls to enable payment
</tr>
</table>

#### App-Specific Payment
If you want to pay only with specific app like BHIM UPI, PhonePe, PayTm, etc. Then you can use method `setDefaultPaymentApp()` of `EasyUpiPayment`.

Following ENUM can be passed to this method.
- `PaymentApp.BHIM_UPI`
- `PaymentApp.AMAZON_PAY`
- `PaymentApp.GOOGLE_PAY`
- `PaymentApp.PHONE_PE`
- `PaymentApp.PAYTM`

Example:
```java
easyUpiPayment.setDefaultPaymentApp(PaymentApp.BHIM_UPI);
```

After this while payment, this app will be opened for transaction.

#### Proceed to Payment
To start the payment, just call `startPayment()` method of EasyUpiPayment and after that transaction is started.
```java
Expand All @@ -120,6 +138,7 @@ To register for callback events, you will have to set `PaymentStatusListener` wi
* `onTransactionSubmitted()` - Invoked when Payment is partially done/In waiting/Submitted/Pending.
* `onTransactionFailed()` - Invoked when Payment is unsuccessful/failed.
* `onTransactionCancelled()` - Invoked when Payment cancelled (User pressed back button or any reason).
* `onAppNotFound();` - Invoked when app specified with `setDefaultPaymentApp()` is not exists on devie.
```java
@Override
public void onTransactionCompleted(TransactionDetails transactionDetails) {
Expand Down Expand Up @@ -155,6 +174,12 @@ To register for callback events, you will have to set `PaymentStatusListener` wi
Toast.makeText(this, "Cancelled", Toast.LENGTH_SHORT).show();
imageView.setImageResource(R.drawable.ic_failed);
}

@Override
public void onAppNotFound() {
// App Not exists on Device
Toast.makeText(this, "App Not Found", Toast.LENGTH_SHORT).show();
}
```

### Removing Listener
Expand Down

0 comments on commit 9324c45

Please sign in to comment.