gpt4 book ai didi

paypal - 如何从 Adaptive Payment API 调用中获取送货地址?

转载 作者:太空宇宙 更新时间:2023-11-03 15:55:53 25 4
gpt4 key购买 nike

您应该如何使用 PayPal 的 Adaptive API 系统从并行支付取回运送信息?通常它只会作为 payer_country 等传回 - 当请求 IPN 脚本时。然而,情况似乎并非如此。

以下是调用 IPN 脚本时传入的参数:

transaction[0].amount 
transaction[0].id
verify_sign
transaction[1].receiver
reverse_all_parallel_payments_on_error
transaction[1].pending_reason
transaction[0].pending_reason
transaction[1].id_for_sender_txn
transaction[0].invoiceId
payment_request_date
test_ipn
cancel_url
charset
return_url
transaction[0].status_for_sender_txn
ipn_notification_url
transaction[1].is_primary_receiver
transaction[1].status
transaction_type
transaction[1].amount
transaction[0].status
log_default_shipping_address_in_transaction
transaction[0].receiver
status
transaction[0].id_for_sender_txn
action_type
fees_payer
pay_key
transaction[1].status_for_sender_txn
transaction[0].paymentType
transaction[1].invoiceId
transaction[1].id
sender_email
notify_version
transaction[1].paymentType
transaction[0].is_primary_receiver

如果我随后执行 PaymentDetails API 调用,我会得到如下信息:

$VAR1 = {
'currencyCode' => 'USD',
'responseEnvelope' => {
'correlationId' => '9944330ab9a8c',
'timestamp' => '2014-04-07T06:08:16.094-07:00',
'ack' => 'Success',
'build' => '10273932'
},
'status' => 'COMPLETED',
'senderEmail' => 'andy.aaaa@ultranerds.co.uk',
'cancelUrl' => 'http://somesite.net/paypal/cancel.html',
'paymentInfoList' => {
'paymentInfo' => [
{
'pendingRefund' => 'false',
'receiver' => {
'accountId' => 'NY3AD33DD739C',
'email' => 'andy-xxx@ultranerds.com',
'amount' => '65.00',
'invoiceId' => '1022',
'primary' => 'false',
'paymentType' => 'GOODS'
},
'transactionId' => '8E1114341X895213Y',
'senderTransactionStatus' => 'COMPLETED',
'senderTransactionId' => '5EV71352C33256006',
'transactionStatus' => 'COMPLETED',
'refundedAmount' => '0.00'
},
{
'pendingRefund' => 'false',
'receiver' => {
'accountId' => 'YYP5C69YWCMKE',
'email' => 'andy.yyy@gmail.com',
'amount' => '15.00',
'invoiceId' => '1023',
'primary' => 'false',
'paymentType' => 'GOODS'
},
'transactionId' => '68H86656UP574062X',
'senderTransactionStatus' => 'COMPLETED',
'senderTransactionId' => '2XW88939LK1112523',
'transactionStatus' => 'COMPLETED',
'refundedAmount' => '0.00'
}
]
},
'feesPayer' => 'EACHRECEIVER',
'actionType' => 'CREATE',
'ipnNotificationUrl' => 'http://somesite.net/paypal/test_ipn.cgi',
'sender' => {
'useCredentials' => 'false',
'accountId' => 'B74RBM5F6SLZG',
'email' => 'andy.aaa@ultranerds.co.uk'
},
'returnUrl' => 'http://somesite.net/paypal/success.html',
'payKey' => 'AP-4EK17906VB6613533',
'reverseAllParallelPaymentsOnError' => 'false'
};

如您所见,根本没有提及送货地址。您应该如何取回该信息?

更新: 嗯,好的,所以看起来 GetShippingAddresses 是我需要的 - 但由于某种原因,当我调用它时它返回时没有任何内容:

{"requestEnvelope":{"errorLanguage":"en_US","detailLevel":"ReturnAll"},"key":"AP-1B1377463N9785350"}/GetShippingAddresses_API_Operation/

...简单地返回:

{
'responseEnvelope' => {
'correlationId' => '3a4443aed09c9',
'timestamp' => '2014-04-07T06:40:35.460-07:00',
'ack' => 'Success',
'build' => '10273932'
}
}

我有点困惑为什么要这样做。有什么建议么?

我在这里找到了一段话:

http://go.developer.ebay.com/devzone/articles/using-paypals-adaptive-payments-and-google-app-engine-build-online-market-python-part-3

Unfortunately, although this follows the process recommended by PayPal's documentation, it doesn't work. There's currently a bug in PayPal's Adaptive Payments implementation. For a traditional payment, the shipping address is not collected; for embedded payments, the GetShippingAddresses call does not return the shipping address.

PayPal has acknowledged the bug and indicated that it expects to have this fixed in April 2011. If you need shipping addresses right now, the recommendation is to collect them on your site rather than relying on the PayPal API.

那是从 2011 年开始的……但现在仍然是这样吗??

抱歉打扰了 - 但有人有任何建议吗?

最佳答案

好的,我得到了答案 - 但不幸的是,这不是我所希望的:

Yes, unfortunately this feature is only available for embedded payment flow. https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/ht_ap-embeddedPayment-curl-etc/

If you're using embedded payment flow, then you can retrieve the address on their PayPal account by passing in senderOptions.requireShippingAddressSelection = true during SetPaymentOption API call. You can then retrieve it via GetShippingAddresses API call.

所以看起来我真的需要做的是要求用户在将他们发送到 paypal 之前提供他们的运输信息,然后存储它。不理想 - 但我想你只需要使用你得到的东西!

关于paypal - 如何从 Adaptive Payment API 调用中获取送货地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22913647/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com