PHP to pay treasure development of Return_url and Notify_url difference Analysis _php Skills

Source: Internet
Author: User

This paper analyzes the difference between Return_url and Notify_url in the development of Alipay in PHP. Share to everyone for your reference. The specific analysis is as follows:

In the Alipay processing business Return_url,notify_url is returned to what state, we have to do some processing according to it must understand the difference between the Return_url,notify_url, I would like to introduce you to the introduction.

Problem Description:

I have in the processing of Alipay business has been such a problem, paid after the completion of the payment PO jump to the merchant specified page, the order status has been updated, through the commissioning of the discovery is Alipay first notice notify_url, completed the order status.

Alipay Return_url and Notify_url notification order issues:

The order is not certain, please do not judge in order, how to judge, is based on your current database status and just from the payment of the status of the treasure to make a comparison to determine whether there has been handled.

For the difference between Alipay Return_url and Notify_url, Sync notification page features (Return_url features):

(1) The buyer after the successful payment will see a Alipay prompt transaction success of the page, the page will stay a few seconds, and then automatically jump back to the merchant specified synchronization notice page (parameter return_url);

(2) The way in which the parameters are obtained in the page needs to be obtained using GET method, such as request. QueryString ("Out_trade_no"), $_get[' out_trade_no '];

(3) This method only after the buyer payment completes automatically jumps, therefore only then carries on once;

(4) This way is not Alipay initiative to call the Merchant page, but Alipay program to use the page automatically jump function, so that the user's current page automatically jump;

(5) on the basis of (4), the machine can be debugged on the server instead of only on the servers;

(6) Return URL only one minute validity period, more than one minute the link address will be invalidated, validation will fail;

(7) When you set the path of the page Jump Sync notification page (return_url), do not add the custom parameters to the page file. For example:

Wrong wording:

Copy Code code as follows:

The correct wording:

Copy Code code as follows:

Server Asynchronous Notification page characteristics (Notify_url attribute):

(1) must ensure that the server asynchronous notification page (Notify_url) No characters, such as spaces, HTML tags, development system with the exception of the information thrown out;

(2) Alipay is the post way to send notification information, so the way to get parameters in this page, such as:

Request. Form ("Out_trade_no"), $_post[' Out_trade_no '.

(3) Alipay to initiate notification, the way will be enabled;

(4) Only in the transaction management of Alipay existence of the transaction, and a change in the status of the transaction, Alipay will be the way to launch the server notification (instant to the account of the transaction status of "Waiting for the buyer to pay" status by default will not send notice);

(5) The interaction between servers, unlike page jump synchronization notification can be displayed on the page, this interaction is not visible;

(6) The first transaction status change (real-time to the account at this time the transaction is completed), not only the page Jump synchronization notification page will be enabled, and the Server asynchronous notification page will also receive payment PO sent to the processing results notice;

(7) The program must print out "success" (without quotes) after execution. If the merchant feedback to Alipay that the character is not success these 7 characters, the Alipay server will keep on sending a notice until more than 24 hours and 22 minutes.

Under normal circumstances, within 25 hours to complete 8 notice (the frequency of the notice is generally: 2m,10m,10m,1h,2h,6h,15h);

(8) After the execution of the program, the page will not be able to perform the page jump. If the implementation of the page jump, Alipay will not receive success characters, will be paid treasure server to determine the page program run abnormal, and the results of the resumption of processing notice;

(9) Cookies, sessions, etc. on this page will be invalidated, that is, the data can not be obtained;

(10) The debugging and operation of this method must be on the server, that is, the Internet can access;

(11) The role of this method mainly to prevent the loss of orders, that is, page jump synchronization notice has not processed orders update, it is to deal with;

(12) The notification ID (parameter notify_id) is valid for only one minute, and more than one minute the notification verifies failure. Once the validation is successful, the next validation will fail.

I hope this article will help you with your PHP program design.

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.