> For the complete documentation index, see [llms.txt](https://docs.ottpay.com/payment-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ottpay.com/payment-api/in-app-alipay/ios-dev-environment.md).

# Implementation with iOS App SDK

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

![](/files/-M6kUDENaHqXKB26wHa8)

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

![](/files/-M6kV25fz8qCFYFMlK7m)

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

![](/files/-M6kVJgmSV0xOEDTTMeR)

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

![](/files/-M6kVblQu0RdlE6DicJN)

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

![](/files/-M6kWFJwo0qTu6lJ5G8A)

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

![](/files/-M6kWXrxzGk7QzmFyz0_)

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

![](/files/-M6kX_uC3-FypkNDPXT5)

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="/files/-M6lf2wDHg-r4aloC8ex" %}
