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
Type | Name | Description | Schema | Example |
---|---|---|---|---|
Body | signature | Notification signature based on transaction parameter | string | "0x7b87a3c4dd63bee43d4c88" |
Body | transaction | Transaction resource in json | string |
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"}}
Name | Description | Schema | Example |
---|---|---|---|
uid | Unique ID for transaction resource | string | "ApGuj5aRILeWka8P" |
domain | Package name | string | "com.mygamestudio.game" |
product | Product name (aka SKU) | string | "sword.001" |
status | Transaction status | string | "COMPLETED" or "CANCELED" or "FAILED" |
added | Transaction added timestmap | string | "2018-11-02 11:24:31.815136" |
modified | Transaction modified timestmap | string | "2018-11-02 11:26:46.043137" |
price.appc | Transaction price in AppCoins | string | "1" |
price.currency | Transaction price currency | string | "USD" |
price.value | Transaction price value | string | "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:
- (PHP) PHP validation
- (JS / Node) Javascript validation
Updated over 5 years ago