• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 917
  • Last Modified:

PHP Toolkit for PayPal v0.51 ipn

Hi I am using a script available online called PHP Toolkit for PayPal v0.51

I have used it on a test site i am making, but I need to get something working that I have realsed I need.

It has a ipn folder that has a ipn_success.php file which says:

{see attached code}

What I need it to do is change the database table for that order to say "Yes" if the payment has gone through.

I assume its done there, as the comment says:
//log successful transaction to file or database

I need to know how to get this working, and how is the order sent back to the site, with a order id? or something else?

I really would like to get this working.

Thanks for any help you can provide.
I wish I could give you 1000 points to get this working as soon as possible

//include file - not accessible directly
if(isset($paypal['business']))
{
//log successful transaction to file or database

}
else
{
	die('This page is not directly accessible');
}
?>

Open in new window

0
cataleptic_state
Asked:
cataleptic_state
  • 2
  • 2
1 Solution
 
cataleptic_stateAuthor Commented:
The order response file example they give is attached

How can I get this to print out on a page or add update to database?


<?php

     if (!strcmp(getenv("REQUEST_METHOD"),"POST")){


        $path=""; #set your logfile directory path here

        $timestamp=date("d-m-y--H-i-s");

        $FILE=fopen("$path$timestamp-$oid.txt","a");

        fwrite($FILE,"OrderID - $oid\n");

        fwrite($FILE,"Transaction Status - $transactionstatus\n");

        fwrite($FILE,"Total - $total\n");

        fwrite($FILE,"ClientID - $clientid\n");

        fwrite($FILE,"Transaction Time Stamp - $datetime\n");

        fwrite($FILE,"ECI Status - $ecistatus\n");

        fwrite($FILE,"Card Prefix - $cardprefix \n");

        fclose($FILE);

    }
    
?>

Open in new window

0
 
Ray PaseurCommented:
I'd suggest that you should hire a PayPal developer to help with this.  It is not a single issue or a simple issue, and there are penalties for making mistakes with money - some of these involve handcuffs.  Better safe than sorry.

I can help with one critical part of the process.  When you are trying to debug any asynchronous script like the PayPal IPN, you have no browser output and that makes it difficult to visualize your data.  What I like to do is capture the output buffer and mail it to myself.  See the code example for how this is done.

best regards, ~Ray


<?php // RAY_ob_start_example.php
error_reporting(E_ALL);
ob_start();

// CREATE SOME DATA
echo "Hello World";

// CREATE AN ERROR NOTICE
$x = $y;

// GRAB THE BROWSER OUTPUT BUFFER
$buffer = ob_get_clean();
mail('You@Your.org', 'OUTPUT BUFFER', $buffer);

Open in new window

0
 
Ray PaseurCommented:
So what was the solution?
0
 
cataleptic_stateAuthor Commented:
I had to hire someone to make it work, its still not working 100%
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now