iOS_Passion
iOS_Passion

Reputation: 788

Balanced Payment integration for iOS

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?

Upvotes: 0

Views: 479

Answers (4)

Remear
Remear

Reputation: 1937

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

Upvotes: 1

tzmartin
tzmartin

Reputation: 96

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.

Upvotes: 1

Sj.
Sj.

Reputation: 1724

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.

Upvotes: 1

lakshmen
lakshmen

Reputation: 29084

  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...

Upvotes: 3

Related Questions