Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    PHP, PayPal, and Custom Ordering Information

    I'm the web designer for a small company that is providing classes in Continuing Education for social workers, nurses, and other organizations. I would like to be able to offer a means of allowing potential attendees to these classes to register for them online, through a PHP form script and accepting payments via PayPal.

    However, being a small company who presently lacks the resources to create and maintain a suitably secure online database solution, I'm keeping all attendee records in an offline DB, and the online registration solution would need to send email(s) to us whenever a new user registers for a class and completes a payment through PayPal.

    Now, normally I would use the PayPal IPN to integrate the PHP form with the PayPal payment transaction, but attendees will need to submit additional information above and beyond what PayPal needs to complete the transaction (such as your licensing board's license number and expiration date), and this additional information would be lost once the user jumps to the PayPal site and back to complete the payment. I won't be able to store this temporary information in a database, and there are far too many problems with cookies to use them to store this information in.

    Presently I cannot think of any means of handling the registration process besides splitting the user registration for the class and the completion of the necessary payments into fully separate operations, which is unacceptable.

    Is there any other way I can integrate a PHP form containing this additional ordering information with PayPal? If not, would I be able to do so using a different scripting language and/or payment service?

  • #2
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    I think this would be better done as a simple e-commerce site. You could add those fields to the fields required by the checkout, and could have each class registration as a product (with full details of the class in the description) and the price. As far as I'm aware you can't send all that info to paypal directly. There might be a custom value for the NVP but I'm not sure if it sends that value back to your script or not
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #3
    Regular Coder
    Join Date
    Nov 2009
    Location
    Hamilton, New Zealand
    Posts
    126
    Thanks
    0
    Thanked 17 Times in 17 Posts
    I've done quite a lot of work with PHP integration with paypal, but I always had the option of using a database to store information. Are you sure that you can't use paypal's pass-through variables to pass the extra details you need to your IPN script?

    I know for a fact that you can send at least one custom pass-through variable, but unsure if you can send more than one. If you can't send more than one, you could serialize (or implode) the variables, and explode them in the IPN script. Custom variables are not shown to the buyer (I'm pretty sure), but they must be a max. of 255 characters.

    Regards,
    Rebbu
    Affordable Web Design (New Zealand Based)
    Internet Marketing Guru
    PHP/mySQL Expert
    -------------------------------------------

  • Users who have thanked Rebbu for this post:

    Tilus (01-08-2010)

  • #4
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    could base64 encode them also I guess
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #5
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    There's quite a bit of information stored in several variables that I might need to pass through, depending on the organization the attendee belongs to (and they might not all fit in that single custom variable), but after thinking it over, I'll probably be able to figure out some sort of workaround.

    Thanks for the assistance, it was a big help.

  • #6
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    What about sending an email with most of the data before you send the user to the paypal page, and then just pass the transaction ID to the paypal page, and send a second email after the paypal is completed, with the rest of the info? I know its not ideal, but it might work for you in this situation.


    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #7
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    Quote Originally Posted by whizard View Post
    What about sending an email with most of the data before you send the user to the paypal page, and then just pass the transaction ID to the paypal page, and send a second email after the paypal is completed, with the rest of the info? I know its not ideal, but it might work for you in this situation.
    Thats a good idea in theory Dan. The only problem will lie in thhe fact that when you move to paypal, you actually directly post to paypal instead of to your script, so you would need to either catch the send via javascript, send the data to a script in paypal with the info and email address, then post the form as originally intended.
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #8
    Regular Coder
    Join Date
    Nov 2009
    Location
    Hamilton, New Zealand
    Posts
    126
    Thanks
    0
    Thanked 17 Times in 17 Posts
    It is possible to make a button using forms which will send the intended POST data to a page with a script to send an email, then, using PHP, re-send headers to redirect the user to the intended paypal form (simple tutorials of how to post headers to send POST data are easy to find). I use a method like this to ensure authenticity of paypal requests etc, but it could be used for sending emails.

    But you could do the same thing with JS, as JAY suggested.

    But as stated, this wouldn't be ideal.
    Affordable Web Design (New Zealand Based)
    Internet Marketing Guru
    PHP/mySQL Expert
    -------------------------------------------

  • #9
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    I don't think it's possible to redirect and send POST/GET data is it? I've not seen it done anywhere before
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #10
    Regular Coder sea4me's Avatar
    Join Date
    Jan 2009
    Location
    Damn, I don't know...
    Posts
    390
    Thanks
    11
    Thanked 28 Times in 27 Posts
    Quote Originally Posted by JAY6390 View Post
    I don't think it's possible to redirect and send POST/GET data is it? I've not seen it done anywhere before
    Do something like this:

    PHP Code:
    <form action='paypal.com/....' method='post' name='frm'> 
    <?php 
    foreach ($your_vars as $a => $b) { 
    print(
    "<input type='hidden' name='".$a."' value='".$b."'>"); 

    ?> 
    </form> 
    <script language="JavaScript"> 
    document.frm.submit(); 
    </script>


  •  

    Posting Permissions

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