在付款交易後,是否可以在IPN呼叫中獲取買家的姓氏和名字?我已經嘗試了一切,從簡單的PAY鏈接調用到設置payType爲「CREATE」,然後使用payKey通過將「requireShippingAddressSelection」設置爲true從「setPaymentOptions」API中檢索地址。兩者都沒有工作。我收到的關於買家的唯一信息是他們的電子郵件地址爲「sender_email」,而且付款金額,不管我怎麼打電話。PayPal適應性 - 買方名稱?
我也嘗試了「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:'假'設置爲真會給我一個名字,但無論我嘗試什麼,我都不能從假改變它。任何人都有什麼想法以及是否可以使用貝寶自適應來獲得買家的名字?我必須錯過一些非常簡單的東西......謝謝!