flutter_gokwik 0.0.2 flutter_gokwik: ^0.0.2 copied to clipboard
A flutter plugin to integrate GoKwik's Flutter SDK.
import 'package:flutter/material.dart';
import 'package:flutter_gokwik/flutter_gokwik.dart';
import 'package:flutter_gokwik_example/home.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'GoKwik Payment Gateway',
debugShowCheckedModeBanner: false,
theme: ThemeData(primaryColor: Colors.indigo),
home: Home() // or CAll GokwikAPI() ,
);
}
}
void GokwikAPI() async {
Gokwik _gokwik;
String requestId = "requestId";
String gokwikOid = "gokwikOid";
String moid = "MerchantOrderID";
String mid = "MerchantID";
String total = "total";
String orderType = "cod/upi/non-gk";
_gokwik.initPayment(context,
production: false, data: GokwikData(requestId, gokwikOid,
total, moid, mid, orderType));
_gokwik.on(Gokwik.EVENT_PAYMENT_SUCCESS, _handleResult);
_gokwik.on(Gokwik.EVENT_PAYMENT_ERROR, _handleResult);
void _handleResult(PaymentResponse response) {
print(response);
}
}