Skip to content

v13.5.0

Compare
Choose a tag to compare
@j3k0 j3k0 released this 07 Sep 14:11
· 114 commits to master since this release
9c71bc7

Add timeout to validation requests

By default, the plugin will now setup a 20 seconds timeout for receipt validation requests.

Receipt validation timeout can be detected using the following code:

CdvPurchase.store.when().unverified(function(response) {
  if (response.payload.code === CdvPurchase.ErrorCode.COMMUNICATION) {
    if (response.payload.status === CdvPurchase.Utils.Ajax.HTTP_REQUEST_TIMEOUT) {
      // request timeout
    }
  }
});

The value for timeout can be customized by specifying the validator this way:

CdvPurchase.store.validator = {
  url: 'https://validator.iaptic.com',
  timeout: 30000, // in milliseconds
}