btravis08 Posted December 9, 2010 Report Share Posted December 9, 2010 Here goes, I have modified the shopping cart system from killersites, and have also linked up with paypal successfully. I also just tested the IPN system from paypal and recorded a fiew variables in my sql database table called purchases. 1st Question: A general question regarding sandbox: Does the IPN testing occur when you make a mock purchase through your actual website. The only way i have successfully passed IPN information along to my database is through the "Instant Payment Notification (IPN) simulator". This is great, but i would really like to see information passed from my website. Is that possible in a mock scenario? 2nd Question: I need to pass a variable called "member_id" to paypal so that after the transaction is made paypal can send me all of the IPN info including the member_id for logging purposes. This ID is essential for linking up my database of members with purchases. Ultimately, I will have a private admin page that will link up members with associated purchases and display them together for easy viewing. I know paypal has a rigid list of acceptable variables. I don't think a buyer name is one of them. I hope i am wrong. Any suggestions on how to pass and retrieve that variable? Thanks! Bryce Quote Link to comment Share on other sites More sharing options...
BeeDev Posted December 9, 2010 Report Share Posted December 9, 2010 I'm not familiar with the Killersites shopping cart system, but looks like the questions are more about Paypal, so I'll have a go: Question 1: Yes it's quite possible. You just need to add "sandbox" to the address on your IPN handler page. The IPN handler page first receives a POST data from paypal, then it should send the data back to paypal to verify, you just need to change the address it sends the verification to: https://www.sandbox.paypal.com/cgi-bin/webscr or something like that. Question 2: I'm not really up to date with the evolving API of paypal, but from what I can remember, you can pass few different variables to paypal. There's one called "custom": <input type="hidden" name="custom" value="<!--Your Member ID Value Here-->" /> And from what I remember from a recent paypal site I made, this "custom" variable comes back from paypal to your website via IPN and also PDT. There's another way to add custom variables to paypal, and those variables called on_0 os_0, on_1 os_1, on_2 os_2 ... "on" stands for "option name" and os stands for "option selection" or something. Basically you must put the variable name in "on" and the value in "os" (So they must be in pairs basically): <input type="hidden" name="on_0" value="member_id" /> <input type="hidden" name="os_0" value="000123456" /> These might not be 100% accurate, and might be outdated so you should check the Paypal PDF's just to make sure Quote Link to comment Share on other sites More sharing options...
btravis08 Posted December 9, 2010 Author Report Share Posted December 9, 2010 I'm new at this, so i may be missing out on the structure of this stuff Anyways, I've attached the two files at work here. The first snippet is from a templates page, which is sending product info to paypal for the transaction. I'm assuming that once the purchase is made IPN info will be sent to my ipn.php file? (second snippet), which will then write to payments.txt? Is this how it works? Thanks help.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.