question

saad-bin-iqbal avatar image
saad-bin-iqbal asked saad-bin-iqbal commented

I'm facing issue with total amount for Custom Line Item while making transaction on Sandbox mode.

We are using a functionality like "Safe Drop" as a Custom Line Item. We add this Custom Line Item to the Order Connector for transaction using the below code
BPS_Application.getBPSApplicationInstance().getOrderConnector().addCustomLineItem(mManualRefundOrder.getId(), mCustomLineItem, false);

Where 'mCustomLineItem' contains price(for example 10000) for quantity 1. But when we pay for this item Clover payment screen shows the amount $0.10 instead of $100. Please consider attached payment screen $0.10 for 10000. safe-drop-amount-min.png
Could you please let me know whether this issue is Clover side or I'm doing something wrong?
SandboxLineItems
2 comments
10 |2000

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

saad-bin-iqbal avatar image saad-bin-iqbal commented ·

@Mike M, @Mark Mullan Please help.

0 Likes 0 ·
saad-bin-iqbal avatar image saad-bin-iqbal commented ·
0 Likes 0 ·

1 Answer

·
Emmanuel MacCaull avatar image
Emmanuel MacCaull answered saad-bin-iqbal commented
Hi @saad_bin_iqbal,

The UnitQty field of a LineItem is actually a fixed-point integer with scaling factor of 1000.

From the docs on com.clover.sdk.v3.order.LineItem https://github.com/clover/clover-android-sdk/blob...

/**
 * Unit quantity if this line item is priced by quantity, or null if the item is not priced by quantity. The value is a fixed-point integer with scaling factor of 1000 (e.g. if charging by ounces then the value should be set to 2500 for 2.5 ounces). To compute the complete price perform the following calculation: PRICE * (UNIT QTY / 1000).
 */
public java.lang.Integer getUnitQty() {
                 

When creating a custom fixed-price LineItem, you can either set the unitQty to 1000 or leave it unset. If you setUnitQty(null), we assume the LineItem represents a single unit.
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.

saad-bin-iqbal avatar image saad-bin-iqbal commented ·

Thanks @Emmanuel MacCaull for your response.

But It was working fine earlier. I started facing this issue recently. Even It is still working fine on my Emulator device but not working on real Clover Station device.

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