Teach you how to use Alipay interface

Source: Internet
Author: User
Tags documentation md5
Alipay interface July 24, 2009 Friday 01:42

The data collected and collated are shared:

First, apply for free integration Services (Rookie level):

Http://union.alipay.com/alipay/leads/apply.htm?src=btoolindex

second, self-service Integration Services (Master level):

1, Alipay interface program, Virtual Goods technology document download: Virtual Commodity Trading service Integration technology documentation and service introduction follow the prompts in the documentation for integration operations.

four different languages of Alipay interface program download:ASP Virtual Goods Trading interface

Aspx.net Virtual Goods Trading Interface (GBK)

Aspx.net Virtual Goods Trading Interface (UTF-8)

JSP Virtual Goods Trading Interface (GBK)

JSP Virtual Goods Trading Interface (UTF-8)

2, Alipay interface program, Virtual goods technology text download: Physical commodity trading Services integration technology documents and services introduction

four different languages of Alipay interface program Download:ASP Physical Goods trading interface

Aspx.net Physical Goods Trading Interface (UTF-8)

Aspx.net Physical Goods Trading Interface (GBK)

JSP Physical Goods Trading Interface (GBK)

JSP Physical Goods Trading Interface (UTF-8)

PHP Physical Goods Trading Interface (link to other forum posts)

Change service to Create_digital_goods_trade_p, cost, notify return address and so on to achieve physical transactions, detailed parameters please set
Change the service to Trade_create_by_buyer, modify the mode of logistics and the cost can realize the physical transaction, detailed parameters please set yourself
Change service to Create_donate_trade_p,total_fee cost, etc. can be donated items, detailed parameters please set yourself

Reminder: The self-service Integrated Alipay Service Experience edition merchant, after the transaction succeeds the system automatically deducts the transaction amount 3% as the transaction handling fee. If you need to upgrade to a special merchant to enjoy a lower rate, contact Alipay official.

3, Payment Treasure Interface program, donation service

Virtual Commodity Trading service Integration technology documentation and service introduction follow the prompts in the documentation for integration.

Alipay donation interface. Donors are free to fill in the amount to donate, while the Alipay folder has a return Alipay notify.asp page notification interface.

Donation Interface ASP Download

third, the payment of the Treasure Interface FAQ FAQ:1, illegal_partner,hash_no_privilege,illegal_sign These three common error code, what is the meaning of the general, under what circumstances appear. A: Illegal_partner is an invalid partner ID. Partner ID is in their own Alipay account extracted a string of numbers, common for filling into the payment PO email or copied to the program when more than a space.
Hash_no_privilege, no authority, if it is virtual or physical transactions, please apply within the account itself.
Illegal_sign, signature error. The description program calculates the sign and the Alipay calculation results do not match. This error occurs in many cases, such as the signature of the wrong sort, security check code fill error, net. There is no coding in the Java program.
1. MD5 Check order problem
MD5 are sorted alphabetically in ascending alphabetical order, depending on the parameters of the summary table. What parameters you need to pass, add those parameters to the original string of MD5. The original string finally remembers to string its own security checksum code. For example, calling an interface requires the following parameters:
Service= Create_direct_pay_by_user
partner=2088006300000000
Key (paid Baoan School inspection code) =1234567890123
Email=test@msn.com
So the data to be signed is: Email=test@msn.com&partner=2088006300000000&service= create_direct_pay_by_user1234567890123
2. Types of Notification returns
There are two types of notice to pay the treasure now. The notification address does not need to be set in the account as before, but is passed to my address by the customer at the time of payment. such as notify_url= "http://www.xxx.com/notify_alipay.asp"
A server notification, the corresponding parameter for Notify_url, Alipay notification using the POST method
b page jump notification, the corresponding parameters for Return_url, Alipay notification use get way
3. The notification return is where to return.
Do not need to go to the account set as before, but by the customer at the time of payment through the parameters passed to my address. For example Notify_url=http://www.xxx.com/ntofiy_alipay.asp we will return the message to you according to the address passed over, please note the format, address if the full http://of the absolute address.
4. Why do I have to set up the right not to receive the message notice?
A The URL that you set up to accept the message is not complete, you may write www.ieeye.com, please write the complete URL as http://www.ieeye.com or https://www.ieeye.com
5. The process of virtual goods
Because Alipay ATN (active trade notify) is a server notification, there is a complete notification strategy, can be said to be close to 0 off the list. However, notifications may not arrive in real time due to network reasons.
6. Order Number Parameter setting problem
The customer's order number parameter is out_trade_no. Each customer's shopping site, have their own order serial number, you can transfer the relevant order number to Alipay, to the use of the account. In the Alipay program, out_trade_no must be a variable, not a fixed value.
7. Chinese coding problem
My parameter sort is certainly not wrong, why I no matter how set, always prompts the error. Illegal_sign
Regardless of the language written in the payment process, please note that the URL request (request) over the encoding, need to use gb2312 or GBK.
8. I am Taobao member is also a developer, I would like to ask Taobao on the use of Alipay and outside the use of what is the difference.
In any use Alipay website on the "Alipay transaction" and on the use of Taobao no difference, Alipay will give you to do the transaction intermediary.
You are the best at trading when you know the content of the transaction, the price, the product information.
As a developer must be familiar with the "Alipay transaction" process.
9. Why I have not received the payment PO's trading notice.
There will be Alipay to your server's network impassability situation: perhaps due to DNS resolution, Netcom or telecommunications line maintenance, DNS problems can be directly set in the URL IP to solve. A prerequisite for receiving a notification: there must be a duplicate transaction order number, which is passed to the Alipay notification return URL (notify_url or return_url) upon payment.
Alipay notification request is a string of URLs, if you are Apache server, you can view the Apache Access.log to see if there are access records. IIS also has a corresponding access log (the exact location is not remembered.) Know friend trouble station information send me a bit)
Attached: Dboyzhang: Create a simple program to see if there is any return information, such as a very simple write file program, the get-way message to write a little bit into the file, and then the Merchant tool to make a failure request to see the results returned. Note is get way, ASP is request ("notify_id") instead of Request.Form ("notify_id")
10. How to set up a request when a shopping cart is packaged using payment transactions
Please pass the actual total price of your goods and postage, and the actual cost of postage, so there will not be some problems that make the customer feel very strange.
11. The notification returns the interface, after receives the payment treasure notice, whether returns to pays the treasure message again.
The notice form of Alipay has two kinds:
A server notification, the corresponding parameter for Notify_url, Alipay notification using the POST method
b page jump notification, the corresponding parameters for Return_url, Alipay notification use get way
For return of the page notice, accept the Alipay message, do not need to pay the treasure system any response.
and for notify server notification, after receiving payment notice, please follow the business logic you need to deal with, and return a page containing no HTML tags, which contains only "Success" or "Fail" text string, note that please do not include any other characters, such as the space and other notification link settings
12.Notify response to Alipay what's the message
Upon receipt of Alipay notification, follow the business logic you need and return a page that contains no HTML tags, containing only "success" or "fail" text strings, and note that please do not include any other characters, such as spaces. The meaning of the corresponding "success" or "fail" please see the following table:
return results
Result description
Success
Processing successful, ending send
Fail
Processing failed, resending
Special attention
After receiving notification of the Alipay server, use the HTTP notification authentication interface to verify the legality of the notification to ensure that the subsequent operation of your system is correct.

13. What is the notification link, why I pay after not give me notice
Https://www.alipay.com/cooperate/apply_digi_goods_security_trade_service.htm
Please make sure the notification link is selected in the account. Now there's the notification link selection:
Please select the transaction status you need to be notified:
Transaction creation
Buyer Payment Successful
Seller shipped successfully
Trading success
Trading closed
Refund Successful
Refund off
Revise the transaction price
Otherwise, you will not be able to return the notification message after payment.

14. My previous backlog of information, the application of recovery can not be sent back.
Use the Notify URL to receive server notifications if an exception or fail is returned. Cause notify notice to stop, can in Alipay account, merchant tools, the bottom left corner "application for Recovery". When the application succeeds, the message is returned immediately.

15. How the Notification interface works:
Alipay's two notification interfaces use the same working principle, two steps:
1 to pay the notice of the treasure to do validation, get true or false results.
String Alipaynotifyurl =https://www.alipay.com/cooperate/gateway.do?service=notify_verify
String alipaynotifyurl=http://notify.alipay.com/trade/notify_query.do?+ "&partner=" + partner+ "notify_id=" + Request.getparameter ("notify_id");
String sign=request.getparameter ("sign");

As on Java programs, use HTTPS or HTTP query addresses. Pass Partner and Notify IDs to verify the results of the message. (See the document in detail.) "HTTP Notification authentication Interface")
2 The correct true result is obtained by verifying the interface, and then the parameters passed over are signed. (Signature mechanism with payment procedure).
Compare to the signature passed, and get the correct validation result true. Then judge the trading status (red letter other transaction status in the Alipay account can be selected, see the "Notification link, why I paid not to give me notice"), and then print out the success message on the page. or a failure message (see "Notify Response to Alipay" for details) such as: If mysign=request. Form ("sign") and responsetxt= "true" Then
If request. Form ("trade_status") = "trade_finished" Then
(Customer's shipping procedure, update order)
Response.Write "Success"
End If
Else
Response.Write "Fail"
End If
3 note, before returning to success the business parameters of the customer's website, such as shipping, updating orders.
If you encounter any problems, please contact the Alipay customer service or website:
Alipay Forum: http://club.alipay.com/index.htm

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.