Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/checkpayment.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of azizny  >  Paypal Class  >  examples/checkpayment.php  >  Download  
File: examples/checkpayment.php
Role: Example script
Content type: text/plain
Description: Check Paypal Payments IPN
Class: Paypal Class
Create buttons and process Paypal payments
Author: By
Last change:
Date: 2008-10-29 07:04
Size: 1,438 bytes
 

Contents

Class file image Download
<?php
/**************************************************/
/*
Released by AwesomePHP.com, under the GPL License, a
copy of it should be attached to the zip file, or
you can view it on http://AwesomePHP.com/gpl.txt
*/
/**************************************************/

/*
This file will teach you show to use our class
to process payments from Paypal
*/

/* Get Paypal Class */
require_once('../paypal.class.php');

$doCheck = new Paypal;

/* Record bad/unauthorized transactions */
$doCheck->setLogFile('logfile.txt');

/*
Do actual checking 
isPaid will be true if payment is good, otherwise
it will be false
*/
$isPaid $doCheck->checkPayment($_POST);

if(
$isPaid == true){
    
/* Now do your own game, process the payment, store it in file or database */
    /* To see sample implementation see our Membership V2.0 script found on our website */

    /*
    Here are some values returned. Entire paramters can be seen on
    PaypalVariables.html located in main folder 
    */

    /*
    check the $payment_status is Completed
    check that $txn_id has not been previously processed
    check that $receiver_email is your Primary PayPal email
    check that $payment_amount/$payment_currency are correct
    process payment
    */
    
    /*
    You can check the $payment_status and do your processing.
    A list of what $payment_status might contain is avaiable
    on PaymentStatus.html located in main folder
    */
    
    
}

?>