question

yrtorres14 avatar image
yrtorres14 asked Jeffrey Blattman commented

Can't seem to listen to ACTION_PAYMENT_PROCESSED utilizing listener.

I'm a bit new to the Clover SDK and to Android Development in general, and I've been trying to use a listener using Broadcast Receiver to detect the ACTION_PAYMENT_PROCESSED broadcast on an emulator. But when I take a look at the logcat to try and detect it manually after going through a simple order, its nowhere to be seen. The listener is declared in the manifest, and the actions are also declared, so in theory it should be functioning correctly. Is there anything I might be missing? Could the Clover Engine not have installed correctly on my emulator?

Clover Android SDKEmulatorIntentsBroadcasts
20 comments
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·

The payments application doesn't run on an emulator. So, what are you doing that you would expect a payment to be processed?

0 Likes 0 ·
yrtorres14 avatar image yrtorres14 David Marginian ♦♦ commented ·

That's good to know. I'm attempting to modify a receipt (more like add a little something to the notes) immediately after a payment has been processed successsfully (be it credit card or cash), before making it to the print receipt screen. I figured that right after that broadcast would be my best bet for adding that data to the receipt.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ yrtorres14 commented ·

https://docs.clover.com/docs/setting-up-an-android-emulator

"We recommend using a Clover Developer Kit (or DevKit) to fully test your user experience. With DevKits, you have access to hardware-specific functionalities, such as:

  • NFC and Bluetooth Low Energy (BLE)
  • Secure payments
  • Printing
  • Scanning"

I am a bit clear how you are processing the payment on the emulator.

0 Likes 0 ·
Show more comments
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

What is your app's target SDK?

0 Likes 0 ·
yrtorres14 avatar image yrtorres14 Jeffrey Blattman ♦♦ commented ·

For now, the Android SDK is the main one we'll be utilizing. The app would be predominantly for Clover and Android devices at the moment of speaking.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ yrtorres14 commented ·

Jeff is asking what the targetSdkVersion is set to in your app's build.gradle.

0 Likes 0 ·
Show more comments

1 Answer

David Marginian avatar image
David Marginian Deactivated answered Jeffrey Blattman commented

I just looked at your app (assuming your developer account matches your community email) and it doesn't appear you granted your application the permission to read payments. I am guessing this is why you aren't seeing the ACTION_PAYMENT_PROCESSED broadcast. I suggest you add that permission, unistall/reinstall your app (from the developer dashboard) and then try again.

3 comments
10 |2000

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

yrtorres14 avatar image yrtorres14 commented ·

Hey David, I tried this but even then the ACTION_PAYMENT_PROCESSED is still not being seen on the emulator. I should be getting a DevKit soon enough, so I suppose I'll be able to confirm is this is an emulator specific problem or if it's an issue with my application.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ yrtorres14 commented ·

Ok, I did confirm that ACTION_PAYMENT_PROCESSED does fire for a cash payment on a devkit.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ yrtorres14 commented ·

Can you create an MVCE that illustrates the problem. An app, with a broadcast receiver, that doesn't get fired when a payment is processed. Put it on github so we can try it.

0 Likes 0 ·

Welcome to the
Clover Developer Community