【问题标题】:PayPal Adaptive - Buyer Name?PayPal 自适应 - 买家姓名?
【发布时间】:2013-06-19 15:36:17
【问题描述】:

是否可以在 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 获得买家的姓名?我一定错过了一些非常简单的东西......谢谢!

【问题讨论】:

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


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2020-12-14
      • 2017-08-09
      • 1970-01-01
      • 2011-12-27
      • 1970-01-01
      • 2015-10-22
      • 2012-11-14
      • 2019-04-26
      • 1970-01-01
      相关资源
      最近更新 更多