| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Member | PHP PayPal IPN I am trying to make a basic PHP PayPal IPN and when I say basic I mean really basic. I have tried everything and can't get anything to work... I am just trying to check if it is verified and it can't even do that. I am using the example with something I added: PHP Code: Any reasons why this doesn't work? |
| |
| | #4 (permalink) |
| NamePros Regular | test it using paypal sanbox https://www.sandbox.paypal.com/ It is a copy of paypal but used for testing non real transactions you can set up as many accounts as possible and transfer any amount of cash between them. This is what i used to test my IPN code. I remember when I was working on it the paypal IPN system wasn't working on their side for quite a while. I also found eliteweaver to fail testing.
__________________ Please add to my rep points if i was helpful. Thanks. Ripe Website Manager - Steve Parish |
| |
| | #5 (permalink) |
| Senior Member | Yes, sandbox is the best option...it gives you a virtual credit card number just for the sandbox, you can then run tests. It may also be an idea to checkout paypaldev.com
__________________ I am no longer a NP moderator -- please do not PM me with moderation requests! ~ VPSSpeed.com - Unmanaged VPS Hosting from $9.95 Get a FREE Mach-1 VPS PLAN with any order - Use the coupon FREEWHIZ |
| |
| | #8 (permalink) |
| I'll do it Technical Services | Hey guys. Here is the code that I use normally for the setup. checkout.php PHP Code: Now for the IPN script: notify.php PHP Code:
__________________ Vhuv|Delq|Fhur|Twut|Tluz|Kegh|Vhir|Juhy|Ruuz|Jyos|Jupt|Vhek Webmaster Blog | Software Downloads Sponsor Ads at SponAds.com |
| |
| | #9 (permalink) |
| Buy my domains. | For the sandbox on Paypal, is the money being sent to a fake account on the sandbox from another fake account on the sandbox? Also, how long should it take for the verification email to come for the sandbox account.. edit: Why do they send the emails to that email buttons? I got lucky I found it. -_- edit2: Never mind all of that. ^ But I still can't get it to work. index.php Code: <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="rocky@sanchez.com"> <input type="hidden" name="item_name" value="something"> <input type="hidden" name="item_number" value="1"> <input type="hidden" name="amount" value="10.00"> <input type="hidden" name="no_shipping" value="2"> <input type="hidden" name="return" value="http://css.la/ipn/return.php"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="bn" value="PP-BuyNowBF"> <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> PHP Code: Last edited by Dan Friedman; 06-25-2006 at 07:38 PM. |
| |
| | #13 (permalink) |
| Buy my domains. | Obviously.. But show me an example of what could be in it. Code: $pageid = $QUERY_STRING;
if ($QUERY_STRING == "")
{
$pageid = 1;
}
$arr = explode("x", $pageid);
$hid = $arr[0];
$catid = $arr[1];
|
| |
| | #14 (permalink) |
| NamePros Member | Alright I ended up modify the script to work and I just tested it on an actual payment (of 31 cents ). Anyways is there some sort of way to get PayPal to pass a custom variable to the IPN?For example when someone is on my site and they have $_SESSION variable set and they go to the site... can you some how pass the information of that $_SESSION variable to the PayPal payment thing so it then will pass that variable to my IPN? EDIT: I am using a buy now button so could I just add: <input type="hidden" name="custom" value="SESSION VARIABLE"> even if the rest of the button is encrypted? Last edited by Scott2503; 06-26-2006 at 01:26 PM. |
| |
| | #16 (permalink) | |
| I'll do it Technical Services | Quote:
Then I explode it when I recieve the whole query string and process it accordingly. The live thing can be seen here. http://www.firescripts.com Which I recently launched and it has the automatic sponsoring system.
__________________ Vhuv|Delq|Fhur|Twut|Tluz|Kegh|Vhir|Juhy|Ruuz|Jyos|Jupt|Vhek Webmaster Blog | Software Downloads Sponsor Ads at SponAds.com | |
| |
| | #17 (permalink) | |
| Senior Member | Quote:
| |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |