From d3001ca04728093c577798b77ed9177bbb754d26 Mon Sep 17 00:00:00 2001 From: Tharun kumar <cb.en.u4cse17419@cb.students.amrita.edu> Date: Mon, 20 Apr 2020 18:35:34 +0530 Subject: [PATCH] Upload New File --- Payement.java | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 Payement.java diff --git a/Payement.java b/Payement.java new file mode 100644 index 0000000..abea5eb --- /dev/null +++ b/Payement.java @@ -0,0 +1,92 @@ +package com.example.fund_restart; + +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; + +public class Payement extends AppCompatActivity implements View.OnClickListener { + Button don_pay; + String money = String.valueOf(10); + String url; + private static final int TEZ_REQUEST_CODE = 123; + private static final String GOOGLE_TEZ_PACKAGE_NAME = "com.google.android.apps.nbu.paisa.user"; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_payement); + Bundle b = getIntent().getExtras(); + String url = b.getString("url"); + don_pay = findViewById(R.id.don_pay); + don_pay.setOnClickListener(this); + String he = url; + + /* Uri uri = + new Uri.Builder() + .scheme("upi") + .authority("pay") + .appendQueryParameter("pa", "cmrfbihar@idbi") + .appendQueryParameter("pn", "Test Merchant") + .appendQueryParameter("mc", "1234") + .appendQueryParameter("tr", "123456789") + .appendQueryParameter("tn", "Little help") + .appendQueryParameter("am", "1.01") + .appendQueryParameter("cu", "INR") + .appendQueryParameter("url", "https://gpay.app.goo.gl/31gzbM") + .build(); + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(uri); + intent.setPackage(GOOGLE_TEZ_PACKAGE_NAME); + startActivityForResult(intent, TEZ_REQUEST_CODE); + + + Uri uri = + new Uri.Builder() + .scheme("upi") + .authority("pay") + .appendQueryParameter("pa", "dhanushg100@okhdfcbank") + .appendQueryParameter("pn", "Test Merchant") + .appendQueryParameter("mc", "1234") + .appendQueryParameter("tr", "123456789") + .appendQueryParameter("tn", "Little Help") + .appendQueryParameter("am", "1.01") + .appendQueryParameter("cu", "INR") + .appendQueryParameter("url", "https://gpay.app.goo.gl/ypFRwR") + .build(); + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(uri); + intent.setPackage(GOOGLE_TEZ_PACKAGE_NAME); + startActivityForResult(intent, TEZ_REQUEST_CODE);*/ + } + + @Override + public void onClick(View v) { + if (v == don_pay) { + if (url == "bihar") { + Uri uri = + new Uri.Builder() + .scheme("upi") + .authority("pay") + .appendQueryParameter("pa", "cmrfbihar@idbi") + .appendQueryParameter("pn", "Test Merchant") + .appendQueryParameter("mc", "1234") + .appendQueryParameter("tr", "123456789") + .appendQueryParameter("tn", "Little help") + .appendQueryParameter("am", money) + .appendQueryParameter("cu", "INR") + .appendQueryParameter("url", "https://gpay.app.goo.gl/31gzbM") + .build(); + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(uri); + intent.setPackage(GOOGLE_TEZ_PACKAGE_NAME); + startActivityForResult(intent, TEZ_REQUEST_CODE); + } + + + } + } +} -- GitLab