Validation of payments and time adjustments in devtosev SDK for Adobe Air

Payments validation

To be protected from fraudulent transactions, we recommend you to use devtodev Anticheat service

Use this method, and devtodev will check the transaction validity with the payment platform, and the response will be returned to the application.

For Android:

- call following method when GooglePlay returns transaction to your onActivityResult.

You can get sharedSecret key here:

  1. Go to the Google Play Developer Console and sign in. Make sure that you sign in to the account from which the application you are licensing is published (or will be published).

  2. In the application details page, locate the Services & APIs link and click it.

  3. In the Services & APIs page, locate the Licensing & In-App Billing section.

Your public key for licensing is given in the Your License Key For This Application field.

For iOS:

- call following method when StoreKit returns transaction to your SKPaymentTransactionObserver.
signature and publicKey for iOS payment validation must be null.
receipt parameter is Base64-encoded Receipt.

Notice! This method does not work on MacOS and Windows platforms. That means onVerifyListener will be never called.

DevToDevCheat.verifyPayment(receipt:String, signature:String, publicKey:String, onVerifyListener:Function);

onVerifyListener is a function that takes one integer argument. For example:

protected function onVerifyListener(param:int):void {
}

param can be one of following values:

VerifyStatus.VALID;
VerifyStatus.INVALID;
VerifyStatus.INTERNAL_ERROR;
VerifyStatus.SERVER_ERROR;

In case of successful check call following main SDK method:

DevToDev.realPayment(pPaymentId:String, pInAppPrice:Number, pInAppName:String, pInAppCurrencyISOCode:String);

Time cheats check

To check for time cheats call checkTime method every time when app is being launched

DevToDevCheat.verifyTime(onTimeVerifyListener:Function);

onTimeVerifyListener is a function that takes one integer argument. For example:

protected function onTimeVerifyListener(param:int):void {
}

param can be one of the following values:

TimeStatus.VALID;
TimeStatus.FORWARD;
TimeStatus.REWIND;

 

Secondary Methods
Checking the events