question

darrank avatar image
darrank asked darrank edited

How to specify Line Item in Split By Item payment with Custom Tender

We have implemented a Custom Tender, but noticed that when we do Split By Item, the item itself is not marked as paid even though the payment is added to the order successfully. Is there something we need to pass back in the intent to mark the specific item as paid when using a custom tender?


This is what it looks like when it is successful (using cash):


Custom Tenders
img-0621.jpg (23.4 KiB)
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.

darrank avatar image darrank commented ·

Is the only way to get the line item marked as paid on an order through the Intent result?

0 Likes 0 ·

1 Answer

·
darrank avatar image
darrank answered darrank edited

It looks like we just need to pass back the Intents.EXTRA_LINE_ITEM_PAYMENTS object.


Full example:


     
            lineItemPayments = intent.getParcelableArrayListExtra<LineItemPayment>(Intents.EXTRA_LINE_ITEM_PAYMENTS)


// Process payment and pass back intent details in Activity.RESULT_OK

       val clientId: String = computeClientId()

        val data = Intent().apply {
            putExtra(Intents.EXTRA_AMOUNT, amount)
            putExtra(Intents.EXTRA_CLIENT_ID, clientId)
            putExtra(Intents.EXTRA_TAX_AMOUNT, taxAmount)
            putExtra(Intents.EXTRA_TIP_AMOUNT, tipAmount)
            putExtra(Intents.EXTRA_NOTE, "Transaction Id: $clientId")
            putExtra(Intents.EXTRA_LINE_ITEM_PAYMENTS, lineItemPayments)
        }

        setResult(Activity.RESULT_OK, data)
        finish()





Is it safe to assume that everything that comes in with the incoming

Intents.ACTION_MERCHANT_TENDER

Intent needs to be passed back in the Activity.Result response?

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