Web2py- PayUMoney Secure Online Payment Gateway.

156 views
Skip to first unread message

sandeep patel

unread,
Dec 15, 2018, 2:03:58 AM12/15/18
to web2py-users
Hello All,

I have customized PayUmoney python SDK for the Web2py user. This app can in integrate with any web2py app and customize according to your needs.

Thanks
Sandeep Patel

Arindam Dasgupta

unread,
Dec 15, 2018, 3:02:06 AM12/15/18
to web...@googlegroups.com
Hi Sandeep,

I installed the app in pythonanywhere cloud and tried to view the index.html file. it said :Requires web2py 2.15.5 or newer

Then I commented out the below two lines from db.py and tried again. But then it gave errors:
if request.global_settings.web2py_version < "2.15.5":
  raise HTTP(500, "Requires web2py 2.15.5 or newer")

Error ticket for "payumoney"

Ticket ID

42.110.131.171.2018-12-15.07-55-13.2cbcd4c5-a853-4a8c-a2d5-e268448066da

<type 'exceptions.ValueError'> unsupported pickle protocol: 3

Version

web2py™Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
PythonPython 2.7.6: /usr/local/bin/uwsgi (prefix: /usr)

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
Traceback (most recent call last):
File "/home/earinda/FarmFresh/gluon/restricted.py", line 227, in restricted
exec ccode in environment
File "/home/earinda/FarmFresh/applications/payumoney/models/db.py", line 95, in <module>
auth.define_tables(username=False, signature=False)
File "/home/earinda/FarmFresh/gluon/tools.py", line 2376, in define_tables
format='%(first_name)s %(last_name)s (%(id)s)'))
File "/home/earinda/FarmFresh/gluon/packages/dal/pydal/base.py", line 834, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
File "/home/earinda/FarmFresh/gluon/packages/dal/pydal/base.py", line 873, in lazy_define_table
polymodel=polymodel)
File "/home/earinda/FarmFresh/gluon/packages/dal/pydal/adapters/base.py", line 500, in create_table
sql_fields_old = pickle.load(tfile)
ValueError: unsupported pickle protocol: 3


How do I get it right?

Best Regards,
Arindam

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sandeep patel

unread,
Dec 15, 2018, 3:13:10 AM12/15/18
to web...@googlegroups.com
I think this error getting because of version. I have tested on both versions 2.16.1 and 2.17.2 that working fine.
Here is demo

Thanks



Arindam Dasgupta

unread,
Dec 15, 2018, 3:33:56 AM12/15/18
to web...@googlegroups.com
Hi Sandeep,
In my pythonanywhere page I can see the following version . So my version is 2.7.6 or 2.14.6 ?
Now I am getting a upgrade option here to version 2.17.2 but it is telling that is is an experimental one. So how do I upgrade it to one of your version ( 2.16.1 or 2.17.2). And also I I do, then will my existing apps be still there or I will have to reinstall them?
Sorry If I am asking too much questions. Thanks in advance. :-)


image.png

sandeep patel

unread,
Dec 15, 2018, 4:05:12 AM12/15/18
to web...@googlegroups.com
Currently, you are using python 2.7.6 and web2py 2.14.6 version.
I have tested this app on python3.6.6 and web2py 2.16.1 and 2.17.2.

You can upgrade directly by clicking on the button(upgrade new to version 2.17.2).
But be careful first take back-up of your apps :)

Thanks/







Arindam Dasgupta

unread,
Dec 15, 2018, 4:51:51 AM12/15/18
to web...@googlegroups.com
Hi I backed up my apps and clicked on the upgrade button. The result is that web2py version got changed to 2.17.2 but python version is still 2.7.6. Now how to upgrade to python 3.6.6 Please don't answer my question today. Because I know it is too much for today . :-)

image.png

Arindam Dasgupta

unread,
Dec 15, 2018, 7:02:21 AM12/15/18
to web...@googlegroups.com
Hi sandeep,
At last I have figured it out myself and the python version is now 3.6.0
And after this change your payumoney app is also running. :-)
Thanks.

image.png

Lovedie JC

unread,
Dec 16, 2018, 5:02:32 AM12/16/18
to web...@googlegroups.com
What about python 2.7 compatibility

sandeep patel

unread,
Dec 16, 2018, 10:15:33 AM12/16/18
to web...@googlegroups.com
@Lovedie,
This app generated with python3 so if you are directly installing that app from git in your application folder then this will raise an error.
If you want to use with Python 2.7. these are the following steps.
1. Create a new app in your web2py environment.
2. Copy index, success, and failure function form git and import also required the library too.
3. Downloads index, success, and failure file from git and past your /view/default folder.
4. Change MERCHANT_KEY, Key, SALT with real ids

Now Payment Gateway will work.

Thanks
Sandeep Patel

Arindam Dasgupta

unread,
Dec 18, 2018, 11:20:52 AM12/18/18
to web...@googlegroups.com
Hi Sandeep,

I have used your method and used the following ids :
def index():
    MERCHANT_KEY = "hKiHd2aX"
    key="hKiHd2aX"
    SALT = "byRHoBc0pq"

The code is working only when MERCHANT_KEY=key. But in your mail it seemed that MERCHANT_KEY and key are different things. From payumoney I got a merchant ID (like 6130012), merchant key and a salt.

The test transaction is completing (I am also getting an SMS) and it is taking me to the success page. But I am getting a ticket in the success page. And if I click the ticket I am getting a blank page. I cannot figure out what is wrong.. I have not changed any code I just put the correct IDs and the name/ email/ phone no. etc. Please help.
And yes, My website is http and not https yet.
 
image.png

BR//Arindam

 

sandeep patel

unread,
Dec 18, 2018, 12:08:18 PM12/18/18
to web...@googlegroups.com
Yes, Arindam  MERCHANT_KEY  and Key both are the same. when you clicked on Internal error link than Admin is disabled because insecure channel message is shown in your browser because of your URL not secure.

you can test on localhost URL instead of this.


Thanks
SP


Arindam Dasgupta

unread,
Dec 18, 2018, 11:55:00 PM12/18/18
to web...@googlegroups.com
Hi Sandeep,
The payment gateway worked after I used an "https" site. However I have some doubts :
1) I have to press the pay now button twice to get it working. What should I change so that one press is sufficient?
2) I had to modify the return statement of success function the following way because success.html is using a variable "c" which is not returned from the function leading to a error :

return dict(txnid=txnid,status=status,amount=amount,c=c)
3) There are some print statements in the success function. But where it is printing these lines..?
     print ("Thank You. Your order status is ", status)

And Thank you truly for the help you did to me. :-)

Best Regards,
Arindam

黄祥

unread,
Dec 19, 2018, 4:30:35 AM12/19/18
to web2py-users
1) I have to press the pay now button twice to get it working. What should I change so that one press is sufficient?

did you put web2py server on windows ?

best regards,
stifan 

Arindam Dasgupta

unread,
Dec 19, 2018, 5:57:26 AM12/19/18
to web...@googlegroups.com
Hi Stifan,

Not I did not put web2py server on windows. I am using python anywhere cloud :


Regards,
Arindam

--

Arindam Dasgupta

unread,
Dec 20, 2018, 2:02:48 PM12/20/18
to web...@googlegroups.com
Hi,

Have you had some time to look at the issue as to why I need to click two times in the Pay Now button to make the transactions?

Best Regards,
Arindam 

sandeep patel

unread,
Dec 21, 2018, 12:47:37 AM12/21/18
to web...@googlegroups.com
@Arindas,
I have updated default.py and index.html in the git repository. Please check it.
Now transactions make in one click and Even you can change user info and pricing programmatically in a wen2py way. 

Let me know if you have any questions

Thanks 
Sp/

Arindam Dasgupta

unread,
Dec 21, 2018, 7:08:00 AM12/21/18
to web...@googlegroups.com
Sandeep,

Thank you so much. I will check this and let you know the results. 
No matter how much I appreciate you it will never be sufficient!! Thanks a lot.

Regards,
Arindam

Arindam Dasgupta

unread,
Dec 22, 2018, 3:46:44 AM12/22/18
to web...@googlegroups.com

Hi Sandeep,
I am facing a serious problem while using this app. It is automatically loging me out of the application after making the payment and reaching the success page. Due to this i am not able to use session.auth.user.id variable from the success page. Do you have a solution for this?
Thanks.Arindam.

To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

Arindam Dasgupta

unread,
Dec 22, 2018, 7:07:40 AM12/22/18
to web...@googlegroups.com
Hi,

I just found that I am not facing the logout issue in web2py version 2.17.1 with python version 3.6.6.  Whereas when I am using 2.17.2 and python version 3.6.0 , I am facing the logout issue after payment. I there a way to downgrade the web2py version to 2.17.1?

image.png
Regards,
Arindam

To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

黄祥

unread,
Dec 22, 2018, 7:22:26 AM12/22/18
to web2py-users
had you try using 2.17.2 and python version 3.6.6 ?

best regards,
stifan

Arindam Dasgupta

unread,
Dec 22, 2018, 7:40:46 AM12/22/18
to web...@googlegroups.com
Hi Stifan,

I have already web2py 2.17.2 installed and I dont have a option to select python 3.6.6. In the list it is displaying only 3.6 and if i select it it is displaying 3.6.0.

image.png

--

sandeep patel

unread,
Dec 22, 2018, 8:22:13 AM12/22/18
to web...@googlegroups.com
@Arindas,
Are you using one app for Payment and one app for a web application or both of contains in one app?

Thanks

Arindam Dasgupta

unread,
Dec 22, 2018, 9:27:54 AM12/22/18
to web...@googlegroups.com

Hi ,
Both is contained in one app. Working fine in 2.17.1 and python version 3.6.6. But not working (logging me out after payment) in 2.17.2 and python version 3.6.0.

Thanks.

On 22 Dec 2018 18:52, "sandeep patel" <patelsa...@gmail.com> wrote:
@Arindas,
Are you using one app for Payment and one app for a web application or both of contains in one app?

Thanks


On Sat, Dec 22, 2018 at 6:10 PM Arindam Dasgupta <nyn.da...@gmail.com> wrote:
Hi Stifan,

I have already web2py 2.17.2 installed and I dont have a option to select python 3.6.6. In the list it is displaying only 3.6 and if i select it it is displaying 3.6.0.

image.png

On Sat, Dec 22, 2018 at 5:52 PM 黄祥 <steve.van...@gmail.com> wrote:
had you try using 2.17.2 and python version 3.6.6 ?

best regards,
stifan

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

Arindam Dasgupta

unread,
Dec 22, 2018, 11:42:58 PM12/22/18
to web...@googlegroups.com

Hi, I figured out that the problem i mentioned is due to the web2py version only. I need to downgrade it to 2.17.1 . But i dont know how. Transferring the whole app to a different pythonanywhere account is an option. But that road is blocked too as i just bought an ssl certificate for this account.

Br//Arindam

Dave S

unread,
Dec 24, 2018, 3:44:12 PM12/24/18
to web2py-users


On Saturday, December 22, 2018 at 8:42:58 PM UTC-8, Arindam Dasgupta wrote:

Hi, I figured out that the problem i mentioned is due to the web2py version only. I need to downgrade it to 2.17.1 . But i dont know how. Transferring the whole app to a different pythonanywhere account is an option. But that road is blocked too as i just bought an ssl certificate for this account.

Br//Arindam


The previous version should be tagged in the git repository.  You will need to do a recursive pull/download to get the DAL files.

/dps

Saranya S

unread,
Sep 5, 2019, 1:46:34 AM9/5/19
to web2py-users
Hi,

I'm getting the same problem. User getting logged out after successful transaction. it's working fine in local host but when deployed to pythonanywhere server, I'm getting this issue. Also tried downdrading web2py version 2.17.1, still no luck...

Did you find solution for this problem....Please share..It'll be very helpful

Thank you....

On Sunday, December 23, 2018 at 10:12:58 AM UTC+5:30, Arindam Dasgupta wrote:

Hi, I figured out that the problem i mentioned is due to the web2py version only. I need to downgrade it to 2.17.1 . But i dont know how. Transferring the whole app to a different pythonanywhere account is an option. But that road is blocked too as i just bought an ssl certificate for this account.

Br//Arindam

On 22 Dec 2018 19:57, "Arindam Dasgupta" <nyn.d...@gmail.com> wrote:

Hi ,
Both is contained in one app. Working fine in 2.17.1 and python version 3.6.6. But not working (logging me out after payment) in 2.17.2 and python version 3.6.0.

Thanks.

On 22 Dec 2018 18:52, "sandeep patel" <patelsa...@gmail.com> wrote:
@Arindas,
Are you using one app for Payment and one app for a web application or both of contains in one app?

Thanks


On Sat, Dec 22, 2018 at 6:10 PM Arindam Dasgupta <nyn.d...@gmail.com> wrote:
Hi Stifan,

I have already web2py 2.17.2 installed and I dont have a option to select python 3.6.6. In the list it is displaying only 3.6 and if i select it it is displaying 3.6.0.

image.png

On Sat, Dec 22, 2018 at 5:52 PM 黄祥 <steve.va...@gmail.com> wrote:
had you try using 2.17.2 and python version 3.6.6 ?

best regards,
stifan

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages