question

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

We are getting this error while adding PER_UNIT Item to Order to do payment. com.clover.sdk.v1.ClientException: status code: -1

We are getting this error while adding PER_UNIT Item to Order before doing payment.
The Error is :- com.clover.sdk.v1.ClientException: status code: -1

The code for adding the item
LineItem tempItem = mOrderConnector.addPerUnitLineItem(mOrderId, mItem.getId(), getVolume(), null, userDataObject.toString());
Clover Android 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.

dhanaraj avatar image dhanaraj commented ·

hey, i am facing issue in order connector add lineitem modification, so if u have found any solution reply me ASAP

0 Likes 0 ·
dhanaraj avatar image
dhanaraj answered zgreathouse Deactivated commented
Hi saad_bin_iqbal,

	If we want to add the PERUNIT type to line item, have to mention the line item stack count as integer value don't go with getVolume() method. 

mLineItem = orderConnector.addPerUnitLineItem(mOrder.getId(), mItem.getId(), mItem.getStockCount().intValue(), null, null);
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 ·

Thanks, Dhanaraj for your response.

Actually getVolume() methods returns Int value already.

Well, I got that there is something wrong with mItem.getId() method. It does not pic same Item's Id as Clover have. That's why I get that error.

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

When you say "It does not pic same Item's Id as Clover have" do you mean you get a different value than what you expected? Or are you perhaps getting a null value?

0 Likes 0 ·
dhanaraj avatar image
dhanaraj answered
10 |2000

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