Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

Оглавление

General work with OTAPI

All methods are available on documentation page: http://docs.otapi.net/en.

...

In some cases, the error message must be shown to the user. It is stored in the Errordescription node and comes with the translation for the language specified when querying in the 'language' parameter.

Application start

You need to get application settings when you start ithttp://docs.otapi.net/en/Documentations/Method?name=GetCommonInstanceOptionsInfo with parameter applicationType=MobileApplication.

...

The first time mobile application starts, it must ask user for permission to receive push notifications. It is necessary to send application push token to the services http://docs.otapi.net/ru/Documentations/Method?name=SetUserPushNotificationToken if the user agreed to receive push notifications. Application should monitor relevance of the push token and update it if necessary in the future.

Receiving session (user authorization)

Working with the user - highlights

Some otapi methods require customer's session parameter. It's necessary to get a sesstion bfore working with logic for users. Initially, you need to get an anonymous session using http://docs.dev.otapi.net/en/Documentations/Method?name=GetAnonymousSession method so that the shopping cart, preferences (for example) and so on could be saved on it. All data will be automatically transferred if the previous anonymous session was transferred during authorization. Obtained session must be saved in the application memory and used later for all requests.

...

The easiest way to force session verification by http://docs.otapi.net/en/Documentations/Method?name=GetUserStatusInfo method. It is the least time consuming.

Registration

User registration is carried out by http://docs.otapi.net/en/Documentations/Method?name=RegisterUser method
Check input data before calling this method:

...

Check Result-> IsEmailVerificationUsed field in the response after successful registration using RegisterUser method. Show message to user "An email was sent to your mail with a link to activation to activate account" if IsEmailVerificationUsed = "true". You need to authorize user immediately (set a new SessionId for him received in response to services) if IsEmailVerificationUsed = "false".

Activation after registration

Together with the message that email was sent, you need to display input field for activation code. You should call http://docs.otapi.net/en/Documentations/Method?name=ConfirmEmail when user checks email and enters the code in the application. There is a field Result->SessionId->Value in response ConfirmEmail which contains authorized user session. Based on this session, you must immediately authorize user in the application.

Authorization

Users' authorization is carried out by http://docs.otapi.net/en/Documentations/Method?name=Authenticate method.
Authorization form should contain the following fields: login (userLogin), password (userPassword) and remember me flag (rememberMe). Check input data before calling Authenticate method:

...

Login as well as user's email can be transferred as userLogin. Probably it is worthwhile to somehow suggest this in the interface.

Social networks authorization

Social Networks Authorization (OT API)

Get the list of available social networks in settings Список социальных сетей надо брать в настройках от GetCommonInstanceOptionsInfo в зависимости от текущего языка, так как например админ может оставить ВКонтакт для русского, и убрать для английского. Смотреть в TranslatableOptions->выбор по языку->ExternalAuthentications.

Password recovery

Password recovery is done by http://docs.otapi.net/en/Documentations/Method?name=RequestPasswordRecovery method.  
Field userIdentifier may contain user login or email. After calling RequestPasswordRecovery, show user the message "Further instructions were sent to your email" and display a form with confirmation code and two text fields for entering the password. User checks code in the email, returns to the application, enters the code and new password. If both fields with password match, then you need to call http://docs.otapi.net/en/Documentations/Method?name=ConfirmNewPassword. ConfirmNewPassword response has Result-> SessionId-> Value field that contains an authorized user session. Based on this session, you need to authorize user in the application immediately.

Application home page

Get collections

Use http://docs.otapi.net/en/Documentations/Method?name=BatchSearchRatingLists method to get collections. We pass the following parameters at the first request:

...

Thus, we get a situation when buyer sees collections from cache. At the same time, collections in the cache have no errors. Situation is possible when we show user outdated information, while we are sure that this information is error-free.

Get banners

You can get a full list of banners configured for application by http://docs.otapi.net/en/Documentations/Method?name=GetBanners method, passing applicationType=MobileApplication parameter.

...

Тип действияПараметр

Url

Absolute address of the link to open when you click banner

Category

ID of the category that should be opened when clicking the banner


Short categories menu

TODO:

Social networks

TODO:

User Preferences

  • Currencies. The list of available currencies must be shown from application settings GetCommonInstanceOptionsInfo Currencies node.
  • Delivery country. The list of available countries must be shown from application settings GetCommonInstanceOptionsInfo DeliveryCountries node. The list of countries must be displayed taking into account current language of application (all translations can be found in TranslatableOptions node).
  • Application language. Show the list of available application languages from application settings GetCommonInstanceOptionsInfo Languages node.

...

Application interface should allow users to change their preferences.

Categories list

Send a request first: http://docs.otapi.net/en/Documentations/Method?name=GetRootCategoryInfoList - we get a list of website root categories. This list can be cached for 24 hours. Then make a separate request for attempt to expand each category - http://docs.otapi.net/en/Documentations/Method?name=GetCategorySubcategoryInfoList. Each list can be also cached for 24 hours using parent category identifier in the key.

...

Absolute image address for category can be returned (image is set by administrator in admin panel) in the optional <IconImageUrl> node http://open-demo.otcommerce.com/uploaded/category/zh_odezhda.jpg </IconImageUrl>.

Recomended vendors page

http://docs.otapi.net/en/Documentations/Method?name=BatchSearchRatingLists method, xmlSearchParameters=

...

FrameSize - number of vendors on the page, TotalCount will be returned in the response - the total number of recommended vendors. You can draw pagination based on TotalCount and FrameSize.

Recomended brands page

http://docs.otapi.net/en/Documentations/Method?name=BatchSearchRatingLists method, xmlSearchParameters=

...

FrameSize - number of brands on the page, TotalCount will be returned in the response - the total number of recommended brands. You can draw pagination based on TotalCount and FrameSize.

Vendors display

The following properties should be used on recommended vendors page, in product card in vendor's block, for viewing all goods of vendor and for displaying information about the vendor:

Property
Description
Where to show
Comments
DisplayNamevendor nameeverywhere

Thanks to this, website admin will be able to change names later, but nothing will change in Mobile Application logic.

DisplayPictureUrlvendor imageeverywhere

Only if available, otherwise there is an image stub in recommended vendors, do not display in other places.

Thanks to this, website admin will be able to change images but nothing will change in Mobile Application logic.

 

Credit/Levelvendor rating from 1 to 20

in product card
on vendor's page

Only if available and more than 0, otherwise it does not need to be displayed.
Credit/TotalFeedbacksnumber of feedbacksin product card
on vendor's page
Only if available and more than 0, otherwise it does not need to be displayed.
Credit/PositiveFeedbacksnumber of positive feedbacksin product card
on vendor's page
Only if available and more than 0, otherwise it does not need to be displayed.
Display as% of total reviews if available.
Scores/DeliveryScoredelivery scrore from 1.0 to 5.0in product card
on vendor's page

Only if available and more than 0, otherwise it does not need to be displayed.

Scores/ItemScoreitem score from 1.0 to 5.0in product card
on vendor's page

Only if available and more than 0, otherwise it does not need to be displayed.

Scores/ServiceScore
service score from 1.0 to 5.0
in product card
on vendor's page

Only if available and more than 0, otherwise it does not need to be displayed.

Basic documentation on search.

...

This approach will allow you to localize search logic and services will be responsible for page display logic.

Product card

Use http://docs.otapi.net/en/Documentations/Method?name=BatchGetSimplifiedItemFullInfo when you open the card for the first time, it's necessary to send the following parameters: RootPath,Vendor,MostPopularVendorItems16,Description

...

 

Раскрыть
titleCustomer did not choose anything
<Request />
equal to
<Request>
    <Current />
</Request>
equal to
<Request>
    <Current Quantity="1" />
</Request>
Раскрыть
titleRequest with quantity in a product without options at all or without selected options
<Request>
    <Current Quantity="5" />
</Request>
Request to current options:
<Request>
    <Current ConfigurationId="idconfiguration" />
</Request>
or
<Request>
    <Current ConfigurationId="idconfiguration" Quantity="5" />
</Request>
or
<Request>
    <Current>
        <Property Id="idcolor" ValueId="idRed"
    </Current>
</Request>
or
<Request>
    <Current>
        <Property Id="idcolor" ValueId="idRed"
        <Property Id="idSize" ValueId="idMiddle"
    </Current>
</Request>
or
<Request>
    <Current Quantity="5">
        <Property Id="colorid" ValueId="idRed"
        <Property Id="idSize" ValueId="idMiddle"
        <Property Id="idModel" ValueId="idSomeModel"
    </Current>
</Request>
Раскрыть
titleRequest with selected other configurations
<Request>
    <Selected ConfigurationId="idConfiguration" Quantity="1" />
    <Selected ConfigurationId="idConfiguration" Quantity="2" />
    ...
</Request>
or
<Request>
    <Selected Quantity="1">
        <Property Id="idColor" ValueId="idRed"
        <Property Id="idSize" ValueId="idMiddle"
    </Selected>
    <Selected Quantity="2">
        <Property Id="idColor" ValueId="idGreen"
        <Property Id="idSize" ValueId="idMiddle"
    </Selected>
    ...
</Request>

A query with everything together can be any combination of other types of queries, for example:
<Request>
    <Current Quantity="5">
        <Property Id="idColor" ValueId="idRed"
    </Current>
    <Selected Quantity="2">
        <Property Id="idColor" ValueId="idGreen"
        <Property Id="idSize" ValueId="idMiddle"
    </Selected>
</Request>


What's Current/Selected - and what's correct? Current or Selected?

If you need only 1 simultaneously selected config, then you can not think about Selected at all.
If you need several (as in 1688), then in Selected send everything where the quantity is entered.

 

Favourite goods

Get list of itemshttp://docs.otapi.net/en/Documentations/Method?name=BatchGetUserData , blockList=Note.

Add item to favorites: http://docs.otapi.net/en/Documentations/Method?name=AddItemToNote , fieldParameters=<Fields/>

Remove item from favorites: http://docs.otapi.net/en/Documentations/Method?name=RemoveItemFromNote , confirmation to delete is required before removing.

Move item into cart: http://docs.otapi.net/en/Documentations/Method?name=MoveItemFromNoteToBasket

Change item quantity in favorites: http://docs.otapi.net/en/Documentations/Method?name=EditNoteItemQuantity

Change commenthttp://docs.otapi.net/en/Documentations/Method?name=EditNoteItemFields , <Fields><FieldInfo Name="Comment" Value="Text for comment"/></Fields>

Change item configuration:
1. you can get available configurations by the following methods http://docs.otapi.net/en/Documentations/Method?name=BatchGetSimplifiedItemFullInfo and http://docs.otapi.net/en/Documentations/Method?name=BatchGetSimplifiedItemConfigurationInfo - similar to item card.
2. new configuration is saved by adding a new one and deleting the old one, i.e. consecutive calls http://docs.otapi.net/en/Documentations/Method?name=AddItemToNote (it is important to pass all fieldParameters from the old record into the method, otherwise you may lose some of information, for example, user’s comment on a product) and http://docs.otapi.net/en/Documentations/Method?name=RemoveItemFromNote 

Favorite sellers

Vendors list: http://docs.otapi.net/en/Documentations/Method?name=BatchGetUserData , blockList=FavoriteVendors

Add vendor to favorites: http://docs.otapi.net/en/Documentations/Method?name=AddVendorToFavorites , fieldParameters=<Fields/>

Remove vendor from favorites: http://docs.otapi.net/en/Documentations/Method?name=RemoveVendorFromFavorites , confirmation to delete is required before removing.

Cart

Get list of items: http://docs.otapi.net/en/Documentations/Method?name=BatchGetUserData , blockList=Basket.

The list of goods should be divided by providers, as you can order goods of only one provider in one order. User should be notified about minimum order amount (if it is set in configuration), you can get it using http://docs.otapi.net/en/Documentations/Method?name=GetCommonInstanceOptionsInfo method (Result->Order->MinOrderCost)

Remove item from cart: http://docs.otapi.net/en/Documentations/Method?name=RemoveItemFromBasket , confirmation to delete is required before removing.

Empty cart http://docs.otapi.net/en/Documentations/Method?name=ClearBasket , confirmation to delete is required before removing.

Move selected item from cart to favorites: http://docs.otapi.net/en/Documentations/Method?name=MoveItemFromCartToNote several calls are made to transfer several marked products MoveItemFromCartToNote

Change quantity of items in the cart: http://docs.otapi.net/en/Documentations/Method?name=EditBasketItemQuantity

Add/edit comment to item: http://docs.otapi.net/en/Documentations/Method?name=EditBasketItemFields <Fields><FieldInfo Name="Comment" Value="Comment text"/></Fields>

Edit item weight: http://docs.otapi.net/en/Documentations/Method?name=EditBasketItemFields <Fields><FieldInfo Name="Weight" Value="New weight of an item"/></Fields>

Edit item configuration:
1. you can get available configurations by http://docs.otapi.net/en/Documentations/Method?name=BatchGetSimplifiedItemFullInfo and http://docs.otapi.net/en/Documentations/Method?name=BatchGetSimplifiedItemConfigurationInfo methods - similar to item card.
2. new configuration is saved by adding a new one and deleting the old one, i.e. consecutive calls http://docs.otapi.net/en/Documentations/Method?name=AddItemToBasket (it is important to pass all fieldParameters from the old record into the method, otherwise you may lose some of information, for example, user’s comment on a product) and http://docs.otapi.net/en/Documentations/Method?name=RemoveItemFromBasket 

Profile

Получение основной информации о пользователе (Имя, email и т.п.Get basic information about user (name, email, etc.): http://docs.otapi.net/ruen/Documentations/Method?name=GetUserInfo , редактирование этой информации возможно с помощью метода you can edit this information with http://docs.otapi.net/ruen/Documentations/Method?name=UpdateUser method.

Адрес доставки. Адрес доставки создается и редактируется отдельно от основной информации о пользователе. Всего возможно N адресов доставки, где N берется из настройки Delivery address. Delivery address is created and edited separately from basic information about the user. N delivery addresses are possible in total where N is taken from the setting http://docs.otapi.net/ruen/Documentations/Method?name=GetCommonInstanceOptionsInfo UserProfile->MaxProfilesCount. Методы для работы с адресом доставкиMethods for working with delivery address:

Для пользователя, необходим интерфейс, который позволяет выбрать профиль используемый по умолчанию Interface is required for user that allows to select default profile https://www.screencast.com/t/1fZ9HuauBjf . Выбранный профиль необходимо сохранить в предпочтения пользователяSelected profile must be saved in user preferenceshttp://docs.otapi.net/ruen/Documentations/Method?name=UpdateUserPreferences , поле ProfileId.ProfileId field.

Get a list of content pages for profile screenПолучение списка контентных страниц для экрана профиляhttp://docs.otapi.net/ruen/Documentations/Method?name=GetContentMenuItemTree , параметрыparameters:

applicationType=MobileApplication
menuList=Profile
includeContent=true

Список стран, в которые возможна доставка, нужно получить с помощью методаGet list of countries for deliveryhttp://docs.otapi.net/ruen/Documentations/Method?name=GetDeliveryCountryInfoList .

Get list of citiesСписок городов нужно получать методомhttp://docs.otapi.net/ruen/Documentations/Method?name=SearchCities  (пока пользователь вводить символы для поиска города, т.е. параметр QueryText пуст, нужно отправить IsMainCity=true для получения списка городов по умолчанию). В момент когда пользователь выбрал город из списка, сохраняем в профиле City и CityCode и автоматически заполняем поле Region.

Важно: CountryCode - обязательно поле для оформления заказа, CityCode - не обязательное поле, если пользователь выбрал город из списка, то система должна передать код в сервисы, если же пользователь ввёл город, которого нет в списке SearchCities, сохраняем только узле City.

Список заказов

while user enters characters to search for the city, i.e. QueryText parameter is empty, you need to send IsMainCity = true to get a list of default cities). When user selects city from the list, save it in the City profile and CityCode profile and automatically fill in the Region field.

Important: CountryCode - obligatory field for placing an order, CityCode - optional field, system must transfer the code to the services if user selected a city from the list. Save only City node if user entered city that is not in SearchCities list.

Orders list

http://docs.otapi.net/ruen/Documentations/Method?name=SearchOrdersForUser

АктивныеActive: <OrderSearchParametersForUser><IsCancelled>false</IsCancelled><IsCompleted>false</IsCompleted></OrderSearchParametersForUser>

ОтмененныеCancelled: <OrderSearchParametersForUser><IsCancelled>true</IsCancelled></OrderSearchParametersForUser>

ЗакрытыеCompleted: <OrderSearchParametersForUser><IsCompleted>true</IsCompleted></OrderSearchParametersForUser>

Список полей для отображенияThe list of fields to display:

ID заказа, который передается в API во все возможные методы: Id
Номер заказа, отображаемый покупателю: DisplayId
Дата заказа: CreatedDateTime
Статус: StatusName
Сумма: TotalAmount
Уже оплачено: TotalAmount минус RemainAmount
К оплате: RemainAmount
Стоимость товаров: GoodsAmount
Позиций товаров: такой информации нет - не показываем это поле

Заказ. Подробная информация
  • Order ID passed in API into all possible methods: Id
  • Order number displayed to buyer: DisplayId
  • Order date: CreatedDateTime
  • Statusс: StatusName
  • Sum: TotalAmount
  • Already paid: TotalAmount minus RemainAmount
  • For payment: RemainAmount
  • Goods price: GoodsAmount
  • Items positions: do not show this field if there is no such information

Order. Detailed information

Получить информацию о заказе: http://docs.otapi.net/ru/Documentations/Method?name=GetSalesOrderDetails

Отображаем для пользователя информацию о заказе (узел OrderInfo, подробнее здесь http://docs.otapi.net/ru/Documentations/Type?name=OtapiOrderInfo), особенности:

  • DisplayId - идентификатор заказа.
  • Id - идентификатор заказа, покупателю показывать не надо, этот Id передается в другие методы OTApi.
  • CanCancel - если заказ можно отменить, показываем кнопку "Отменить заказ" - http://docs.otapi.net/ru/Documentations/Method?name=CancelSalesOrder
  • Для отображения состояния заказа (выбор цветовой гаммы и т.п.), нужно использовать флаги: IsPaid, IsCancelled, IsCompleted

Отображаем список товаров в заказе (узел SalesLinesList, подробнее о каждой строке здесь http://docs.otapi.net/ru/Documentations/Type?name=SalesLine)

Список посылок - http://docs.otapi.net/ru/Documentations/Method?name=GetSalesOrderShippings

Заказ. Оформление заказа и выбор способа доставки

В один заказ можно оформить товары только одного провайдера.

При оформлении заказа, потребуется форма выбора адреса доставки или, если адрес ранее на создавался, форма создания адреса/ов доставки (якорь на документацию по профилям доставки).

При оформлении заказа, потребуется выбрать способ доставки из предоставленного списка: запрос http://docs.otapi.net/ru/Documentations/Method?name=SearchDeliveryModes , параметры xmlSearchParameters:

  • ProviderType - ид провайдера;
  • Weight - вес товаров, в случае оформления из корзины, потребуется получить список товаров методом http://docs.otapi.net/ru/Documentations/Method?name=GetPartialBasket , получить сумму веса каждой позиции (для каждого товара нужно умножить вес товара на заказываемое количество);
  • CountryCode - код страны доставки из выбранного адреса доставки;
  • CityCode - код города доставки из выбранного адреса доставки.

Пример параметров: <DeliveryModeSearchParameters><CountryCode>RU</CountryCode><CityCode>7700000000000</CityCode><Weight>75.000</Weight><ProviderType>Taobao</ProviderType></DeliveryModeSearchParameters>.

При отображении способов доставки, необходимо учесть флаг IsPickupPointMode.

  • Если флаг = false, показываем пользователю поля Адрес доставки и Индекс (значения полей берем из выбранного адреса доставки).
  • Если флаг = true, Адрес доставки и Индекс берем из выбранного пункта выдачи. Предоставляем пользователю интерфейс по выбору пункта выдачи: показываем все доступные пункты выдачи для текущего способа доставки http://docs.otapi.net/ru/Documentations/Method?name=SearchDeliveryPickupPoints (по умолчанию должен быть выбран пункт выдачи, который сохранен в выбранном адресе/профиле доставки).

После успешного оформления заказа, нужно сохранить ExternalDeliveryId в предпочтения пользователя (http://docs.otapi.net/ru/Documentations/Method?name=UpdateUserPreferences) , а так же обновить параметры адреса доставки, если интерфейс сразу этого не сделал (http://docs.otapi.net/ru/Documentations/Method?name=UpdateUserProfile).

Из корзины

Перед тем как оформить заказ из корзины, необходимо "проверить" актуальность цен и возможность оформления:

  • после того как клиент выбрал галочками товары которые он хочет оформлять, вызываем метод http://docs.otapi.net/ru/Documentations/Method?name=RunBasketChecking с выбранными идентификаторами корзины, в ответ получаем и запоминаем "идентификатор активности"
  • показываем клиенту оверлей, фразу "Пожалуйста, подождите. Товары в корзине проходят проверку на наличие. Время проверки зависит от количества товаров в корзине" и прогресс бар
  • вызываем функцию http://docs.otapi.net/ru/Documentations/Method?name=GetBasketCheckingResult передав в нее идентификатор активности
    • если в ответе нет ошибки и IsFinished != true, показываем прогресс клиенту из узла ProgressPercent и через одну секунду еще раз вызываем метод GetBasketCheckingResult 
    • из узла Messages для нужного элемента корзины показываем текст и статус (статус отображаем путем изменения цвета строки, Ok - зеленый, Warning - желтый, Error - красный)
    • если IsFinished == true, скрываем прогресс бар и
      • если в Messages есть хотя бы один Error - проматываем экран до первой ошибки и предоставляем пользователю возможность исправить ошибку (например выбрать другое количество товаров и по новой запустить проверку корзины)
      • если ошибок нет, но есть хотя бы один Warning - проматываем экран до первого предупреждения и предоставляем пользователю возможность повторно нажать на кнопку "оформить заказ", повторное нажатие должно сразу начать процедуру оформления заказа без повторной проверки корзины (важно: если пользователь изменил количество, конфигурацию или выбрал галочками другие товары - процесс проверки корзины должен начинаться заново)
      • если нет ни ошибок ни предупреждений, сразу открываем экран оформления заказа.

Важно при каждом изменении выбранных товаров запускать проверку корзины заново, а так же заново показывать сообщения об ошибке/успехе от сервисов.

Заказ можно оформить "из корзины", для этого нужно вызвать метод http://docs.otapi.net/ru/Documentations/Method?name=CreateOrder , передав в него:

  • элементы корзины (якорь на документацию по корзине)
  • способ доставки
  • профиль пользователя
  • не обязательно: можно предложить пользователю ввести комментарий к заказу.

Дозаказ

При оформлении заказа, нужно предложить пользователю возможность сделать дозаказ (если такая возможность у пользователя имеется). Получаем заказы, в которые можно сделать дозаказ, вызов http://docs.otapi.net/ru/Documentations/Method?name=SearchOrdersForUser с параметрами xmlSearchParameters=

<OrderSearchParametersForUser><ProviderType>ИдПровайдера(например: Taobao)</ProviderType><IsAvailableForRecreation>true</IsAvailableForRecreation></OrderSearchParametersForUser>

если такие заказы есть, предлагаем покупателю выбрать: оформляет он новый заказ или делает дозаказ. Для дозаказа нужно вызвать метод http://docs.otapi.net/ru/Documentations/Method?name=RecreateOrder .

Быстрый заказ

Заказ можно оформить из карточки товара, кнопка "Быстрый заказ", для этого нужно вызвать метод http://docs.otapi.net/ru/Documentations/Method?name=AddOrder , передав в него:

  • список оформляемых товаров (для быстрого заказа из карточки 1688, это несколько товаров разной конфигурации). Для каждого товара обязательно нужно передать ид товара, ид конфигурации и количество (остальные возможные параметры передавать не нужно)
  • способ доставки
  • профиль пользователя
  • не обязательно: можно предложить пользователю ввести комментарий к заказу.

Оплата заказа и пополнение лицевого счета

Если заказ не оплачен, обязательно предлагаем пользователю его оплатить. Если на лицевом счете клиента есть средства - запрос http://docs.otapi.net/ru/Documentations/Method?name=GetAccountInfo , узле AvailableAmount (при отображении обязательно используем CurrencySign) , предлагаем пользователю кнопку, которая оплатит заказ с лицевого счета. На кнопке пишем сумму доступную для оплаты, это должна быть или RemainAmount из информации о заказе http://docs.otapi.net/ru/Documentations/Method?name=GetSalesOrderDetails (при условии что на лицевом счете больше чем RemainAmount) или AvailableAmount (при условии что на лицевом счете меньше чем RemainAmount).

При нажатии на кнопку вызываем метод http://docs.otapi.net/ru/Documentations/Method?name=PaymentPersonalAccount и обновляем страницу заказа.

Заказ можно оплатить и через платежные системы. Запрашиваем список доступных платежных систем: http://docs.otapi.net/ru/Documentations/Method?name=GetPaymentModes . Картинка ПС - AbsoluteImageUrl, название ПС - Name. При клике на платежную систему, отображаем кнопку "Оплатить" и если узел CustomField == "Email" - отображаем поле ввода почты, если узел CustomField == "Phone" - отображаем поле ввода номера телефона.

При клике на кнопку Оплатить, вызываем метод http://docs.otapi.net/ru/Documentations/Method?name=GetPaymentParameters . Передаем параметры Amount (RemainAmount из информации о заказе), CurrencyCode, PaymentSystemId, OrderId, в SuccessUrl и FailUrl адреса возврата, которые приложение сможет перехватить. По полученному ответу формируем http-форму, открывем её в браузере, и отправляем её.:

  • RequestUrl - url на который нужно отправить форму
  • RequestMethod , если не пришел отправляем POST форму (иногда приходится отправлять GET, согласно параметру)
  • IsNewWindow - нужно открыть форму в новом окне или в текущем, для мобильного приложения параметр видимо не актуален - всегда открываем запрос в новом окне браузера
  • IsIFrame - вместо form отображаем в браузере iframe src={RequestUrl}?{Parameters вида param1=value1&param2=value2}
  • IsImmmediate - пока игнорируем в мобильном приложении
  • Parameters - список параметров платежа6 которыее надо обработать в зависимости от свойства IsUserData7
    • Если IsUserData==false, параметр нужно вставить в форму, для передачи в платежную систему.
    • Если IsUserData==true, параметр нужно просто вывести на экран.

Если в метод GetPaymentParameters не передать OrderId , то лицевой счет клиента пополнится на сумму Amount.

После успешного или неуспешного платежа, браузер вернется на один из переданных адресов, соответственно приложение должно их перехватить, закрыть браузер, и показать соответствующий экран.