Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I make a PayPal donate button default to $10 but enable users to change the amount?

share|improve this question
up vote 1 down vote accepted

Using this tutorial I made a textbox where the user is able to specify the amount they want to pay on a form I have complete control over, before I send them to a PayPal webpage to complete the transaction.

My gemfile:

gem 'paypal-sdk-adaptivepayments'

My Ruby payment code

  p = PayPalPayer.new
  amt = @buyamount.to_f
  trackingId = SecureRandom.uuid
  senderEmail = 'senderemail@emailaddress.com'
  receiverEmail = 'receiveremail@emailaddress.com'
  url = 'http://redirectotohereafterpaymentcomplets'
  pay = p.pay(senderEmail, receiverEmail, amt, url, trackingId)
  redirect pay[:url] //this takes the user to a page to complete the payment
share|improve this answer
That link is broken :-( – Casebash Jan 1 at 11:49
Today I learned why it is against policy to just post links. I dug up my code and pasted it in. – David Silva Smith Jan 1 at 19:34
Much appreciated! – Casebash Jan 2 at 6:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.