Back to project page Java-Yandex.Money-API-SDK.
The source code is released under:
MIT License
If you think the Android project Java-Yandex.Money-API-SDK listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ru.yandex.money.api; /*from www.ja va2 s . c om*/ import ru.yandex.money.api.response.ReceiveOAuthTokenResponse; import ru.yandex.money.api.rights.Permission; import java.io.IOException; import java.util.Collection; /** * ?????????? ???? ????????? ???????? ?????????? ??????. * ????????? ????????? ?? ???? ???????: * <ol> * <li>???????????? uri ???? ???????? ?????? ?????????? ??????</li> * <li>????? ?????????? ?????? ?? ????????????</li> * </ol> * <p/> * <p/> * Copyright 2012 Yandex Money, All rights reserved. * <p/> * Date: 25.10.13 18:50 * * @author sergeev */ public interface TokenRequester { /** * URI ??????? ???? OAuth-???????????. ???????????? ???????? ?? ????? ?????? ????? ??????? */ String URI_YM_AUTH = "https://sp-money.yandex.ru/oauth/authorize"; /** * URI ?????? ???? ????????? OAuth-???????????. ???????????? ???????? ?? ????? ?????? ????? ??????? ?????????? */ String URI_YM_AUTH_MOBILE = "https://m.sp-money.yandex.ru/oauth/authorize"; /** * URI ???? ?????? ?????????? ?????? ?? ????????????. ?????? ???????????? ?? ?????????? ?????????. * ??????? ?????? uri ?????? ???? ???????? ??????????? ?????? ???????. ? ????? ?????? JSON ?? ???????? ???????. */ String URI_YM_TOKEN = "https://sp-money.yandex.ru/oauth/token"; /** * ????? OAuth-?????????????? ??????????? ???? ?????????? ?????????? * ???? (??????). * * @param scope ???????? ????????????? ??????????? ????. ???????? ??? ??????????????? scope ? ???? ???????. * @param redirectUri URI ????????? ???????????, ?? ??????? OAuth-??????? * ??????????????? ???????? ????????? ?????????? ???????????. ???????? ?????? ????????? * ??? ????????????? ?????????? ?????? ???? ????????? ???????? redirectUri, * ?????????? ??? ???????????? ???????????. ??? ?????????? ?? ????????????? ?????????????? * ????????? ???????????, ??????? ????? ???? ????????? ? ????? ??????? URI. * @param mobileMode ???? ?????? ?????????? ??????????? (????????? ????? ???? true ? ??????? ???? false) * @return URI, ?? ???????? ????? ???????? ???? ????????? ??????????? * */ String authorizeUri(String scope, String redirectUri, Boolean mobileMode); /** * ????? OAuth-?????????????? ??????????? ???? ?????????? ?????????? * ???? (??????). * * * @param permissions ????????????? ????? ???? ?????? * @param redirectUri URI ????????? ???????????, ?? ??????? OAuth-??????? * ??????????????? ???????? ????????? ?????????? ???????????. ???????? ?????? ????????? * ??? ????????????? ?????????? ?????? ???? ????????? ???????? redirectUri, * ?????????? ??? ???????????? ???????????. ??? ?????????? ?? ????????????? ?????????????? * ????????? ???????????, ??????? ????? ???? ????????? ? ????? ??????? URI. * @param mobileMode ???? ?????? ?????????? ??????????? (????????? ????? ???? true ? ??????? ???? false) * @return URI, ?? ???????? ????? ???????? ???? ????????? ??????????? * */ String authorizeUri(Collection<Permission> permissions, String redirectUri, Boolean mobileMode); /** * ????? ???? ?????? ?????????? ????, ??????????? ?? ???????? ???????.????? * ?????? ?????? ?????? authorize, ?? ???????????? ????? ???????? ? ?????? * ?????????????. * * @param code ????????? ??? (?????), ?????????? ?????? ?? ????? ???????????. * ?????????????? ? ??????? ?????????? ?????????????? ??????????? ?????????????. * @param redirectUri URI, ?? ??????? OAuth-??????? ??????????????? ???????? * ????????? ?????????? ???????????. ???????? ?????? ????????? ??? ????????????? ?????????? * ?????? ???? ????????? ???????? redirectUri, ????? ??????????? ? ????? authorize. * @return ??????????? ???????? {@link ru.yandex.money.api.response.ReceiveOAuthTokenResponse} * @throws java.io.IOException ?????? ??????? ?? ????????? ???????.????? * @throws ru.yandex.money.api.InternalServerErrorException ????????????? ?????? ???????? ???????.????? */ ReceiveOAuthTokenResponse receiveOAuthToken(String code, String redirectUri) throws IOException; ReceiveOAuthTokenResponse receiveOAuthToken(String code, String redirectUri, String clientSecret) throws IOException; /** * ????? ?????????? ????????????? ??????????? ? ????????? API ???????.??????, * ??????? ?????? ?????????????? ? ????????????? ????????. * * @return ????????????? ??????????? */ String getClientId(); String makeScope(Collection<Permission> permissions); }