Jump to content

Archived

This topic is now archived and is closed to further replies.

pocobueno1388

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

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 ^^

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Yeah, I don't see how you would match the paypal email with the users ID either, that would leave a hole in the system if the emails were different.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
[quote author=pocobueno1388 link=topic=112300.msg456004#msg456004 date=1161556534]
I know there is another way...
[/quote]

well, if you find another [b]safe[/b] way, let me know

Share this post


Link to post
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 ^^

Share this post


Link to post
Share on other sites
All that is doing is changing the item name that shows up in the Paypal shopping cart to have their number attached to it. I thought you wanted a way for your system to automatically associate a purchase with a Paypal receipt?

Share this post


Link to post
Share on other sites

×

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.