2

i have checked the native-script-paytm integration plugin. but both git-hub repository are not running instead it gives stack exception. so i created my own project and some how its doing something. but here i have lot of questions on how to get 'mid', 'order id' etc.

can anyone give step by step details for this.

const createViewModel = require("./main-view-model").createViewModel;
const Paytm = require("@nstudio/nativescript-paytm").Paytm;
const paytm = new Paytm();

exports.pageLoaded = function (args) {
    const page = args.object;
    page.bindingContext = createViewModel();
}


exports.onPayWithPaytm = function (args) {
    console.log("Paying");

    paytm.setIOSCallbacks({
        didFinishedResponse: function (response) {
            console.log("got response");
            console.log(response);
        },
        didCancelTransaction: function () {
            console.log("User cancelled transaction");
        },
        errorMissingParameterError: function (error) {
            console.log(error);
        }
    });

    const order = {
        // This will fail saying duplicate order id
        // generate your own order to test this.
        MID: "Tomcas09769922377481",
        ORDER_ID: "ORDER8874",
        CUST_ID: "CUST6483",
        INDUSTRY_TYPE_ID: "Retail",
        CHANNEL_ID: "WAP",
        TXN_AMOUNT: "10.00",
        WEBSITE: "APP_STAGING",
        CALLBACK_URL: "https://pguat.paytm.com/paytmchecksum/paytmCallback.jsp",
        CHECKSUMHASH:
            "NDspZhvSHbq44K3A9Y4daf9En3l2Ndu9fmOdLG+bIwugQ6682Q3JiNprqmhiWAgGUnNcxta3LT2Vtk3EPwDww8o87A8tyn7/jAS2UAS9m+c="
    };

    paytm.createOrder(order);

    paytm.initialize("STAGING");

    paytm.startPaymentTransaction({
        someUIErrorOccurred: function (inErrorMessage) {
            console.log(inErrorMessage);
        },
        onTransactionResponse: function (inResponse) {
            console.log(inResponse);
        },
        networkNotAvailable: function () {
            console.log("Network not available");
        },
        clientAuthenticationFailed: function (inErrorMessage) {
            console.log(inErrorMessage);
        },
        onErrorLoadingWebPage: function (
            iniErrorCode,
            inErrorMessage,
            inFailingUrl
        ) {
            console.log(iniErrorCode, inErrorMessage, inFailingUrl);
        },
        onBackPressedCancelTransaction: function () {
            console.log("User cancelled transaction by pressing back button");
        },
        onTransactionCancel: function (inErrorMessage, inResponse) {
            console.log(inErrorMessage, inResponse);
        }
    });
}  

For reference enter image description here

Nitish Kumar
  • 6,054
  • 21
  • 82
  • 148
Vikas Acharya
  • 3,550
  • 4
  • 19
  • 52

1 Answers1

0

As mentioned in the plugin's ReadMe file,

You will need a working backend server to generate paytm orders. Do not generate the order or checksum in the app.

Manoj
  • 21,753
  • 3
  • 20
  • 41
  • i have seen that but didn't get clearly. can you tell in detail on how to get checksum ..! a step by step guidance for javascript. thank you – Vikas Acharya Mar 05 '19 at 12:49
  • You have all the details if you refer the backend server repo. – Manoj Mar 05 '19 at 12:52
  • i used php with webserver and got checksum as a response but order id is null. now a new page open after showing round busy cursor and an error message "404 not found". how to do further steps given by paytm. ->Your server passes the payload and checksumhash back to the app which hands over these details to Paytm SDK ->SDK verifies payload and displays payment Paytm checkout page – Vikas Acharya Mar 06 '19 at 06:24
  • error i'm getting. chromium: [INFO:CONSOLE(0)] "The certificate used to load https://pguat.paytm.com/oltp-web/processTransaction?ORDER_ID=ORDER8874 uses an SSL certificate that will be distrusted in the future. Once distrusted, users will be prevented from loading this resource. See https://g.co/chrome/symantecpkicerts for more information.", source: https://pguat.paytm.com/oltp-web/processTransaction?ORDER_ID=ORDER8874 (0) – Vikas Acharya Mar 06 '19 at 06:30
  • @Manoj can you help me out with `vue` language here, or any references which I can refer to integrate the same on `nativescript-vue` app – Nitish Kumar Apr 26 '19 at 16:39
  • There is nothing specific to Vue with this plugin. It works the same with all the flavours. – Manoj Apr 26 '19 at 16:53
  • @Manoj can you guide me to https://stackoverflow.com/questions/55872696/integrating-nativescript-paytm-plugin-in-nativescript-vue-application where I'm doing mistake? – Nitish Kumar Apr 26 '19 at 17:49