question

marcvsdev avatar image
marcvsdev asked guillemotadmire answered

Total Dollar Amount of All Unsettled Transactions

How can I get total amount of all unsettled transactions using either the Clover RemotePay SDK or the Clover WIndows SDK. I have noticed that there is a class on Clover WIndows SDK called BatchCardTotal. (com.clover.remote.sdk.v3.payments.BacthCardTotal)
Can this class get me the total unsettled transactions amount? If yes can I get a sample code to use it.

clover developer community
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.

hampton avatar image hampton commented ·

Some merchants are configured to add a surcharge to all credit card transactions they process. This surcharge is a set percentage of the post-tax order total.

getaway shootout

0 Likes 0 ·
joanneprofitt avatar image
joanneprofitt answered parquet76 commented

@territorial io Hello,

To obtain the total amount of all unsettled transactions, you would need to implement additional logic in your application. Here's a general approach you can follow:

1. Retrieve the list of transactions: Use the appropriate method from the Clover SDK to fetch a list of transactions from the Clover device or Clover backend. These transactions will include both settled and unsettled ones.

2. Filter unsettled transactions: Iterate through the list of transactions and filter out the unsettled transactions based on their status. Each transaction object typically has a field that indicates its status, such as "SETTLED" or "VOIDED". Exclude transactions with a status indicating they have been settled.

3. Calculate the total amount: Sum up the amounts of the remaining unsettled transactions to obtain the total unsettled amount. Make sure to consider the currency and handle any necessary conversions.

Here's a sample code snippet in Java showcasing this approach:

java
// Assuming you have a CloverConnector instance called "cloverConnector"


// Retrieve the list of transactions
cloverConnector.getTransactions(new TransactionQuery(), new ICloverConnectorListener() {
    @Override
    public void onQueryTransactionsResponse(QueryTransactionsResponse response) {
        if (response.isSuccess()) {
            List<Transaction> transactions = response.getTransactions();


            // Filter unsettled transactions
            List<Transaction> unsettledTransactions = new ArrayList<>();
            for (Transaction transaction : transactions) {
                if (!transaction.getCardTransaction().getStatus().equals("SETTLED")) {
                    unsettledTransactions.add(transaction);
                }
            }


            // Calculate the total unsettled amount
            long totalUnsettledAmount = 0;
            for (Transaction transaction : unsettledTransactions) {
                totalUnsettledAmount += transaction.getAmount();
            }


            // Use the totalUnsettledAmount as needed
            System.out.println("Total unsettled amount: " + totalUnsettledAmount);
        } else {
            // Handle the error
            System.out.println("Failed to retrieve transactions: " + response.getResult());
        }
    }


    // Implement other required methods of ICloverConnectorListener
});

Note that this code assumes you have properly set up the CloverConnector instance and implemented the ICloverConnectorListener interface to handle the response and other events from the Clover device.

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.

marcvsdev avatar image marcvsdev commented ·

Your solution is very promising and in the right direction.

But unfortunately my program is for Semi Integrated Windows POS using SNDP for DotNet in CSharp and not using java. My ICloverConnector as well as my ICloverConnectorListener objects do not have that .getTransactions command.

On my program the cloverConnector is installed and instantiated. Right now the program is already in production for more than a year and it can do sales, refund, void, etc., with no problem. Its just right now we need this feature to get total unsettled transactions. Some how I cannot find the cloverconnector command in CSharp to do it. Are you or anyone else can help me with this feature in CSharp? Thank you

0 Likes 0 ·
parquet76 avatar image parquet76 marcvsdev commented ·
Dud, that was likely a ai chat bot response, generally garbage. You would need to use the REST API, clover connector doesn't have this capability.
0 Likes 0 ·
guillemotadmire avatar image
guillemotadmire answered

@dinosaur game Hi,

The Unsettled Transactions page allows you to review transactions that have not yet been sent for settlement. Depending on the status of these transactions, they can be either voided, or captured and submitted for settlement.

10 |2000

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

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