By Xav

← Writing

Whose number belongs on the receipt?

If I send you a mobile plan, the first thing I look for on the receipt is your number. I want to know that I sent it to the right person.

In MyDigicel, a purchase summary could get a phone number from the currently selected account. For an ordinary purchase, that made sense. A gift introduced a second person. Both numbers were valid, and either one looked perfectly reasonable on a receipt.

Keep the recipient with the gift

When I choose who gets the plan, the app already has the answer the receipt needs. I changed the gifting flow to carry that number through to the summary. A purchase for my own account could keep using the selected account.

The easiest way to miss the difference is to test with a single number. I’d sign in as one person, send the plan to another, and read the receipt as the sender. Then I’d buy a plan for myself and check that receipt too.

Choose data that can prove you wrong

Say the selected account ends in 11 and the recipient ends in 42. For the gift, I expect 42 on the summary. For a purchase for myself, I expect 11. I’d assert the number in the recipient field specifically. Searching the whole page for 42 could pass even if the field itself showed the wrong person.

What makes this worth writing about is that the two values have the same type and are both available to the app. A type check can tell me I have a phone number. Only the purchase context tells me whose number belongs on this receipt. That’s why I carry the recipient forward from the gift instead of reconstructing it from whichever account happens to be selected later.

All posts →