Encoding Return URL for US Payment Gateway

10 views
Skip to first unread message

Peter Hamilton

unread,
Oct 8, 2011, 8:20:00 AM10/8/11
to 50/50 API
Hi Andrew,

How do I encode the URL for a return url for the US Payment gateway?

Currently using this:

return_url = url_for :controller => 'donation', :action =>
'callback_us'
return_url += "?data=${data}"
return_url += "&donation_id=${donation_id}"
return_url += "&amount=${amount}"

url = "http://5050.gd/campaigns/11/donate"
url += "?return_url=#{CGI::escape(return_url)}"
url += "&data=#{donation.id}"
url += "&suggested_amount=#{donation.pledged}"

return url

Which produces a URL different to the example.
Me:
http://5050.gd/campaigns/11/donate?return_url=http%3A%2F%2Fgiveabuck.gd%2Fdonation%2Fcallback_us%3Fdata%3D%24%7Bdata%7D%26donation_id%3D%24%7Bdonation_id%7D%26amount%3D%24%7Bamount%7D&data=49&suggested_amount=5
Sample:
http://5050.gd/campaigns/[project_id]/donate?return_url=http%3A%2F%2Fwww.example.com%2Fcallback%3Fname%3D%24%7Bname%7D%26amp%3Bamount%3D%24%7Bamount%7D

When sent back from 5050 site (which works fine) the params have not
been replaced so come through as ${data} not '49'

Any Ideas?

Andrew Senter

unread,
Oct 11, 2011, 11:45:41 AM10/11/11
to 5050...@googlegroups.com
Hi Pete, we were having a few issues with this while I was away so url parameter substitution was disabled.

Can you give it a shot, see how it goes now? I've put in place a few fixes.

Andrew
Reply all
Reply to author
Forward
0 new messages