cashfree_pg 0.0.4+8 copy "cashfree_pg: ^0.0.4+8" to clipboard
cashfree_pg: ^0.0.4+8 copied to clipboard

discontinuedreplaced by: flutter_cashfree_pg_sdk
outdated

A Flutter plugin for Cashfree PG integration. It opens the payment page inside a webview.

example/lib/main.dart

import 'package:cashfree_pg/cashfree_pg.dart';
import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(home: MyApp()));

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('CFSDK Sample'),
        ),
        body: Center(
          child: RaisedButton(
            child: Text('DO PAYMENT'),
            onPressed: () {
              makePayment();
            },
          ),
        ),
      ),
    );
  }

  makePayment() {
    //Replace with actual values
    String stage = "TEST";
    String orderId = "Order Id";
    String orderAmount = "ORDER AMOUNT";
    String tokenData = "TOKEN_DATA";
    String customerName = "Customer Name";
    String orderNote = "Order Note";
    String orderCurrency = "INR";
    String appId = "APP_ID";
    String customerPhone = "9094395340";
    String customerEmail = "sample@gmail.com";
    String notifyUrl = "https://test.gocashfree.com/notify";

    Map<String, dynamic> inputParams = {
      "orderId": orderId,
      "orderAmount": orderAmount,
      "customerName": customerName,
      "orderNote": orderNote,
      "orderCurrency": orderCurrency,
      "appId": appId,
      "customerPhone": customerPhone,
      "customerEmail": customerEmail,
      "stage": stage,
      "tokenData": tokenData,
      "notifyUrl": notifyUrl
    };

    CashfreePGSDK.doPayment(inputParams)
        .then((value) => value?.forEach((key, value) {
              print("$key : $value");
              //Do something with the result
            }));
  }
}
40
likes
0
pub points
90%
popularity

Publisher

unverified uploader

A Flutter plugin for Cashfree PG integration. It opens the payment page inside a webview.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on cashfree_pg