question

creacuity avatar image
creacuity asked creacuity answered

Introduce a dialog after the Pay button is pressed

We would like to achieve something similar to what's depicted in the screenshot below. We would like to display a dialog when the user presses the "Pay" button. I know this has been done in many apps, we just haven't figured out the best way to achieve this.

Could you let us know what is the best way to accomplish this? Thank you so much!


1690390425534.png

Broadcasts
1690390425534.png (56.5 KiB)
10 |2000

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

bryanvargas avatar image
bryanvargas answered
10 |2000

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

creacuity avatar image
creacuity answered

Thank you for your reply and help! I guess the issue that I'm running into is that the CUSTOMER_TENDER intent is not reaching my activity.

Here is the activity definition.

<activity
    android:name="ApplyDiscountToOrder"
    android:label="@string/app_name"
    android:exported="true">
    <intent-filter>
        <action android:name="clover.intent.action.CUSTOMER_TENDER" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

I have also tried other intents. It seems that V1_PAY_BUILD_START works when I register it in code like this:

IntentFilter filter = new IntentFilter();
filter.addAction(Intents.ACTION_V1_PAY_BUILD_START);
registerReceiver(receiver, filter);

However, CUSTOMER_TENDER does not get triggered even when registered in code.

Adding a custom tender type using MODIFY_ORDER works perfectly. I would like to make it so that it doesn't require user input for the activity to be displayed...

Would you know why I'm not receiving the intents in my listener?

10 |2000

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

creacuity avatar image
creacuity answered

It seems that I needed to change the targetSdk to 25 in my build.gradle file. This seems to fix it. Also, my emulator does work for this either, I need to deploy to my device, and it works fine after the targetSdk versoion change...

10 |2000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Welcome to the
Clover Developer Community