Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PayPal to MySQL Database...

Guest
Jun 09, 2010 Jun 09, 2010

I have created a website that a user selects a PayPal subscription for lets say $9.95 per month.  I got the PayPal working on my site to go up to the purchase.  However, I heard that there is a way that PayPal is able to connect or send something to my MySQL database inserting the user information so that the user can have access to the website rather than inserting the information manually when I get the papal confirmation.  If someone can explain to me how the procedure if it is possible to have PayPal info of what the user subscribed to back to my MySQL database and not need to enter the information manually.  Here is what I have.

MySQL database for the user

CREATE TABLE IF NOT EXISTS `payaccthist` (
  `payhistid` varchar(35) NOT NULL,
  `date` date NOT NULL,
  `userid` varchar(35) NOT NULL,
  `acctexpir` date DEFAULT NULL,
  `regcostid` varchar(35) NOT NULL DEFAULT '',
  `approved` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Only to show',
  PRIMARY KEY (`payhistid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Snippet of PayPal page

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="business" value="me@me.com" />
<input type="hidden" name="lc" value="CA" />
<input type="hidden" name="item_name" value="<?php echo $monthsSelected; ?> Month(ly) Subscription" />
<input type="hidden" name="item_number" value="<?php echo $monthsSelected; ?> months" />
<input type="hidden" name="no_note" value="1" />
<select name="a3">
<?php do { ?>
<option value="<?php echo $row_getMonthly['cost']; ?>"><?php echo $row_getMonthly['cost']; ?></option>
<?php } while ($row_getMonthly = mysql_fetch_assoc($getMonthly)); ?>
</select>
<br />
<input type="hidden" name="currency_code" value="CAD" />
<input type="hidden" name="src" value="1" />
<!--Continous billing for 12 months-->
<select name="srt">
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
Months <br />
<input type="hidden" name="t3" value="M" />
<input type="hidden" name="sra" value="1" />
<input type="hidden" name="p3" value="1" />
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHostedGuest" />

<input type="hidden" name="receiver_email" value="me@me.com" />
<input type="hidden" name="custom" value="User: <?php echo $row_getUseSubscription['username']; ?> is <?php echo $row_getUseSubscription['f_name']; ?> <?php echo $row_getUseSubscription['l_name']; ?>" />
<br />
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal Gateway - The safer, easier way to pay online!" />
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>

Thank you for your responses.

TOPICS
Server side applications
3.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 10, 2010 Jun 10, 2010

Do you want to get the IPN confirmation?

Its not clear what you mean by: "PayPal is able to connect or send something to my MySQL database  inserting the user information so that the user can have access to the  website"

Or do you want the users details to come across onto the paypal payment page?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 10, 2010 Jun 10, 2010

What I want to know is it possible that when a user pays a subscription on my site using PayPal Subscription button submitting PHP code.  Is there a way that if a user pays for a subscription on my site and when he/she pays that there is a way of PayPal submitting me back to me in php code that will insert that users information that now this user can have access to the website.  Is there such a thing?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 11, 2010 Jun 11, 2010

Hi,

Yes there is: Google this: PHP Toolkit for PayPal v0.51

It is a php Paypal processing script, with IPN, it can send a notification back to your database.

You will need a field in your database to hold the response.

The file paypal will write back to should have a database connection and a insert statement.

I have used this with great success.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 11, 2010 Jun 11, 2010

That is so neat.

I had no idea there was something like that out there.

I tried to do a search of of the "PHP Toolkit for PayPal v0.51" however, I cannot find the script.  At one link it directed me to the PayPal website but I got an error on my browser saying to not download.  I do not know what that is about.

Can you please send me the link to the site that has helped you.  I really appreciate it.

Thank you so much for your knowledge.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 11, 2010 Jun 11, 2010

I cant find it either.

I have it on my laptop at home. When I go home, I will upload it somewhere or email it to you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 11, 2010 Jun 11, 2010

Thank you, I look forward to it.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 15, 2010 Jun 15, 2010
LATEST

Were you able to find it on your laptop and uploaded?

I am looking forward to getting my hands on it.

Have a great day.

Thank you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines