payumoney_sdk 0.0.1 copy "payumoney_sdk: ^0.0.1" to clipboard
payumoney_sdk: ^0.0.1 copied to clipboard

outdated

A new Payu plugin.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:payumoney_sdk/payumoney_sdk.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool response;
  final payu=PayumoneySdk();

  @override
  void initState() {
    super.initState();
    initPayu();
  }


  Future<void> initPayu() async {
    bool ispayuSetup;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
     ispayuSetup=await payu.setupPayuDetails(
         merchantID: "4955750",
         merchantKey: "k5SC5F",
         isProduction: false,
         activityTitle: "Test",
         disableExitConfirmation: true);
    } on PlatformException {
      ispayuSetup=false;
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    if(ispayuSetup){
      payu.startPayment(
          txnid: "IRD",
          amount: "100",
          name:"saurabh" ,
          email: "saurabh.kanaujia@siply.in",
          phone: "7045202875",
          productName: "Siply",
          hash: "#kkk");
    }

    setState(() {
      response =ispayuSetup;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Payumoney SDK'),
        ),
        body: Center(
          child: Text('Payu  setup on: $response\n'),
        ),
      ),
    );
  }
}
5
likes
0
points
7
downloads

Publisher

unverified uploader

Weekly Downloads

A new Payu plugin.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on payumoney_sdk

Packages that implement payumoney_sdk