flutter_jiopay_pg 0.0.13 copy "flutter_jiopay_pg: ^0.0.13" to clipboard
flutter_jiopay_pg: ^0.0.13 copied to clipboard

Flutter plugin for connecting jiopay plugin

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

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';

Create Jiopay instance

JiopayPg jiopayFlutterPlugin= JiopayPg();

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);

The handlers would be defined somewhere as


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

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

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",
      },
    }

Open Checkout

jiopayFlutterPlugin.open(options);
0
likes
120
points
72
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin for connecting jiopay plugin

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

eventify, flutter

More

Packages that depend on flutter_jiopay_pg