# Implementation with iOS App SDK

#### &#x20;:ballot\_box\_with\_check: Add OTTPaySDK.framework into your Project

![](https://1288750261-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld5XVMQHp74noDIXTus%2F-M6kTsay57rzJxoImC6f%2F-M6kUDENaHqXKB26wHa8%2Fimage.png?alt=media\&token=c23a6b44-7361-44a3-8c0c-0b8d20646ebf)

#### :ballot\_box\_with\_check: In the Link Binary With Libraries on the Build Phases tab, add the following dependency

![](https://1288750261-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld5XVMQHp74noDIXTus%2F-M6kV-ngN91Te-fnKw8F%2F-M6kV25fz8qCFYFMlK7m%2Fimage.png?alt=media\&token=728866f4-1295-413a-ad23-b6bba8b50bfe)

#### :ballot\_box\_with\_check: Add $(PROJECT\_DIR)/OTTPaySDK.framework/Headers in Build Settings

![](https://1288750261-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld5XVMQHp74noDIXTus%2F-M6kV8BZTGYdWfu_eVKh%2F-M6kVJgmSV0xOEDTTMeR%2Fimage.png?alt=media\&token=ff51bb17-2704-442f-9083-e60b381d9b32)

#### :ballot\_box\_with\_check: Register sdk in AppDelegate to set URL Types

![](https://1288750261-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld5XVMQHp74noDIXTus%2F-M6kV8BZTGYdWfu_eVKh%2F-M6kVblQu0RdlE6DicJN%2Fimage.png?alt=media\&token=0a766fcf-621d-46ae-be9c-43411c324f47)

:point\_right: Note: shopID is optional for future usage

![](https://1288750261-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld5XVMQHp74noDIXTus%2F-M6kVfFTWgz15D7ztE3i%2F-M6kWFJwo0qTu6lJ5G8A%2Fimage.png?alt=media\&token=61c9cc99-3527-45d5-b2a4-5a8c37ac8bad)

:ballot\_box\_with\_check: Registration in AppDelegate implements to listen for payment callbacks

![](https://1288750261-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld5XVMQHp74noDIXTus%2F-M6kWR7-xgOYqVxrpk-_%2F-M6kWXrxzGk7QzmFyz0_%2Fimage.png?alt=media\&token=ef42eb63-582d-4819-ac22-d8f7991ece60)

```
#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
```

#### :ballot\_box\_with\_check: Call OTTPAY payment API

![](https://1288750261-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld5XVMQHp74noDIXTus%2F-M6kXIgPp_81o-NFmKTQ%2F-M6kX_uC3-FypkNDPXT5%2Fimage.png?alt=media\&token=3ed65254-8fb4-4597-8a89-b8ff04745983)

NOTE:&#x20;

1\. All the monetary measurement unit in API is CENT. For example, one dollar will be expressed as 100, when it is passed into API.

&#x20;2\. The AlipaySDK is connected to the sdk. If you need to use the AlipaySDK interface, you can use it directly without having to import it repeatedly.&#x20;

3\. Error message with error code:&#x20;

```
code msg
9000 订单支付成功
8000 正在处理中
4000 订单支付失败
6001 用户中途取消
6002 网络连接出错
```

:point\_right: Here is the sdk for iOS App for download

{% file src="<https://1288750261-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld5XVMQHp74noDIXTus%2F-M6leqi_uKuqXdBEs_G8%2F-M6lf2wDHg-r4aloC8ex%2Fios-sdk-ottalipay_release.zip?alt=media&token=472431d7-d204-4718-97e9-6c59f6a67d8a>" %}
