mrdishant / Paytm-Flutter-Plugin

A Flutter plugin to use the Paytm as a gateway for accepting online paymnets in Flutter app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

paytm

A Flutter plugin to use the Paytm as a gateway for accepting online paymnets in Flutter app.

Getting Started

Screenshot_20190601-141441(1) Screenshot_20190601-141512

Testing Credentials:

MID : ParloS79006455919746

CHANNEL_ID: WAP

INDUSTRY_TYPE_ID: Retail

WEBSITE: APPSTAGING

PAYTM_MERCHANT_KEY: 380W#7mf&_SpEgsy

Lets’s begin

You can start paytm transaction following two steps:

1. Generate CheckSum:

You have to setup CheckSum Generation on your server ideally. But for testing purpose you can use the below api and request it and it will provide you checksum for your transaction.

CheckSum Generation URL: https://us-central1-mrdishant-4819c.cloudfunctions.net/generateCheckSum

Parameters to be passed: (Using flutter http package)

final response = await http.post(url, headers: {
  "Content-Type": "application/x-www-form-urlencoded"
}, body: {
  "mid": "ParloS79006455919746",
  "CHANNEL_ID": "WAP",
  'INDUSTRY_TYPE_ID': 'Retail',
  'WEBSITE': 'APPSTAGING',
  'PAYTM_MERCHANT_KEY': '380W#7mf&_SpEgsy',
  'TXN_AMOUNT': '10',
  'ORDER_ID': orderId,
  'CUST_ID': '122',
});

Replace the values with merchant account your values , and in response you will get checksum.

var checksum = response.body;

2. Start Payment:

Callback Url:

For Testing(Stagging) use this: https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=

For Production(Stagging) use this: https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=

var paytmResponse = Paytm.startPaytmPayment(
    true,
    "ParloS79006455919746",
    orderId,
    "122",
    "WAP",
    "10",
    'APPSTAGING',
    callBackUrl,
    'Retail',
    response.body);

paytmResponse.then((value) {
  setState(() {
    payment_response = value.toString();
  });
});

Parameters are like as per given below

1.Testing (Staging or Production) if true then Stagging else Production

2.MID provided by paytm

3.ORDERID your system generated order id

4.CUSTOMER ID

5.CHANNEL_ID provided by paytm

6.AMOUNT

7.WEBSITE provided by paytm

8.CallbackURL (As discussed above)

9.INDUSTRY_TYPE_ID provided by paytm

10.checksum generated now

For Cloning the example app code visit: Paytm Plugin

For detailed usage visit : Paytm Medium Post

For any query : Mail me at mr.dishantmahajan@gmail.com

About

A Flutter plugin to use the Paytm as a gateway for accepting online paymnets in Flutter app.

License:Other


Languages

Language:Objective-C 31.2%Language:Swift 22.5%Language:Java 21.7%Language:Dart 15.4%Language:Ruby 9.2%