PayPal Adaptive - 买家姓名?

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

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

我也尝试过“getShippingAddresses”API,但也没有成功。我在文档中找不到任何具体内容。这是一个示例 IPN 响应,我已经删除了无用的部分,例如重定向 URL: 交易:'0':.is_primary_receiver:'true' .id_for_sender_txn:TXN_CODE .receiver:RECEIVER_EMAIL .amount:10.00 美元 .status:已完成 .id:TRANS_ID .status_for_sender_txn:已完成 .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_ad dress_in_transaction: 'false' action_type: 创建字符集:windows-1252 transaction_type:自适应支付 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 获取买家的姓名?我一定是遗漏了一些非常简单的东西……谢谢!

最佳答案

像这样的事务为发件人返回的唯一信息是 sender_email 值。

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

关于PayPal Adaptive - 买家姓名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17253288/

相关文章:

curl - Paypal 沙箱异常 "Unable to communicate with the PayPal gateway"Magento

c# - 如何使用 PayPal for web application 只是为了付款,而不是像购买订单一样

php - 如何在 PayPal 订阅按钮上设置开始日期

php - 检测 Paypal 订阅取消

paypal - 在 IPN 争议通知中识别用户或其订单

Paypal自适应支付和IPN

python - 用于支付另一个 paypal 帐户的 Paypal REST Api

php - 支付成功后获取交易明细

php - 使用 PayPal API 和 PHP 设置简单的 Retreat 注册