iOS development--bison detailed payment integration Pinterest

Source: Internet
Author: User
Tags color representation

"Recently, because the company project needs to be integrated payment, the document is not very clear, encountered some pits, so record, hope to help people who need." "

The previous simple integration did not encounter any pits, here to organize the official integration documentation, the steps are as follows

Import file

Add header File Reference

Set the link flag target->build Setting, other Linker flags set to-all_load
It may be possible to add-all_load after conflicts with other libraries, you can try to use-force_load separate load library, Force_load followed by the full path of the Lib library
-force_load $ (srcroot)//libpaysdkcolor.a (* needs to be determined by the path you place in your library)

Invoke SDK display, note retain, after automatic release, will crash after call

self.sdk = [[[LLPaySdk alloc] init] autorealse]; // 创建self.sdk.sdkDelegate = self; // 设置回调NSDictionary* signedDic = [payUtil signedOrderDic:orderParam andSignKey:md5key_or_rsakey] // 加过签名的订单字典[self.sdk presentPaySdkInViewController:rootVC withTraderInfo:signedDic];

Write a result callback

// 订单支付结果返回,主要是异常和成功的不同状态- (void)paymentEnd:(LLWalletPayResult)resultCode withResultDic:(NSDictionary *)dic
SDK Configurable section

The IOS SDK can be customized by modifying the resource bundle, because it is inside the bundle, please clean proj after the change, so it will take effect.

1, the picture replacement, in the internal picture can replace the change bit own style

2, color and other changes, you can modify the Default.css file, support #abcdef,123,123,123 two color representation

3, modify the value of meaning list

Navigation bar Color: Replace the Shoushi3.png file, and modify the NavBar field in the CSS file (only the fields are represented in the Default.css file) background-color
Navigation bar title: Titleiconname in the NavBar field; TitleText

Note A bit of pit is here, this is not the first time to pay when the popup box customization, frame background can not be changed, can only modify the color to match with the app

The following changes are in place:



! [Uploading lianlianzhifu01_768352.png ...]

Confirm button: #a-button
Cancel button: #b-button
Text box: Uitextfield
Confirmation of the popup dialog font color: #TX-3

The official original effect is the following:


Lianlianzhifu01.png

This is done after the modification:


Lianlianzhifu02.png parameter Field section

The parameter description has in the demo, can refer to. Field name and WAP inconsistency, please refer to the description of the parameters in the demo, the parameters of the user_id is not the merchant number, is the merchant's own system user number, the front card input, No_agree is through the API query the number of binding card

Use part

The entries in the demo are used to test various payment conditions, including authentication payment (input name, id), Pre-payment (input card number, agreement number). Not required, please test according to your own payment method.
The number of supported banks, according to the type of payment and the merchant, can be configured, please contact the operation.
Payment of the verification method (SMS, gesture code, payment password) needs to be configured by our server personnel, please contact the relevant server docking personnel.

Problems

Signature please use server-side signature as far as possible, if using client signature, please use Payutil in demo

1. Run a direct crash

Answer: The SDK is not retain.

2. Class extensions are used in the SDK, please add-all_load in the other link flag

3. Prompt initialization error

A: 1, check the environment and merchant number and so on whether the match, 2, check whether the signature method is correct (refer to the Signature tool), 3, the order information whether there are missing items;

4. Initialization of common error hints, explanations, and coping methods

1, the type of transmission is not nsstring
Explanation: The order must be passed the order form {"Strkey": "strvalue", "Strkey1″:" Strvalue2 "}, please do not pass {" key ": [V1, v2]} or {" key ": {" Ikey ":" V "}} This
Response, modify the format of the value in the order, especially Risk_item, need to become {"Risk_item": "{\" r_key\ ": \" V\ "}"} so

2, the merchant does not have this payment product permission

Explanation: Our products are divided into authentication payment, quick payment and many other payment methods. A payment method corresponding to the package, payment call methods, merchant numbers are different.
Response: First check whether the merchant number is the correct merchant number, such as < certification payment Test Merchant number 201408071000001543> < quick pay Test merchant number 201408071000001546>
Then check that the corresponding package or call method is not correct. In iOS, a dedicated calling method has been extracted.

// 快捷支付- (void)presentQuickPaySdkInViewController:(UIViewController*)viewController withTraderInfo:(NSDictionary*)traderInfo;// 认证支付- (void)presentVerifyPaySdkInViewController:(UIViewController*)viewController withTraderInfo:(NSDictionary*)traderInfo;

3, the merchant does not have this payment permission
Explanation: a merchant number corresponding to the commodity business type is limited.
Response: Modify merchant Business Type Busi_partner is a String (6) Virtual merchandise sales: 101001
Physical merchandise Sales: 109001
External Account Recharge: 108001

4. Signature verification is incorrect
Explanation: The signature has specific rules, and the specific parameters inside the order participate in the signature.
Response: The Payutil function is available in the latest demo of iOS and can be called directly to generate a properly signed order. Then again, we advise the merchant to complete the signature operation on the server side.

After the payment succeeds, does not need to do the extra processing, the backstage side through the callback address has already submitted, but when integrates the dictionary inside the Notify_url is the server's callback address, this address is the background personnel integration repeatedly pays.

After continuing to encounter the pit there is a need to apply for Merchant product configuration table such as:



! [Uploading lianlianzhifu03_844594.png ...]

There are also the Silver Merchant configuration table such as:


Lianlianzhifu03.png


The most pit father is the "risk control parameters", need 8, and the demo only wrote one, did not say to write other, the parameters are as follows:

/*frms_ware_category  *商品类目(固定2009)user_info_mercht_userno 商户用户唯一标识(token)user_info_bind_phone 绑定手机号(已有)user_info_dt_register 注册时间user_info_full_name  用户注册姓名(认证姓名)user_info_id_no 用户注册证件号码user_info_identify_state 是否实名认证 1是0非user_info_identify_type 实名认证方式*/

Copyright belongs to ©bison All if need to reprint please keep original hyperlink address! Otherwise the consequences are self-esteem!

    • It Blog-ios developer Quiz Community-read reviews, compare user ratings, view screenshots and learn more about the IT Blog-ios developer Quiz Community, big God online for you. Download the IT Blog-ios Developer Quiz Community, great God online for you and enjoy on your iPhone, IPad and IPod touch. Bison? itunes.apple.com→
    • Bison Technology Blog –ios Development-Self-paced iOS development Advanced preferred blog, sharing high-quality iOS development technology, development of the difficult diseases encountered, in this all sweeping, search for excellent third-party open source framework, share to everyone, iOS Development technology blog, Walk along the boulevard of iOS development with bison. Bison? allluckly.cn→
    • Sindrilin's small nest-Blog for Sindrilin-hi, I ' m Lin Sindri, an IOS coder, now work in Shenzhen Bison? sindrilin.com→



Wen/bison (author of Jane's book)
Original link: http://www.jianshu.com/p/64468fbe04ab
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

iOS development--bison detailed payment integration Pinterest

Related Article

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.