1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[How to] Paypal - Send Transaction id securly to my website page

Discussion in 'Other Languages' started by Rahul91, Oct 30, 2014.

  1. Rahul91

    Rahul91 Newbie

    Joined:
    Nov 9, 2013
    Messages:
    33
    Likes Received:
    4
    Location:
    India
    I am Programming a php script which can store user information after completing payments.
    here is structure:-
    verify.php

    • Get transaction_id, item_id,item_name,buyer_id and buyer_name from paypal and item information from my site databse
    • If Item found in my database then attached paypal information with item and user, else display failed or error message
    • redirect to other page, like completed/failed.. you can track this item from usercp / unable to processing req. please fill this form and our staff will be review shortly
    success.php
    • use for only displaying success or failed messages

    My Main file is verify.php, all action will be process in this file...
    i can handle all work except paypal information, e.g: tran_id, name and etc.
    I also checked in paypal developer, but i am unable to understand these variables..
    any examples will be ok for understanding

    Thanks
     
  2. Repulsor

    Repulsor Power Member

    Joined:
    Jun 11, 2013
    Messages:
    712
    Likes Received:
    267
    Location:
    PHP Scripting ;)
    Ok, I am not going into details but wil give you a quick guide.

    Go to Paypal settings and configure the IPN url. It is where paypal posts to after a tracsaction.

    For you, it will be verify.php.

    Now for a trial run echo all POST variables to a file to see what datas paypal is sending you.

    Write all data to a text file.

    Now you see all the datas that are being posted. Now you can make you script to dovthe database writes and stuff.

    I am writing this from my mobile, its really a hazzle to type from this.
     
  3. Repulsor

    Repulsor Power Member

    Joined:
    Jun 11, 2013
    Messages:
    712
    Likes Received:
    267
    Location:
    PHP Scripting ;)
    IPN - Instant payment notification just for your information.
     
  4. Rahul91

    Rahul91 Newbie

    Joined:
    Nov 9, 2013
    Messages:
    33
    Likes Received:
    4
    Location:
    India
    Problem is that, paypal only send this information if a payment completed unless it will not send anything.
    how do i test in this case? i can't buy my products myself...
     
  5. Repulsor

    Repulsor Power Member

    Joined:
    Jun 11, 2013
    Messages:
    712
    Likes Received:
    267
    Location:
    PHP Scripting ;)
    Search "Test Paypal accounts" in google.
     
  6. Rahul91

    Rahul91 Newbie

    Joined:
    Nov 9, 2013
    Messages:
    33
    Likes Received:
    4
    Location:
    India
    thank you very much.. its help me lot :)