question

garyf avatar image
garyf asked Mark Mullan Deactivated commented

OnOrderUpdateListener2 not firing onPaymentProcessed

I'm getting this error running a demo with SDK 'com.clover.sdk:clover-android-sdk:latest.release' and Clover 2.0-1836. The code block adds a test OnOrderUpdateListener2 listener which implements onPaymentProcessed

public class TestOrderChangeListener implements OrderConnector.OnOrderUpdateListener2 {
    @Override
    public void onPaymentProcessed(String orderId, String paymentId) {
        System.out.printf("Payment processed: %s, %s\n", orderId, paymentId);
    }
...

orderConnector = new OrderConnector(this, account, null);
orderConnector.addOnOrderChangedListener(new TestOrderChangeListener());

however this is not fired when a payment is complete. Currently trying to find a work around using android.app.Activity#RESULT_OK however ideally the listener process would be used. Any example code of this working would be welcomed.

10 |2000

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

Mark Mullan avatar image
Mark Mullan Deactivated answered

Hi Gary,

Thanks for reposting this question - your code looks mostly fine and I was able to get the intended results with just a few minor changes: http://pastebin.com/4pSQeBJE. Please let me know if further clarification is required.

Best,

Mark

10 |2000

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

garyf avatar image
garyf answered Mark Mullan Deactivated commented

We found that we were calling orderConnector.disconnect() to clear the orderConnector before connecting it up. Removing this and the listener worked as expected.

1 comment
10 |2000

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

Mark Mullan avatar image Mark Mullan commented ·

Great! Thanks for the closure. I appreciate you following up. Let me know if I can help with any additional questions that come up during development.

0 Likes 0 ·

Welcome to the
Clover Developer Community