question

darrank avatar image
darrank asked dazza5000 edited

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

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

Related to this question, but more specific:

https://community.clover.com/questions/23267/how-to-specify-line-item-in-split-by-item-payment.html

Custom Tenders
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

·
dazza5000 avatar image
dazza5000 answered dazza5000 edited

What I learned is that you need to update the Order PayType to SPLIT_ITEM for the lineItemPayment to be reflected on the LineItem. I have still been unable to determine how to determine what else needs to be updated so that the next payment will be scheduled. I think there is probably some kind of result intent that is sent from the split payment screen that can not be reproduced through the SDK.

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.

dazza5000 avatar image dazza5000 commented ·
    override fun updatePayTypeOnCurrentOrder(payType: PayType): Result<Unit> {
        val currentOrder = getCurrentOrder()
        return if (currentOrder != null) {
            val cloverOrder = orderV31Connector.getOrder(currentOrder.orderId)
            cloverOrder.payType = payType
            try {
                orderV31Connector.updateOrder(cloverOrder)
                Result.Success(Unit)
            } catch (throwable: Throwable) {
                Result.Failure(throwable)
            }
        } else {
            Result.Failure(Throwable("Current order is null"))
        }
    }


0 Likes 0 ·

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