kkiapay_flutter_sdk 1.0.5
kkiapay_flutter_sdk: ^1.0.5 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,
name: 'JOHN DOE',
theme: "#E30E25",
);
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: TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Color(0xFFE30E25)),
foregroundColor: MaterialStateProperty.all(Colors.white),
),
child: Text(
'Pay Now',
style: TextStyle(color: Colors.white),
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => kkiapay),
);
},
),
),
);
}
}