iOS Application SDK Implementation
Support iOS 9 or above
Add OTTPaySDK.framework to your project
![](image%20%285%29.png)
In Link Binary With Libraries on the Build Phases tab, add the following dependencies
![](image%20%2819%29.png)
In build settings add $(PROJECT_DIR)/OTTPaySDK.framework/Headers
![](image%20%289%29.png)
Register SDK in AppDelegate and set URL type
![](image%20%2818%29.png)
Note: shopID is optional for future use
![](image%20%2811%29.png)
Register in AppDelegate to monitor payment callback
![](image%20%283%29.png)
#ifdef IOS9
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options{
[OTTPaySDK application:application handleOpenURL:url];
return YES;
}
#else
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString
*)sourceApplication annotation:(id)annotation{
[OTTPaySDK application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
return YES;
}
#endif
Call OTTPAY payment API
![](image%20%286%29.png)
NOTE:
-
All currency units of measurement in the API are CENT. For example, CAD 1.00 will be represented as “100” when passed into the API.
-
AlipaySDK connects to the SDK. If you need to use the AlipaySDK port, you can use it directly without repeated import.
-
Return code and return messages:
code msg
9000 Order paid successfully
8000 are being processed
4000 Order payment failed
6001 User canceled midway
6002 Network connection error