Jump to content

Using PHP variables on paypal...? *SOLVED* Look inside for how to do it.


pocobueno1388

Recommended Posts

Okay...on my site every user has a unique account ID. If they want they can pay to have their account upgraded, but I have no way of telling what account number to upgrade if I can't put there ID into my paypal payment page.

When you click the link to pay it brings you to paypal and shows all the information. It tells the user that clicks what the payment is for, quantity, and price. When you set up this on paypal you can choose what you want to make the 'payment for' to say. I would like mine to say:

Upgrade for account #[their account number]

but I obviously can't tell it to insert there account number on paypals site. I have seen it done, I just don't understand how to do it.

Hopefully I explained this good enough...any ideas?

I appreciate everyones help ^^
Link to comment
Share on other sites

[quote author=redarrow link=topic=112300.msg455710#msg455710 date=1161493727]
You match the paypal email with the users id .
[/quote]
i was also intrested in this question.. but matching emails, isnt always as stright forward, as users use diferent emails...
i have made a script where it sents an alert or mail to me when the user is sent to the 'return' page which paypal asks for.

This helps me as if any one refreashes that page, or goes to it via the address bar, i will only get 1 of the 2 emails which i need to upgrade an account..

but like pocobueno1388, i have also seen sites where your user id is taken over to paypal, and i am also unsure how this is done
Link to comment
Share on other sites

you need to take advantage of the paypal IPN (Instant Payment Notification) system. you can actually provide specified custom fields in your paypal checkout, and when it is processed by Paypal, they will hit the IPN script you notify with those same variables for you to process as you see fit. that way, you can pass a user id or passphrase to your IPN script to make sure it's a valid purchase.
Link to comment
Share on other sites

Okay, I figured it out from a friend. Here is how to do it.

[code]
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

<input type='hidden' name='item_name' value='Player ID #$sid'>

<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="email@host.com">
<input type="hidden" name="amount" value="$20.00">
<input type="hidden" name="page_style" value="PayPal">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="cn" value="Account ID to Credit:">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="https://www.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!">
</form>

[/code]

Just replace my information of course ^^
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.