Last updated:
0 purchases
flutter redpay
flutter-redpay #
RedPay's SDK for flutter
Installation #
To Install:
flutter pub add flutter_redpay
or
pubspec.yaml
dependencies:
flutter_redpay: ${latest_version}
copied to clipboard
Usage #
// ...
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_redpay/flutter_redpay.dart';
class RedPayConsumer extends StatefulWidget {
const RedPayConsumer({super.key});
@override
State<RedPayConsumer> createState() => _RedPayConsumerState();
}
class _RedPayConsumerState extends State<RedPayConsumer> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: RedPay(
env: Env.test,
customerEmail: '***********@gmail.com',
description: 'Payment',
amountInMinor: '10000',
metadata:{"key":"value"},
apiKey: 'PK_**********-*********************',
onInitFailed: (error) {
//SDK failed to initialize
},
onSuccess: (result) {
//Handle successful transaction
},
),
);
}
}
copied to clipboard
N.B:
Amount in minor means 100 should be passed as "10000"
Currency default : NGN
Env default : production
metadata parameter is optional but can be used to pass any data you'd like to retrieve with a transaction
Component should be wrapped in a view component occupying its intended space
Be sure the internet permission is added to your manifest.xml for Android
License #
MIT
Copyright RedPay Limited 2024
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.