3. Quick Payments Integration
How to launch a shop
If your game doesn't feature in-game purchases, skip payments integration for good. If you have integrated our login system, you are ready to go live!
But, if your game features in-game purchases, you need to integrate payments and create a game shop.
This section explains the quick payments integration, where developers let IDC Games manage the payments integration and your players make purchases at the default game shop, which is automatically created for you game both at at both the website and the launcher, upon uploading it to our platform.
About game shops
A game shop is always located at the game's URL shop folder and will look something like this: https://en.idcgames.com/game_name/shop.
At the Shop section of the Panel you can configure the items you want to sell so you can identify them at the game's backend. Check out the documentation for configuring items at 1. Panel Guide > 1.3. Shop section. There you will be able to configure items, articles, offers, promo codes, apart from the proper shop (tabs, target users, themes, etc).
There are 3 ways of launching a game's shop:
1. Launch the shop at the IDC Games platform (not recommended).
2. Launch the shop at the game's browser or at an external browser.
3. Launch the shop at the IDC Games launcher.
1. Launching a shop at the IDC Games platform
With this option, the user is directed to the game's shop URL at the platform (web) to make a purchase, where he has to log in before making the purchase. The IDC Games platform will then make an http request to the developer's server, where the developer has to define the callback with the details of the transaction and send the answer to IDC Games. This option is not recommended because the user is not always loged in when making a purchase attempt, and having to log in can disencourage him from completing the process.
2. Launching a shop at the game's browser or at an external browser
The shop is launched with the following code, where "game" is the game's ID:
The developer has to define the callback at the Panel.
Parameters of the answer
Upon a purchase completion, the game will receive callback to the endpoint provided with a POST request wiht a Json inside that will look like this:
PARAMETER NAME | DESCRIPTION | TYPE |
---|---|---|
action | Type of event triggered. For purchase events the value is "idcpayment" | String |
useridc | ID of the user that triggers the event within the IDC Games platform | String |
gamer_ip | IP address of the user that triggers the event | Number |
transactionid | Transaction or purchase identifier | Number |
sandbox | Values "0" for false and "1" for true | Boolean |
refund | Values "0" for false and "1" for true | Boolean |
country | Country ISO 3166-1 alpha-2 code | String |
currency | Currency ISO 4217 alphabetic code (EUR, USD, GBP, etc.) | String |
amount_total | Total price of the transaction, the actual price the end user will pay, the sum of all the variables "price" of the items purchased ("bought_items") in the transaction | Number |
amount_net | Total net price of the transaction without VAT, the sum of all the variables "price_net" of the items purchased in the transaction | Number |
amount_vat | Total VAT price of the transaction | Number |
provider | Payment method selected by the user, values "Paypal", "Paysafecard", "Skrill", etc | String |
bought_data | Array for each and every item purchased witht the details of the transaction | array |
Variables for the bought_data (purchased items) array:
PARAMETER NAME | DESCRIPTION | TYPE |
---|---|---|
game_item_id | Game item identifier, set by developer at the platform section Shop > Items | String |
game_article_id | Game article identifier, set by developer at the platform section Shop > Articles | Number |
idc_article_token | Article token | String |
number_of_items | Number of game items purchased | Number |
price | End user price of the transaction, the actual price the end user will pay for current item | Number |
price_net | Net price of the transaction without VAT | Number |
currency | ISO 4217 currency alphabetic currency code (EUR, USD, GBP, etc.) | String |
article_count | Number of articles within the transaction | Number |
has_offer | Values "0" for false and "1" for true | Boolean |
offer_discount | Values "0" for false and "1" for true | Boolean |
has_coupon | Values "0" for false and "1" for true | Boolean |
coupon_discount | Values "0" for false and "1" for true | Boolean |
Example of a callback request:
Developers can test the callback with this example of a PostMan request to a callback URL:
3. Launching the shop at the IDC Games launcher
These are the necessary steps in order to use IDCLauncher Shop. IDC Games Launcher must be executed if you want to use these functions.
1. Create callback function (see OnPurchaseNotify function code). This is the function that will be called every time that a new notification is received.
2. Activate notifications (see activatePurchaseNotifications function code). Before opening the shop notifications must be configured, since all the purchase notifications will be received by the callback configured there. Once you activate notifications you will receive all pending purchase notifications for the user. Every purchased element must be added to the user inventory. Once items are added to the user inventory, the transaction must be closed to change it's status from pending to closed.
3. Open shop (see openShopPurchase function code). This function will open IDCGames Launcher shop. If the user makes a successfull transaction, a new purchase notification will be received.
4. Close transaction (see closeShopTransaction function Code). This function is used to notify idcgames that an item has been successfully assigned to a user. Once that an item has been assigned to the user, transaction must be close to avoid receiving repeated purchase notifications.
Configure the notification of payment events:
There are 2 ways of receiving payment notifications:
DLL event, which invokes a function where the items of the purchase are notified. If a purchase takes place at the web and the game is not launched at the time, the DLL event will receive the notification upon the next launching of the game.
Callback URL (optional). Add a Callback URL at the panel which contains within all the the information related to a purchase.
Last updated