payumoney_pro_unofficial 0.0.4 payumoney_pro_unofficial: ^0.0.4 copied to clipboard
Flutter Plugin to implement PayUMoney Latest Checkout SDK in Android App.
Flutter PayUMoney Pro SDK #
Flutter Plugin to implement PayUMoney Latest Checkout SDK in Android App. #
Screenshots
Note: This Plugin is in initial release. Please test it well before using it in production app. #
Currently Support Android Platform only. iOS Soon #
Step 1: Android Implementation #
There are few steps you need to follow to implement PayUMoney SDK:
-
Open file android/app/build.gradle in your flutter project and update minSdkVersion under "defaultConfig" to 21 (if greater than leave)
-
Open AndroidManifest.xml located at android/app/src/main and add following code:
xmlns:tools="http://schemas.android.com/tools"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" <--- paste here
package="yourPackageName">
also add this code:
tools:replace="android:label"
<application
android:name="io.flutter.app.FlutterApplication"
android:label="YourAppName"
tools:replace="android:label" <-- Paste here
android:icon="@mipmap/ic_launcher">
Step 2: Flutter Implementation #
Run this command in project terminal to add dependency
flutter pub add payumoney_pro_unofficial
or add manually to pubspecs.yaml
payumoney_pro_unofficial: ^0.0.4
Get latest packages
flutter pub get
Import package to by adding this line at the top
import 'package:payumoney_pro_unofficial/payumoney_pro_unofficial.dart';
Copy and paste this code
Future<void> initializePayment() async{
final response= await PayumoneyProUnofficial.payUParams(
email: '<Customer Email>',
firstName: '<Customer Name>',
merchantName: '<Merchant Name>',
isProduction: true,
merchantKey: '<Merchant Key>',
merchantSalt: '<Merchant Salt Version 1>',
amount: '<Amount in Rs>',
productInfo: '<Product Name>',
transactionId: '<Unique ID>',
userCredentials:'<Merchant Key>:' + '<Customer Email or User ID>',
userPhoneNumber: phone
);
if (response['status'] == 'success')
handlePaymentSuccess();
if (response['status'] == 'failed')
handlePaymentFailure(response['message']);
}
handlePaymentSuccess(){
//Implement Your Success Logic
}
handlePaymentFailure(String errorMessage){
print(errorMessage);
//Implement Your Failed Payment Logic
}
Pro Tip: #
- Always make sure you validate Phone number(Must be 10 Digits) else payment page might not appear.
- Avoid hardcoded credentials.
- Always generate unique transaction id for each transaction.
- Store Transaction & Details to database for later analysis or usage.
For any issue please write to contact@orangewp.com
To Connect on Instagram | Youtube | Business Inqury