public void onIabPurchaseFinished(IabResult result, Purchase purchase) {
   UnityPlayer.currentActivity.sendBroadcast(new Intent(UnityProxyActivity.ACTION_FINISH));
   Log.d(TAG, "Purchase finished: " + result + ", purchase: " + purchase);
   if (result.isFailure()) {
     Log.e(TAG, "Error purchasing: " + result);
     UnityPlayer.UnitySendMessage(
         EVENT_MANAGER,
         PURCHASE_FAILED_CALLBACK,
         result.getResponse() + "|" + result.getMessage());
     return;
   }
   Log.d(TAG, "Purchase successful.");
   String jsonPurchase;
   try {
     jsonPurchase = purchaseToJson(purchase);
   } catch (JSONException e) {
     UnityPlayer.UnitySendMessage(
         EVENT_MANAGER, PURCHASE_FAILED_CALLBACK, "-1|Couldn't serialize the purchase");
     return;
   }
   UnityPlayer.UnitySendMessage(EVENT_MANAGER, PURCHASE_SUCCEEDED_CALLBACK, jsonPurchase);
 }