Quick integration
Fast access
1、DEMO Download
Click to download the DEMO code of declaration product, including customs Interface (alipay.acquire.customs) and customs query interface (alipay.overseas.acquire.customs.query), embedded JAVA, PHP, CSHARP, 3 kinds of programming languages, as well as MD5 and RSA, two kinds of DEMO signature.
2、Configuring the DEMO of developer information
Note: developer's information is needed for calling interface.
Programming language | Profile Path |
JAVA | Find directory src-> com-> alipay-> config-> AlipayConfig.java file and open. |
PHP | Find and open the Alipay.config.php file. |
.NET | Find and open app_code-> AlipayConfig.cs file. |
Locate the following parameters in the configuration file and configure them correspondingly:
partner | Collaborator ID, contract account. When you become Alipay subscriber, you will be assigned a string of 16-bit pure numbers, beginning with 2088. See the document to "Get PID". |
//Merchant ID starting with 2088 and it contains 16 digits public static String partner = "2088611221573217";
If you choose MD5 signature method, configure it as following:
key | MD5 safety checksum, detailed in "Acquire PID and MD5 Key". |
//Merchant MD5 Key
public static String key = "3qm4goiqs7y7cifw0vdp6hgti15boqyj"
If you select the RSA signature mode, configure it as following:
private_key | Locally generate the business own RSA public and private keys -> see the documentation "key configuration - Configure RSA key"; • Remove the generated public key "----- BEGIN PUBLIC KEY -----" and "----- END PUBLIC KEY -----" and remove Enter and space, upload Alipay -> please refer to the document "key configuration - configure RSA keys." NOTE: After the original private key generated by is turned into PKCS8 format, remove the "----- BEGIN RSA PRIVATE KEY -----" and "----- END RSA PRIVATE KEY -----" and remove Enter and space, fill in here. PHP and .NET is in the original private key format, remove the "----- BEGIN RSA PRIVATE KEY -----" and "----- END RSA PRIVATE KEY -----" and remove Enter and space, fill in here. |
alipay_public_key | Here is Alipay public key, not public key generated by business just now. It's used for verifying the returned callback information. Please refer to the document "Key Configuration - Configure RSA keys." NOTE: DEMO has been configured, no need to modify. |
3、Run DEMO
After configuring and positioning the corresponding environment server (environment need to be built), you can run the DEMO and have pay experience.
- JAVA:JDK1.5 above.
- NET:framework 3.5 above.
- PHP:PHP5.0 above,and open CURL services, SSL services.
- If there are business end DNS settings, and if there are firewall polices.
- If there are limiting ports and if there’re the needs of opening ports: 80 or 443.