gpt4 book ai didi

php - 为什么我从 PayPal 的 IPN 获得 2 次不同数据的匹配?

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

在我的站点上进行简单的 Web 交易后,我的 IPN 处理程序不仅收到了预期的“完成”点击,还收到了 2 次点击。每个都有不同的数据。第一个看起来像这样:

stdClass Object
(
[transaction] => Array
(
[0] => stdClass Object
(
[invoiceId] => PVIFmMOZTm2xkjbs
[id_for_sender_txn] => 3M760109N8943254L
[receiver] => me@gmail.com
[is_primary_receiver] => false
[id] => 08B29244UF9480324
[status] => Completed
[paymentType] => GOODS
[status_for_sender_txn] => Completed
[pending_reason] => NONE
[amount] => GBP 50.00
)

)

[payment_request_date] => Wed Sep 18 12:55:36 PDT 2013
[return_url] => http://mysite.com/checkout/paypal-overlay-state/complete
[fees_payer] => EACHRECEIVER
[ipn_notification_url] => http://mysite.com/ipn
[sender_email] => buyer@gmail.co.uk
[verify_sign] => AFcWxV21C7fd0v3bYYYRCpSSRl31ASUp2KT0F-R3d2QqGIzfWpkS.gWz
[test_ipn] => 1
[cancel_url] => http://mysite.com/checkout/paypal-overlay-state/cancel
[pay_key] => AP-4V279017Y7501703X
[action_type] => PAY
[memo] => SOMETHING
[transaction_type] => Adaptive Payment PAY
[tracking_id] => PVIFmMOZTm2xkjbs
[status] => COMPLETED
[log_default_shipping_address_in_transaction] => false
[charset] => windows-1252
[notify_version] => UNVERSIONED
[reverse_all_parallel_payments_on_error] => false
)

第二个看起来像这样:

stdClass Object
(
[mc_gross] => 50.00
[invoice] => PVIFmMOZTm2xkjbs
[protection_eligibility] => Ineligible
[payer_id] => NRQL7RKB54XWY
[tax] => 0.00
[payment_date] => 12:57:41 Sep 18, 2013 PDT
[payment_status] => Completed
[charset] => windows-1252
[first_name] => Ashley
[mc_fee] => 1.90
[notify_version] => 3.7
[custom] =>
[payer_status] => unverified
[business] => me@gmail.com
[quantity] => 0
[verify_sign] => AFcWxV21C7fd0v3bYYYRCpSSRl31AJGmBkDrCSx-mp-dKf5.Wc6co3ra
[payer_email] => payer@gmail.co.uk
[memo] => SOMETHING
[txn_id] => 08B29244UF9480324
[payment_type] => instant
[last_name] => Ward
[receiver_email] => me@gmail.com
[payment_fee] =>
[receiver_id] => XSSCKHZJZRBDQ
[txn_type] => web_accept
[item_name] =>
[mc_currency] => GBP
[item_number] =>
[residence_country] => GB
[test_ipn] => 1
[receipt_id] => 2722-5250-1650-6726
[transaction_subject] =>
[payment_gross] =>
[ipn_track_id] => a503d9ea64b1e
)

我如何理解这些数据?为什么有2次点击?我需要注意哪一个?

显示的数组是每个请求的 PHP $_POST 数组的直接打印。从时间戳可以看出,第一个 IPN 比第二个略早到达。

编辑:

我了解到第一个数组(第一个 IPN 命中)是您在使用 Adaptive Payments API 时获得的额外收据。

对于大多数用例,我相信这可以忽略,因为第二个 IPN 命中包含您需要的所有有用数据。

尽管需要注意的是,第二个更有用的 IPN 阵列比第一个阵列晚 2 分钟出现。第一个 IPN 命中在付款处理后立即到达,而第二个 IPN 直到 2 分钟后才到达...不知道为什么会这样...

谢谢!

最佳答案

我认为问题在于您对命中的初始定义。或者您可能错误地定义了一个变量,这就是您获得 2 次点击的原因

关于php - 为什么我从 PayPal 的 IPN 获得 2 次不同数据的匹配?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18881907/

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