Silver Link Jump pay Learning record 1

Source: Internet
Author: User

Recently in a project, which involves the payment function, the use of UnionPay's online payment function (Gateway jump payment). The example of UnionPay is very pit dad, simple code is just a lot of, the key part of a little comment is not, many tool classes have no source. So it is difficult to learn. There is relatively little information on the Internet, and only some of the information is quite old. So I'm going to keep a record of my study history, and maybe it will help others.

Download UnionPay Demo

I use UnionPay gateway to pay the function, need to complete the online payment, pay the jump, and accept the notice of UnionPay to update their database functions.

UnionPay Technical Service Home address is https://open.unionpay.com/ajweb/index a lot of information can be found here.

I downloaded the demo here Https://open.unionpay.com/ajweb/help/file/techFile?cateLog=Sample_code there is a lot of information to choose from. But in fact a lot of it is repetitive, many are not used (for the function I do). So choose what you need. I chose the download Resources category in the Development Package menu (left menu) below the Jump Gateway Payment Product Technology Development kit.

When I wrote this project, the UnionPay version was the 1.11 version of 2015-07-29 (New (⊙﹏⊙))

A mess of things in there ..... PHP ah java Ah asp ah everything has ....

I chose the Java version.

It then imports everything underneath the SRC directory below the sample code into its own Web project. (It's all imported, so you'll import acp_sdk.properties in addition to. java)

Then import the jar and Upacp_sdk-1.0.0-20150703140550.jar under the dependency package into the Lib directory (I did not import the JSON optional package)

Show a picture of everything

Then the project is built. Isn't it super easy? Then I'll how to configure the project:

Configuring the Properties File

Then I'll say how to configure the properties file.

Properties File Open comments are all Unicode encoding ... It's a pit-daddy. Do not understand can go online to turn Unicode into Chinese to look at the comments. In fact, there is no need. I'll show you a few more useful configuration items later: Nothing else is useless.

Acp_sdk.properties This file, everyone, don't rename it.

Because this file name is UnionPay written dead in the configuration class. Changes to the name will not be read.

Before the various URL configuration we do not need to change, download is a well-equipped test address. Only when it is officially on-line is it necessary to configure it as a formal address (but my project is not on the line.) So I don't know what the official address is. But I see on the UnionPay official website that there is information to write. People can go to their own search to see)

The following configuration is related to the certificate, in addition to a sentence. There are few lines of configuration in the properties ... Pit me for a few days time.

Copy all 3 folders of the network test environment in the Certificate Cert folder to the desktop. Because it's going to work. (I put it on the table for ease of configuration)

Modify the value of the Acpsdk.signCert.path in properties to the c:\\users\\administrator\\desktop\\ Network test environment \ \ Merchant Private key Certificate (signature) pm_700000000000001_ Acp.pfx

You can change the control path, note here 700000000000001 this number. It will be used in the back (the pit for a few days ...). )

This certificate needs to be changed to formal certificate after the official launch, this certificate is used for testing.

ACPSDK.SIGNCERT.PWD does not need to change, because the test certificate password is 6 0.

Similarly, after the official launch to change to their own password

Acpsdk.signCert.type no need to modify, that is PKCS12

Acpsdk.validateCert.dir value modified to c:\\users\\administrator\\desktop\\ network test environment \ UnionPay Public Key certificate (verification)

Validatecert is used when the UnionPay to send you a message to determine the authenticity of the (others may forge UnionPay information, so need to use this certificate to verify the authenticity of the information), so it is not useful for creating order payments. However, the following query UnionPay payment information to use, so also configured together.

Add Acpsdk.encryptCert.path this key,value for c:\\users\\administrator\\desktop\\ network test environment \ \ Encryption Certificate (selected according to business requirements) \\encrypt.cer

UnionPay actually does not have this configuration by default. The Pit Daddy Ah ... This is the time you send a message to UnionPay to determine whether the order is the designated merchant (you) sent over. It is also used to verify authenticity (encryption)

The completion of these configuration can be happy (chop hand) and UnionPay made a deal.

Create an order

(To be Continued ...) )

Silver Link Jump pay Learning record 1

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.