question

mohit-kanada avatar image
mohit-kanada asked ·

Intents.ACTION_CUSTOMER_ADD_TIP always returns with Result Cancelled

I am trying to implement TIP flow along with order process. For that I am starting intent "Intents.ACTION_CUSTOMER_ADD_TIP" with start activity for result. But issue is it will start TIP screen to select but same time, instantly it will send result cancelled to parent activity from where customer tip activity is started. After TIP selection and done, parent activity is not receiving any thing. Here below is my code snippet.

Intent intent = new Intent(Intents.ACTION_CUSTOMER_ADD_TIP);
intent.putExtra(Intents.EXTRA_AMOUNT, OrderAmount); 
intent.putExtra(Intents.EXTRA_ORDER_ID, OrderId);
startActivityForResult(intent, REQUEST_CODE_TIP);


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    Log.d("TIP", "on result");

	if (requestCode == REQUEST_CODE_TIP) {
	    if (resultCode == Activity.RESULT_OK) {
        	Log.d("TIP", ""+data.getLongExtra(Intents.EXTRA_TIP_AMOUNT,0l));
	    } else if (resultCode == Activity.RESULT_CANCELED) {
        	Log.d("on result TIP", "cancelled");
    	    }
	}
}
OrdersIntents
8 comments
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.

What device(s) are you making this app for? Are you just wanting to add tip or does your app also handle the rest of the payment flow? Could you provide more context?

0 Likes 0 ·

We want to make this app for all clover devices. We want to collect tip amount and handle rest of payment flow. Once we successfully collect tip amount from "Intents.ACTION_CUSTOMER_ADD_TIP" we planned to complete flow using "Intents.ACTION_SECURE_PAY" along with selected tip amount.

Let me know if you need any additional details.

0 Likes 0 ·

Using the "Intents.ACTION_CUSTOMER_ADD_TIP" will not work on every device. The activity it launches does not exist on Station 2018. As tipping is treated as a tip adjustment in the newest Staton Secure Pay flow. In general we strongly discourage the use of intents. Instead you should use the PaymentConnector SDK.

Does your app also build the order? I ask because if your app is basically a full POS solution it would be considered a semi-integration. We have a team which specifically supports semi-integrations and I want to make sure you are getting the proper support.

0 Likes 0 ·
Show more comments

0 Answers

Welcome to the
Clover Developer Community