skypay_sdk 0.0.1 skypay_sdk: ^0.0.1 copied to clipboard
Seamless payment integration for Flutter with SkyPay SDK – Simplify and secure payments in your apps effortlessly.
About #
SkyPay is a comprehensive payment gateway solution in Nepal by SkyBase Innovations. It simplifies integration, boosts developer productivity, reduces costs, and minimizes technical challenges. With options like Manual Entry, Merchant API, and SkyPay Managed, it streamlines online payments and is especially beneficial for developers. It also supports various payment methods, including Khalti, eliminating the need to integrate with individual banks.
Pre-requisites #
- Create your FREE MERCHANT ACCOUNT here: Merchant Registration Page
- Download & set up the Merchant App from the link available your Dashboard
- Copy your Access Key / API Key provided on your dashboard page
Getting Started #
-
Import package:
import 'package:skypay_pkg/skypay_pkg.dart';
-
Create a navigator key in your
main.dart
class SkyPayDemoApp extends StatefulWidget { final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); SkyPayDemoApp({super.key});
-
Pass the navigator key in your Material app
return MaterialApp( navigatorKey: widget.navigatorKey,
-
Go to your Skypay dashboard and copy the
API Key
from My Api Key -
Override your
initState
method with the following@override void initState() { Skypay.initConfig( navigatorKey: widget.navigatorKey, accessKey: "870027"); super.initState(); }
Replace the accessKey with your api key
Initialize Payment #
Skypay.initPayment(
orderId: "123457",
amount: 100,
onSuccess: (data) {
//On Success Event
},
onFailure: (data) {
//On Fail Event
},
onCancellation: () {
//On Cancell Event
},
);
Parameters #
Parameter | Required | Description |
---|---|---|
amount | true | The transaction amount. |
success_url | false | URL to be redirected when payment successful |
failure_url | false | URL to be redirected when payment fails |
order_id | true | Unique identifier for the order (same order_id is available for 10 minutes) |
Callbacks #
-
onSuccess: On successful transactions, you can use the onSuccess callback. The function will be invoked on a successful transaction.
-
onFailure: On On failed transactions, you can use the onFailure callback. The function is responsible for handeling fail cases.
-
onCancellation: When user decides to cancel the payment the onCacellation function will be invoked.
That's it! You've successfully integrated Skybase Payments into your platform. If you have any questions or need further clarification, feel free to reach out to our support team.