【发布时间】:2014-05-27 03:35:01
【问题描述】:
我在implementation guide 的第 4 步,到目前为止一切都很顺利。然而,我现在的问题是在他们成功通过 Paypal 进行身份验证后检索用户详细信息。
使用paypal-sdk-merchant gem,这是当用户在验证后从 Paypal 返回时触发的方法:
def confirm
@api = PayPal::SDK::Merchant::API.new
@get_express_checkout_details = @api.build_get_express_checkout_details({:Token => params[:token]})
@get_express_checkout_details_response = @api.get_express_checkout_details(@get_express_checkout_details)
end
指南(链接到上面)指出:
A response will be returned containing the user's shipping address, the transaction status, and more:
TOKEN=EC-1234567890&ACK=Success&CHECKOUTSTATUS=PaymentActionNotInitiated&EMAIL=user@example.com&...
但我不知道如何访问返回的信息,在我看来我已经尝试过:
<%= @get_express_checkout_details_response.email %>
<%= @get_express_checkout_details_response.Email %>
and
<%= @get_express_checkout_details_response.EMAIL %>
但似乎没有任何效果。有什么想法吗?
【问题讨论】:
-
尝试 binding.pry 并查看响应并在此处发布,可能不是对象,可能是哈希或 JSON...
标签: ruby-on-rails ruby paypal paypal-sandbox express-checkout