我使用这个宝石将Paypal集成到Ruby Paypal Ruby SDK中,所以一切都很完美,现在我可以将用户重定向到我的PayPal Sandbox帐户,用户可以确认付款.
用户确认付款后,会通过网址中的PaymentId,Token和PayerId重定向回我的网站.
问题是当我想用这段代码执行付款时
payment = Payment.find(@payment.id)
if payment.execute( :payer_id => params[:PayerId] )
# Success Message
# Note that you'll need to `Payment.find` the payment again to access user info like shipping address
else
payment.error # Error Hash
end
Run Code Online (Sandbox Code Playgroud)
什么都没发生.