PayPal payment interface solution

Source: Internet
Author: User
Tags form post http post website hosting
PayPal is a fast, secure, and convenient payment option for cross-country transactions. Currently, PayPal can be linked to most of China's credit cards, so that China's cross-country transaction revenue and expenditure can be realized. Apply for the PayPal website address: https://www.paypal.com/paypalinterface. The interface is slightly different from the other one. In fact, the line interface is also a site plug-in. The specified paypal ipn (Instant Payment Notification) is a kind of mechanism developed by Paypal to notify third-party users of the transaction quota of the system. The principle of IPN is very simple, that is, when a transaction occurs and the transaction volume changes, for example, Paypal uses the common http post method when the payment is made, or the refund or withdrawal is made, submit some changes of the transaction to a certain area of the website (IPN Handler). When this area accepts the request, add the original data records to the cmd = _ policy-validate of the certificate and POST them back to the Paypal interface address. If the data volume is correct, then Paypal returns the string VERIFIED. If the result is VERIFIED, your program can use these numbers for operation. It is very painful to set up a Sandbox producer, but it is impossible to create two developers as third-party developers, every time I renew my account, I still need to trade some money. Therefore, Paypal opened a Sandbox for developers to develop, first, go to the https://developer.paypal.com/workshop to create a producer, after that, enter the Sandbox to create a Alipay website (at least one Business and one Personal account should be created ), this billing method is the same as the Paypal process. Information can be false, including bank renewal and credit card (in fact, Paypal Sandbox will automatically generate some hosts ). Next, you need to activate the Alipay website hosting function of the Paypal Sandbox. This parameter does not matter what email address you fill in during the Paypal Sanbox website, any emails sent to the mailbox filled in by the mailbox will be stored in the Email address on the management interface of the mailbox. Log on to the Sandbox's Alipay Paypal website, and you also need to verify your linked bank. This website can be filled in immediately, then, Add Funds to recharge your primary account (920-203-920 ). Then, you also need to activate the IPN option. In the Profile configuration area of the Business region, click Edit, and then click Edit, open IPN. If you use a fixed IPN Handle, you can enter the address directly. Next, we recommend that you set the address of the Paypal interface to a signed URL (type = "hidden" name = "yy_url" value = ""). server sends a notification. This notification will include all the payment information of your customer (for example, the customer registration name and the gold medal) and an encrypted token. When a server receives a notification, it sends the message (including the encrypted proxy) back to a secure PayPal URL. PayPal will use the encrypted string to check the identity certificate for the transaction. This operation that forwards IPN data back to PayPal prevents "spoofing". Therefore, you can ensure that IPN comes from PayPal. When you enter your credit card, PayPal will send the confirmation information of its validity to your server. Tip: to renew the pay-as-you-go notification, you will need to upload a URL through which you can receive notifications from your subscription. After you use the pay-as-you-go notification, your server will receive a notification every time you receive the payment, this notification will be sent to the specified URL in the form post method stored in Alipay, and will include all payment information. The bottom of this detail list the notification FORM changes. Each time you receive an IPN from PayPal, you must complete the notification validation process described below before the ticket is implemented. Confirm the listed information to ensure that the transaction is valid. The notification confirms that the IPN payment is in your PayPal payment option, you must confirm whether the email address used as "receiver_email" has been confirmed in your PayPal account. After the server receives the pay-as-you-go notification, you will need to confirm it by creating an http post sent to PayPal. Your POST should be sent to the producer. You also need to append a variable named "_ policy-validate" to the POST string (for example, cmd = _ policy-validate. PayPal will return to the POST and contain a single word "VERIFIED" or "INVALID" in the response body ". When you receive a VERIFIED response, you need to submit a row before the verification ticket is executed:
  • Confirm "payment_status" as "Completed", because the system will also send IPN for other results (such as "Pending" or "Failed.
  • Check whether "txn_id" is retained to prevent the spoofer from re-using the completed transactions in the transaction.
  • Your credit card "receiver_email" is the email address that has been registered in your PayPal account to prevent payment from being sent to the email address of the bully.
  • Check other transaction conditions (such as item quota and quota) to confirm that the above quota has not been changed, you can use the IPN data volume to update your data volume and handle things.
If an "invalid" notification is received, it should be considered a suspicious notification and should be inspected. Major metric data: when submitting a sticky token to PayPal, it should include the following four hidden changes and a batch of images. That is to say, the shortest token that you need to stick to PayPal is as follows:
12345678 // "_ Xclick" Buy now // the email address on the PayPal website // The item name (or the car name) de "value =" USD "> // specify the parameter value as" USD "," EUR "," GBP "," CAD ", "JPY ". // Item comment (the total comment of all items in the car, because it is in the _ Xclick Mode) 
Variable business: number of items on the quantity email address on your PayPal account. Later than 1, The item_name item name will be multiplied by the Golden Mile (or the car name will be used ). It must be a letter or number, and a maximum of 127 characters, item_number, can be selected for pay-as-you-go. It must be a letter number, with a maximum of 127 characters of amount items (the total size of all items in a car) shipping the shipping cost of the item shipping2 the shipping cost required for each additional item handling manual operation cost tax is based on the transaction shipping cost. If this change is used, the reset parameter value will overwrite all the configuration items with the reset information (regardless of the home location ). No_shipping: the routing address. If it is set to "1", your customer will not be asked to provide the Sending address. This variable is optional. If it is omitted or set to "0", you will be prompted to enter the destination address cn for selection, the message "no_note" is displayed on the prompt "payment" (up to 40 characters. If this parameter is set to "1", you will not be prompted for an incoming ticket. This variable is optional. If it is omitted or set to "0", a prompt is displayed for your customer logon. On0 is the first choice among region names. A maximum of 64 characters are selected in the first os0 group. It can contain a maximum of 200 characters. "On0" must be defined to recognize "os0 ". In on1, the second choice is named "register. A maximum of 64 characters can be selected in the second os1 group. It can contain a maximum of 200 characters. "On1" must be defined to recognize "os1 ". Custom may decide not to display the selectable changes to your customers. It can be used with the Stored Procedure invoice to determine the number of optional parameter changes that will not be displayed to your customers. It can be used with the y_url extension and IPN. Sending IPN Form Post URL return after payment is completed, your client will return URL cancel_return after payment is canceled. the URL of the specified porn image, the image size is 150X50 pixels. cs sets the background color of your payment option. If it is set to "1", the background color is black. This variable is optional. If it is omitted or set to "0", the background color will be white. PayPal allows you to stick the variable, the condition will change the following "cmd" value: To: You can also use the following changes by modifying the "cmd" value: expand the name of the first_name client address of the email client. It must be a letter or number, and a maximum of 32 characters are the last names of last_name. It must be a letter or number, and a maximum of 64 characters can be entered in the country or region where the address of address1 is located. It must be a alphanumeric character. The maximum length is 100 characters. The second line of the address2 customer address is required. It must be a letter or number, with a maximum of 100 characters in the city. It must be a letter or number, with a maximum of 100 characters in the state client address. It must be the official OFFICIAL 2-character zip client address, which is the official website. The official website is "maid ". the top three day_phone_a telephone calls during the day are the day_phone_ B telephone calls during the day: if you want to change the default operation and manual configuration in "user information", please refer to your user information to allow your operation calculation, then click "Allow to use the transaction-based operation" option. Upload a single item to PayPal. If your third-party car can be set to buy a single item to PayPal, information about related items will be added to the Daily Record and system notifications of the home and home. To add information about the item, you need to paste the HTML format element to the new version of the PayPal procedure. This process is very similar to the description of #1 "uploading the total number of vehicles to PayPal". The difference lies in: set the "cmd" variable to "_ cart" and add the necessary HTML rows and the new changes that refer to "upload" between <Table> and the standard. the following lines: define a set of new values that correspond to each item listed in the following dimensions by your partner. Append "_ x" to the variable name "variable", where "x" indicates the item category. Starting from 1, add one for each added item. Item_name_x (item # x required) Name of item # x in the vehicle. It must be a letter or number. A maximum of 127 characters can be selected when item_number_x relates to item # x in a bicycle. It must be a letter character, with a maximum of 127 characters amount_x (item # x required) item # x shipping_x Shipping item # x's first item (number 1) shipping2_x cost # x (quantity 2 or more) the required shipping cost handling_x item # x's handling cost on0_x item # x's first choice should be named again. A maximum of 64 characters can be entered for the first group of os0_x item # x. It can contain a maximum of 200 characters ." On0_x must be defined to distinguish os0_x ". On1_x item # The second choice of Item x. The second set of optional values for an os1_x item # x up to 64 characters. It can contain a maximum of 200 characters ." On1_x must be defined to distinguish os1_x ". To reproduce each item in a bicycle, this variable sets that each item in your bicycle must be included in a set of required changes and any selected changes in the preceding table. The first item in a vehicle must be used as the parameter value for the end of "_ 1", such as "item_name_1" and "amount_1. Similarly, the second item should be named after "item_name_2" and "amount_2. Tip: the "_ x" value must be incremented in order by a single bit to identify the difference. If you jump from item #1 to item #3 and the value of item #2 is not specified, the third item will be ignored. Specify metric types: All metric changes (gold, runtime, runtime 2, manual, and billing) the "currency_code" of the pay-as-you-go instance changes to the specified type of metric. Because it is not a different item, you do not need to append "_ x" to the variable name ". If there is no "currency_code" variation, we will assume that all the replica changes are USD. PayPay APIPayPal provides multiple API interfaces for developers. Before using an API, you must first apply for a senior user or enterprise employee, at the same time, you must obtain the API certificate for each API call. Once you have obtained the API certificate, you can use the related API. Currently, we provide two API interfaces: NVP and SOAP. Generally, we recommend that you use the NVP interface. Name-Value Pair (NVP) interface-the sum of requests must use a simple HTTP. This interface is easy to implement. It is suitable for initial developers and persons who need to quickly complete integration. SOAP interfaces-request sum and response are all completed through SOAP. This interface is applicable to the development of the object project. The PayPal API: NVP (name/Value Pair) interface has passed the nvp api, you only need to send an HTTP request to PayPal and specify the request data in the form of "name = value" to make full use of the API function of PayPal. Nvp api is a simple interface for PayPal's business functions, operation management, and business operations. The most basic way to use nvp apis is to send an NVP string over HTTPS connections to the PayPal server, and then handle the response (which is also an NVP string ). The basic steps for creating nvp api libraries are as follows: Create a please evaluate numeric string for a specific API method. Send this parameter string to the PayPal server over HTTPS connections. NVP in the processing server response. For each nvp api, the request string contains the API Signature Name, API secret, the name of the API to be called, and the token for the tag transaction, for example: USER = someone@unknowncompany.com & PWD = mypassword & METHOD = GetExpressCheckoutDetails & TOKEN = EC-23T233ZP3DFB... A successful response includes the following elements: ACK = Success, and a unique token used to mark a transaction. ACK = Success & TIMESTAMP = date/timeOfResponse & CORRELATIONID = debuggingToken & VERSION = 2.300000 & BUILD = buildNumber & TOKEN = EC-3DJ78083ES565113B & EMAIL = abcdef@anyemail.com & PAYERID = Success & PAYERSTATUS = verified & FIRSTNAME = john & LASTNAME = Smith... you can use the nvp api to perform the following operations: Search for completed transaction records and Check Transaction sentiment; automatically post-terminal functions, such as permission capture and authorization, and refund handling; the API Profile is imported into the seller's zookeeper to obtain the corresponding APIProfile. If it is viewed in a Chinese statement, it is obtained in-use response information-API FAQs, when you apply for an API, you have two options. The first option is the authentication method, and the second option is the authentication method. To verify the identity of a merchant. When you choose to upload a digital certificate, you can access the MIIT ~. This article provides instructions on how Express Checkout works. On this basis, you can ask www.paypal.com/IntegrationCenter/ic_nvp.html to obtain the relevant token on behalf of Alibaba Cloud; you can ask www.paypal.com/IntegrationCenter/ic_sandbox.html,API Reference https://www.paypal.com/IntegrationCenter/ic_api-reference.html about your PayPal Environment

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.