Difference between revisions of "IOS API Documentation"

From Cloud9 Payment Processing Gateway Documentation
Jump to: navigation, search
(Download iOS SDK Library)
Line 1: Line 1:
 
{{Template:C9Header|iOS Integration}}
 
{{Template:C9Header|iOS Integration}}
 
[[image:iOS.jpg|thumb|HTTP API Sample Screenshot|link=http://cloud9paymentgateway.com/files/PDC/iOS/]]<br>
 
[[image:iOS.jpg|thumb|HTTP API Sample Screenshot|link=http://cloud9paymentgateway.com/files/PDC/iOS/]]<br>
==Download iOS SDK Library==
+
=Download iOS SDK Library=
 
'''[http://cloud9paymentgateway.com/files/PDC/iOS/ iOS SDK Library Download]'''
 
'''[http://cloud9paymentgateway.com/files/PDC/iOS/ iOS SDK Library Download]'''
  
==Download iOS Sample Project==
+
=Integration Steps=
'''[http://cloud9paymentgateway.com/files/API/samples/iOS iOS Sample Project Download]'''
+
==iPassthruManager - Communication with Multiplexer (Payment Terminal Communication Server)==
 
+
#Implement the protocol IPassthruNotificationSupport
==Installation and Build ==
+
#Call initWithDelegate to instantiated the iPassthruManager class.
#Unzip Payment.zip
+
#Call setConnectionWithHost to set the Multiplexer host and port
#Copy Payment/ folder to project_root
+
#Call Start to connect to Multiplexer and connect to the ICM122 via bluetooth
#Open xcode and drag project_root/Payment/ folder to xcode project (select copy if needed)
+
#Call Stop to disconnect the above connections.
#'''target->Build Settings->Other Linker Flags'''<br>Add -Objc, -lc++, -all_load
 
#'''target->Build Settings->Enable bitcode'''->No
 
 
 
==Verify Search Paths==
 
To avoid the Apple Linker Errors:<br>
 
#'''target->Build Settings->Library Search paths'''<br>* Path of the payment library - eg '''$(PROJECT_DIR)/CardTest/Payment'''<br>* Path of the react - eg '''$(PROJECT_DIR)/CardTest/Payment/React'''
 
#'''target->Build Phases->Link Binary With Libraries'''<br>Add these files:<br>* Click + -> select libPayment.a (Payment/libPayment.a)<br>* Click + -> select libPaymentPhone.a (Payment/libPaymentPhone.a)<br>* Click + -> select libReact.a (Payment/React/libReact.a)
 
#'''target->Build Phases->Copy Bundle Resources'''<br>Click + -> select main.jsbundle (Payment/include/main.jsbundle)
 
 
 
==Import==
 
Import '''Payment.h''' in header file of  '''UIViewController'''<br>
 
<syntaxhighlight lang="cpp">
 
//ViewController.h
 
#import "Payment.h"
 
</syntaxhighlight>
 
 
 
==Initialization==
 
To initialize library functions, write below code in the implementation file<br>
 
<syntaxhighlight>
 
[[Payment sharedMySingleton] initializeReactView:self]
 
 
 
//ViewController.m
 
- (void)viewDidLoad {
 
    [super viewDidLoad];
 
    [[Payment sharedMySingleton] initializeReactView:self];
 
}
 
</syntaxhighlight>
 
 
 
==Usage==
 
===Request===
 
<syntaxhighlight>
 
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];
 
</syntaxhighlight>
 
 
 
===Response===
 
Response of api call will be received at '''onResponseCallback'''<br>
 
Response object contains request and response Json.<br>
 
<syntaxhighlight>
 
//ViewController.m
 
- (void)onResponseCallback:(id)response {
 
    NSLog(@"%@", response);
 
    NSString *string = [NSString stringWithFormat:@"%@", [response objectForKey:@"responseJson"]];
 
    NSLog(@"%@", string);
 
}
 
</syntaxhighlight>
 
 
 
  
 +
==iPDCManager - Communication with Cloud9 Payment Web Device Controller(PWC)==
 +
#Implement the protocol IPDCManagerNotify
 +
#Call initWithDelegate to instantiated the iPDCManager class.
 +
#Call postTransactionToUrl to send a JSON request to Cloud-PDC via https protocol.
  
 +
=Protocol Reference=
 +
*IPassthruManagerNotifyClient is used for ICM122 communication event notify.
 +
*IPassthruManagerNotifySSL is used for Multiplexer communication event notify.
 +
*ServerToClientDataSent is triggered after sending data to ICM122.
 +
*ClientToServerDataSent is triggered after sending data to Multiplexer.
 +
*HttpsDataReceived is triggered when a Cloud-PDC response is receieved.
 +
*HttpsErrorOccurred is triggered when the https connection encounter a error.
  
 
{{Template:C9Footer|Integration}}
 
{{Template:C9Footer|Integration}}

Revision as of 09:49, 4 January 2018




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

HTTP API Sample Screenshot

Download iOS SDK Library

iOS SDK Library Download

Integration Steps

iPassthruManager - Communication with Multiplexer (Payment Terminal Communication Server)

  1. Implement the protocol IPassthruNotificationSupport
  2. Call initWithDelegate to instantiated the iPassthruManager class.
  3. Call setConnectionWithHost to set the Multiplexer host and port
  4. Call Start to connect to Multiplexer and connect to the ICM122 via bluetooth
  5. Call Stop to disconnect the above connections.

iPDCManager - Communication with Cloud9 Payment Web Device Controller(PWC)

  1. Implement the protocol IPDCManagerNotify
  2. Call initWithDelegate to instantiated the iPDCManager class.
  3. Call postTransactionToUrl to send a JSON request to Cloud-PDC via https protocol.

Protocol Reference

  • IPassthruManagerNotifyClient is used for ICM122 communication event notify.
  • IPassthruManagerNotifySSL is used for Multiplexer communication event notify.
  • ServerToClientDataSent is triggered after sending data to ICM122.
  • ClientToServerDataSent is triggered after sending data to Multiplexer.
  • HttpsDataReceived is triggered when a Cloud-PDC response is receieved.
  • HttpsErrorOccurred is triggered when the https connection encounter a error.





From the makers of Cloud9 Payment Processing Gateway and Creditline Credit Card Processing Software