In this section you become familiar with the following parts of the in-game payment integration procedure:
How to validate the POST data returned by the payment callback function.
Before confirming the credit and updating the user’s balance with the purchased amount, check the POST data you receive with the callback:
|hash||Each call requires a handshake hash, generated using theÂ SHA-256Â algorithm.TheÂ hashÂ value is returned with the callback.Verify the hash contentÂ to make sure the payment confirmation originates from the Spil Games payment service.|
|transaction_id||The transaction ID.You receive the transaction ID value from Spil Games.Every time a new payment is initiated, a new transaction ID is issued.Use theÂ transaction_idÂ parameter to identify the transaction on your side.Use this parameter and the corresponding value to verify payments on your end.Do notÂ rely on other parameters like currency or amount, since they may need to be modified to accommodate users’ local currencies.|
|status||End status of the transaction.For further details, seeÂ Payment end statuses.|
You can add virtual currency to the user’s balance if the payment status value isÂ PAID.The paid amount valueÂ must equalÂ the amount value.If the paid amount is zero:
If the paid amount is larger than zero, but not equal to the amount:
In case of a partial payment, check theÂ PARTIALÂ payment end status inÂ Payment end statuses.
The parameters listed below are identical to those you pass with theÂ showPaymentSelectionScreenÂ call to trigger the payment selection screen.
As a best practice, we recommend you log these and other events that can modify the balance.
Before confirming the credit and updating the user’s balance with the purchased amount, you may wish to check also the following additional POST parameters:
|This input parameter corresponds to…||… this POST parameter returned with the callback|
|params(optional custom parameters)||custom_parameters|