flutter
razorpay gateway plugin
a flutter plugin for razorpay gateway integration for both android and ios.
installing
add this in pubspec.yaml
razorpay_plugin: ^0.0.2
using
import 'package:razorpay_plugin/razorpay_plugin.dart';
startpayment() async {
map<string, dynamic> options = new map();
options.putifabsent("name", () => "razorpay t-shirt");
options.putifabsent("image", () => "https://www.73lines.com/web/image/12427");
options.putifabsent("description", () => "this is a real transaction");
options.putifabsent("amount", () => "100");
options.putifabsent("email", () => "[email protected]");
options.putifabsent("contact", () => "9988776655");
//must be a valid html color.
options.putifabsent("theme", () => "#ff0000");
options.putifabsent("api_key", () => "api_key_here");
map<dynamic,dynamic> paymentresponse = new map();
paymentresponse = await razorpay.showpaymentform(options);
print("response $paymentresponse");
}
response :
{"code": 0, "message": "payment cancelled by user"}
or
{"code": 1, "message": "rpz_asdw23axd223s"}
if payment is successful message will contain the payment_id from razorpay.
demo app
![[2025] Integrate Razorpay Gateway (2OS) integrate razorpay gateway (2os)](https://i0.wp.com/user-images.githubusercontent.com/14369357/48185114-109bae00-e35a-11e8-9df8-2c8ccfcdbfc7.png?w=770&ssl=1)
![[2025] Integrate Razorpay Gateway (2OS)](https://i0.wp.com/user-images.githubusercontent.com/14369357/48185687-d3d0b680-e35b-11e8-849b-0899364df2f2.png?w=770&ssl=1)
Comments are closed.