Web site with PHP implementation PayPal Integration method _php Skills

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 Code code 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= "yun_qi_img/btn_buynowcc_lg.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!

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.