Difference between revisions of "IOS API Documentation"
(→Import) |
|||
| Line 5: | Line 5: | ||
==Installation and Build == | ==Installation and Build == | ||
| + | <code> | ||
#Unzip Payment.zip | #Unzip Payment.zip | ||
#Copy Payment/ folder to project_root | #Copy Payment/ folder to project_root | ||
| Line 11: | Line 12: | ||
#target->Build Settings->Other Linker Flags<br>:Add -Objc, -lc++, -all_load | #target->Build Settings->Other Linker Flags<br>:Add -Objc, -lc++, -all_load | ||
#target->Build Settings->Enable bitcode->No | #target->Build Settings->Enable bitcode->No | ||
| + | </code> | ||
==Import== | ==Import== | ||
Import Payment.h in header file of UIViewController<br> | Import Payment.h in header file of UIViewController<br> | ||
<code> | <code> | ||
| − | //ViewController.h | + | //ViewController.h |
| − | /#import "Payment.h" | + | /#import "Payment.h" |
</code> | </code> | ||
| − | + | To initialize library functions, write below code in the implementation file<br> | |
| + | <code> | ||
[[Payment sharedMySingleton] initializeReactView:self] | [[Payment sharedMySingleton] initializeReactView:self] | ||
| + | </code> | ||
<code> | <code> | ||
| − | //ViewController.m | + | //ViewController.m |
| − | - (void)viewDidLoad { | + | - (void)viewDidLoad { |
| − | [super viewDidLoad]; | + | [super viewDidLoad]; |
| − | [[Payment sharedMySingleton] initializeReactView:self]; | + | [[Payment sharedMySingleton] initializeReactView:self]; |
} | } | ||
</code> | </code> | ||
| Line 33: | Line 37: | ||
===Request=== | ===Request=== | ||
<code> | <code> | ||
| − | NSMutableDictionary *data = [@{ | + | NSMutableDictionary *data = [@{ |
| − | @"apiCall":@{ | + | @"apiCall":@{ |
| − | @"url": @"https://testlink.c9pg.com:5551/hj", | + | @"url": @"https://testlink.c9pg.com:5551/hj", |
| − | @"method": @"POST", | + | @"method": @"POST", |
| − | @"data": @{ | + | @"data": @{ |
| − | @"GMID": @"1234", | + | @"GMID": @"1234", |
| − | @"GTID": @"1234", | + | @"GTID": @"1234", |
| − | @"GWPW": @"1234", | + | @"GWPW": @"1234", |
| − | @"MainAmt": @"123", | + | @"MainAmt": @"123", |
| − | + | ||
| − | } | + | } |
| − | } | + | } |
| − | } mutableCopy]; | + | } mutableCopy]; |
| − | [[Payment sharedMySingleton] send:data]; | + | [[Payment sharedMySingleton] send:data]; |
</code> | </code> | ||
===Response=== | ===Response=== | ||
| − | Response of api call will be received at onResponseCallback | + | Response of api call will be received at onResponseCallback<br> |
| − | Response object contains request and responseJson. | + | Response object contains request and responseJson. |
<code> | <code> | ||
| − | //ViewController.m | + | //ViewController.m |
| − | - (void)onResponseCallback:(id)response { | + | - (void)onResponseCallback:(id)response { |
| − | NSLog(@"%@", response); | + | NSLog(@"%@", response); |
| − | NSString *string = [NSString stringWithFormat:@"%@", [response objectForKey:@"responseJson"]]; | + | NSString *string = [NSString stringWithFormat:@"%@", [response objectForKey:@"responseJson"]]; |
| − | NSLog(@"%@", string); | + | NSLog(@"%@", string); |
| − | } | + | } |
</code> | </code> | ||
Revision as of 20:45, 20 September 2017
Cloud9 Payment Gateway Documentation. This site can also be reached at http://docs.cloud9paymentgateway.com
Contents
Download iOS SDK Library
Please use this link to download the library: iOS SDK Library
Installation and Build
- Unzip Payment.zip
- Copy Payment/ folder to project_root
- Open xcode and drag project_root/Payment/ folder to xcode project (select copy if needed)
- target->Build Settings->Objective-C Automatic Reference Counting
:Debug - No
:Release - No - target->Build Settings->Other Linker Flags
:Add -Objc, -lc++, -all_load - target->Build Settings->Enable bitcode->No
Import
Import Payment.h in header file of UIViewController
//ViewController.h
/#import "Payment.h"
To initialize library functions, write below code in the implementation file
[[Payment sharedMySingleton] initializeReactView:self]
//ViewController.m
- (void)viewDidLoad {
[super viewDidLoad]; [[Payment sharedMySingleton] initializeReactView:self];
}
Usage
Request
NSMutableDictionary *data = [@{
@"apiCall":@{
@"url": @"https://testlink.c9pg.com:5551/hj",
@"method": @"POST",
@"data": @{
@"GMID": @"1234",
@"GTID": @"1234",
@"GWPW": @"1234",
@"MainAmt": @"123",
}
}
} mutableCopy];
[[Payment sharedMySingleton] send:data];
Response
Response of api call will be received at onResponseCallback
Response object contains request and responseJson.
//ViewController.m
- (void)onResponseCallback:(id)response {
NSLog(@"%@", response); NSString *string = [NSString stringWithFormat:@"%@", [response objectForKey:@"responseJson"]]; NSLog(@"%@", string);
}
From the makers of Cloud9 Payment Processing Gateway and Creditline Credit Card Processing Software