gpt4 book ai didi

php - 如何使用PHP获取返回页面上的paypal买家地址

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

我没有得到街道地址、州和城市。我使用以下代码获取信息:

<?php
if($_GET['tx']) $tx= $_GET['tx'];
$identity = '1Y7reMOTMxCY66RFk.......................';
$ch = curl_init();
curl_setopt_array($ch, array ( CURLOPT_URL =>
'https://www.sandbox.paypal.com/cgi-bin/webscr', CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => http_build_query(array ('cmd' => '_notify-synch','tx' => $tx,
'at' => $identity,)), CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => FALSE,
CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false,));
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if( substr($response, 0, 7) == 'SUCCESS')
{
$response = substr_replace($response, '', 0, 7);
$response = str_replace(array("\n", "\r", "\r\n"), '&', $response);
parse_str($response, $response_array);
}
echo "<pre>"; print_r($response_array); ?>

输出:

Array
(
[transaction_subject] =>
[txn_type] => web_accept
[payment_date] => 21:41:19 Aug 20, 2014 PDT
[last_name] => Maurya
[residence_country] => US
[pending_reason] => address
[item_name] => THE BOOM
[payment_gross] => 1495.00
[mc_currency] => USD
[business] => arunk-facilitator@hotmail.com
[payment_type] => instant
[protection_eligibility] => Ineligible
[payer_status] => verified
[fraud_management_pending_filters_1] => Maximum Transaction Amount
[tax] => 0.00
[payer_email] => pm.sz@gmail.com
[txn_id] => 3PU02356JM49....
[quantity] => 1
[receiver_email] => arunk-facilitator@hotmail.com
[first_name] => Prikshit
[payer_id] => HFKPSNRD...
[receiver_id] => N4DKWT577...
[item_number] => 102
[handling_amount] => 0.00
[payment_status] => Pending
[shipping] => 0.00
[mc_gross] => 1495.00
[custom] =>
[charset] => windows-1252
)

最佳答案

由于它是按钮支付,您需要确保变量的值
您的按钮代码中的 no_shipping 未设置为 1。如果 no_shipping=1 传递给你
不会在 PDT 和 IPN 中取回送货地址。

你可以在下面的 url 上得到这个变量的描述:

https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables#no_shipping

关于php - 如何使用PHP获取返回页面上的paypal买家地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25418737/

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