gpt4 book ai didi

php - 如何从 IPN 访问事务数组值

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

我正在尝试解析来自 paypal 的 IPN 回调。付款类型是自适应的,因此有一系列交易(即使我只有 1 个)。

这是一个 IPN 示例,为了便于阅读,对一些字段进行了修剪:

 array (
'payment_request_date' => 'Fri Jan 30 22:28:54 PST 2015',
'verify_sign' => 'removed',
'transaction[0].id_for_sender_txn' => 'removed',
'transaction[0].receiver' => 'removed',
'cancel_url' => '#pruned',
'transaction[0].is_primary_receiver' => 'false',
'pay_key' => '#removed',
'action_type' => 'PAY',
'transaction[0].id' => 'id is here',
'transaction[0].status' => 'Completed',
'transaction[0].paymentType' => 'SERVICE',

)

我正在尝试访问“transaction[0].id”的值,但无法将其转储。我基本上尝试了所有我能想到的方法:

 $id = $_POST['transaction'][0]['id']; 
$id = $_POST['transaction[0].id'];

还尝试将数组请求为 var,然后使用它:

 $id = $array->transaction[0].id;  

最佳答案

关于php - 如何从 IPN 访问事务数组值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28307904/

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