question

Bryanne Vega avatar image
Bryanne Vega asked Bryanne Vega commented

Can com.clover.intent.action.PAYMENT_PROCESSED give payment details ?

Can com.clover.intent.action.PAYMENT_PROCESSED give payment details such as:

Total Subtotal Discounts Tax Rates Taxes Amount Non-taxable amounts

Etc?

Intents
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mark R avatar image
Mark R answered

Looks like it gives only following extras. Once you have the PaymentID and OrderID, you can do a web api call with that PaymentID to get more details about that payment.

com.clover.intent.extra.ORDER_ID – String: The ID of the order.

com.clover.intent.extra.PAYMENT_ID – String: The ID of the new payment.

com.clover.intent.extra.AMOUNT – Long: The amount (in cents) of the payment.

Reference : https://docs.clover.com/build/android...

https://www.clover.com/api_docs#!/pay...

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jacob Abrams avatar image
Jacob Abrams answered Bryanne Vega commented

Mark R's answer is pretty good. Once you've got the Order using the ORDER_ID you can use the OrderCalc class to give you the information you want. Please take a look at the OrderCalc class to see all the functions available. In some cases you may need to do some simple math if there isn't a function that gives exactly what you want. Here is some example code:

String orderId = intent.getStringExtra(Intents.EXTRA_ORDER_ID);
String paymentId = intent.getStringExtra(Intents.EXTRA_PAYMENT_ID);
long amount = intent.getLongExtra(Intents.EXTRA_AMOUNT, 0l);

OrderConnector connector = new OrderConnector(...)

com.clover.sdk.v3.order.Order o = connector.getOrder(orderId);
OrderCalc oc = new OrderCalc(o);
long tax = oc.getTax();
long subtotal = oc.getLineSubtotal(o.getLineItems());
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.

Bryanne Vega avatar image Bryanne Vega commented ·

Thanks for the great tip! My software would need to be compatible with the 2000 software (& pro) so it must be by Rest API requests, thank you!

0 Likes 0 ·

Welcome to the
Clover Developer Community