Jump to content


Photo

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


  • Please log in to reply
10 replies to this topic

#1 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 22 October 2006 - 02:44 AM

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

#2 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 22 October 2006 - 03:57 AM

Hmmm, anyone? I still can't figure it out.

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 22 October 2006 - 05:08 AM

You match the paypal email with the users id .
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 leeming

leeming
  • Members
  • PipPipPip
  • Advanced Member
  • 93 posts

Posted 22 October 2006 - 01:08 PM

You match the paypal email with the users id .

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
Im not perfect ;) lol

#5 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 22 October 2006 - 07:19 PM

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.

#6 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 22 October 2006 - 07:22 PM

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.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#7 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 22 October 2006 - 10:35 PM

I know there is another way...

#8 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 23 October 2006 - 01:17 AM

I know there is another way...


well, if you find another safe way, let me know
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#9 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 24 October 2006 - 03:16 AM

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

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


Just replace my information of course ^^

#10 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 24 October 2006 - 12:34 PM

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?
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#11 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 24 October 2006 - 09:21 PM

Nope, that is all I wanted was to make their ID number appear in that specific spot.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users