2
我在2checkout中創建了一個測試演示帳戶。並且我測試了一些代碼以在2checkout中進行演示付款。 在帳戶中,我設置了'演示設置''開'如何在2checkout集成中確認支付是否成功
一切正常,我得到哈希匹配返回頁面上。
以下是我的代碼。
的index.php
<form action='https://www.2checkout.com/checkout/spurchase' method='post'>
<input type='hidden' name='sid' value='123456' >
<input type='hidden' name='mode' value='2CO' >
<input type='hidden' name='li_0_type' value='product' >
<input type='hidden' name='li_0_name' value='Test' >
<input type='hidden' name='li_0_price' value='2.00' >
<input type='hidden' name='li_0_quantity' value='4' >
<input type='hidden' name='li_0_tangible' value='N' >
<input type='hidden' name='currency_code' value='INR' >
<input name='submit' type='submit' value='Checkout' >
</form>
return.php
if ($_REQUEST['demo'] == 'Y')
{
$order_number = 1;
}
else
{
$order_number = $_REQUEST['order_number'];
}
$hashSecretWord = '2checkout';
$compare_string = $hashSecretWord . $_REQUEST['sid'] . $order_number . $_REQUEST['total'];
$compare_hash1 = strtoupper(md5($compare_string));
$compare_hash2 = $_REQUEST['key'];
if ($compare_hash1 != $compare_hash2)
{
echo "Hash Mismatch";
}
else
{
echo "Hash Matched";
}
如何確認是否支付成功了還是不?
我看不到我帳戶中的演示訂單 但我收到有關每個訂單的郵件。同時iam在return.php頁面中顯示「HAsh匹配」。
我還創建了一個API用戶名&密碼。
如何使用API詳細信息完成這些付款流程?
這是否意味着我們無法在2Checkout中測試成功的演示順序?即使我收到我的演示訂單詳細信息的電子郵件,我總是會收到「失敗」答覆。我是否可以不測試響應'PASS'的流程? – random