instamojo_plus 0.0.2
instamojo_plus: ^0.0.2 copied to clipboard
A Flutter package to integrate Instamojo payment gateway.
πͺ Instamojo Flutter
A simple Flutter plugin for integrating Instamojo Payment Gateway in your mobile apps. Supports both Android and iOS, with WebView-based checkout for a smooth in-app payment flow.
π Features
π Secure Instamojo payment gateway integration
π³ Accept payments using Instamojo APIs
π WebView-based hosted payment page
π¦ Simple and developer-friendly API
βοΈ Getting Started
Add dependency
π Example Usage #
Add this to your pubspec.yaml:
dependencies:
instamojo_plus: ^0.0.2
Import the package
import 'package:instamojo_flutter/instamojo_flutter.dart';
Initialize API
final paymentRequest = InstamojoPaymentRequest(
purpose: 'Subscription',
amount: double.parse('10'),
buyerName: 'name',
email: '[email protected]',
phone: 'phonenumber',
redirectUrl: 'http://www.example.com/redirect/',
);
π‘ Navigate to the screen it willreturn your respnse
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PaymentScreen(
clientId: 'clientId',
clientsecret: 'clientsecret',
paymentRequest: paymentRequest,
onPaymentSuccess: (p0) =>
debugprint('Payment Success: $p0'),
onPaymentError: (p0) => debugprint('ΒΈ $p0'),
onPaymentCancel: () => debugprint('Payment Cancelled'),
)),
);
Steps to create CLIENTID and CLIENT SECRET
Step 1: Login to the Instamojo Dashboard.
Step 2: Click on API&Plugin Section [App Screenshot]
Step 3: Scroll Down and click on create credentials [Screenshot]
Step 4: [Screenshot]