Cyberpay provides you with the most convenient and fastest process of making and collecting payments from your customers within Nigeria
The mobile SDK will serve as an easy to use library to quickly integrate Cyberpay to your mobile application.
The will serve as a wrapper on the existing Cyberpay web services and create a mobile entry point for making both Card and Bank transactions.
The SDK will provide custom views/layouts for checkout, pin, otp, sucured3d as well as handles all business logics taking the bulk of the job and exposing just three call backs representing the status of the transaction.
The Cyberpay Flutter SDK is compatible with iOS Apps supporting iOS 11 and above.
-
Add the cyberpay package to the dependencies section of your
pubspec.yaml
file. The code below makes the Dart API of thecyberpayflutter
plugin available in your applicationdependencies: cyberpayflutter: ^1.0.5
-
Run the following command in your terminal after navigating to your project directory, to download the package
flutter pub get
Step 1: Import the cyberpay sdk
import 'package:cyberpayflutter/cyberpayflutter.dart';
Step 2: Complete integration with Our Drop-In UI
try {
var result = await Cyberpayflutter.makePayment(
integrationKey: "MERCHANT_INTEGRATION_KEY",
amount: "PAYMENT_AMOUNT_IN_KOBO",
customerEmail: "CUSTOMER_EMAIL",
liveMode: false);
if (result.isPaymentSuccessFul) {
print("Payment is Successfult, Your Payment Reference: ${result.paymentReference}");
}
else {
print(result.errorMessage);
}
} on PlatformException catch (e) {
var error = "Cyberpay Error: '${e.message}'.";
print(error);
}
Step 1: Import the cyberpay sdk
import 'package:cyberpayflutter/cyberpayflutter.dart';
Step 2: Complete integration with Our Server Drop-In UI
try {
var result = await Cyberpayflutter.makePaymentWithReference(
integrationKey: "MERCHANT_INTEGRATION_KEY",
reference: "TRANSACTION_REFERENCE_FROM_SERVER",
liveMode: false);
if (result.isPaymentSuccessFul) {
print(
"Payment is Successfult, Your Payment Reference: ${result.paymentReference}");
} else {
print(result.errorMessage);
}
} on PlatformException catch (e) {
var error = "Cyberpay Error: '${e.message}'.";
print(error);
}
Note : Ensure when going live, you change liveMode
to true
, and also change the integration key. This key can be gotten from the merchant dashboard on the cyberpay merchant portal
To run the example project, clone the repo, and run the following command in your terminal:
flutter run
cyberpaysdk is available under the MIT license. See the LICENSE file for more info.