2

是否可以在 PAY 交易后在 IPN 呼叫中获取买家的名字和姓氏?我已经尝试了从简单的链式 PAY 调用到将 payType 设置为“CREATE”,然后通过将“requireShippingAddressSelection”设置为 true 来使用 payKey 从“setPaymentOptions”API 中检索地址的所有方法。两者都没有奏效。我收到的关于买家的唯一信息是他们作为“sender_email”的电子邮件地址和支付的金额,无论我如何拨打电话。

我也尝试过“getShippingAddresses”API,但也没有运气。我在文档中找不到任何具体内容。这是一个示例 IPN 响应,我删除了重定向 URL 之类的无用位: transaction: '0': .is_primary_receiver: 'true' .id_for_sender_txn: TXN_CODE .receiver: RECEIVER_EMAIL .amount: USD 10.00 .status: Completed .id: TRANS_ID .status_for_sender_txn: Completed .paymentType: SERVICE .pending_reason: NONE '1': .paymentType: SERVICE .id_for_sender_txn: TXN_CODE .is_primary_receiver: 'false' .status_for_sender_txn: Completed .receiver: RECEIVER_EMAIL .amount: USD 10.00 .pending_reason: NONE .id: TRANS_ID .status: Completed log_default_shipping_address_in_transaction: 'false' action_type: CREATE charset: windows-1252 transaction_type: Adaptive Payment PAY notify_version: UNVERSIONED sender_email: SENDER_EMAIL fees_payer: EACHRECEIVER reverse_all_parallel_payments_on_error: 'false' pay_key: 'PAY_KEY' status: COMPLETED test_ipn: '1'

并拨打电话:

pay_request = PaypalAdaptive::Request.new

data = {
"returnUrl" => "", 
"requestEnvelope" => {"errorLanguage" => "en_US"},
"currencyCode"=>"USD",  
"receiverList"=>{"receiver"=>[{"email"=>"", "amount"=>"10.00"},{"email"=>"", "amount"=>"10.00"}]},
"cancelUrl"=>"",
"actionType"=>"PAY",
"ipnNotificationUrl"=>""
}

pay_response = pay_request.pay(data)

//OTHER ATTEMPT: was to grab payKey here and try setting payment options with another request call, but that didn't work either

if pay_response.success?
  redirect_to pay_response.preapproval_paypal_payment_url
else
  puts pay_response.errors.first['message']
  redirect_to failed_payment_url
end

我想也许将这一行 -> log_default_shipping_address_in_transaction: 'false' 设置为 true 会给我一个名字,但无论我尝试什么,我都无法将它从 false 更改。任何人都知道发生了什么,甚至是否有可能使用 PayPal Adaptive 获得买家的姓名?我一定错过了一些非常简单的东西......谢谢!

4

1 回答 1

1

从这样的交易中返回给发件人的唯一信息是sender_email价值。

这是我们的 IPN 指南的链接,其中有一节介绍了在 Pay API 调用中返回的信息: https ://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/ipnguide.pdf

于 2013-06-24T20:13:40.293 回答