payumoney_pro_unofficial 0.0.1 payumoney_pro_unofficial: ^0.0.1 copied to clipboard
Unofficial plugin for PayUMoney SDK
import 'dart:convert';
import 'package:flutter/material.dart';
import 'dart:async';
import "package:crypto/crypto.dart";
import 'package:flutter/services.dart';
import 'package:payumoney_pro_unofficial/payumoney_pro_unofficial.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: ElevatedButton(
child: Text("Make Payment"),
onPressed: () async {
final data = await PayumoneyProUnofficial.payUParams(
email: 'contact@Orangewp.com',
firstName: "Mukesh",
merchantName: 'Mukesh Joshi',
isProduction: true,
merchantKey: 'XHqp4X',
merchantSalt: 'mPcke2Yv',
amount: '1',
productInfo: 'Recharge',
transactionId: '1113111',
userCredentials: 'XHqp4X:contact@orangewp.com',
userPhoneNumber: '8006444711');
if (data['status'] == 'success') handlePaymentSuccess(data);
if (data['status'] == 'failed') handlePaymentFailure(data);
},
),
),
),
);
}
handlePaymentSuccess(data) {
print("Success");
}
handlePaymentFailure(data) {
print("Failed");
}
}