How to interpret the POST data parameters included in the callback notification e-mail triggered by the payment callback function.
Send this reply to every payment notification you receive through the callback, regardless the reported payment status.
When you reply to the callback URL withÂ [OK], you stop receiving automated callback notifications for payment transactions.
If you do not send this reply, callback POST data for payment transactions remain in the payment queue for 7 days/one week; during this period, callback notifications are sent on an hourly basis.
Callback failure notifications are automated e-mails triggered by theÂ payment callback. They are sent to the following recipients:
The POST data format is alwaysÂ plain text, regardless theÂ Content-TypeÂ header fieldÂ value.
Callback notification e-mail subjects follow the pattern described in the table below.
In an actual e-mail subject, theÂ <game name>Â placeholder is replaced with the game name the callback failure notification refers to.
|Live||[Payment Service LIVE] Callback failure: <game name>|
TheÂ URLÂ section contains theÂ payment callback URLÂ you as a game developer set and configure in theÂ payment administration tool.
Use it to validate payment data on your end.
TheÂ HEADERSÂ section contains theÂ HTTP headersÂ you as a game developer define and send along with the response.
Typical HTTP headers that can be included in a callback notification are:
TheÂ StatusÂ header and theÂ status codeÂ associated to it can provide information about possible issues, for example when a payment fails (status code:404) or when the partner’s server behaves unexpectedly (status code:Â 500).
TheÂ BODYÂ section contains the callback message body. You as a game developer define it. It can be anything you want to include.
If you want to stop receiving automated callback notifications for a given payment transaction, you need to reply withÂ [OK]Â (square brackets included) in the BODY section. In this way, the POST data associated to that payment transaction are removed from the payment queue, and notification e-mail sending is stopped.
TheÂ BODYÂ section contains the POST data parameters.
The table below lists the supplied POST parameters and their corresponding values.
|transaction_id||integer||Yes||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 this parameter and the corresponding value to verify payments on your end.When you want to refer to a specific payment transaction, include the corresponding transaction ID value in your communication with the Spil Games support team assisting you.Example:Â 123|
|amount||integer||Yes||The amount due, the total sum the user needs to pay to purchase the selected package.The value is inÂ cents.Example:Â 800|
|paid_amount||integer||Yes||The amount the user paid to purchase the selected package.The value is inÂ cents.Example:Â 800|
|game_id||integer||Yes||The game ID value, as sent by the game developer to Spil GamesÂ on their first request.Example:Â 203|
|site_id||integer||Yes||The site ID value, as sent by the game developer to Spil GamesÂ on their first request.Example:Â 79|
|channel_id||integer||Yes||The channel ID value, as sent by the game developer to Spil GamesÂ on their first request.Example:|
|package_id||integer||Yes||The package ID value, as sent by the game developer to Spil GamesÂ on their first request.Example:Â 42|
|sku_type||string||Yes||TheÂ SKUÂ type/name, as sent by the game developer to Spil GamesÂ on their first request.Example:Â coins|
|sku_unit||integer||Yes||TheÂ SKUÂ measurement unit, as sent by the game developer to Spil GamesÂ on their first request.Example:Â 100|
|transaction_token||string||Yes||Unique identifier for the payment selection screen instantiation.Every time the payment selection screen is triggered, a new transaction token is generated.This parameter returns theÂ tokenÂ ID valueÂ of theÂ optionsÂ object that you send as an argument when you make aÂ showPaymentSelectionScreenÂ call.Example:Â unique-alphanumeric-string-1234|
|custom_parameters||key-value pairs||Yes||Extra custom parameters that you want to be returned in theÂ callback.This parameter returns theÂ paramsÂ valueÂ of theÂ optionsÂ object that you send as an argument when you make aÂ showPaymentSelectionScreenÂ call. It can take up toÂ 200 characters.If no custom parameters are defined in theÂ showPaymentSelectionScreenÂ call, thecustom_parametersÂ returned with the callback are empty.
Example:Â key: value
|status||string||Yes||End status of the transaction.The allowed values are:
For further details, seeÂ Payment end statuses.
In case of a partial payment, check theÂ PARTIALÂ payment end status inÂ Payment end statuses.
|user_id||string||Yes||The user name value, as sent by the game developer to Spil GamesÂ on their first request.The user name string value isÂ case-insensitive.This parameter returns theÂ userIdÂ valueÂ of theÂ optionsÂ JSON object that you send as an argument when you make aÂ showPaymentSelectionScreenÂ call.The returned user name value always corresponds to the user name value given by the initial payment, which may be in a different upper-/lowercase sequence.Example:Â james_kirk|
|internal_sku_name||string||Yes||InternalÂ SKUÂ name for a specific SKU.The returned value identifies the pricing package the user selected and purchased.This value is not exposed to end users.Example:Â gamecoins|
|created||date||Yes||The creation date of the transaction, i.e. when the transaction was initiated.Date format:Â YYYY-MM-DD HH:MM:SSExample:Â 2013-06-30 19:00:05|
|lastmodified||date||Yes||The date of the latest/most recent change or modification to the transaction information.Date format:Â YYYY-MM-DD HH:MM:SSExample:Â 2013-06-30 19:01:12|
|paymentMethod||string||Yes||The payment method the end-user selected to carry out and complete the transaction.Example:Â sms|
|provider||string||Yes||The name or reference code of the payment provider service used to process the transaction.Example:Â paypal|
|currency||string||Yes||TheÂ three-letter currency codeÂ reference, as used in the payment transaction.Example:Â EUR|
|hash||string||Yes||Each call requires a handshake hash, generated using theÂ SHA-256Â algorithm.The hash value is calculated usingÂ the parameters included in this table, and you can find theÂ secret keyÂ in theÂ payment administration tool, on Menu>Account>Publisher Information. The secret is a:
For further details, seeÂ Hash verification.
|is_subscription||integer||Yes||This parameter flags whether a user has any active subscriptions.Allowed values are:
Default value:Â 0
|multiplier||decimal||Yes||This parameter allows you to check if a promotion multiplier applies to the transaction.Default value:Â 1Example:Â 1.5|
Callback failure notification email example:
HTTP/1.1 404 Not Found
Date: Tue, 23 Jul 2013 13:30:11 GMT
Server: Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/126.96.36.19935 PHP/5.3.24
<pre class="prettyprint linenums lang-json">(
[transaction_id] â12345678 // Check this parameter to verify a transaction
[amount] â 123
[paid_amount] â 123
[game_id] â 175
[site_id] â 16
[channel_id] â 1
[package_id] â 12345
[sku_type] â MegaCoins
[sku_unit] â 100
[transaction_token] â unique-alphanumeric-string-1234
[status] â PAID
[user_id] â phineasgauge1823
[internal_sku_name] â gamecoins
[created] â 2013-06-30 19:00:05
[lastmodified] â 2013-06-30 19:01:12
[paymentMethod] â sms
[provider] â payment-provider-name
[currency] â EUR
[hash] â f15da616592a0eb
[is_subscription] â 0
<pre class="prettyprint linenums">This is an automated message. For further inquiries please contact email@example.com