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


Java CanMakePaymentQueryResult类代码示例

本文整理汇总了Java中org.chromium.payments.mojom.CanMakePaymentQueryResult的典型用法代码示例。如果您正苦于以下问题:Java CanMakePaymentQueryResult类的具体用法?Java CanMakePaymentQueryResult怎么用?Java CanMakePaymentQueryResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: canMakePayment

import org.chromium.payments.mojom.CanMakePaymentQueryResult; //导入依赖的package包/类
/**
 * Called by the merchant website to check if the user has complete payment instruments.
 */
@Override
public void canMakePayment() {
    if (mClient == null) return;

    CanMakePaymentQuery query = sCanMakePaymentQueries.get(mOrigin);
    if (query == null) {
        query = new CanMakePaymentQuery(mMethodData.keySet());
        sCanMakePaymentQueries.put(mOrigin, query);
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                sCanMakePaymentQueries.remove(mOrigin);
            }
        }, CAN_MAKE_PAYMENT_QUERY_PERIOD_MS);
    }

    if (!query.matchesPaymentMethods(mMethodData.keySet())) {
        mClient.onCanMakePayment(CanMakePaymentQueryResult.QUERY_QUOTA_EXCEEDED);
        if (sObserverForTest != null) {
            sObserverForTest.onPaymentRequestServiceCanMakePaymentQueryResponded();
        }
        return;
    }

    if (query.getPreviousResponse() != null) {
        respondCanMakePaymentQuery(query.getPreviousResponse().booleanValue());
        return;
    }

    query.addObserver(this);
    if (isFinishedQueryingPaymentApps()) query.setResponse(mCanMakePayment);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:36,代码来源:PaymentRequestImpl.java

示例2: respondCanMakePaymentQuery

import org.chromium.payments.mojom.CanMakePaymentQueryResult; //导入依赖的package包/类
private void respondCanMakePaymentQuery(boolean response) {
    mClient.onCanMakePayment(response
                    ? CanMakePaymentQueryResult.CAN_MAKE_PAYMENT
                    : CanMakePaymentQueryResult.CANNOT_MAKE_PAYMENT);
    if (sObserverForTest != null) {
        sObserverForTest.onPaymentRequestServiceCanMakePaymentQueryResponded();
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:9,代码来源:PaymentRequestImpl.java

示例3: canMakePayment

import org.chromium.payments.mojom.CanMakePaymentQueryResult; //导入依赖的package包/类
/**
 * Called by the merchant website to check if the user has complete payment instruments.
 */
@Override
public void canMakePayment() {
    if (mClient == null) return;

    CanMakePaymentQuery query = sCanMakePaymentQueries.get(mPaymentRequestOrigin);
    if (query == null) {
        // If there has not been a canMakePayment() query in the last 30 minutes, take a note
        // that one has happened just now. Remember the payment method names and the
        // corresponding data for the next 30 minutes. Forget about it after the 30 minute
        // period expires.
        query = new CanMakePaymentQuery(Collections.unmodifiableMap(mMethodData));
        sCanMakePaymentQueries.put(mPaymentRequestOrigin, query);
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                sCanMakePaymentQueries.remove(mPaymentRequestOrigin);
            }
        }, CAN_MAKE_PAYMENT_QUERY_PERIOD_MS);
    } else if (shouldEnforceCanMakePaymentQueryQuota()
            && !query.matchesPaymentMethods(Collections.unmodifiableMap(mMethodData))) {
        // If there has been a canMakePayment() query in the last 30 minutes, but the previous
        // payment method names and the corresponding data don't match, enforce the
        // canMakePayment() query quota (unless the quota is turned off).
        mClient.onCanMakePayment(CanMakePaymentQueryResult.QUERY_QUOTA_EXCEEDED);
        if (sObserverForTest != null) {
            sObserverForTest.onPaymentRequestServiceCanMakePaymentQueryResponded();
        }
        return;
    }

    query.addObserver(this);
    if (isFinishedQueryingPaymentApps()) query.notifyObserversOfResponse(mCanMakePayment);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:37,代码来源:PaymentRequestImpl.java

示例4: respondCanMakePaymentQuery

import org.chromium.payments.mojom.CanMakePaymentQueryResult; //导入依赖的package包/类
private void respondCanMakePaymentQuery(boolean response) {
    if (mClient == null) return;

    boolean isIgnoringQueryQuota = false;
    if (!shouldEnforceCanMakePaymentQueryQuota()) {
        CanMakePaymentQuery query = sCanMakePaymentQueries.get(mPaymentRequestOrigin);
        // The cached query may have expired between instantiation of PaymentRequest and
        // finishing the query of the payment apps.
        if (query != null) {
            isIgnoringQueryQuota =
                    !query.matchesPaymentMethods(Collections.unmodifiableMap(mMethodData));
        }
    }

    if (mIsIncognito) {
        mClient.onCanMakePayment(CanMakePaymentQueryResult.CAN_MAKE_PAYMENT);
    } else if (isIgnoringQueryQuota) {
        mClient.onCanMakePayment(response
                        ? CanMakePaymentQueryResult.WARNING_CAN_MAKE_PAYMENT
                        : CanMakePaymentQueryResult.WARNING_CANNOT_MAKE_PAYMENT);
    } else {
        mClient.onCanMakePayment(response ? CanMakePaymentQueryResult.CAN_MAKE_PAYMENT
                                          : CanMakePaymentQueryResult.CANNOT_MAKE_PAYMENT);
    }

    mJourneyLogger.setCanMakePaymentValue(response || mIsIncognito);

    if (sObserverForTest != null) {
        sObserverForTest.onPaymentRequestServiceCanMakePaymentQueryResponded();
    }
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:32,代码来源:PaymentRequestImpl.java

示例5: canMakePayment

import org.chromium.payments.mojom.CanMakePaymentQueryResult; //导入依赖的package包/类
@Override
public void canMakePayment() {
    if (mClient != null) {
        mClient.onCanMakePayment(CanMakePaymentQueryResult.CANNOT_MAKE_PAYMENT);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:7,代码来源:PaymentRequestFactory.java


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