Sync Response

Response Handling

The result of the transaction can be listened by the application with the method:

@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { ... }

The resultCode indicates if the transaction went successfully (Activity.RESULT_OK) or not (Activity.RESULT_CANCELED)

When the transaction is successful, the data intent also contains the id of the finished transaction and it can be obtained by using the following:

data.getExtras().get("transaction_hash");

Also in the response intent it's possible to get the response code of the transaction with the following:

data.getExtras().getInt(RESPONSE_CODE)

Check in the following table the returned response codes.

Response Codes

Response CodeDescription
0Success
1User pressed back or canceled a dialog
2The network connection is down
3This billing API version is not supported for the type requested
4Requested product (aka SKU) is not available for purchase
5Invalid arguments provided to the API
6Fatal error during the API action
7Failure to purchase since item is already owned
8Failure to consume since item is not owned