rajeshghosh avatar image
rajeshghosh asked tamer commented

Can not delete modifiers added to line item using Clover SDK

Hi All,

Anybody has any idea, why can't i remove a modifier from a line item ? Whereas I have been able to add.

I have added modifier using OrderConnector's addLineItemModification function now I am using OrderConnector's deleteLineItemModifications functions, but it doesn't let me do it, it throws ClientException. Really appreciate your help on this.

Regards Rajesh

10 |2000

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

Can you provide a little bit more information? If you can supply the relevant lines of code and the output from `adb logcat -v time` when you attempt to run the code.

0 Likes 0 ·

Sure, the exception I am getting com.clover.sdk.v1.ClientException at com.clover.sdk.v1.ServiceConnector.throwOnFailure( at com.clover.sdk.v1.ServiceConnector.execute( at com.clover.sdk.v3.order.OrderConnector.deleteLineItemModifications( And the responsible code for this [orderconnection instance].deleteLineItemModifications(ORDER_ID, LINE_ITEM_ID, List of ModificationIds);

0 Likes 0 ·

Hmm unfortunately there's not enough information there to figure it out. We need to make some improvements in our logging...

0 Likes 0 ·
Jacob Abrams avatar image
Jacob Abrams answered tamer commented

Looking at our code I see a few possibilities:

  • Unknown or empty order id
  • Empty line item id
  • Empty modification id list
  • Order is locked (an order becomes locked when there are already payments, credits or refunds)

Can you print out the Order object you trying to modify to logcat using Log.d(TAG, "Order: " + order) and send us the results.

10 |2000

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

Since this comment box doesn't allow me posting more than 600 chars here is the required information Order Status = open :: Order ID =YQ22JCCZ5R01J :: Line Item ID = V4VKVNXN3QP06 Modification ID = NC4D32VE34KK0 Order Object Snippet "manualTransaction":false,"state":"open" Steps I Followed 1. Added LineItem 2. Added Modifier to the LineItem as no way to add Modification object 3. Before delete modifiers I have to loop through all Modifications and then compare Modifire from the list of Modifications and got Modification ID as delete lineitem modifier require Modification ID not Modifier ID

0 Likes 0 ·

Any updates from Clover SDK developers. Please help me out on this, as you are the only one who can help me.

0 Likes 0 ·

Can you use to send us the entire toString output of your order right before you invoke the deleteLineItemModifications method?

0 Likes 0 ·

Please check this pastbin link

0 Likes 0 ·

Thanks, can you also paste in some lines of code you are using to delete modifiers?

0 Likes 0 ·
Show more comments
Mike M avatar image
Mike M answered tamer commented

Can you put a breakpoint where the exception is being thrown so you can catch it? Then please inspect the ClientException and let us know what its message is, or log it to logcat. All our exceptions should have a reason given as the message field.

10 |2000

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

Using break point I could get a least amount data .. see below


ResultStatus{statusCode=UNKNOWN, statusMessage=null}

0 Likes 0 ·

What version of Clover Services (com.clover.engine) and the clover-android-sdk are you using?

0 Likes 0 ·

Welcome to the
Clover Developer Community