Problem with loyalty app and full order discount

Hi @dennis ,

I have some problems with our loyalty app:

  1. When I apply a discount that is equal to the order total, i.e. the order total will be 0.00:

    • the Sale popup is automatically closed and the order’s payment cannot be completed.
      => This brake our process, we are waiting for the event TRANSACTION_COMPLETED, but in this case this event wont be fired. We cannot send the completed order to our backend.
  2. When our app apply some discount and after that the user select “Cancel” in the Sale popup, all the applied changes in the order are roll-backed. Is this a normal behavior or it is a bug?

Iveta

  1. There is not TRANSACTION_COMPLETED broadcast because there was no payment tendered. You should listen to ORDER_CREATED and ORDER_COMPLETED broadcasts

  2. Yes because the order has not been saved yet.

Our app cannot subscribe for events ACTION_ORDER_UPDATE and ACTION_ORDER_COMPLETED.
It Successfully subscribed only for ACTION_NEW_ORDER_CREATED, but this is not working for our case, because we need the order id of the completed order.

See our implementation below as example:

  • broadcast receiver configuration in AndroidManifest.xml file:
...
<receiver android:name=".loyalty.transaction.OrderUpdatedReceiver"android:enabled="true"android:exported="true">
    <intent-filter>
        <action android:name="poynt.intent.action.ORDER_UPDATED" />
    </intent-filter>
</receiver>
...
  • The broadcast receiver implementation:
package com.rewardslabs.myrewards.loyalty.transaction;
import android.content.BroadcastReceiver;import android.content.Context;
import android.content.Intent;
import timber.log.Timber;    


/**
 * Created by iveta on 25.01.18. 
*/
public class OrderUpdatedReceiver extends BroadcastReceiver {    
    @Override
    public void onReceive(Context context, Intent intent) {
        Timber.d("OrderUpdatedReceiver - order update action received");
    }
}

Poynt Register sends NEW_ORDER_CREATED broadcast if a new order gets created and paid, you should receive ORDER_COMPLETED when a previously saved order gets paid. Are you saying that you are not able to get ORDER_COMPLETED broadcasts?

Yes.

That’s exactly my problem . I do not receive ORDER_COMPLETED when a previously saved order gets paid.