question

blueleaves avatar image
blueleaves asked Jeffrey Blattman commented

Customer Address Not showing up on Receipt

Hello, all.

For my application I allow an end user to dynamically create a Customer in my own activity. I have the Activity's layout set up with all of the correct data fields (EditTexts in Android) so the user can type in:

  • first name
  • last name
  • phone number
  • email address
  • Addresses (all 3)
  • City, State, Zip

The problem that seems to be occurring is that the Addresses are not saving to the Customer so that, when this customer has an order created for him/her, and a receipt is printed, the Customer's address is not showing up on the receipt. Here is the code I am using to save the Customer's address:

customerConnector.addAddress(customer.getId(), addressOne, addressTwo, addressThree, city, state,   zipCode);

Note*: each of the variables are String data types that are extracted from the EditText widgets.

*Also, the Phone Number and Email Address appear on the receipt, just not the Addresses. Likewise, I use their customerConnector().set... counterpart methods as well.

Any information would be helpful to me with this problem. Does the internal mechanism of customerConnector.setAddress() act differently than the other 'customerConnector().setEmailAddress(), etc' methods? Am I using it correctly?

Thanks!

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

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

I verified that if I use our Customer app, open an order for a customer, and then print the order receipt, the customer information does show. Still investigating.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

Does your app have CUSTOMERS_W permission?

0 Likes 0 ·
blueleaves avatar image blueleaves commented ·

Hey, Jeff. Thanks for the replies and help.

Yes, my application does have the CUSTOMER_W permission.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

Can you capture a logcat around you calling addAddress() and perhaps link to it from pastebin? If you go to the Customers app, do you see the address there?

0 Likes 0 ·
q-factor avatar image q-factor commented ·

Was this issue resolved ?

0 Likes 0 ·
Show more comments

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered Jeffrey Blattman commented
Do you see the updated customer fields when you retrieve that customer programmtically or from within the Customers app?
5 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.

blueleaves avatar image blueleaves commented ·

I believe that if the end user selects the option to do so, the Customer's address will appear on the receipt:

https://help.clover.com/article/recei...

"Check Show customer info on order receipt to display the customer’s name, address, phone, and email address on the order receipt"

As for your question, the customer fields do appear to be retrieved both programmatically and from the Customers app on my emulator. Nonetheless, there is a discrepancy when testing it on a device, as the address will be retrieved for some end users and not for others.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ blueleaves commented ·

I stand corrected I forgot about that option. For everyone on this thread, it would help if you can either provide a simple set of steps that can be done using Clover apps (as an end user) or a programmatic MCVE that shows the problem. I see the feature working in the simple case here. If your case, if you can provide say an example app that creates a customer, adds an address, then get the customer and show the address does not exist, then I can file a bug here on the problem.

0 Likes 0 ·
blueleaves avatar image blueleaves commented ·

I would also like to add that this code yields a null result:

List<Customer> customersList = customerConnector.getCustomers();
Customer customer  =  customersList.get(0);
String phoneNumber = customer.getPhoneNumbers().get(0).getPhoneNumber();  // phoneNumber is null

While this code will not:

List<Customer> customersList = customerConnector.getCustomers();
Customer customer = customerConnector.getCustomer(customerLists.get(0).getId());
String phoneNumber = customer.getPhoneNumbers().get(0).getPhoneNumber();  // phoneNumber is not null

Do you know why this might be?

0 Likes 0 ·
blueleaves avatar image blueleaves commented ·

Any help with this would be much appreciated. Thanks!

0 Likes 0 ·
biteheist avatar image biteheist commented ·
Was there any resolution? Our printed receipts are completely different than the web receipts.
0 Likes 0 ·

Welcome to the
Clover Developer Community