Web site with PHP implementation PayPal Integration method
Source: Internet
Author: User
So today I'm going to talk about how to integrate your website with PayPal.
First of all, go to PayPal to apply for a number bar, the information is complete, we can start action music, right, when applying for PayPal, to apply for the kind of account that can accept others payment.
Next, we really started PayPal and the integration of the site.
In fact, PayPal has provided a fool-type payment button to create a way, but generally we do not, because we have to according to the actual situation of their own site to write customized payment button. Let's start with a piece of code:
Copy CodeThe code is as follows:
<form action= "HTTPS://WWW.SANDBOX.PAYPAL.COM/CGI-BIN/WEBSCR" method= "POST" >
<!--which account to pay, change the value to your account-->
<input type= "hidden" name= "Business" value= "recieve@gmail.com" >
<!--define the type of button. -->
<input type= "hidden" name= "cmd" value= "_xclick" >
<!--defines the return method of IPN, 2 represents post. -->
<input type= "hidden" name= "rm" value= "2" >
<!--to which page to jump to when the user pays successfully. -->
<input type= "hidden" name= "return" value= "http://www.sqlview.com/payment/notify.php" >
<!--is important to the values you define. -->
<input type= "hidden" name= "Custom" value= "MyValue" >
<!--the name of the product. -->
<input type= "hidden" name= "item_name" value= "Floor Ticket" >
<!--prices of goods. -->
<input type= "hidden" name= "Amount" value= "5.95" >
<!--the price unit of the commodity. -->
<input type= "hidden" name= "Currency_code" value= "USD" >
<!--users can adjust the number of items. -->
<input type= "hidden" name= "undefined_quantity" value= "1" >
<!--submit buttons and pictures. -->
<input type= "image" Src= "/program/uploadpic/2010-12/201012923526366.gif" border= "0" name= "submit" alt= "PayPal- The safer, easier way to pay online! " >
</form>
This submission form above I wrote almost the most commonly used options, of course, have special needs to go to the PayPal website to check the manual.
The previous form mentioned IPN (Instant Payment Notification), this is the key, that is, when the user paid successfully, PayPal sent us a notice, which contains the information variables of the transaction, We specify PayPal to send these variable information to our site has been set up a good page, through this page we need to write variable information to the database, the page through the $_post can get the desired information. How to set IPN, login paypal account, click Profile Options, set IPN can be.
OK, sounds is not very simple, hurriedly integrate PayPal, so that your site can accept users around the world to pay!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.