Android validation of payments and time adjustments

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.

Call following method when GooglePlay returns transaction to your onActivityResult:

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

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.

Result can take one of following values:

public enum VerifyStatus {	
                           Valid,
                           Invalid,
                           InternalError,
                           ServerError
                         };

In case of successful check call following main SDK method:

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

Time cheats check

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

DevToDevCheat.verifyTime(OnTimeVerifyListener onTimeVerifyListener);

Result can take one of following values:

public enum TimeStatus {
                         Valid,
                         Forward,
                         Rewind
                       };

 

Secondary Methods
Checking the events