Dynamic promotions
Note
In case you are using Dynamic Pricing you should skip this step.
Dynamic Promotions are promotions which do not require any registration on our system, you are able to generate them from the front-end. From our side, when we receive such a promoted transaction we directly contact your back-end, at the URL that you have provided to us as “verification URL”, providing the information below:
Value | Definition |
---|---|
method |
In this case you will receive as method name: “promotion” |
guid |
This is the value that you should use as a unique identifier for a user. For more information about GUID look here. This value is added by us. |
user_id |
The username that you have pass to us. |
sku_type |
The SKU that get’s the promotion. |
sku_unit |
The amount of the SKU without the promotion applied. |
multiplier |
The multiplier that we apply for the promotion. |
hash |
The hash that we use on the transactions. |
If we receive an [OK] as a reply from your side we grant the promotion, otherwise we process the transaction without the promotion.
Trigger a Dynamic Promotion
In your client instance, just before the showPaymentSelectionScreen() method, overwrite the onOpen event, as shown in the following example:
client.onOpen = function() {
client.showPromotion({multiplier:1.7}); // 70% extra SKU amount
};
Name | Type | Mandatory? | Definition |
---|---|---|---|
multiplier | numeric | Yes |
Calculates the extra SKU amount you assign to the promotion.It accepts numeric values:
|
Info
You cannot set up a new promotion for a specific game/site combination while an existing promotion targeting the same site/game combination is running.
Examples
When you copy-paste these examples, make sure you replace the dummy data with actual, valid data.
Dynamic promotion
The method in the example below takes an object as its first and only argument. The object is a simple key-value representation of the parameters used to determine the content of the payment selection screen.
var client = new PaymentClient();
var options = {
'siteId': 1,
'gameId': 1,
'userId': 'john.doe',
'token': 'example-token-1234',
'params': 'action=payment&source=spilgames',
'selectedSku': 'greendiamonds'
};
// Optional: active dynamic promotion
client.onOpen = function() {
client.showPromotion({multiplier:1.7}); // 70% of extra sku
};
client.showPaymentSelectionScreen(options);