you could post the solution clearly step by step you would be my savior

Take a look at what I did to sort out this problem:aatelfer wrote:Hey you guys, I did some tests and realized that something is happening inside "http://servername.com/shop/payment/pp_standard/callback" that is causing a problem.
I created a paypal.php file in the shop root and changed the callback to that url. It seems to be working well.
Something is happening before the callback is called.
Code: Select all
http://phpsoft.mirrors.phpclasses.org/browse/file/9167.html
Code: Select all
<?php
// Load the paypal wrapper...found at phpclasses.org
require_once('system/library/paypal.class.php');
// Test server
$p = new Paypal('https://www.sandbox.paypal.com/cgi-bin/webscr');
//$p->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';
if ($p->validate_ipn()) {
$request = 'response=' . 'VERIFIED';
foreach ($p->ipn_data as $key => $value) {
$request .= '&' . $key . '=' . urlencode(stripslashes($value));
}
$ch = curl_init('http://'.$_SERVER['SERVER_NAME'].'/store/index.php?route=payment/pp_standard/callback');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
}
else{
$subject = 'Instant Payment Notification - Reception failed';
$to = 'xxxxx@xxx.com'; // your email
$body = "An instant payment was unsuccessful.\n";
$body .= "from ".$p->ipn_data['payer_email']." on ".date('m/d/Y');
$body .= " at ".date('g:i A')."\n\nDetails:\n";
foreach ($p->ipn_data as $key => $value) { $body .= "\n$key: $value"; }
mail($to, $subject, $body);
}
?>
Code: Select all
http://www.mystore.com/store/paypal.php
zeeb100 wrote:aatelfer
These were my operaizone
download the file from the following link paypal.class.phpCode: Select all
http://phpsoft.mirrors.phpclasses.org/browse/file/9167.html
I create the file in http://www.mystore / store / paypal.php
Code: Select all
<?php // Load the paypal wrapper...found at phpclasses.org require_once('system/library/paypal.class.php'); // Test server $p = new Paypal('https://www.sandbox.paypal.com/cgi-bin/webscr'); //$p->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; if ($p->validate_ipn()) { $request = 'response=' . 'VERIFIED'; foreach ($p->ipn_data as $key => $value) { $request .= '&' . $key . '=' . urlencode(stripslashes($value)); } $ch = curl_init('http://'.$_SERVER['SERVER_NAME'].'/store/index.php?route=payment/pp_standard/callback'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); } else{ $subject = 'Instant Payment Notification - Reception failed'; $to = 'xxxxx@xxx.com'; // your email $body = "An instant payment was unsuccessful.\n"; $body .= "from ".$p->ipn_data['payer_email']." on ".date('m/d/Y'); $body .= " at ".date('g:i A')."\n\nDetails:\n"; foreach ($p->ipn_data as $key => $value) { $body .= "\n$key: $value"; } mail($to, $subject, $body); } ?>
copied the files paypal.class.php in the folder " system/library/ "
I log into my account paypal and change the address in IPNCode: Select all
http://www.mystore.com/store/paypal.php
make on a transaction test and the result is the same in the database status_order is set to "0"
have done something wrong?
Code: Select all
if ($order_info) {
if (strcmp($this->request->post['response'], 'VERIFIED') == 0) {
$this->model_checkout_order->confirm($order_id,
$this->config->get('pp_standard_order_status_id'));
return true;
}else{
}
}
Users browsing this forum: No registered users and 13 guests