All Projects → wangsun6 → android-upi-payment

wangsun6 / android-upi-payment

Licence: MIT license
An android library for integrating payment using existing upi apps.

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to android-upi-payment

bitcoincashjs
WARNING: This project is no longer maintained. Please, use bitcore-lib-cash instead.
Stars: ✭ 80 (+207.69%)
Mutual labels:  payment, transaction
DYFStoreKit
([Swift] https://github.com/chenxing640/DYFStore) A lightweight and easy-to-use iOS library for In-App Purchases (Objective-C). DYFStoreKit uses blocks and notifications to wrap StoreKit, provides receipt verification and transaction persistence and doesn't require any external dependencies.
Stars: ✭ 52 (+100%)
Mutual labels:  payment, transaction
linkpe
Linkpe is a Node.js based API🐳 to generate shareable UPI Payment links
Stars: ✭ 22 (-15.38%)
Mutual labels:  upi, upi-payment
react-native-upi
A tiny module for Adding payments via UPI in your react native apps ❤️
Stars: ✭ 41 (+57.69%)
Mutual labels:  payment, upi
Tinkoff-Acquiring-SDK-Flutter
Flutter Tinkoff Acquiring SDK is a simple way to integrate payments into your mobile application.
Stars: ✭ 42 (+61.54%)
Mutual labels:  payment
credit-card-prompt
Credit card prompt with validation and address lookup
Stars: ✭ 13 (-50%)
Mutual labels:  payment
java-api
Zold Java API
Stars: ✭ 20 (-23.08%)
Mutual labels:  payment
kotlin-coroutines-jdbc
A library for interacting with blocking JDBC drivers using Kotlin Coroutines.
Stars: ✭ 40 (+53.85%)
Mutual labels:  transaction
leptin
🔗 Leptin is a PoW blockchain completely built in Nodejs.
Stars: ✭ 57 (+119.23%)
Mutual labels:  transaction
42-cent
Node.js multi-gateway payment processing module
Stars: ✭ 43 (+65.38%)
Mutual labels:  payment
Banklink
PHP payment library to easily integrate Baltic banklinks (supports old and new iPizza protocol), E-commerce gateaway (Estcard, Nets Estonia), Liisi Payment Link and Pocopay.
Stars: ✭ 34 (+30.77%)
Mutual labels:  payment
mysql-interview-questions
SQL Basics
Stars: ✭ 202 (+676.92%)
Mutual labels:  transaction
PayBhama
No description or website provided.
Stars: ✭ 16 (-38.46%)
Mutual labels:  payment
ISO8583-Message-Client-java
ISO8583 Message Packer and Unpacker with ISOClient in Java
Stars: ✭ 94 (+261.54%)
Mutual labels:  payment
wc-moldovaagroindbank
WooCommerce maib Moldova Agroindbank Payment Gateway
Stars: ✭ 13 (-50%)
Mutual labels:  payment
simple-mpesa
A simple example of how MPESA works. Works with all 3 types of customers i.e. Agents, Merchants and Subscribers. Allows you to configure a tariff and apply it to transactions. The project follows DDD principles.
Stars: ✭ 31 (+19.23%)
Mutual labels:  transaction
africastalking-node.js
Official Node.js SDK for Africa's Talking
Stars: ✭ 113 (+334.62%)
Mutual labels:  payment
ex operation
A library for making domain operations in Elixir
Stars: ✭ 33 (+26.92%)
Mutual labels:  transaction
direct-stripe
Stripe payment button for WordPress websites
Stars: ✭ 12 (-53.85%)
Mutual labels:  payment
ccashcow
💰 Accept cards & crypto. Payments so easy a cow could do it.
Stars: ✭ 40 (+53.85%)
Mutual labels:  payment

Upi Payment

API Download

Demo:

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

dependencies {
    ...
    /*Upi Payment */
    implementation 'com.wangsun.upi.payment:upi-payment:{latestVersion}'
}

Usage

Step 1: Declare and Initialize UpiPayment.

Java

// note: always create new instance of PaymentDetail for every new payment/order
var payment = PaymentDetail(
    "wangsunhakhun@oksbi",  //vpa/upi = your vpa/upi
    "Wangsun Hakhun",       //name = your name
    "",                     //payeeMerchantCode = only if you have merchantCode else pass empty string
    "",                     //txnRefId =  if you pass empty string we will generate txnRefId for you
    "description",          //description =
    "2.00")                 //amount = format of amount should be in decimal format x.x (eg 530.00)

// note: always create new instance of UpiPayment for every new payment/order
new UpiPayment(this)
        .setPaymentDetail(payment)
        .setUpiApps(UpiPayment.getUPI_APPS())
        .setCallBackListener(new UpiPayment.OnUpiPaymentListener() {
            @Override
            public void onSubmitted(@NotNull TransactionDetails data) {
                //transaction pending: use data to get TransactionDetails
            }

            @Override
            public void onError(@NotNull String message) {
                //user backpress or transaction failed
            }

            @Override
            public void onSuccess(@NotNull TransactionDetails data) {
                //transaction success: use data to get TransactionDetails
            }
        }).pay();

Kotlin

// note: always create new instance of PaymentDetail for every new payment/order
var payment = PaymentDetail(
    vpa="wangsunhakhun@oksbi",
    name = "Wangsun Hakhun",
    payeeMerchantCode = "",       // only if you have merchantCode else pass empty string
    txnRefId = "",                // if you pass empty string we will generate txnRefId for you
    description = "description",
    amount = "2.00")              // format of amount should be in decimal format x.x (eg 530.00), max. 2 decimal places

// note: always create new instance of UpiPayment for every new payment/order
UpiPayment(this)
    .setPaymentDetail(payment)
    .setUpiApps(UpiPayment.UPI_APPS)
    .setCallBackListener(object : UpiPayment.OnUpiPaymentListener{
        override fun onSubmitted(data: TransactionDetails) {
            //transaction pending: use data to get TransactionDetails
        }
        override fun onSuccess(data: TransactionDetails) {
            //transaction success: use data to get TransactionDetails
        }
        override fun onError(message: String) {
            //user backpress or transaction failed
        }
    }).pay()

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.

//adding others upi apps to our default selected apps
//todo: check names of all apps first
//todo: name should be in lowercase
ArrayList<String> appList = UpiPayment.getUPI_APPS();
appList.add("new app name1");
appList.add("new app name2");

//adding new set of apps
ArrayList<String> newList = new ArrayList<String>();
newList.add("paytm")
newList.add("google pay")
newList.add("bhim")

//and pass this to: setUpiApps(newList): or setUpiApps(appList):

3. setCallBackListener():

this will listen to the result of payment transaction(Only one callback will trigger for a single transaction).

  1. .onSuccess(): trigger whenever transaction is successfully completed
  2. .onSubmitted(): trigger whenever transaction is pending
  3. .onError(): trigger whenever transaction is failed/user backpress/or other error

If you want to implement callBackListener() globally then implements UpiPayment.OnUpiPaymentListener.

Java

eg.

public class YourActivity extends AppCompatActivity implements UpiPayment.OnUpiPaymentListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    //override below functions
    @Override
    public void onSuccess(@NotNull TransactionDetails data) {}

    @Override
    public void onSubmitted(@NotNull TransactionDetails data) {}

    @Override
    public void onError(@NotNull String message) {}
}

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.

ArrayList<String> existingUpiAppNames = UpiPayment.getExistingUpiApps(context);

Quick Links


To pick media files(audio,image,video) you can use Turtlebody Media Picker library.

To pick doc files(txt,doc,docx,pdf etc) you can use Turtlebody Doc Picker library.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].