Android Open Source - Java-Yandex.Money-API-SDK Token Requester






From Project

Back to project page Java-Yandex.Money-API-SDK.

License

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.

Java Source Code

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);
}




Java Source Code List

com.samples.client.Settings.java
com.samples.server.SampleIncomingTransferListener.java
com.samples.server.ServletListener.java
com.samples.yamodroid.Consts.java
com.samples.yamodroid.GreatAppActivity.java
ru.yandex.money.api.ApiCommandsFacadeImpl.java
ru.yandex.money.api.ApiCommandsFacade.java
ru.yandex.money.api.CommandUrlHolder.java
ru.yandex.money.api.InsufficientScopeException.java
ru.yandex.money.api.InternalServerErrorException.java
ru.yandex.money.api.InvalidTokenException.java
ru.yandex.money.api.ProtocolRequestException.java
ru.yandex.money.api.TestUrlHolder.java
ru.yandex.money.api.TokenRequesterImpl.java
ru.yandex.money.api.TokenRequester.java
ru.yandex.money.api.YamoneyAccount.java
ru.yandex.money.api.YamoneyApiClient.java
ru.yandex.money.api.YandexMoneyImpl.java
ru.yandex.money.api.YandexMoney.java
ru.yandex.money.api.enums.Destination.java
ru.yandex.money.api.enums.MoneyDirection.java
ru.yandex.money.api.enums.MoneySource.java
ru.yandex.money.api.enums.OperationHistoryType.java
ru.yandex.money.api.enums.Status.java
ru.yandex.money.api.notifications.IncomingTransferListener.java
ru.yandex.money.api.notifications.IncomingTransfer.java
ru.yandex.money.api.notifications.NotificationUtils.java
ru.yandex.money.api.notifications.NotificationsServlet.java
ru.yandex.money.api.response.AccountInfoResponse.java
ru.yandex.money.api.response.FundraisingStatsResponse.java
ru.yandex.money.api.response.OperationDetailResponse.java
ru.yandex.money.api.response.OperationHistoryResponse.java
ru.yandex.money.api.response.ProcessPaymentResponse.java
ru.yandex.money.api.response.ReceiveOAuthTokenResponse.java
ru.yandex.money.api.response.RequestPaymentResponse.java
ru.yandex.money.api.response.util.OperationHistoryError.java
ru.yandex.money.api.response.util.Operation.java
ru.yandex.money.api.response.util.PaymentErrorCode.java
ru.yandex.money.api.response.util.ProcessPaymentError.java
ru.yandex.money.api.response.util.RequestPaymentError.java
ru.yandex.money.api.response.util.money.PaymentMethods.java
ru.yandex.money.api.rights.AbstractLimitedPermission.java
ru.yandex.money.api.rights.AbstractPermission.java
ru.yandex.money.api.rights.AccountInfo.java
ru.yandex.money.api.rights.IdentifierType.java
ru.yandex.money.api.rights.MoneySource.java
ru.yandex.money.api.rights.OperationDetails.java
ru.yandex.money.api.rights.OperationHistory.java
ru.yandex.money.api.rights.PaymentP2P.java
ru.yandex.money.api.rights.PaymentShop.java
ru.yandex.money.api.rights.Payment.java
ru.yandex.money.api.rights.Permission.java
ru.yandex.money.droid.ActivityParams.java
ru.yandex.money.droid.AuthActivity.java
ru.yandex.money.droid.Consts.java
ru.yandex.money.droid.DetailHistoryActivity.java
ru.yandex.money.droid.HistoryActivity.java
ru.yandex.money.droid.HistoryAdapter.java
ru.yandex.money.droid.IntentCreator.java
ru.yandex.money.droid.LoadHistoryTask.java
ru.yandex.money.droid.PaymentActivity.java
ru.yandex.money.droid.PaymentConfirmActivity.java
ru.yandex.money.droid.PaymentShopParcelable.java
ru.yandex.money.droid.ProcessPaymentTask.java
ru.yandex.money.droid.Utils.java
ru.yandex.money.droid.YandexMoneyDroid.java