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.
Comments are closed.