Java Code Examples for org.chromium.chrome.browser.payments.ui.PaymentRequestUI#TYPE_CONTACT_DETAILS

The following examples show how to use org.chromium.chrome.browser.payments.ui.PaymentRequestUI#TYPE_CONTACT_DETAILS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PaymentRequestImpl.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onSectionAddOption(
        @PaymentRequestUI.DataType int optionType, Callback<PaymentInformation> callback) {
    if (optionType == PaymentRequestUI.TYPE_SHIPPING_ADDRESSES) {
        editAddress(null);

        if (mMerchantNeedsShippingAddress) {
            mPaymentInformationCallback = callback;
            return true;
        }
    } else if (optionType == PaymentRequestUI.TYPE_CONTACT_DETAILS) {
        editContact(null);
    } else if (optionType == PaymentRequestUI.TYPE_PAYMENT_METHODS) {
        PreferencesLauncher.launchSettingsPage(
                mContext, AutofillLocalCardEditor.class.getName());
    }

    return false;
}
 
Example 2
Source File: PaymentRequestImpl.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
@PaymentRequestUI.SelectionResult
public int onSectionAddOption(
        @PaymentRequestUI.DataType int optionType, Callback<PaymentInformation> callback) {
    if (optionType == PaymentRequestUI.TYPE_SHIPPING_ADDRESSES) {
        editAddress(null);
        mPaymentInformationCallback = callback;
        // Log the add of shipping address.
        mJourneyLogger.incrementSelectionAdds(
                PaymentRequestJourneyLogger.SECTION_SHIPPING_ADDRESS);
        return PaymentRequestUI.SELECTION_RESULT_ASYNCHRONOUS_VALIDATION;
    } else if (optionType == PaymentRequestUI.TYPE_CONTACT_DETAILS) {
        editContact(null);
        // Log the add of contact info.
        mJourneyLogger.incrementSelectionAdds(PaymentRequestJourneyLogger.SECTION_CONTACT_INFO);
        return PaymentRequestUI.SELECTION_RESULT_EDITOR_LAUNCH;
    } else if (optionType == PaymentRequestUI.TYPE_PAYMENT_METHODS) {
        editCard(null);
        // Log the add of credit card.
        mJourneyLogger.incrementSelectionAdds(PaymentRequestJourneyLogger.SECTION_CREDIT_CARDS);
        return PaymentRequestUI.SELECTION_RESULT_EDITOR_LAUNCH;
    }

    return PaymentRequestUI.SELECTION_RESULT_NONE;
}
 
Example 3
Source File: PaymentRequestImpl.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
@PaymentRequestUI.SelectionResult
public int onSectionAddOption(
        @PaymentRequestUI.DataType int optionType, Callback<PaymentInformation> callback) {
    if (optionType == PaymentRequestUI.TYPE_SHIPPING_ADDRESSES) {
        editAddress(null);
        mPaymentInformationCallback = callback;
        // Log the add of shipping address.
        mJourneyLogger.incrementSelectionAdds(Section.SHIPPING_ADDRESS);
        return PaymentRequestUI.SELECTION_RESULT_ASYNCHRONOUS_VALIDATION;
    } else if (optionType == PaymentRequestUI.TYPE_CONTACT_DETAILS) {
        editContact(null);
        // Log the add of contact info.
        mJourneyLogger.incrementSelectionAdds(Section.CONTACT_INFO);
        return PaymentRequestUI.SELECTION_RESULT_EDITOR_LAUNCH;
    } else if (optionType == PaymentRequestUI.TYPE_PAYMENT_METHODS) {
        editCard(null);
        // Log the add of credit card.
        mJourneyLogger.incrementSelectionAdds(Section.CREDIT_CARDS);
        return PaymentRequestUI.SELECTION_RESULT_EDITOR_LAUNCH;
    }

    return PaymentRequestUI.SELECTION_RESULT_NONE;
}