Help with "simple :-( " PHP paypal billing script

Discussion in 'PHP' started by swanwebtech, Sep 17, 2008.

  1. #1
    I have a website that sells competion tickets.
    A user may order up to 10 tickets at a time.
    I've written PHP to calculate the total spend and also store the customer details in a database.
    In order to complete the transaction I need to be able to allow the user to send my client a payment via paypal but i dont know where to start.
    I'm pretty sure this can be done using the POST method but i have no clue as to what parameters or hidden items i need to send to paypal or is it all controled via the url?

    Please help

    see www.winthishome.co.uk for further clarification
     
    If someone posts a solution, use the "Best Answer" link in their post to pick it as the best answer.
    swanwebtech, Sep 17, 2008 IP
  2. happpy

    happpy Well-Known Member

    Messages:
    926
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    120
    #2
    easiest is to use that "xclick" url paypal gives you on the site with button options...

    twist the parameters from PHP how you need them and send the user there via header("Location: ....");
     
    happpy, Sep 17, 2008 Set Best Answer IP
  3. ClickMedia

    ClickMedia Banned

    Messages:
    104
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can get more ready made classes for payment integration in phpclasses.org .
     
    ClickMedia, Sep 17, 2008 Set Best Answer IP
  4. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #4
    you need to fill in all parameters given by paypal..
    or what click media said, use the classes at phpclasses.org. that will fill in the required parameters
     
    bartolay13, Sep 17, 2008 Set Best Answer IP
  5. swanwebtech

    swanwebtech Guest

    Best Answers:
    0
    #5
    Thanks for all your input guys :)

    Eventually I obtained the following code from the paypal website, i can easily modify this to fit my requirments with php.


    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="sharog@hotmail.com">
    <input type="hidden" name="item_name" value="Competition Entry">
    <input type="hidden" name="amount" value="10.00">
    <input type="hidden" name="no_shipping" value="1">
    <input type="hidden" name="no_note" value="1">
    <input type="hidden" name="currency_code" value="GBP">
    <input type="hidden" name="lc" value="GB">
    <input type="hidden" name="bn" value="PP-BuyNowBF">
    <input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
    <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
    </form>