UnionPay payment and payment

Source: Internet
Author: User

UnionPay payment and payment

UnionPay payment(1) UnionPay payment Flowchart

(2) download the development kit from the UnionPay developer Platform
(3)install “uppaydemo.apk ". The running effect after installation is as follows:


(4)open Chinese UnionPay Mobile Phone Payment Control File Access android.doc ", in this document there is a test account (account: 6226090000000048, verification code: 123456), use the test account for testing, the results are as follows:





(5) The source code corresponding to “UPPayDemo.apk is also in the Development Kit. This Demo can be fully paid, indicating that the current Demo has been fully configured with the development environment of UnionPay, we only need to refer to this Demo to configure our own project.
Note: compilation in the UnionPay development environment cannot be performed in a too old environment. Otherwise, an exception will be reported if the class cannot be found.
Create an Android project on the following page:



Activity_main.xml is as follows:
MainActivity. java is as follows:


(7) configure the UnionPay development environment:

A) copy the corresponding resources to the corresponding directory according to the prompt of the running apk. B) import the UnionPay Demo and copy the permissions in the list file in the UnionPay Demo to our project. c) copy the payment-related Activity statement stated in the UnionPay Demo to our project.


(8) According to the running apk prompt, call the UPPayAssistEx. startPay () method for payment. Why are the parameters in this method used? Search for "startPay" in the UnionPay Demo to view the code. Refer to APKActivity. The Code is as follows:




(9) A tn parameter is required in the previous step. This tn parameter is the transaction serial number. For how to obtain this value, see BaseActivity in UnionPay Demo. The Code is as follows:


(10) For the verification result, refer to the BaseActivity implementation in UnionPay Demo. The Code is as follows:





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.