当前位置: 首页>>代码示例>>Java>>正文


Java WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE属性代码示例

本文整理汇总了Java中com.google.android.gms.wallet.WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE属性的典型用法代码示例。如果您正苦于以下问题:Java WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE属性的具体用法?Java WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE怎么用?Java WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.android.gms.wallet.WalletConstants的用法示例。


在下文中一共展示了WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleError

protected void handleError(int errorCode) {
    switch (errorCode) {
        case WalletConstants.ERROR_CODE_SPENDING_LIMIT_EXCEEDED:
            Toast.makeText(this, getString(R.string.spending_limit_exceeded, errorCode),
                    Toast.LENGTH_LONG).show();
            break;
        case WalletConstants.ERROR_CODE_INVALID_PARAMETERS:
        case WalletConstants.ERROR_CODE_AUTHENTICATION_FAILURE:
        case WalletConstants.ERROR_CODE_BUYER_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_MERCHANT_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE:
        case WalletConstants.ERROR_CODE_UNSUPPORTED_API_VERSION:
        case WalletConstants.ERROR_CODE_UNKNOWN:
        default:
            // unrecoverable error
            String errorMessage = getString(R.string.google_wallet_unavailable) + "\n" +
                    getString(R.string.error_code, errorCode);
            Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
            break;
    }
}
 
开发者ID:Adyen,项目名称:adyen-android-pay-sample-code,代码行数:21,代码来源:OrderConfirmationActivity.java

示例2: handleError

private void handleError(int errorCode) {
    switch (errorCode) {
        case WalletConstants.ERROR_CODE_SPENDING_LIMIT_EXCEEDED:
            // may be recoverable if the user tries to lower their charge
            // take the user back to the checkout page to try to handle
        case WalletConstants.ERROR_CODE_INVALID_PARAMETERS:
        case WalletConstants.ERROR_CODE_AUTHENTICATION_FAILURE:
        case WalletConstants.ERROR_CODE_BUYER_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_MERCHANT_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE:
        case WalletConstants.ERROR_CODE_UNSUPPORTED_API_VERSION:
        case WalletConstants.ERROR_CODE_UNKNOWN:
        default:
            // unrecoverable error
            // take the user back to the checkout page to handle these errors
            handleUnrecoverableGoogleWalletError(errorCode);
    }
}
 
开发者ID:Adyen,项目名称:adyen-android-pay-sample-code,代码行数:18,代码来源:FullWalletConfirmationFragment.java

示例3: handleError

@Override
protected void handleError(int errorCode) {
    switch (errorCode) {
        case WalletConstants.ERROR_CODE_SPENDING_LIMIT_EXCEEDED:
            Toast.makeText(getActivity(),
                    getString(R.string.spending_limit_exceeded, errorCode),
                    Toast.LENGTH_LONG).show();
            break;
        case WalletConstants.ERROR_CODE_INVALID_PARAMETERS:
        case WalletConstants.ERROR_CODE_AUTHENTICATION_FAILURE:
        case WalletConstants.ERROR_CODE_BUYER_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_MERCHANT_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE:
        case WalletConstants.ERROR_CODE_UNSUPPORTED_API_VERSION:
        case WalletConstants.ERROR_CODE_UNKNOWN:
        default:
            // unrecoverable error
            mGoogleWalletDisabled = true;
            displayGoogleWalletErrorToast(errorCode);
            break;
    }
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:22,代码来源:CheckoutFragment.java

示例4: handleError

@Override
protected void handleError(int errorCode) {
    if (checkAndRetryFullWallet(errorCode)) {
        // handled by retrying
        return;
    }
    switch (errorCode) {
        case WalletConstants.ERROR_CODE_SPENDING_LIMIT_EXCEEDED:
            // may be recoverable if the user tries to lower their charge
            // take the user back to the checkout page to try to handle
        case WalletConstants.ERROR_CODE_INVALID_PARAMETERS:
        case WalletConstants.ERROR_CODE_AUTHENTICATION_FAILURE:
        case WalletConstants.ERROR_CODE_BUYER_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_MERCHANT_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE:
        case WalletConstants.ERROR_CODE_UNSUPPORTED_API_VERSION:
        case WalletConstants.ERROR_CODE_UNKNOWN:
        default:
            // unrecoverable error
            // take the user back to the checkout page to handle these errors
            handleUnrecoverableGoogleWalletError(errorCode);
    }
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:23,代码来源:ConfirmationFragment.java

示例5: handleError

@Override
protected void handleError(int errorCode) {
    switch (errorCode) {
        case WalletConstants.ERROR_CODE_SPENDING_LIMIT_EXCEEDED:
            Toast.makeText(getActivity(),
                    getString(R.string.spending_limit_exceeded, errorCode),
                    Toast.LENGTH_LONG).show();
            break;
        case WalletConstants.ERROR_CODE_INVALID_PARAMETERS:
        case WalletConstants.ERROR_CODE_AUTHENTICATION_FAILURE:
        case WalletConstants.ERROR_CODE_BUYER_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_MERCHANT_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE:
        case WalletConstants.ERROR_CODE_UNSUPPORTED_API_VERSION:
        case WalletConstants.ERROR_CODE_UNKNOWN:
        default:
            // unrecoverable error
            handleUnrecoverableGoogleWalletError(errorCode);
            break;
    }
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:21,代码来源:PaymentFragment.java

示例6: handleError

protected void handleError(int errorCode) {
    switch (errorCode) {
        case WalletConstants.ERROR_CODE_SPENDING_LIMIT_EXCEEDED:
            Toast.makeText(this, getString(R.string.spending_limit_exceeded, errorCode),
                    Toast.LENGTH_LONG).show();
            break;
        case WalletConstants.ERROR_CODE_INVALID_PARAMETERS:
        case WalletConstants.ERROR_CODE_AUTHENTICATION_FAILURE:
        case WalletConstants.ERROR_CODE_BUYER_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_MERCHANT_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE:
        case WalletConstants.ERROR_CODE_UNSUPPORTED_API_VERSION:
        case WalletConstants.ERROR_CODE_UNKNOWN:
        default:
            // unrecoverable error
            String errorMessage = getString(R.string.google_wallet_unavailable) + "\n" +
                getString(R.string.error_code, errorCode);
            Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
            break;
    }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:21,代码来源:BikestoreFragmentActivity.java

示例7: handleError

private void handleError(int errorCode) {
    if (checkAndRetryFullWallet(errorCode)) {
        // handled by retrying
        return;
    }
    switch (errorCode) {
        case WalletConstants.ERROR_CODE_SPENDING_LIMIT_EXCEEDED:
            // may be recoverable if the user tries to lower their charge
            // take the user back to the checkout page to try to handle
        case WalletConstants.ERROR_CODE_INVALID_PARAMETERS:
        case WalletConstants.ERROR_CODE_AUTHENTICATION_FAILURE:
        case WalletConstants.ERROR_CODE_BUYER_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_MERCHANT_ACCOUNT_ERROR:
        case WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE:
        case WalletConstants.ERROR_CODE_UNSUPPORTED_API_VERSION:
        case WalletConstants.ERROR_CODE_UNKNOWN:
        default:
            // unrecoverable error
            // take the user back to the checkout page to handle these errors
            handleUnrecoverableGoogleWalletError(errorCode);
    }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:22,代码来源:FullWalletConfirmationButtonFragment.java

示例8: checkAndRetryFullWallet

/**
 * Retries {@link WalletClient#loadFullWallet(FullWalletRequest, int)} if
 * {@link #MAX_FULL_WALLET_RETRIES} has not been reached.
 *
 * @return {@code true} if {@link ConfirmationFragment#getFullWallet()} is retried,
 *         {@code false} otherwise.
 */
private boolean checkAndRetryFullWallet(int errorCode) {
    if ((errorCode == WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE ||
            errorCode == WalletConstants.ERROR_CODE_UNKNOWN) &&
            mRetryLoadFullWalletCount < MAX_FULL_WALLET_RETRIES) {
        mRetryLoadFullWalletCount++;
        getFullWallet();
        return true;
    }
    return false;
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:17,代码来源:ConfirmationFragment.java

示例9: checkAndRetryFullWallet

/**
 * Retries {@link Wallet#loadFullWallet(GoogleApiClient, FullWalletRequest, int)} if
 * {@link #MAX_FULL_WALLET_RETRIES} has not been reached.
 *
 * @return {@code true} if {@link FullWalletConfirmationButtonFragment#getFullWallet()} is retried,
 *         {@code false} otherwise.
 */
private boolean checkAndRetryFullWallet(int errorCode) {
    if ((errorCode == WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE ||
            errorCode == WalletConstants.ERROR_CODE_UNKNOWN) &&
            mRetryLoadFullWalletCount < MAX_FULL_WALLET_RETRIES) {
        mRetryLoadFullWalletCount++;
        getFullWallet();
        return true;
    }
    return false;
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:17,代码来源:FullWalletConfirmationButtonFragment.java


注:本文中的com.google.android.gms.wallet.WalletConstants.ERROR_CODE_SERVICE_UNAVAILABLE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。