instamojo_plus 0.0.1
instamojo_plus: ^0.0.1 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
๐งช Supports Sandbox and Live environments
โ๏ธ Getting Started
Add dependency
dependencies: instamojo_flutter: path: ../ # or from pub.dev once published
Import the package
import 'package:instamojo_flutter/instamojo_flutter.dart';
Initialize API
final api = InstamojoApi( apiKey: 'YOUR_CLIENT_ID', authToken: 'YOUR_CLIENT_SECRET', isLive: false, // false = Sandbox, true = Production );
๐ก Example Usage final paymentRequest = { "purpose": "Subscription", "amount": "10.0", "buyer_name": "Sujith", "email": "[email protected]", "phone": "7994095833", "redirect_url": "https://www.example.com/redirect/" };
final response = await api.createPaymentRequest(paymentRequest);
if (response['success']) { final longUrl = response['payment_request']['longurl']; Navigator.push( context, MaterialPageRoute( builder: (context) => PaymentScreen( paymentUrl: longUrl, onPaymentSuccess: (data) => print('Payment Success: $data'), onPaymentError: (error) => print('Payment Error: $error'), onPaymentCancel: () => print('Payment Cancelled'), ), ), ); }