Difference between revisions of "IOS API Documentation"

From Cloud9 Payment Processing Gateway Documentation
Jump to: navigation, search
(Import)
Line 34: Line 34:
 
==Usage==
 
==Usage==
 
===Request===
 
===Request===
<code>
+
<syntaxhighlight lang="js">
 
NSMutableDictionary *data = [@{
 
NSMutableDictionary *data = [@{
 
                         @"apiCall":@{
 
                         @"apiCall":@{
Line 49: Line 49:
 
                   } mutableCopy];
 
                   } mutableCopy];
 
[[Payment sharedMySingleton] send:data];
 
[[Payment sharedMySingleton] send:data];
</code>
+
</syntaxhighlight>
 
===Response===
 
===Response===
 
Response of api call will be received at onResponseCallback<br>
 
Response of api call will be received at onResponseCallback<br>
 
Response object contains request and responseJson.
 
Response object contains request and responseJson.
<code>
+
<syntaxhighlight lang="json">
 
//ViewController.m  
 
//ViewController.m  
 
- (void)onResponseCallback:(id)response {
 
- (void)onResponseCallback:(id)response {
Line 60: Line 60:
 
     NSLog(@"%@", string);
 
     NSLog(@"%@", string);
 
}
 
}
</code>
+
</syntaxhighlight>
  
  

Revision as of 20:57, 20 September 2017




Cloud9 Payment Gateway Documentation. This site can also be reached at http://docs.cloud9paymentgateway.com

HTTP API Sample Screenshot

Download iOS SDK Library

Please use this link to download the library: iOS SDK Library

Installation and Build

  1. Unzip Payment.zip
  2. Copy Payment/ folder to project_root
  3. Open xcode and drag project_root/Payment/ folder to xcode project (select copy if needed)
  4. target->Build Settings->Objective-C Automatic Reference Counting
    :Debug - No
    :Release - No
  5. target->Build Settings->Other Linker Flags
    :Add -Objc, -lc++, -all_load
  6. 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