Async Notification

Async notification

On top of the synchronous response, EIP-681A payments provides an asynchronous notification service allow you to sync AppCoins transactions with your own servers. The EIP-681A notification service triggers a notification when a completed, canceled or failed event occurs. In order to use this service you must set the callback_url parameter at the EIP-681A URI and prepare your server to receive a sign transaction resource as described bellow.

Method
POST

HTTP request example

https://www.mygamestudio.com/v1/appcoins_ipn.php?out_trade_no=2082389608326064

Parameters

TypeNameDescriptionSchemaExample
BodysignatureNotification signature based on transaction parameterstring"0x7b87a3c4dd63bee43d4c88"
BodytransactionTransaction resource in jsonstring

Transaction parameter fields

This parameter represents a transaction resource under a json string schema. This data is used to generate the signature parameter that we recommend to be validated as described on the 'Validate transaction resource' section.

{"uid":"ApGuj5aRILeWka8P","domain":"com.mygamestudio.game","product":"sword.001","status":"COMPLETED","added":"2018-11-0211:24:31.815136","modified":"2018-11-0211:26:46.043137","price":{"appc":"1","currency":"USD","value":"0.1"}}
NameDescriptionSchemaExample
uidUnique ID for transaction resourcestring"ApGuj5aRILeWka8P"
domainPackage namestring"com.mygamestudio.game"
productProduct name (aka SKU)string"sword.001"
statusTransaction statusstring"COMPLETED" or "CANCELED" or "FAILED"
addedTransaction added timestmapstring"2018-11-02 11:24:31.815136"
modifiedTransaction modified timestmapstring"2018-11-02 11:26:46.043137"
price.appcTransaction price in AppCoinsstring"1"
price.currencyTransaction price currencystring"USD"
price.valueTransaction price valuestring"0.1"

Validate transaction resource

The transaction resource is signed with your wallet private key. In order to validate if the signature parameter match to the transaction parameter, one of the following examples can be used: