nov / paypal-express

Ruby Gem for PayPal Express Checkout API
MIT License
374 stars 163 forks source link

Getting 'payment_request' var to receive info about payment #89

Closed GoodJob closed 8 years ago

GoodJob commented 8 years ago

First of all, I want to thank you for a wonderful library. It is just what I was looking for. Pure way to execute simple paypal payment :)

I'm facing the problem how to get 'payment_request' var in "successful_payment" action,

def successful_payment
        response = request.checkout!(
              params[:token],
              params[:PayerID],
              payment_request
            )
        end
        response.payment_info
        #error: payment_request is not defined
end

How can I move payment_request, which is in my Instant payment request action(if I understand this correctly) to this one? Thank you so much. Any thoughts would be great!

GoodJob commented 8 years ago

Oh I have missed the point! I need to use not this block of code, but this one response = request.details(token)

It works perfect now! Please close this ticket and sorry for disturbing :)