【发布时间】:2017-03-19 01:03:57
【问题描述】:
我需要验证我的 IPN 消息,但它总是返回 INVALID
我的 IPN
cmd=_notify-validate&mc_gross=76.00&protection_eligibility=Ineligible&payer_id=5F68MJE8GYSFL&tax=0.00&payment_date=23%3A01%3A49%2BNov%2B04%2C%2B2016%2BPDT&payment_status=Completed&charset=UTF-8&first_name=Buyer%2BBrij&mc_fee=2.78¬ify_version=3.8&custom=&payer_status=verified&business=brij.mohan-softo-facilitator%40softobiz.com&quantity=1&payer_email=brij.mohan-softo-buyer%40softobiz.com&verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31A2CY4u8sMD28t8rYIS1l.8kZv8Om&txn_id=2M448997GH018883K&payment_type=instant&last_name=Softobiz&receiver_email=brij.mohan-softo-facilitator%40softobiz.com&payment_fee=&receiver_id=UUEGZHZ6WXVCG&txn_type=web_accept&item_name=Hire%2BGuard&mc_currency=GBP&item_number=&residence_country=GB&test_ipn=1&handling_amount=0.00&transaction_subject=&payment_gross=&shipping=0.00&merchant_return_link=click%2Bhere&auth=AtmNfVa7oX-lTpjA7qqntT12AX085EG9DbyOgtWjgrr1Qm7nc3hfy442zorp44VGQ59KWCXZbifuNdzDp.A3n.w&form_charset=UTF-8
然后我在这里查看了 IPN
1.) https://www.sandbox.paypal.com/webscr
2.) 我的帐户-> 历史记录-> IPN 历史记录-> 即时付款通知 (IPN) 详细信息
下面是IPN消息
mc_gross=76.00&protection_eligibility=Ineligible&payer_id=5F68MJE8GYSFL&tax=0.00&payment_date=23:01:49 Nov 04, 2016 PDT&payment_status=Completed&charset=UTF-8&first_name=Buyer Brij&mc_fee=2.78¬ify_version=3.8&custom=&payer_status=verified&business=brij.mohan-softo-facilitator@softobiz.com&quantity=1&verify_sign=A--8MSCLabuvN8L.-MHjxC9uypBtA5uyYRfhtvRLzxfTdTg29AzcboEl&payer_email=brij.mohan-softo-buyer@softobiz.com&txn_id=2M448997GH018883K&payment_type=instant&last_name=Softobiz&receiver_email=brij.mohan-softo-facilitator@softobiz.com&payment_fee=&receiver_id=UUEGZHZ6WXVCG&txn_type=web_accept&item_name=Hire Guard&mc_currency=GBP&item_number=&residence_country=GB&test_ipn=1&handling_amount=0.00&transaction_subject=&payment_gross=&shipping=0.00&ipn_track_id=3ab983572cde
我在谷歌上进行了研究,据我所知,除了这一点,一切似乎都很好
验证您对测试 IPN 消息的响应是否包含与测试消息完全相同的变量和值,并且它们与测试消息中的顺序相同。最后,验证原始变量前面是否有 cmd=_notify-validate 变量。
可能我无法理解我如何以相同的顺序和相同的值发送 ipn,因此教皇可以验证我的 IPN。当我将我的 ipn 与原始 ipn 进行比较时,您会注意到 ¬ify_version=3.8 和原始 ipn 消息 notify_version=3.8
我正在使用这个 paypal IPN 验证类
https://github.com/paypal/ipn-code-samples/tree/master/php
这是我的贝宝表格
<form name="myform" action="<?php echo $paypal_url;?>" method="post">
<input type="hidden" name="business" value="<?php echo $merchant_email;?>" />
<input type="hidden" name="notify_url" value="<?php echo $notify_url;?>" />
<input type="hidden" name="cancel_return" value="<?php echo $cancel_return;?>" />
<input type="hidden" name="return" value="<?php echo $success_return;?>" />
<input type="hidden" name="user_id" value="<?php echo get_current_user_id(); ?>">
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="lc" value="" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="page_style" value="paypal" />
<input type="hidden" name="charset" value="UTF-8" />
<input type="hidden" name="item_name" value="Hire Guard" />
<input type="hidden" name="cbt" value="Back to FormGet" />
<input type="hidden" value="_xclick" name="cmd"/>
<input type="text" name="amount" value="<?php echo esc_attr($_POST['amount']); ?>" />
<input type="submit" class="button button-primary button-border-white submit-btn " value="Pay now" />
【问题讨论】:
标签: wordpress paypal paypal-ipn