> 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" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ottpay.com/payment-api/in-app-alipay/ios-dev-environment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
