如何从响应中访问Express Checkout详细信息?

时间:2022-10-14 14:27:58

I am on step 4 of the implementation guide, and so far everything has been pretty cake. My problem now, however, is retrieving user details after they have successfully authenticated with Paypal.

我在实施指南的第4步,到目前为止一切都很美好。但是,我现在的问题是在用Paypal成功验证后检索用户详细信息。

Using the paypal-sdk-merchant gem, this is the method fired when a user returns from Paypal after authenticating:

使用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

The guide (linked to above) states:

指南(链接到上面)指出:

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&...

But I can't figure out how to access the returned information, in my view I have tried:

但我无法弄清楚如何访问返回的信息,在我看来我尝试过:

<%= @get_express_checkout_details_response.email %>
<%= @get_express_checkout_details_response.Email %>
and
<%= @get_express_checkout_details_response.EMAIL %>

but nothing seems to be working. Any ideas?

但似乎没有任何工作。有任何想法吗?

1 个解决方案

#1


0  

PayPal's gem used SOAP API and return result in corresponding structure - check documentation. For example user email - response.PayerInfo.Payer, shipping address - response.PayerInfo.Address

PayPal的gem使用SOAP API并将结果返回到相应的结构中 - 检查文档。例如用户电子邮件 - response.PayerInfo.Payer,送货地址 - response.PayerInfo.Address

#1


0  

PayPal's gem used SOAP API and return result in corresponding structure - check documentation. For example user email - response.PayerInfo.Payer, shipping address - response.PayerInfo.Address

PayPal的gem使用SOAP API并将结果返回到相应的结构中 - 检查文档。例如用户电子邮件 - response.PayerInfo.Payer,送货地址 - response.PayerInfo.Address