【发布时间】:2018-03-23 13:14:53
【问题描述】:
我是扩展名为 .a 的静态库的新手,我正在尝试将 atom 技术支付网关引入 iOS 应用程序。他们提供 2 个文件 1.libAtomPayLib(Live).a 2.libAtomPayLib(UAT).a 还有一个非常简短的文档
根据他们的文档,我已将 .a 文件添加到项目中,“添加了其他链接标志”“$(OTHER_LDFLAGS) -ObjC”。
文档中有一点我不明白
在构建阶段添加捆绑“resourcesLib”,选择您的项目目标(复制捆绑资源)。
以下代码来自文档
#import <UIKit/UIKit.h>
#import "nb.h"
#import "card.h"
#import "NSString+DES.h"
#import "NSData+DES.h"
@interface ViewController : UIViewController <NSXMLParserDelegate,nbDelegate,cardDelegate>
{
NSXMLParser *parser;
}
@property (weak, nonatomic) IBOutlet UIButton *InitiateRequest;
@property (nonatomic,retain) NSXMLParser *parser;
-(IBAction)callVC:(id)sender;//Call for all transaction
@end
我尝试在 viewcontroller.h 文件中使用此代码,但出现错误“nb.h not found” 我猜这些头文件来自库,如果它与项目正确链接,nb.h 将随处可用。我还在添加文档详细信息
ATOM 移动 SDK 集成
Atom 移动集成旨在使您能够通过移动应用程序处理付款。
集成类型:- 非无缝:
设置
• Create new Group in your project hierarch & add all the files from “payAtom” in it.
• Select your Project from Left Panel
• Go to targets tab & select the application
• Go to Build Setting & select Basic & Combined Tabs
• Add the following property as shown below
如果您找不到“其他链接器标志”,那么您可以执行以下步骤
• Select the project file from the project navigator on the far left side of the window.
• Select the target for where you want to add the linker flag.
• Select the "Build Settings" tab
• Choose "All" to show all Build Settings.
• Scroll down to the "Linking" section, and double-click to the right of where it says "Other Linking Flags".
• A box will appear, Click on the "+" button to add a new linker flag.
• Type "$(OTHER_LDFLAGS) -ObjC" (no quotes) and press enter.
• Add Bundle ”resourcesLib” in Build Phases selecting your project target(Copy Bundle Resources).
整合:
• Merchant will design a screen wherein he will accept all the required fields including the bank detail, payment options and card details.
• Pass the data to Library as follows in the same format:
ViewController.h 文件
#import <UIKit/UIKit.h>
#import "nb.h"
#import "card.h"
#import "NSString+DES.h"
#import "NSData+DES.h"
@interface ViewController : UIViewController <NSXMLParserDelegate,nbDelegate,cardDelegate>
{
NSXMLParser *parser;
}
@property (weak, nonatomic) IBOutlet UIButton *InitiateRequest;
@property (nonatomic,retain) NSXMLParser *parser;
-(IBAction)callVC:(id)sender;//Call for all transaction
@end
ViewController.m 文件
#import "ViewController.h"
#import "nb.h"
#import "card.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize parser;
• (void)viewDidLoad { [super viewDidLoad];
}
• (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(IBAction)callVC:(id)sender
{
nb *netB = [[nb alloc] init]; netB.myDelegate = self; netB.loginid=@"459"; netB.txnscamt=@"0"; netB.loginid=@"459"; netB.password=@"Test@123"; netB.prodid=@"NSE"; netB.txncurr=@"INR"; netB.clientcode=@"001"; netB.custacc=@"100000036600"; netB.amt=@"100.000"; netB.txnid=@"9Q6";//unique each time
netB.date=@"23/08/2010%2011:57:00";//unique each time netB.bankid=@"2001"; netB.ru=@"https://paynetzuat.atomtech.in/paynetz/param"; [self presentViewController:netB animated:YES completion:nil];
}
-(void)secondviewcontrollerDissmissed:(NSString *)stringToFirst
{
NSString *getResult; getResult = stringToFirst;
NSLog(@"received---->%@",getResult); //This will return status success or Fail of Transaction
}
@end
【问题讨论】:
-
你集成ATOM成功了吗?
-
你能解释一下这行吗?在你的项目层次结构中创建新组并将“payAtom”中的所有文件添加到其中。我有来自 ATOM 的包文件夹,在这个包里面有多个名为“payAtom”的文件夹,我真的很困惑:(
-
@KhushbuDesai 通过使用网页视图我已经成功集成了 ATOM ,简单地重用了我们网站的支付网关。我必须使用一套程序,我已将其添加到答案部分
-
@KhushbuDesai 我也是这样做的 :-) 没有其他办法,当我正式联系 atom tech 时,他们说他们没有 iOS 开发人员来解决这个问题 :-D跨度>
-
我得到了同样的回复;)
标签: ios swift static-libraries xcode9