HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Rollback of purchases in the _BILLING system  (Read 555 times)

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Rollback of purchases in the _BILLING system
« on: Jun 27, 16, 04:18:13 PM »

We recently hooked up the in-game web store to our $_BILLING system node override and it works well, though I had a few questions about it.

Basically what I have right now is in fulfillment I am incrementing an integer field on the player account.  Then in the rollback function I decrement that field by the same amount. But I am worried about possibly decrementing that field when it was not previously incremented.

Are the fulfillment and rollback functions mutually exclusive? That is, inside of the rollback function, should I assume the code in the success function did not happen? Or would I indeed need to reverse what was done for "success"?  Most importantly, would the rollback ever be called when the fulfillment function was not called?

Also, for this transaction we do not need a node created, but it seems that the way the system is written it requires some sort of node to be created. So I left it as the default _ExternalShopItem.  But we don't want these created persisted nodes to linger, so I am destroying it in fulfillment, as well as in the rollback function should it get to there.  Destroying it would not create any issues with this system, would it?
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.