How to send data to PayPal from controller? - ruby-on-rails

Usually if I want to make a payment via PayPal through a Rails app, I prepare a payment form in a view and after clicking that is a user redirected to PayPal, where (s)he pay and is redirected back to the app.
I would need send a regular form with data to controller, then to save them there and then according to what's in the sent data to redirect user to PayPal, where (s)he would pay.
But how to do something like this? Is even this approach allowed to make a payment with using PayPal?
Thank you

You will probably want to consume the PayPal API. This may provide a better experience for your user since you won't have to bounce them out to PayPal and back.
It looks like there's a gem that may help you out: paypal_adaptive
I haven't tried it, so your mileage may vary.

Related

Transfer fund from stripe platform account to a recipient by email

One of my clients have a situation to pay their website user directly from platform account to user. I can do it by using their transfer payment API.
But, my client want to pay to user's email so that user can have option to perform rest of the action.
I went through their API documentation but don't see anything related to do that. Does anyone have similar experience or know anything related to do that?
Stripe's API doesn't have anything like that, but it is something you may be able to build into your application.
I think you might want to contact Stripe Support and fill them in on your use case and see if they can offer you some specific suggestions.

Rails 4: PayPal IPN, Payments for various Sellers

I am working on a Rails Application where Users can buy Items other Users shared previously.The payments should be flexible to allow the User who shared an Item to get the money a buyer pais.
1) Is it possible to create Flexible Paypal Payments (Different Seller, different Price for each Item)?
2) Can you use the PayPal IPN with Donations to check whether a buyer paid or not?
3) If not, what is the most efficient way to achive that goal?
Thanks in advance for each answer! Please tell me if you need additional information.
Here's the way I'd approach this:
Is it possible to create Flexible Paypal Payments?
Different sellers: Do you want them to be able to receive the payment directly in their Paypal? If that's the case, you'd need to provide them the details to create a Paypal merchant account and securely store those details, but I don't think that's the approach you want to take;
Most payment solutions provider gives a way to send payment to multiple vendors/merchants, which you may instead want to set up or even in your application, you can set up a kind of payment stuff to ensure that integrates with Paypal's API to pay your vendor soon as you receive payments for items.
So, yes it's possible, the different sellers could be tricky, but all other things are possible!
Can you use the PayPal IPN with Donations to check whether a buyer paid or not?
Absolutely, that's one of the biggest benefit of the IPN is that your application gets to know on time if someone has made a payment. You only have to validate this record with Paypal and, not like it's often necessary compare the payment amount

Amazon Simple Pay - Send Up User Data

I am trying to integrate my web app with Amazon Simple Pay, so that users can pay for added functionality on the website.
Once a user makes a payment, I need to update that user in the database to mark them as being paid. It seems, however, like I can't send up any data, like the USER ID, so when my IPN comes back from Amazon, I don't know how to link the payment information with the user. How can I do this?

setup donation system in rails

Ok so there is this feature that I would like to implement on my site. Users can choose to donate money to a specific nonprofit (let's say Wikipedia). So they click donate and they choose the amount on the website, get redirected to PayPal website, complete the transaction, and then get redirected to my website AFTER I get some Instant Notification, with which I track that donation in my website database with the users info.
I looked up some Railscasts video about PayPal, but they were all mostly about e-commerce. How can I set up the system to wire the money directly to Wikipedia's PayPal account and how can I get the notification back? I really could appreciate it if someone could assist me with this.
P.S I am running the localhost server for now, will that be a problem?
What you're trying to do is called a "third party transaction" since the first two parties to the transaction are the donor and the recipient org (eg Wikipedia).
From my quick search of PayPal, I don't think it is supported. Even if it is supported, you'd need approval from each of the recipients to set it up. Eg see this Paypal 3rd party shopping cart article
Amazon Flexible Payments Service does support third party payments. Again, you'd need the co-operation of the recipients.
You could have the donors pay money to you which you would then turn around and donate to the non-profits. But to do so, either your donors would lose the tax deductions or you'd need to become a non-profit yourself. In addition, there would be two sets of transaction fees, yours and the recipients.

Can I get an order confirmation from PayPal Standard without relying on the customer to click "Return to site" from PayPal?

I need to do order processing upon confirmation of payment. Using PayPal Standard, is there a way I can get an order ID (that my site specifies) and a flag for whether the payment is received or not?
It appears that CMS's like Joomla have been able to do what I'm describing, but I haven't been able to find anything in PayPal Documentation that indicates how. Of course, I'm sure the answer is in there, and I will ontinue looking, but if someone could save me some time by pointing me in the correct direction, I would really appriciate it!
Just a little more information, I am developing this site in ASP.NET MVC with C#. I have also been researching PayPal IPN feature, but after talking to other developers in the office, they strongly recommend steering clear of IPN because of it's asynchronous nature.
Any thoughts?
Thanks for any help.
There are many ways to get information from PayPal. Essentially they break down into two categories, "push" and "pull".
"Push" is when PayPal pushes information to you. There are two ways that PayPal pushes information
Information sent in the URL when the customer returns to your site.
The IPN notifications.
"Pull" is when you request information from PayPal. PayPal provides a variety of APIs that you can use to get information about your transactions. So, for example, you could set up a job that runs every X minutes and asks PayPal for information about any orders that you know were sent to PayPal, but for which you didn't receive information on a return URL.
Here are a couple of links to get you started:
https://www.x.com/community/ppx/transaction_information
https://www.x.com/docs/DOC-1372

Resources