flutter_redpay_sdk 1.0.1
flutter_redpay_sdk: ^1.0.1 copied to clipboard
RedPay's Flutter SDK for payments. To be used by RedPay's merchants to offer payment collection services within their flutter applications
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter_redpay_sdk/flutter_redpay_sdk.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: RedPay(
env: Env.test,
metadata:{"key":"value"},
customerEmail: "************@gmail.com",
description: "A purchase",
currency: Currency.ngn,
redPayPaymentChannels: [
RedPayPaymentChannels.card,
RedPayPaymentChannels.transfer,
RedPayPaymentChannels.ussd,
RedPayPaymentChannels.qr,
RedPayPaymentChannels.opay,
RedPayPaymentChannels.momo
],
onSuccess: (reference) {
print("Success");},
amountInMinor: "10000",
apiKey: "*****************************",
onInitFailed: (reason) {
print(reason);},
)),
);
}
}