我有一个网上商店我遇到的问题是,payfast确实调用了我的notify_url,但似乎没有发布数据或者我应该说我没有得到任何数据。这是我使用的代码。
购买:
<button id="cCart" type="submit" class="btn btn-danger my-cart-btn my-cart-b" onClick="Javascript:window.location.href = 'https://sandbox.payfast.co.za/eng/process?merchant_id=10007327&merchant_key=rnbmwzzwudp39&item_name=Cell+C+R5+Airtime&item_description=Cell+C+R5+Airtime&payment_method=cc&amount=5.00&email_address=<?php echo $_SESSION['qwertp'];?>&custom_str1=pinless&custom_str2=xx&custom_str3=<?php function Licenseuu() {$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789"; $pass = array();$alphaLength = strlen($alphabet) - 1;for ($i = 0; $i < 12; $i++) {$n = rand(0, $alphaLength);$pass[] = $alphabet[$n];}return implode($pass);echo $pass;}?>&custom_str4=p-cellc&custom_int1=5&custom_int2=1&custom_str5=<?php echo $_SESSION['xxfs'];?>&notify_url=http://www.luqratemobile.co.za/pass.php?&cancel_url=http://www.luqratemobile.co.za/cancelled.html&return_url=http://www.luqratemobile.co.za/thankyou.html';">Buy Airtime</button>
我收到的代码是:
$custuser = $_GET["custom_str1"];
header( 'HTTP/1.0 200 OK' );
flush();
// Posted variables from ITN
$pfData = $_POST;
$myfile = fopen("payfastPost.txt", "w") or die("Unable to open file!");
$txt = $custuser;
fwrite($myfile, $txt);
fclose($myfile);
//update db
switch( $pfData['payment_status'] )
{
case 'COMPLETE':
// If complete, update your application, email the buyer and process the transaction as paid
$myfile = fopen("payfastComplete.txt", "w") or die("Unable to open file!");
$txt = $pfData;
fwrite($myfile, $txt);
fclose($myfile);
break;
case 'FAILED':
// There was an error, update your application
$myfile = fopen("payfastFailed.txt", "w") or die("Unable to open file!");
$txt = $pfData;
fwrite($myfile, $txt);
fclose($myfile);
break;
default:
// If unknown status, do nothing (safest course of action)
break;
}
答案 0 :(得分:0)
Full match 798-866 `case 'courseDifferences' : $page='admin/p-events/diff.php`
Group 1. 804-821 `courseDifferences`
Group 2. 843-866 `admin/p-events/diff.php`
Match 7
Full match 2036-2110 `case 'course_program' : $page='admin/p-program/courseProgram.php`
Group 1. 2042-2056 `course_program`
Group 2. 2077-2110 `admin/p-program/courseProgram.php`
解决了我的问题。