question

ondrej avatar image
ondrej asked ondrej commented

How to mark the current order as paid after web based payment

Hello,

I am developing a custom tender. The custom processing is initiated by a 'Custom tender' button from the Register application. I am creating payments for the order using the web API. I use the web API since I need to create multiple payments using multiple custom tenders. I did not found a way to mark the order as 'paid' if the whole order is paid. The desired functionality is that the Register switches directly to the 'choose receipt method' screen right after returning from the custom processing.

These are approaches and results:

1) Create payments using web API. Wait for the synchronization between the Clover server and local client. Hope that server will mark the order as 'paid'. Result: The payments are attached to the order, but the status is still 'open'.

2) After creating payments using the web API, issue a web call to update the status of the order to the state='paid'. Wait for the sync and return 'TenderActivity.RESULT_CANCELED'. Result: The Register payment screen is reopened with the outstanding amount of $0. The merchant has to add one more $0 cash payment to close the order (or to do something similar). In other words, the payments are in the system, outstanding value is $0, but the order is not 'paid'.

3) After creating payments using the web API and waiting for sync, set the state=paid on the local order in the Clover OS. Then return 'TenderActivity.RESULT_CANCELED'. The effect is the same as in the case 2).

4) same as 2) but returning TenderActivity.RESULT_OK with amount $0. The order IS closed (the Register goes to the 'choose receipt method' screen), but there is an additional $0 payment on the order.

Is there some way to mark the order as paid when using a custom tender in the Register and issuing web based payments? The case 4) is the closest to the desired functionality, but the $0 payment is misleading.

Thank you, Ondrej

Orders
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.

1 Answer

anthonypinto avatar image
anthonypinto answered ondrej commented

There is one additional alternative:

If you complete your payments, and wait for the sync, you can then populate a v3 payment object with one of your payments attach it to the result with Intents.EXTRAPAYMENT, and return RESULTOK.

This will lead to the 'choose receipt method' screen without the $0 payment, but do note that the receipt will be a payment receipt for only the payment you attached as an extra.

If you need that receipt to reflect all of the payments you have added, they would need to be combined into a single payment.

1 comment
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.

Hello @AnthonyPinto , thank you for the suggestion.

Unfortunately I have tried:

  • create web payment, sync, wait 10 seconds, return in Intents.EXTRA_PAYMENT new Payment object with correct tender,id, etc ....
  • do not create web payment, return in Intents.EXTRA_PAYMENT a new Payment with tender amount, etc
  • create web payment, sync, wait 10 seconds, return in Intents.EXTRAPAYMENTID the correct payment ID

But nothing changed the behaviour that either the payment is not listed at all or it is listed in payments, but the screen still shows outstanding $0 amount to pay cash.

Ondrej

0 Likes 0 ·

Welcome to the
Clover Developer Community