question

justinsouter avatar image
justinsouter asked David Marginian Deactivated commented

Still having issues getting Customer info on ONE merchant

Our app relies on getting Customer information from the Order. Seems to work for all our merchants except one. Can we get some insight into why this might be? I will post the device ID as a comment-for-moderator. Thanks.

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

David Marginian avatar image David Marginian ♦♦ commented ·

Can you provide an order id in a private post as well? Is it possible there isn't a customer associated with the order? How are you obtaining the order/customer? Is it possible at some point you had to add customer read permissions? If so, is it possible the merchant never uninstalled/reinstalled your app after you added the permission?

-1 Like -1 ·
justinsouter avatar image justinsouter David Marginian ♦♦ commented ·

We've confirmed with a pic of the order screen that there is a customer attached.

Our app gets the Order and Customer with an OrderConnecter in our customer tender activity (code fragment below).

We definitely did have to add customer read permission in an app update. We had issues with this merchant in the uninstall/reinstall process but I'm relatively confident it eventually worked.


new Thread(new Runnable() {
    @Override
    public void run() {
        OrderConnector orderConnector = new OrderConnector(getApplicationContext(), CloverAccount.getAccount(TenderActivity.this), null);
        try {

            Order order = orderConnector.getOrder(mOrderId);
            List<Customer> customers = order.getCustomers();
            Logger.i("log_test", "Set CustomerInfo from " + customers.size() + " customer");

            // assign object whether or not we have an attached customer
            mTenderViewModel.CustomerInfo = new JSONObject();

            if (customers != null && customers.size() > 0) {
                try {
                    mTenderViewModel.CustomerInfo.put(Constant.KEY_MOBILE, customers.get(0).getPhoneNumbers().get(0).getPhoneNumber());
                    mTenderViewModel.CustomerInfo.put(Constant.KEY_EMAIL, customers.get(0).getEmailAddresses().get(0).getEmailAddress());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        } catch (RemoteException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        } catch (ServiceException e) {
            e.printStackTrace();
        } catch (BindingException e) {
            e.printStackTrace();
        }
    }
}).start();


0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ justinsouter commented ·

Have the merchant reproduce the issue and then immediately after send us the device logs (Help App -> Menu -> Diagnostics -> Send device logs) we can then check the logs to see if any of those exceptions are printing.

0 Likes 0 ·

0 Answers

·

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