question

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

Modifiers
3 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.

Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

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 ·
rajeshghosh avatar image rajeshghosh commented ·

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

0 Likes 0 ·
Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

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.

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

rajeshghosh avatar image rajeshghosh commented ·

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 ·
rajeshghosh avatar image rajeshghosh commented ·

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 ·
Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

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

0 Likes 0 ·
rajeshghosh avatar image rajeshghosh commented ·

Please check this pastbin link

http://pastebin.com/afPixn20

0 Likes 0 ·
Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

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.

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.

rajeshghosh avatar image rajeshghosh commented ·

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

BadParcelableException

ResultStatus{statusCode=UNKNOWN, statusMessage=null}

0 Likes 0 ·
tamer avatar image tamer commented ·

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