Results 1 to 3 of 3

Thread: paypal api php return url help

  1. #1
    Join Date
    May 2012
    Posts
    217
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default paypal api php return url help

    Hi

    I have created a site that when users are logged in, they click a link which takes them to PayPal to pay and then returned to a form page to fill out a job advert, it all works perfect apart from one little issue I have

    after they submitted the job advert form and is added to the db, they close the page after logging out and then open that page again, they can add another job advert again without paying so was seeing if there is any coding that checks if they have not paid and it redirects them to a error page if they not paid and try accessing the job advert form page

    Hope that makes sense

    This is the script I am using that works apart from the return url issue where they can access the return url again without paying so need a way of checking if the user has paid or not

    http://www.sanwebe.com/2012/07/paypa...ckout-with-php

    Thank you in advance

    Ian

  2. #2
    Join Date
    May 2012
    Posts
    217
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Think I figured a way round it but unsure how to code it

    in BuyerTable I have added a paid and complete column so when the payment is made via PayPal the paid column gets updated to a 1 for Yes, I have set it to default of 0 for No and then when they submit the job advert the complete column gets updated to a 1, again I have set that to a default of 0

    it's the coding where I am getting stuck, I am completing the payment and takes me to the return url but the paid column is not being updated to a 1

    below is the coding I have from my process.php file that does the PayPal API that adds the transaction to the db

    Code:
    $insert_row = $mysqli->query("INSERT INTO BuyerTable 
                        (BuyerName,BuyerEmail,TransactionID,ItemName,ItemNumber,ItemAmount)
                        VALUES ('$buyerName','$buyerEmail','$TransactionID','$ItemName','$ItemNumber', '$ItemTotalPrice')");
    					
    					$update_row = $mysqli->query("UPDATE BuyerTable SET paid = 'Y' WHERE TransactionID = '$TransactionID'");

  3. #3
    Join Date
    May 2012
    Posts
    217
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Sorry made a slight adjustment in the UPDATE query to the following

    UPDATE BuyerTable SET paid = '1' WHERE TransactionID = '$TransactionID'

    but it is not updating the paid column

Similar Threads

  1. $50 Paypal to whoever can do this...
    By daviscross in forum JavaScript
    Replies: 2
    Last Post: 06-20-2008, 11:09 PM
  2. Paypal with JSP
    By Eidher in forum Java
    Replies: 3
    Last Post: 03-20-2008, 06:57 PM
  3. PayPal
    By heebie in forum PHP
    Replies: 0
    Last Post: 07-12-2007, 07:29 PM
  4. PayPal IPN??
    By centenial in forum PHP
    Replies: 3
    Last Post: 10-10-2006, 01:12 PM
  5. PayPal Help~!
    By politebadass in forum HTML
    Replies: 1
    Last Post: 01-08-2005, 05:23 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •