• Home
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • App Market Developer Platform
  • Clover GO
  • Ideas & Feedback
  • Semi-Integration
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
Skip to main content
  • Create
    • Ask a question
    • Post an idea
    • App Market Developer Platform
    • Clover GO
    • Ideas & Feedback
    • Semi-Integration
    • Topics
    • Questions
    • Articles
    • Ideas
  • Sign in
  • Home
  • App Market Developer Platform
This question was closed 2 days ago by David Marginian for the following reason: The question is answered, right answer was accepted

question

ojhatushar avatar image
ojhatushar asked · 4 days ago

How to get open order from clover sdk

Hi

I am creating order from my application using below function:-

Order order = orderConnector.createOrder(new Order());

I want to ask below things.

How to get all orders which is open ? Can we get order state?

OrdersClover Android SDK
Comment
0
10 |2000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

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

2 Answers

  • Sort by Created Created
  • Sort by Oldest Oldest
  • Sort by Votes Votes
Jacob Abrams avatar image
Jacob Abrams answered · 3 days ago ACCEPTED ANSWER

You can use the OrderContract in the clover-android-sdk:

https://github.com/clover/clover-android-sdk/blob/master/clover-android-sdk/src/main/java/com/clover/sdk/v3/order/OrderContract.java

Use the contract with ContentProvider#query

https://developer.android.com/reference/android/content/ContentResolver?hl=en#query(android.net.Uri,%20java.lang.String%5B%5D,%20java.lang.String,%20java.lang.String%5B%5D,%20java.lang.String)

The query should have the following params:

uri: OrdersContract.Summaries.contentUriWithAccount(...)

projection: null (or the specific columns you want)

selection: OrdersContract.Summaries.PAYMENT_STATE + " = ?"

selectionArgs: { "OPEN" }

sortOrder: OrderContract.Summaries.CREATED + " DESC"


You will get back a Cursor that you may iterate over and read the results. Our OrderPaidActivity example in clover-android-sdk has an example query using the OrderContract in it.

You should also read about content provider if you aren't familiar with it here: https://developer.android.com/guide/topics/providers/content-provider-basics

· 2 comments · Share
10 |2000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

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

David Marginian avatar image David Marginian ♦♦ · 3 days ago

Thanks Jacob. Very good to know. Do we have documentation on this?

0 · ·
Jacob Abrams avatar image Jacob Abrams ♦ David Marginian ♦♦ · 3 days ago

We need to improve documentation on our clover-android-sdk, especially regarding contracts.

Looking at the main javadoc front page located here https://clover.github.io/clover-android-sdk/ you will notice the following statement: "Searching for and displaying large amounts of data is best done through a content provider" followed by a link to the OrderContract javadocs which are quite minimal unfortunately.

0 · ·
David Marginian avatar image
David Marginian answered · 4 days ago EXPERT ANSWER

I believe OrderConnector can retrieve a list of orders only by id. I think you will have to use the REST API to filter by state - https://docs.clover.com/clover-platform/reference#ordergetorders-2.

· 2 comments · Share
10 |2000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

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

ojhatushar avatar image ojhatushar · 4 days ago

Any another way, I want to get only open orders using clover sdk

0 · ·
Jacob Abrams avatar image Jacob Abrams ♦ · 3 days ago

Android apps running on Clover devices should avoid using the REST API, it's almost never necessary. Using the REST API from android apps is much slower and requires an active network connection but our goal is for nearly all functionality on our devices to work offline as well as online. Nearly all the data and functionality needed should be available in the clover-android-sdk.

0 · ·

Welcome to the
Clover Developer Community

question details

3 People are following this question.

ojhatushar follows this question david.marginian follows this question jacobabrams follows this question
Answers Subscribe to Answers Answers and Comments Subscribe to Comments and Answers

Related Questions

Insert item into order list items 1 Answer

Passing Tax Value to PreAuth Capture 0 Answers

Create order with customer with an associated client 2 Answers

can i get order's invoice using clover api? 1 Answer

Customer Receipt Printing fails for orders made via API 1 Answer

Answerhub Logo
  • About
  • ·
  • FAQ
  • ·
  • Privacy
  • ·
  • Copyright © 2010-19 DZone, Inc.