kkiapay_flutter_sdk 1.0.2
kkiapay_flutter_sdk: ^1.0.2 copied to clipboard
KkiaPay allows businesses to safely receive payments by mobile money, credit card and bank account.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:kkiapay_flutter_sdk/kkiapayWebview.dart';
import './successScreen.dart';
void main() => runApp(App());
void sucessCallback(response, context) {
print(response);
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SuccessScreen(
amount: response['amount'],
transactionId: response['transactionId']
)),
);
}
final kkiapay = KKiaPay(amount: 1,phone: '97000000',data: 'hello world',sandbox: true,apikey: 'xxxxxxxxxxxxxxx',callback: sucessCallback,);
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Kkiapay Sample'),
centerTitle: true,
),
body: KkiapaySample(),
));
}
}
class KkiapaySample extends StatelessWidget {
const KkiapaySample({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: ButtonTheme(
minWidth: 250.0,
height: 60.0,
child: FlatButton(
color: Color(0xFFE30E25),
child: Text(
'Pay Now',
style: TextStyle(color: Colors.white),
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => kkiapay),
);
},
),
),
);
}
}