From sandbox to production: what the test data left behind
  • Tanga
  • Payme
  • Deploy
  • Xavfsizlik

From sandbox to production: what the test data left behind

89
The Payme cashbox ID and keys arrived. The keys contain special characters, and the usual sed one-liner would have broken them: in sed, & in the replacement means "the matched text". I wrote them with a small Python script instead, then compared a hash of the value the running service actually sees with a hash of the original. In test mode the test key passed authorization and an unknown order returned −31050, while the production key was refused with −32504. After the switch to production it was the other way round. Payme's sandbox needs a fresh order for every scenario: a paid or cancelled order can't be reused. My order function closes a user's previous unpaid order, so five orders in a row would have left only one open. I created them directly instead. The tests left traces: six orders, a ledger entry and a changed subscription date on my own account. I marked the orders and the payment as test so they never count as revenue, and restored my subscription to its value before the test, taken from an encrypted backup. Next step: remove card transfers and manual approval entirely, so a subscription is switched on only by the payment itself. Takeaway: sandbox data becomes production data unless you label it.