简体   繁体   English

iOS的平衡付款集成

[英]Balanced Payment integration for iOS

I am trying to do the payment using https://www.balancedpayments.com/ . 我正在尝试使用https://www.balancedpayments.com/进行付款。 They have their iPhone library for this https://github.com/balanced/balanced-ios . 他们为此提供了iPhone库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? 问题是没有足够的文档说明如何在XCode 4.5项目中添加Balanced.framework?

  1. Download the Balanced framework . 下载Balanced框架
  2. Add Balanced.framework to your project and to Build Phases -> Link Binary With Libraries. 将Balanced.framework添加到您的项目中,并建立阶段->将二进制文件与库链接。
  3. Add CoreTelephony.framework to Build Phases -> Link Binary With Libraries. 将CoreTelephony.framework添加到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... 如果您需要更多帮助,请查看他们所附的示例项目...

You Just Need to add those Balanced- Classes as a static library, It will work out. 您只需要将那些Balanced-Class添加为静态库,它将可以解决。

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. 转到YourProject-> Target-> BuildPhases-> LinkWithBinaryLibraries,在此处添加StaticLibrary。

Hope this will help you. 希望这会帮助你。

Follow this issue on Github. 在Github上关注此问题 The lack of linking Balanced.framework is related to Xcode templates. 缺少链接Balanced.framework与Xcode模板有关。 The fix is documented in the project's "Contributing" section. 该修复程序记录在项目的“贡献”部分中。 You need to build it. 您需要构建它。

The balanced-ios project has changed quite a bit since this question was asked. 自从提出这个问题以来,balanced-ios项目已经发生了很大变化。 It now creates a static library instead of a framework. 现在,它创建一个静态库而不是框架。 This change was made for the reasons described in balanced-ios Project Architecture. 进行此更改是出于平衡iOS项目体系结构中所述的原因

To integrate balanced-ios into iOS projects, do the following: 要将Balanced-ios集成到iOS项目中,请执行以下操作:

  • Download the latest pre-built release zip from https://github.com/balanced/balanced-ios/releases https://github.com/balanced/balanced-ios/releases下载最新的预构建发行版zip。
  • Copy balanced.a to your project 将balanced.a复制到您的项目
  • Add balanced.a to Build Phases -> Link Binary With Libraries 将balanced.a添加到构建阶段->使用库链接二进制文件
  • Add CoreTelephony.framework to Build Phases -> Link Binary With Libraries 将CoreTelephony.framework添加到构建阶段->将二进制文件与库链接
  • 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. 将includes拖到您的项目中,以便您可以从那里查看文件。 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 可以在README的https://github.com/balanced/balanced-ios中找到代码用法示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM