iOS Application SDK Implementation
Support iOS 9 or above
Add OTTPaySDK.framework to your project
In Link Binary With Libraries on the Build Phases tab, add the following dependencies
In build settings add $(PROJECT_DIR)/OTTPaySDK.framework/Headers
Register SDK in AppDelegate and set URL type
Note: shopID is optional for future use
Register in AppDelegate to monitor payment callback
#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
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