Upi Payment
An android library for integrating payment using existing upi apps.
UpiPayment Library for Android (AndroidX)
A UpiPayment library for integrating upi payments using existing upi supported apps like googple pay, bhim etc.
Setup
Step 1: Add the dependency
Usage
Step 1: Declare and Initialize UpiPayment.
Java
Kotlin
Explanation:
1. setPaymentDetail():
Set all payment details like vpa/upi, amount, name etc.
Note: always create new instance of PaymentDetail for every new payment/order.
2. setUpiApps():
Set selected upiApps.
Java
eg.
3. setCallBackListener():
this will listen to the result of payment transaction(Only one callback will trigger for a single transaction).
- .onSuccess(): trigger whenever transaction is successfully completed
- .onSubmitted(): trigger whenever transaction is pending
- .onError(): trigger whenever transaction is failed/user backpress/or other error
If you want to implement callBackListener() globally then implements UpiPayment.OnUpiPaymentListener.
Java
eg.
Extra function-> getExistingUpiApps():
To check existing upi apps. eg. Developer can hide(visibility) "Pay using Upi App" button if there is no upi app present.
Java
eg.