flutter_jiopay_pg

Creator: coderz1093

Last updated:

Add to Cart

Description:

flutter jiopay pg

JioPay Flutter #
Flutter plugin for JioPay SDK.
Getting Started #
This flutter plugin is a wrapper around our Android and iOS SDKs.
Installation #
Add this to dependencies in your app's pubspec.yaml
flutter_jiopay_pg: ^0.0.1
copied to clipboard
Note for Android: Make sure that the minimum API level for your app is 19 or higher.
Usage #
Sample code to integrate can be found in example/lib/main.dart.
Import package
import 'package:flutter_jiopay_pg/flutter_jiopay_pg.dart';
copied to clipboard
Create Jiopay instance
JiopayPg jiopayFlutterPlugin= JiopayPg();
copied to clipboard
Attach event listeners
The plugin uses event-based communication, and emits events when payment fails or succeeds.
The event names are exposed via the constants EVENT_PAYMENT_SUCCESS, EVENT_PAYMENT_ERROR from the JiopayPg class.
Use the on(String event, Function handler) method on the JiopayPg instance to attach event listeners.

jiopayFlutterPlugin.on(JiopayPg.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
jiopayFlutterPlugin.on(JiopayPg.EVENT_PAYMENT_ERROR, _handlePaymentError);

copied to clipboard
The handlers would be defined somewhere as

void _handlePaymentSuccess(PaymentSuccessResponse response) {
debugPrint(msg: "SUCCESS: " + response.tnxId!);
}

void _handlePaymentError(PaymentFailureResponse response) {
debugPrint('_handlePaymentError: $response');
}

copied to clipboard
Setup options
var options={
'appaccesstoken': "APP_ACCESS_TOKEN",
'appidtoken':"APP_ID_TOKEN",
'intentid': "INTENT_ID",
'buildVariant':"prod",// OPTIONAL with pp sit prod
'theme': {
'brandColor': "BRAND_COLOR_HEX",
'bodyBgColor': "BODY_BG_COLOR_HEX",
'bodyTextColor': "BODY_TEXT_COLOR",
'headingText': "HEADING_TEXT_COLOR",
},
}
copied to clipboard
Open Checkout
jiopayFlutterPlugin.open(options);
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.