question

caleb avatar image
caleb asked caleb answered

Custom Tender Not Reflecting Intent Extras

Setting the intent extras like this:

fun approve(activity: Activity) {
    val data = Intent()
    data.putExtra(Intents.EXTRA_AMOUNT, 0.42f);
    data.putExtra(Intents.EXTRA_CLIENT_ID, 1234);
    data.putExtra(Intents.EXTRA_NOTE, "Transaction Id: " + 1234);
    activity.setResult(RESULT_OK, data);
    activity.finish();
}


But payment ends up being $0.00 in register and the note and client id are not reflected on the payment.

1664772893476.png


I thought from the docs on the customer facing set up that the amount provided for `EXTRA_AMOUNT` would get applied as the payment. Do I need to do something to apply the payment beyond providing the Intent extras?


Here is the Intent URI from the PAYMENT_PROCESSED broadcast - it is not reflecting the extras.

URI: intent:#Intent;action=com.clover.intent.action.PAYMENT_PROCESSED;launchFlags=0x10;component=com.bokoup.merchantapp/.ui.MyBroadcastReceiver;S.com.clover.intent.extra.ORDER_ID=B9DM683P3PXC2;l.com.clover.intent.extra.AMOUNT=0;S.com.clover.intent.extra.TENDER=com.bokoup.merchantapp;S.com.clover.intent.extra.PAYMENT_ID=N7Q80HZDRA0EA;end

Here was one similar question - answer in that case was wrong data type. I think I'm passing the values with the correct types. Here is the URI of the Intent that is getting passed in to setResult.


intent:#Intent;i.clover.intent.extra.CLIENT_ID=1234;S.clover.intent.extra.NOTE=Transaction%20Id%3A%201234;f.clover.intent.extra.AMOUNT=0.42;end
Custom Tenders
1664772893476.png (37.7 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.

1 Answer

·
caleb avatar image
caleb answered

EXTRA_AMOUNT has to be a LONG where $0.42 for example would be passed as 42.toLong() in Kotlin.

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