question

brokenOval avatar image
brokenOval asked ·

Disabling Customer Payment Option also disables Merchant Tender

I'd like to disable the Customer Payment Option but still allow the merchant to use the tender from their screen on a tethered device.

Each time I disable the Customer Payment Option it turns off the Payment Tender, and if I enable the Tender it also enables the Customer Payment Option.

Is this a bug?

Edit: I have tried enabling and disabling the options on the devices themselves (Setup App->Payments) - the online dashboard doesn't seem to have a section for "Customer Payment Options".
PaymentsCustom Tenders
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Raymond Lee avatar image
Raymond Lee answered ·
The "Customer Payment Options" is to make it clear to the merchant which custom tenders are customer facing. The enabling/disabling does seem redundant with the "Tenders" section, but it is more of a convenience to be able to enable/disable customer facing tenders straight from that section.

So it is not a bug, however your use case is valid though, so I will put in enhancement request to be able enable merchant facing / customer facing for a custom tender independently.

In the meanwhile, a workaround that should solve your use case is to provide a setting in your app to disable / enable customer facing for your tender. Every time this setting is changed, you can enable / disable the Activity that handles your customer facing tender (which enables / disables the intent filter as well). The setup app will automatically see the customer tender intent filter or the absence of it.

This workaround is based on this stackoverflow answer on disabling intent filters.

Here is sample code to do the workaround:
customerTenderButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        PackageManager pm = getContext().getPackageManager();
        ComponentName compName = new ComponentName(getContext().getPackageName(), 
                getContext().getPackageName() + ".CustomerTenderActivity");
        if (pm.getComponentEnabledSetting(compName) == PackageManager.COMPONENT_ENABLED_STATE_ENABLED) {
            pm.setComponentEnabledSetting(
                    compName,
                    PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                    PackageManager.DONT_KILL_APP);
            Toast.makeText(getContext(), "CUSTOMER TENDER DISABLED", Toast.LENGTH_SHORT).show();
        }

        else {
            pm.setComponentEnabledSetting(
                    compName,
                    PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                    PackageManager.DONT_KILL_APP);
            Toast.makeText(getContext(), "CUSTOMER TENDER ENABLED", Toast.LENGTH_SHORT).show();
        }
    }
});
2 comments Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for the thorough answer - that is very useful. Will give that a shot!

1 Like 1 · ·

No problem! Let me know if it does not work for you, I also edited the answer, as I realized it is not needed to delete / create the tender, the device will automatically update to add / remove the customer tender based on whether the intent filter is present or not.

0 Likes 0 · ·
Raymond Lee avatar image
Raymond Lee answered ·
Whether a custom tender shows up as a merchant facing tender and/or as a customer facing tender is defined by the app that handles the custom tender. The app defines this in the AndroidManifest.xml, as an intent filter. ( Custom Tender doc goes into more detail)

For a merchant facing tender, include the following intent filter for the Activity that will handle the intent that comes from a merchant clicking on the custom tender:
    <intent-filter>
        <action android:name="clover.intent.action.MERCHANT_TENDER" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>

For a customer facing tender, include the following intent filter for the Activity that will handle the intent that comes from a customer clicking on the custom tender in the Secure Pay app:
    <intent-filter>
        <action android:name="clover.intent.action.CUSTOMER_TENDER" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>

An app can choose to use the same Activity to handle both merchant facing and customer facing tenders, or have separate Activities handle each type of intent. It can also choose to only define one of the two intent filters, and exclude the other.

So in order to only have a merchant facing tender, the app should only have the merchant tender intent filter set up in the AndroidManifest.xml, and not include the customer tender intent filter.
1 comment Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks @Raymond Lee - We have both tenders defined in the manifest. However some merchants want to allow the customer facing option and some don't - all require the merchant tender, so a certain level of flexibility is required.

Are you saying that the "Customer Payment Options" section in the device Setup is in fact redundant then and doesn't do anything? I would have expected the "Tenders" section to control the Merchant Tenders and the "Customer Payment Options" to control the Customer Tenders, but in fact both control both - so perhaps the option just shouldn't be there at all, given that it is there though, it seems to me this is a bug. Is that the case and is it likely to be fixed?

If not we will need to look at a workaround and potentially just remove the Customer Tender altogether.

0 Likes 0 · ·

Welcome to the
Clover Developer Community