Author Topic: Paypal not changing status to confirmed  (Read 43556 times)

spyderwoman

  • Beginner
  • *
  • Posts: 46
    • SpyderWoman, LLC
Re: Paypal not changing status to confirmed
« Reply #75 on: May 20, 2010, 01:43:55 am »
Thank you. do you have any idea of where I can find the pp data logs? I have searched all over pp and through their help desk and have found nothing.

stinga

  • Contributing Developer
  • Full Member
  • *
  • Posts: 872
    • Squangle ltd
Re: Paypal not changing status to confirmed
« Reply #76 on: May 20, 2010, 12:01:58 pm »
history > ipn history
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

spyderwoman

  • Beginner
  • *
  • Posts: 46
    • SpyderWoman, LLC
Re: Paypal not changing status to confirmed
« Reply #77 on: May 20, 2010, 14:18:54 pm »
Here is what I grabbed from the IPN History (xxx out personal data)
Quote
mc_gross=106.75&invoice=56_4d487bac81aa9604ee12bf84d62a1&protection_eligibility=PartiallyEligible&address_status=unconfirmed&payer_id=AUE6WS7LP9EVA&tax=0.00&address_street=5448 xxxx peakway&payment_date=18:14:40 May 18, 2010 PDT&payment_status=Completed&charset=windows-1252&address_zip=xxx&first_name=xxxx&mc_fee=3.40&address_country_code=US&address_name=xxxx&notify_version=2.9&custom=&payer_status=verified&business=xxxx@yahoo.com&address_country=United States&address_city=apex&quantity=1&verify_sign=AiKZhEEPLJjSIccz.2M.tbyW5YFwAAH672D69td5a.19DzqPEo4RcR1f&payer_email=xx.xxx@xxxx.com&txn_id=1AW79863R9490501E&payment_type=instant&payer_business_name=xxxx, LLC&last_name=xxx&address_state=NC&receiver_email=xxx@yahoo.com&payment_fee=3.40&receiver_id=Y8CG4JS7NM2FL&txn_type=web_accept&item_name=Order Number: 5&mc_currency=USD&item_number=&residence_country=US&handling_amount=0.00&transaction_subject=Order Number: 5&payment_gross=106.75&shipping=0.00

stinga

  • Contributing Developer
  • Full Member
  • *
  • Posts: 872
    • Squangle ltd
Re: Paypal not changing status to confirmed
« Reply #78 on: May 20, 2010, 19:47:19 pm »
also need the rest of the data, HTTP response code etc
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

spyderwoman

  • Beginner
  • *
  • Posts: 46
    • SpyderWoman, LLC
Re: Paypal not changing status to confirmed
« Reply #79 on: May 20, 2010, 19:49:45 pm »
That is all that was there... Is that the problem?

beriskunk

  • Beginner
  • *
  • Posts: 2
Re: Paypal not changing status to confirmed
« Reply #80 on: August 25, 2010, 17:22:47 pm »
Hi there...

I'm havig a huge trouble with this... then i decided to rewrite notify.php to change the order status in the database at the moment of receiving the IPN Notify. Then, when i put this code on it:

Code: [Select]
<?php
$fromname"Your name here";
$from_email "your email here";
$recipient_email "recipients email here";
$subject "Paypal IPN Test";
$body null;
$header "From: ".$fromname" <".$from_email.">\r\n";
foreach($_POST as $var=>$val){
$body .= $var.":".$val."/n";
}
mail($recipient_email$subject$body$header);
?>

I receive the notification correctly. But, someone know how to put that POST data inside variables instead?

Thanks!

beriskunk

  • Beginner
  • *
  • Posts: 2
Re: Paypal not changing status to confirmed
« Reply #81 on: August 26, 2010, 01:08:16 am »
Yeaaah! Forgive my last post... I solved it ;D I finally rewrited notify.php for fill it to my purposes: I just need to change the order_status automatically to "completed" when the transaction is for a digital download (and when the buyer has paid, of course!)

Then, i want to share ;)

there are the steps that i followed before to do it (Note that it's only fot developing, sandbox must be disabled in production environment)

Quote
#create buyer & seller accounts in https://developer.paypal.com/
#Inside VMart configuration => Shop => Payment methods => paypal => Config
  • Set testmode = NO
  • put the sandbox seller account in the seller email field.
  • enable sandbox in extra info on paypal payment method.
#access to https://www.sandbox.paypal.com with the seller account.
#On profile => more options => Instant Payment Notify => Activate and modify the IPN URL to target my notify.php
#On profile => more options => payment preferences in the web site

And now... my new notify.php:

Code: [Select]
<?php

//SEND IPN TEST TO SELLER (test purposes)

$fromname"IPN Test";
$from_email "ipn@sandbox.paypal.com";
$recipient_email "shop@company.net";
$subject "Paypal IPN Test";
$body null;
$header "From: ".$fromname" <".$from_email.">\r\n";
foreach($_POST as $var=>$val){
$body .= $var.":".$val."<br />";
}

mail($recipient_email$subject$body$header);


// assign posted variables FROM PAYPAL to local variables
$item_name $_POST['item_name'];
$item_number $_POST['item_number'];
$payment_status $_POST['payment_status'];
$payment_amount $_POST['mc_gross'];
$payment_currency $_POST['mc_currency'];
$txn_id $_POST['tnx_id'];
$receiver_email $_POST['receiver_email'];
$payer_email $_POST['payer_email'];
$invoice $_POST['invoice'];

// WRITE DATA.TXT FILE (tracking purposes)
$fp fopen ('data.txt''w');
fwrite ($fp$payment_status);
fwrite ($fp":");
fwrite ($fp$invoice);
fclose ($fp);

// CHANGE ORDER STATUS IN DATABASE

if ($payment_status "Completed") {

// PREPARE VARIABLES FOR CONNECT TO THIS DATABASE
$myServer "localhost";
$myUser "xxxxxxx";
$myPass "*******";
$myDB "database";

//connection to the database
$dbhandle mysql_connect($myServer$myUser$myPass)
  or die("Couldn't connect to SQL Server on $myServer");

//select a database to work with
$selected mysql_select_db($myDB$dbhandle)
  or die("Couldn't open database $myDB");

//declare the SQL statement that will query the database

 
$sqlsprintf ("UPDATE jos_vm_orders SET order_status = 'C' WHERE order_number='%s';"mysql_real_escape_string($invoice)); 

$sql2=$sql;

$result=mysql_query($sql2);


if (!$result
{
die('Invalid query: ' mysql_error());
}

//execute the SQL query and return records

$result mysql_query($query);

if (!$result
{
    
$message  'Invalid query: ' mysql_error() . "\n";
    
$message .= 'Whole query: ' $query;
    die(
$message);


// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also , mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row mysql_fetch_assoc($result)) 
{
mysql_result(order_status);
mysql_free_result($result);
mysql_close($dbhandle);
}
}
}
?>


That's all! hope this may be usefull for someone... for my that was a nightmare due to my low level skill with PHP, then you can imagine how happy i am now :D

Note:
The e-mail with the download links are not sent  ??? but the buyer can access downloads throught the confirmation order email or the checkout results page. If someone knows how to do it, tell me please!

PD: I translated directly from Spanish, maybe not well done!  :P

Vitriol

  • Beginner
  • *
  • Posts: 11
Re: Paypal not changing status to confirmed
« Reply #82 on: October 02, 2010, 21:18:35 pm »
Hi there,

I'am still having the same problem - many tests (pratically all of them) and nothing. Paypal not changing status to confirmed.

Joomla 1.5.20
VM 1.1.5

Thanks in advance,

V.