Payout

In order for the user to redeem his collected rewards, they must be paid out. A reward can only be paid out exactly once.

There are two methods to pay out the rewards: via server-to-server payout or via the SDK. The two methods are mutually exclusive. You can only use either server-to-server payout or the SDK payout. Please discuss with your account manager which method to use.

Server-to-server payout

In order to use the server-to-server payout, you need to create an endpoint on your server that we can request in order to notify you of the user's rewards. Once you receive the notification, it will be up to you to deliver it to the user.

We highly recommend using server-to-server payout for rewards due to higher security and better transparency on your end.

Endpoint structure

We will call your endpoint with an HTTP GET request and the configured parameters:

Security

To ensure that requests come from us, you should calculate the sid parameter and compare it to the parameter sent in the callback. It is calculated as follows: sid = sha1(concatenate(trans_uuid, user_uuid, currency, coin_amount, device_id, sdk_app_id, s2s_token)) We will supply you with the parameter s2s_token separately.

Example Endpoint URL: https://example.com/example?[YourParamName]={user_uuid}&[YourParamName]={sid}&[YourParamName]={coin_amount}&[YourParamName]={currency}&[YourParamName]={trans_uuid}&[YourParamName]={sdk_sub_id1}&[YourParamName]={sdk_sub_id2}

Via SDK

If you cannot handle the payout requests via an endpoint on your server, we can also handle the reward payouts inside the SDK itself.

To pay out the rewards that the user has collected from partner apps directly in the SDK, call

import io.adjoe.sdk.AdjoePayoutEvent;

...

private function doAdjoePayout():void {
  adjoe.addEventListener("onPayoutSuccess", onPayoutSuccess);
  adjoe.addEventListener("onPayoutError", onPayoutError);

  adjoe.doPayout();
}

private function onPayoutSuccess(event:AdjoePayoutEvent):void {
  trace("Adjoe payout was successful with " + event.getCoins() + " coins");
}

private function onPayoutError(event:AdjoePayoutEvent):void {
  trace("Adjoe payout failed with reason " + event.getReason());
}

This method always pays out all coins which the user has collected, i.e. the value of adjoeRewardsEvent.getAvailablePayoutCoins().

If the user has not accepted the adjoe Terms of Service yet, this operation will fail and event.getReason() will be equal to AdjoePayoutEvent.REASON_TOS_NOT_ACCEPTED. You might want to display the offerwall again so that the user can accept the adjoe Terms of Service. This operation will also fail with event.getReason() equal to AdjoePayoutEvent.REASON_UNKNOWN if the user is blocked by the adjoe services.

Adjoe Parameters

You can pass additional UA and placement parameters when you launch Playtime:

var adjoeParams:AdjoeParams = new AdjoeParams();
adjoeParams.setUaNetwork("uaNetwork");
adjoeParams.setUaChannel("UaChannel");
adjoeParams.setUaSubPublisherCleartext("UaSubPublisherCleartext");
adjoeParams.setUaSubPublisherEncrypted("UaSubPublisherEncrypted");
adjoeParams.setPlacement("Placement");

adjoe.doPayout(adjoeParams);

Last updated