Google refunded $200 because I missed 5 lines of Code
aswinmohanme.github.io
aswinmohanme.github.io
Every night the platform would kick off a process to claim money from the telco using some key which was tied to an SMS the user had sent.
That process was responsible for more than $1 million a month, but it was buggy as hell.
Half of the billing attempts would fail, the retry logic was buggy, processes would crash so you would just start them again without proper semantics to ensure you don’t bill people twice.
After a while there were so many retries outstanding that you couldn’t get through them overnight, so we would try in random orders and we would have the process running from 3 days ago whilst try close off today’s bills.
I’m sure people were billed incorrectly and a lot of money was left on the table from users who should have been billed. We never really heard a lot of noise about this either.
So I’m sympathetic to this process and glad that Apple and Google have improved the confidence around mobile commerce.
Why? Because most accounting software is horrible and have minimal to no third party integration options. Many of them don't have an API, so the only option you're left with is manually (!) importing some XML structure every day. The logic is usually very limited so stuff like record mutations are often silently ignored during the import.
The accounting software world is evil. Deliberately engineered vendor lock-in, very limited third party integrations, ridiculous charges for 'custom' implementations, etc. I once build a migration tool for a well known accounting/ERP suite, and my partnership with them was immediately terminated due to 'breach of terms'.
https://www.businessinsider.com/google-emails-adtrader-lawsu...
Carrier Billing has definitely gotten better and easier. From the Google Play side of things, there is an API that is used to help with things (no public docs I can find sadly).
If you want to get a feeling of what it looks like, you can check out Standard Payments: https://developers.google.com/standard-payments/
Imagine having an app about there ticking away and making pretty decent revenue. Little do you know there's a subtle error in business critical code (e.g. in-app purchases, ads, etc), reducing the revenue by over 50%. This is something I've seen first-hand and have become quite paranoid about. I suspect that it happens a lot. The reality is, no matter how many times one looks at their own code, there is no substitute for continuous testing of typical use cases in a production environment, ensuring that business critical code functions as expected. It's a continious process, because even if the code works properly at the beginng and isn't modified, the underlying OS or API's it interacts with can change and introduce unexpected behaviour.
There are ways to mitigate this: 1. Instrument, monitor, alert 2. Experiment, and convert canaries to experiments.
It's really vital to thoroughly test and verify any financial code. Any code, but financial doubly so. And do it again in production. Even small errors can really add up over time.
Why are you getting declined transactions? Why are you getting chargebacks? Are we getting one transaction per sale?
Can someone who understands this domain better explain why this exists?
A superficial reading of the text triggers thoughts of "fraud prevention", but the code the author uses to fix it is clearly one a fraudulent app can also easily include.
Other thoughts about preventing poor user experiences such as dark patterns to trigger accidental purchases, or bait-and-switch functionality with Fremium apps also don't seem to be prevented by this.
So what's going on?
This ACK confirms that the application properly processed the notification and delivered the item to the user. Otherwise, Play assumes that the purchase was lost in the ether sometime before fulfillment (e.g. bug, the app crashed, etc.).
Without acknowledging the purchase the money was refunded back to the people who purchased it. And the best thing was the dark theme would be activated even if the user got the money refunded.
I'm not familiar with the API, and I could see both of them looking the same on the dashboard, but Google themselves should be able to distinguish between the two, and one of the two cases is very likely a bug in the app code. I could not see a case where not acknowledging the purchase would be intended.
I'm happy to hear some developers still care about size esp. for mobile, but on the other end, I'm sad because I'm currently using Flutter for building apps and I'm jealous of that 4.5MB difference :D
Maybe it also lengthens the app loading but everybody here doesn't talk about it because it's well known of android developers, which I'm not?
I also didn't see that the difference is just 5MB. Most apps are in the double or even triple digits.
In addition, caring about anything being 3 times larger than necessary stikes me as the right mindset. Individual items may insignificant but they add up. It's certainly better than the electron-ic opposite.
For users who haven't enabled automatic updates, they're going to delay updates more often for bigger apps too.
There may be runtime impacts too, but that's outside my area of knowledge. I would guess there are better things to look at to improve responsiveness of an app than simply executable size, but it probably doesn't hurt.
This aside, I am surprised somebody changed framework not once but twice ! That must be a small codebase (or somebody that really loves to experiment).
I would hope that there is something more robust for server-handled purchased though.
It was an unfortunate mistake by the author, but it makes perfect sense why it happened. The person who made the mistake should lose out.
A lesson for next time always read blog posts about new APIs you are planning on implementing, especially when it comes to payments.
One change I'd suggest, dragging to reorder custom apps.
I actually looked at this because I thought Google had refunded money to the author and I wanted to see what had actually inspired an act of customer service from a company known for not having it.