3

Just started playing with Google App Engine & Python (as an excuse ;)). How do I correctly submit a form like this

<form action="https://www.moneybookers.com/app/payment.pl" method="post" target="_blank">
<input type="hidden" name="pay_to_email" value="ENTER_YOUR_USER_EMAIL@MERCHANT.COM">
<input type="hidden" name="status_url"
<!-- etc. -->
<input type="submit" value="Pay!">
</form>

w/o exposing the data to user?

yanchenko
  • 56,576
  • 33
  • 147
  • 165

2 Answers2

6

It sounds like you're looking for urllib.

Here's an example of POSTing from the library's docs:

>>> import urllib
>>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
>>> f = urllib.urlopen("http://www.musi-cal.com/cgi-bin/query", params)
>>> print f.read()
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
0

By hiding the sensitive bits of the form and submitting it via JavaScript.

Make sure you have a good way of referring to the form element...

<form ... id="moneybookersForm">...</form>

... and on page load, execute something like

document.getElementById("moneybookersForm").submit();

At least I don't know of other ways. For JavaScript-disabled people, the Pay! button should be kept visible.

AKX
  • 152,115
  • 15
  • 115
  • 172