I'm finding conflicting information on the standard way to integrate PayPal for what I'm trying to do. This is a somewhat higher level question.
My task: After a non-authenticated user of my app (a 'guest') pays for a booking on PayPal, I need them auto redirected back, where I create a record of this, send appropriate emails, and begin my account creation flow.
I'm leaning towards setting it up as described in this SO answer
It uses the 'paypal-sdk-rest' gem and sends a hash of data to a paypal endpoint like:
values = {
:business => business,
:cmd => '_cart',
:upload => 1,
:return => return_url
}
values.merge!({
"amount_1" => amount,
"item_name_1" => name,
"item_number_1" => id,
"quantity_1" => '1'
})
"https://www.sandbox.paypal.com/cgi-bin/webscr?" + values.to_query
But this appears based on a Railscast implementation from way back in 2008! I have doubts this is still an ideal way of doing it.
Auto return:
1) In the implementation above, I cannot get auto return to work, despite setting it up on my business profile.
2) A static URL is required for the auto return setup on the profile page, but I want to pass dynamic data to the auto return for triggering subsequent actions. Will the return_url specified above override the static URL set on the profile page, is it supposed to (since I can't get it to work I can't test and see)?
3) I've read that auto return won't work if users pay with a CC on PayPal?? If that's true, auto return isn't something I should depend on so I need to find a better implementation.
So maybe I should be using:
1) Instant Payment Notifications (IPNs)
or
2) Payment Data Transfer (PDTs).
Should I be using these, if so, which one? Do they accomplish the same goals?
I really just want the simplest, quickest implementation. PayPal is not the main payment method on my app, and I'm questioning whether I should bother supporting it now, given how dead straightforward other solutions (like Stripe) have been for me by comparison plus a growing task list that needs attention.
Thanks in advance for any guidance offered.