How do I make a PayPal donate button default to $10 but enable users to change the amount?
1 Answer
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 = '[email protected]'
receiverEmail = '[email protected]'
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
-
-
2Today I learned why it is against policy to just post links. I dug up my code and pasted it in. Commented Jan 1, 2016 at 19:34
-