PayPal适应性 - 买方名称?

时间:2013-06-22 17:14:08

标签: paypal paypal-sandbox paypal-ipn paypal-adaptive-payments

在PAY交易后,是否有可能在IPN通话中获得买方的名字和姓氏?我尝试了从简单的链式PAY调用,到将payType设置为“CREATE”,然后使用payKey通过将“requireShippingAddressSelection”设置为true从“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得到买家的名字?我一定很想念一些非常简单的东西......谢谢!

1 个答案:

答案 0 :(得分:1)

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

以下是我们的IPN指南的链接,它有一个关于Pay API调用中返回的信息的部分: https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/ipnguide.pdf