IOS Integrated UnionPay Payment Swift

Source: Internet
Author: User

① first add the UnionPay Payment SDK to the project:

  

② because the class library is written in C + +, you need to write a plug-in and use OC to write:

  

③ then creates a bridging file for OC with Swift and introduces a header file.

④ Payment on payment page call

I use the nsurlconnectiondelegate to do the network request, the method is to complete the load, call the plug-in method, this method has four parameters, the first is to put the results of the request, in fact, is the payment number (the actual development is using the server returned), the second "00" Represents the real environment, I passed here to represent the test environment, the third is to call this method of the controller, the fourth is to specify the proxy. Then after the call:

  

PS: After the integration of the environment, the operation will be error, errors are as follows

and the simulator or the real machine will stop at the calling page:

The solution is to find other linker flags in Bulid setting and add-OBJC, then you can!

IOS Integrated UnionPay Payment Swift

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.