이 내가 특정 스크립트에 대해 묻고 싶다 헤이, 여기있다 : 나는 모든 것을 이해페이팔 ipn 개발자 스크립트 오래?
, 그것은 구조화 아주 좋은 정말 좋아 내가, 내가뿐만 아니라 매우 안전 보인다, 하지만이 다른 부분에 대해 하나의 질문이 있습니다.
} else {
// PayPal payment is valid
// Process order here
}
여기서해야 할 일은 무엇입니까? 데이터베이스에 값을 삽입 하시겠습니까 ?? 하지만이 전에했다?! :
} else {
// Transaction not processed, store it in the database
$payer_email = mysql_real_escape_string($_POST[‘payer_email’]);
$gross = mysql_real_escape_string($_POST[‘mc_gross’]);
인사말!
편집 : 좋아요, 이것으로 재연 공격을 막을 수 있습니까? :
if($f[‘count’] > 0) {
$errors[] = “Transaction already processed”;
} else {
if (count($errors) > 0) {
// IPN data is incorrect - possible fraud
// It is a good practice to send the transaction details to your e-mail and investigate manually
$message = "IPN failed fraud checks";
mail(‘[email protected]’, 'IPN Fraud Warning', $message, $headers);
} else {
// Transaction not processed, store it in the database
$payer_email = mysql_real_escape_string($_POST[‘payer_email’]);
$gross = mysql_real_escape_string($_POST[‘mc_gross’]);
$insert = mysql_query(“INSERT INTO transactions (txt_id, payer_email, mc_gross) VALUES
(‘$txt_id’,’$payer_email’,’$mc_gross’)”);
}
}
이 점에 대해 어떻게 생각하십니까?
이 코드 질문이나 비즈니스 프로세스 질문입니까? –
저는 비즈니스 파트 타임까지 db – user2602535
에 값을 삽입하지 않을 때,이 else-part에서 무엇을해야할지 묻고 싶었습니다. –