This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14197|Reply: 1

PayPal PayPal interface development

[Copy link]
Posted on 4/30/2019 9:12:12 PM | | | |
Recently, the website needs to connect to the international payment interface PayPal, and it took a few days to record the pitfalls it encountered for later use.

1. The first step is to apply for a merchant account on the official websiteThe hyperlink login is visible.I don't know the specific steps here, after all, I didn't come to apply

2. Because we are using the website here, we use the most convenient website payment standard version, and the rest can also be implemented with the API of fast checkout.

First, we configure the parameter information we need to use into the config
Then we build the page code that requires us to post, and store the values that must be filled in the hidden domain <input type="hidden" />

These parameters are more important, and you can go to the official website to find relevant documents for a more comprehensive parameter introduction

3. The initiation code is okay, let's write the code to return and notify the page

On the notification page, we can get the following key parameters

We can use item_number parameters to correspond to the database, verify according to the pay_order to prevent reuse, and judge whether the transaction is successful based on pay_status (pay_status="Completed").

One thing to note here is that PayPal does not automatically return by default, and relevant configurations are required. Steps: User information - > sales notification - > website payment habit setting




Just set the two places in the picture to on.

4. The return page is generally only used to display the recharge results, and we generally put it on the notification page to handle the relevant business logic.


The ValidateSource method is mainly verified by calling the interface after the obtained parameters + "&cmd=_notify-validate" to see if the parameters have been tampered with during the passing process.

Note the red area above, this must be indispensable, the https interface we access, if the above code is missing, will report an exception: Request aborted: Failed to create an SSL/TLS secure channel

Well, after writing the above code, we can publish it to the server for testing, PayPal's test is still relatively good, providing us with a special test address, you can arbitrarily add merchants and personal accounts to test.

First, we log in with our registered account:The hyperlink login is visible.


After logging in we find



Here we will be given two default accounts, of course, you can also make any changes, and then we can test with the accounts we set

After the test is completed, if we want to log in to our test account to view information, we need to use this URL:The hyperlink login is visible.

We log in with the merchant account here, and here we also need to operate the configuration information in step 3 again.

Here you can also check our IPN information





Official introduction:The hyperlink login is visible.






Previous:"Maven Practice" Xu Xiaobin
Next:Machine Learning Original PDF eBook 45 books
 Landlord| Posted on 5/3/2020 5:45:14 PM |
Use your own encapsulated PayPal because PayPal has two types of authentication
1: Use the interface to obtain the token (due to poor network, the token is often not obtained, and the acquisition timeout is obtained)
2: Use header Basic validation (current scenario)
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com