Git Product home page Git Product logo

flutter_payu_unofficial's Introduction

flutter_payu_unofficial

Unofficial PayU Money Flutter Plugin supports Android & iOS.

Flutter Payu Unofficial uses Mobile SDK provided by PayU Money Dev Team

Screenshot 1 Screenshot 3 Screenshot 4.

Getting started

Add dependency in pubspec.yaml

flutter_payu_unofficial: 1.0.3

Follow me on Twitter

Follow me on Linkedin

Features

Feature
Plug n Play Simple to install, ready to use UI
Auto Read OTP Auto read OTP on supported platform
PayU Money Mobile SDK Based on PayU Money Mobile SDK for iOS and Android
Null Safety โœ…

Android Installation

Edit AndroidManifest.xml

Put this line in AndroidManifest.xml's manifest tag

   xmlns:tools="http://schemas.android.com/tools"

<project-dir>/android/app/src/main/AndroidManifest.xml

Example: 
<manifest xmlns:android="http://schemas.android.com/apk/res/android"  
  xmlns:tools="http://schemas.android.com/tools" <--------- Paste here 
  package="com.abhimortal6.flutter_payu_money_example">

And put this line in application tag after android:label

   tools:replace="android:label"
Example: 
<application  
  android:name="io.flutter.app.FlutterApplication"  
  android:icon="@mipmap/ic_launcher"  
  android:label="flutter_payu_money_example"  
  tools:replace="android:label" <--------- Paste here >

For iOS no configuration is needed

Usage Examples

Prepare Payment Parameters

// Prepare Payament Parameters.

PaymentParams _paymentParam = PaymentParams(  
		  merchantID: "Merchant ID",  
		  merchantKey: "Merchant Key",  
		  salt: "Salt",  
		  amount: "100",  
		  transactionID: "TXNID1234567890",  
		  firstName: "FirstName",
		  email: "[email protected]",  
		  productName: "Test Product",  
		  phone: "9876543210",  
		  fURL: "https://www.payumoney.com/mobileapp/payumoney/failure.php",  
		  sURL: "https://www.payumoney.com/mobileapp/payumoney/success.php",  
		  udf1: "udf1",  
		  udf2: "udf2",  
		  udf3: "udf3",  
		  udf4: "udf4",  
		  udf5: "udf5",  
		  udf6: "",  
		  udf7: "",  
		  udf8: "",  
		  udf9: "",  
		  udf10: "",  
		  hash: "",  
		  isDebug: true,); // true for Test Mode, false for Production
		  //also disables logs in production
		  //default is false

Initiate Payment

// returns PayuPaymentResult object

PayuPaymentResult _paymentResult = await FlutterPayUMoney.initiatePayment(
		paymentParams: _paymentParam, 
		showCompletionScreen: false);
		//false will not show in built success/failure screens
		//default is true

Compare result

// PayuPaymentResult.status is String and PayuPaymentStatus class have some generic statuses to compare cleanly.
// Actual response is in PayuPaymentResult.response.
// Response is Map<dynamic,dynamic> and direct from SDK nothing changed.

	if (_paymentResult.status == PayuPaymentStatus.success) {  
	  print("Success: ${_paymentResult.response}");  
	} else if (_paymentResult.status == PayuPaymentStatus.failed) {  
	  print("Failed: ${_paymentResult.response}");  
	} else if (_paymentResult.status == PayuPaymentStatus.cancelled) {  
	  print("Cancelled by User: ${_paymentResult.response}");  
	} else {  
	  print("Response: ${_paymentResult.response}");  
	  print("Status: ${_paymentResult.status}");  
	}

flutter_payu_unofficial's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mayurpitroda96

flutter_payu_unofficial's Issues

Failed parse during installPackage

Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl729700664.tmp/base.apk (at Binary XML file line #349): com.payu.custombrowser.PreLollipopPaymentsActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]
Error: Failed to install APK again.

Showed error while installing the app in android version 12. How to fix it?

App is crashing when clicking on back button in image picker (

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=62442, result=0, data=Intent { (has extras) }} to activity {in.popmart.mobile/in.popmart.mobile.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.success(java.lang.Object)' on a null object reference
E/AndroidRuntime(11003): at android.app.ActivityThread.deliverResults(ActivityThread.java:4846)
E/AndroidRuntime(11003): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4887)
E/AndroidRuntime(11003): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(11003): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(11003): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(11003): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
E/AndroidRuntime(11003): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(11003): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(11003): at android.app.ActivityThread.main(ActivityThread.java:7397)
E/AndroidRuntime(11003): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11003): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(11003): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
E/AndroidRuntime(11003): Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.success(java.lang.Object)' on a null object reference
E/AndroidRuntime(11003): at com.abhimortal6.flutter_payu_unofficial.FlutterPayuUnofficialPlugin.onActivityResult(FlutterPayuUnofficialPlugin.java:189)
E/AndroidRuntime(11003): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java:739)
E/AndroidRuntime(11003): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java:426)
E/AndroidRuntime(11003): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:677)
E/AndroidRuntime(11003): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:616)
E/AndroidRuntime(11003): at android.app.Activity.dispatchActivityResult(Activity.java:8110)
E/AndroidRuntime(11003): at android.app.ActivityThread.deliverResults(ActivityThread.java:4839)
E/AndroidRuntime(11003): ... 11 more
W/.popmart.mobil(11003): No such thread for suspend: 0x71e6f2f6c8:Thread-15

Gateway closes with error "Payment Cancelled"

Only tested in Android so far.

I don't know how relevant this might be but, here:

I/flutter ( 5653): Arguments Map: {merchantID: xxxxxxxxx, merchantKey: xxxxxx, salt: xxxxxxxxxvxxxxx, amount: 35.00, transactionID: xxxxN03589310, phone: xxxxxxxxxx, productName: Shopping, firstName: aditya, email: [email protected], sURL: https://www.payumoney.com/mobileapp/payumoney/success.php, fURL: https://www.payumoney.com/mobileapp/payumoney/failure.php, udf1: udf1, udf2: udf2, udf3: udf3, udf4: udf4, udf5: udf5, udf6: , udf7: , udf8: , udf9: , udf10: , hash: xxxxxxxxxxxxxxx, isDebug: true, showCompletionScreen: true}

One issue that might've been with my app was that I also had the tag in manifest:
android:usesCleartextTraffic="true"

So my manifest had to be:
tools:replace="android:label,android:usesCleartextTraffic"

But other than that, the gateway is still closing with failure.
I'm not using test credentials as they might've caused the issue.

These arguments were checked on Web App and the payment was successfully made. Probably something wrong with my setup.
Any ideas?

SBI not listed in netbankin

Initially it was present then after that it disappear currently when netbanking select there is no SBI bank

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.