Jump to content

PayPal variable passing


btravis08

Recommended Posts

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

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...