Closed hkis-gh closed 6 years ago
Hi @hkis-gh ,
I just decompiled the paytm library present in the plugin repo and I don't see that abnormalities which is mentioned above. I see below lines as I decompile the PGSDK_V2.1.jar file.
private static final String STAGING_PG_URL = "https://pguat.paytm.com/oltp-web/processTransaction";
private static final String PRODUCTION_PG_URL = "https://secure.paytm.in/oltp-web/processTransaction";
.
Further this is a cordova plugin. No changes are needed in this plugin to make it work with Ionic 3 (until cordova has modified backward incompatible changes that harms the plugin recognition). You have to mention declare var paytm: any;
in the
I used the library from Paytm repo(not custome made). https://github.com/Paytm-Payments/Paytm_Android_App_Kit https://github.com/Paytm-Payments/Paytm_iOS_App_Kit
Try deleting all platforms and reinjecting it again. Plugins are not installed properly might be the issue
Thank you @ArunYogi for your reply on this. However it seems that you misunderstood what I wrote initially so let me just confirm if that's the case then.
Yes, you're correct that after de-compiling jar file from your plugin the URLs currently which are set are as follows: private static final String STAGING_PG_URL = "https://pguat.paytm.com/oltp-web/processTransaction"; private static final String PRODUCTION_PG_URL = "https://secure.paytm.in/oltp-web/processTransaction";
What my initial comment was to say according to what we talked with Paytm merchant support team (technical) that those are their old servers and they don't support anymore. So, below are their new server URLs as they recommended to use:
private static final String STAGING_PG_URL = "https://securegw-stage.paytm.in/theia/processTransaction"; private static final String PRODUCTION_PG_URL = "https://securegw.paytm.in/theia/processTransaction";
Upon calling your plugin code when/after the order is processed on Paytm, it doesn't redirect back to the app due to those incorrect URLs. Here is the log which may probably help you to figure out about what we're trying to report.
As you can see from the screenshot above, the page is calling old server URLs with some trailing value which is I guess WEBSITE parameter value returned from the Paytm!
The interesting fact is as you said you're using the same plugin for another couple of apps - how does it support old server URLs of Paytm?
BTW we've already mentioned declare var paytm: any;
in the ts file, without that it's not going to work of course!
@hkis-gh Are you talking about Callback URL or the Transaction Request URL?
I know it's bit confusing between CB Vs. TXN request URL but this is something we're even confused after having lot of conversation with Paytm support team which is still unclear to us. So, here is the screenshot of how we're generating checksum on server side PHP function.
According to them, the TXN request URL should be set to their new server but I wondered what it has to do with Callback URL since we're successfully redirected to their payment screen and the issue is with redirect only after payment is done!
I am facing kind of a similar problem...
After the transaction is completed, instead of returning back to the APP, I am being redirected to the APP_URL mention in the Sandbox Credentials, even though I am using { "WEBSITE" : "APPSTAGING" }
1 | 2 | 3 |
---|---|---|
App URL in Sandbox Credentials is the same
@hkis-gh , Paytm doesn't stop supporting old version url, if that's the case lost of application (including ours) would break in production. But ofcourse they don't suggest the old urls to new users/clients. The screenshot shows different message, the paytm "Process Transaction" url which is shown in the picture has www.suga....com, this is not a correct url.. This plugin or paytm doesnt supprot these kind of urls.
Here I see lots of issues are reported as one.
@YaMo97, Check with Paytm, on the redirecting to app_url. If you have given custome url to Paytm, then Paytm will redirect to your given server/app url and server has to take care of redirecting back to your mobile app not the plugin.
If you ask Paytm to configure general callback url for your merchant Id like "https://pguat.paytm.com/paytmchecksum/paytmCallback.jsp", then paytm automatically returns control mobile app.
Varaiables like WEBSITE, CALLBACKURL,INDUSTRY_TYPE_ID, sometime are different for a merchantid. So its better confirm with them.
@ArunYogi Thanks, I am communicating with Paytm regarding my issue.
Also, I found this note:
Important Note:
We are not supporting PgSdk jar from now onwards. Kindly use the below mentioned Gradle dependency for the same.
Gradle Dependency:
Command: compile 'com.paytm:pgplussdk:1.1.5'
Note:
- If you have the Jar file please Remove the jar file and jar dependency from the project.
- Kindly change the import statements accordingly.
Source: Paytm_Android_App_Kit/Payment_Web_Sdk/README.md
Does this have an impact on this plugin?
@YaMo97 , its not blocker, but of course, need to migrate for new library & url. So far I didn't get any notice from Paytm for migration to new url or library.
@ArunYogi I am now able to successfully complete a transaction. The URLs are working. Thanks for your hard work.
@hkis-gh Here are some few modifications you should do in your Checksum_get() function.
Generate the checksum using all the parameters of the Transaction Request, except the "ENVIRONMENT" (Coz as you mentioned, it gets removed)
Set CALLBACK_URL = "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=ORDER000xxx" (whatever the order ID is); Be sure to add the ORDER ID to the Callback.
Callback URL is used by PayTM to POST the Transaction Response. This returns the control from the plugin back to the App's Activity/Page.
That's it. You'll be good to go.
Oh and also, I once faced the "Oops Error", when I forgot to add the Checksum to the Transaction Request. So, make sure the Checksum is there and is correct.
Maybe try logging the Request Parameters before starting the payment and crosscheck whether all parameters are present in the Request.
Closing this clarification issue, as all are clear on how to proceed forward.
Oh and also, I once faced the "Oops Error", when I forgot to add the Checksum to the Transaction Request. So, make sure the Checksum is there and is correct.
Maybe try logging the Request Parameters before starting the payment and crosscheck whether all parameters are present in the Request.
Hi @YaMo97 , Even after setting my callback url to https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=ORDER000xxx, after successful transaction it is redirecting to the app url mentioned in the sandbox credentials. Do i need to contact paytm people to change my app url to https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=ORDER000xxx ?
Hi @shwetagharshi, I did contact PayTM and they did a credential reset using my Merchant ID. After that, the redirection was working as expected. (Redirected successfully to the Callback URL and control was returned from plugin back to the App).
Thanks @YaMo97
I am trying in staging mode using sandbox right now. Could you please tell me what are we supposed to give as App Url in production mode?
@shwetagharshi According to new PayTM Developer Docs,
WEBSITE [String(30) Mandatory] : - For staging environment: For staging environment: WEBSTAGING For production environment: Will be available here once your activation is complete.
Basically, you'd have to complete the integration process with the app/website (the coding part) and then submit your App to PayTM for approval. After that, they'll provide you with all the Production Credentials required for Production Mode.
Also, in case of APPs, WEBSITE
should be APPSTAGING
for staging environment.
@YaMo97
Thanks a lot for the help :)
@ArunYogi Hi, I was able to do successful transactions in last few days. But now after generating checksum it redirects to this page which says to update the transaction url to https://securegw-stage.paytm.in/theia/processTransaction. After doing the same in server side, i still get the same error page. Is there any changes in the plugin we need to do?
Yes, Paytm library has to be updated. Working on that now.
@ArunYogi
Thanks.
@shwetagharshi & @ArunYogi - after using new url its working for you ? i try using new url and page says 404 not found error.
@umesh25 Yes it does work with the updated plugin library
@shwetagharshi can you share latest plugin url and code sample, which version of ionic used in your app?
We've successfully migrated your plugin to IONIC 3. However we're facing issue where the URLs used are outdated or doesn't support by Paytm anymore and thus after processing the payment it doesn't redirect back to the app as desired. We've de-compiled PGSDK_V2.1.jar file and noticed that they're hard-coded into PaytmPGService.java file with their older version. After talking to Paytm support we got to know that the new or latest URLs which should be used are as below.
private static final String STAGING_PG_URL = "https://securegw-stage.paytm.in/theia/processTransaction"; private static final String PRODUCTION_PG_URL = "https://securegw.paytm.in/theia/processTransaction";
@ArunYogi Can you please provide us source code or at least latest jar file to accomplish above changes so that we can fulfill our requirement? Your help will be highly appreciated. Kindly let me know. Thank you very much in advance.