4

I'm having a nativescript-vue application where I want to integrate nativescript-paytm plugin, I created a method on click event: payNow() which contains all the necessary details of Paytm as described in Readme.md/documentation/demo app.

import {
    Paytm,
    Order,
    TransactionCallback,
    IOSCallback
} from "@nstudio/nativescript-paytm";

const paytm = new Paytm()
methods: {
    payNow() {
        paytm.setIOSCallbacks({
            didFinishedResponse: function(response) {
                console.log(response);
            },
            didCancelTransaction: function() {
                console.log("User cancelled transaction");
            },
            errorMissingParameterError: function(error) {
                console.log(error);
            }
        });
        // Sample order
        const order  = {
            // This will fail saying duplicate order id
            // generate your own order to test this.
            MID: "rzqfRq*******83",
            ORDER_ID: "NOETIC_ORDER_0001",
            CUST_ID: "CUST_6483",
            INDUSTRY_TYPE_ID: "Retail",
            CHANNEL_ID: "WAP",
            TXN_AMOUNT: "10.00",
            WEBSITE: "WEBSTAGING",
            CALLBACK_URL: "https://pguat.paytm.com/paytmchecksum/paytmCallback.jsp",
            EMAIL: "rubal@example.com",
            MOBILE_NO: "9876543210",
            CHECKSUMHASH: "NDspZhvSHbq44K3A9Y4daf9En3l2Ndu9fmOdLG+bIwugQ6682Q3JiNprqmhiWAgGUnNcxta3LT2Vtk3EPwDww8o87A8tyn7/jAS2UAS9m+c="
        };

        paytm.initialize("STAGING"); 

        paytm.createOrder(order);

        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);
           }
      });
    }
}

While executing so I only get to see screens like this:

enter image description here

I can see that while cancelling I get a message in my console User cancelled transaction by pressing back button that means these things are also working but I am unable to see any screen, atleast if any error message is visible I can try to debug. Help me out with this.

Here's the message which I get in my command prompt:

JS: Avoid using ListView or ScrollView with no explicit height set inside StackLayout. Doing so might results in poor user interface performance and a poor user experience. chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0 chromium: [INFO:aw_field_trial_creator.cc(54)] First-WebView-Experiment not found JS: 'User cancelled transaction by pressing back button' JS: Avoid using ListView or ScrollView with no explicit height set inside StackLayout. Doing so might results in poor user interface performance and a poor user experience. chromium: [INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://pguat.paytm.com will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: (0) chromium: [INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://pguat.paytm.com will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: https://pguat.paytm.com/oltp-web/processTransaction?ORDER_ID=NOETIC_ORDER_0001 (0) JS: 'User cancelled transaction by pressing back button' JS: Avoid using ListView or ScrollView with no explicit height set inside StackLayout. Doing so might results in poor user interface performance and a poor user experience. chromium: [INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://pguat.paytm.com will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: (0) chromium: [INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://pguat.paytm.com will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: https://pguat.paytm.com/oltp-web/processTransaction?ORDER_ID=NOETIC_ORDER_0001 (0)

For more info I raised issue on GitHub repo: https://github.com/nstudio/nativescript-paytm/issues/5

Edit:

I tried adding it through playground, but since it uses external library integration is not possible. However I tried using in following link

https://play.nativescript.org/?template=play-vue&id=CpqoNA&v=2

Hope this gives more clear picture about it.

Edit:

My whole payment.vue file looks like following link: https://gist.github.com/nitish1986/f23644514082efe757f132e943f2df51

Thanks

Nitish Kumar
  • 6,054
  • 21
  • 82
  • 148
  • I'd guess that your issue has to do with the template code. Can you add that to the question? (Vue has some issues where templates just render as white screens.) – Ed Jones May 08 '19 at 11:40
  • @EdJones You want the vue file? – Nitish Kumar May 08 '19 at 11:41
  • Nitish, It might help. – Ed Jones May 08 '19 at 11:44
  • @EdJones Please find the complet `payment.vue` file in the link: https://gist.github.com/nitish1986/f23644514082efe757f132e943f2df51 – Nitish Kumar May 08 '19 at 11:45
  • Thanks. There's a lot going on here, but it's possible the problem is in this line : this.$navigateTo(Invoice); You might check with some of the navigateTo issues to see if you can get it working. Seems like there should be vue template code for that invoice page. – Ed Jones May 08 '19 at 12:01
  • @EdJones Thanks for looking into the matter. I've done testing of codes step by step. First step to resolve this was I started from line no. 190 and removed all the parts above it inside my `payNow()` function. my Invoice page works fine if I don't involve my `paytm` part – Nitish Kumar May 08 '19 at 12:06

0 Answers0