Balanced Payment integration for iOS

两盒软妹~` 提交于 2019-12-13 04:24:16

问题


I am trying to do the payment using https://www.balancedpayments.com/ . They have their iPhone library for this https://github.com/balanced/balanced-ios . The problem is that there is not enough documentation on how the Balanced.framework has to be added in the XCode 4.5 project?


回答1:


  1. Download the Balanced framework.
  2. Add Balanced.framework to your project and to Build Phases -> Link Binary With Libraries.
  3. Add CoreTelephony.framework to Build Phases -> Link Binary With Libraries.

Usage:

#import <Balanced/Balanced.h>
Balanced *balanced = [[Balanced alloc] initWithMarketplaceURI:@"/v1/marketplaces/TEST-MP2autgNHAZxRWZs76RriOze"];
BPCard *card = [[BPCard alloc] initWithNumber:@"4242424242424242" expirationMonth:8 expirationYear:2025 securityCode:@"123"];

If you need more help, look at the example project they have attached...




回答2:


You Just Need to add those Balanced- Classes as a static library, It will work out.

Add a Static Library to your Project. Now add those balanced classes to your static Library.

Goto YourProject->Target->BuildPhases->LinkWithBinaryLibraries Here add the StaticLibrary.

Hope this will help you.




回答3:


Follow this issue on Github. The lack of linking Balanced.framework is related to Xcode templates. The fix is documented in the project's "Contributing" section. You need to build it.




回答4:


The balanced-ios project has changed quite a bit since this question was asked. It now creates a static library instead of a framework. This change was made for the reasons described in balanced-ios Project Architecture.

To integrate balanced-ios into iOS projects, do the following:

  • Download the latest pre-built release zip from https://github.com/balanced/balanced-ios/releases
  • Copy balanced.a to your project
  • Add balanced.a to Build Phases -> Link Binary With Libraries
  • Add CoreTelephony.framework to Build Phases -> Link Binary With Libraries
  • Copy includes/balanced to your project's include folder (or create an include folder and copy includes/balanced to it) includes is automatically included in header search paths. Drag includes to your project so you can see the files from there. If you copy the include files to a location other than includes you'll probably need to add the path to User Header Search Paths in your project settings

Code usage examples can be found in the README at https://github.com/balanced/balanced-ios



来源:https://stackoverflow.com/questions/16786283/balanced-payment-integration-for-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!