void MJStoreEventHandler::onItemPurchased(EventCustom *event) {
    __Dictionary *eventData = (__Dictionary *)event->getUserData();
    CCPurchasableVirtualItem *purchasable = dynamic_cast<CCPurchasableVirtualItem *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_PURCHASABLE));
    __String *payload = dynamic_cast<__String *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_DEVELOPERPAYLOAD));
    CCSoomlaUtils::logDebug(TAG, __String::createWithFormat("ItemPurchased: %s %s",
                                                            purchasable->getItemId()->getCString(),
                                                            payload->getCString())->getCString());
}
void MJStoreEventHandler::onMarketPurchase(EventCustom *event) {
    __Dictionary *eventData = (__Dictionary *)event->getUserData();
    CCPurchasableVirtualItem *purchasable = dynamic_cast<CCPurchasableVirtualItem *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_PURCHASABLE));
    __String *token = dynamic_cast<__String *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_PURCHASABLE_ID));
    __String *payload = dynamic_cast<__String *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_DEVELOPERPAYLOAD));
    CCSoomlaUtils::logDebug(TAG, __String::createWithFormat("MarketPurchase: %s token: %s payload: %s",
                                                            purchasable->getItemId()->getCString(),
                                                            token->getCString(),
                                                            payload->getCString())->getCString());
    
    // Android ONLY
    __String *originalJSON = dynamic_cast<__String *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_ORIGINAL_JSON));
    if (originalJSON != NULL) {
        CCSoomlaUtils::logDebug(TAG, __String::createWithFormat("MarketPurchase: Original JSON %s", originalJSON->getCString())->getCString());
    }
    __String *signature = dynamic_cast<__String *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_SIGNATURE));
    if (signature != NULL) {
        CCSoomlaUtils::logDebug(TAG, __String::createWithFormat("MarketPurchase: Signature %s", signature->getCString())->getCString());
    }
    __String *userId = dynamic_cast<__String *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_USER_ID));
    if (userId != NULL) {
        CCSoomlaUtils::logDebug(TAG, __String::createWithFormat("MarketPurchase: User ID %s", userId->getCString())->getCString());
    }
}
void MJStoreEventHandler::onMarketPurchaseVerification(EventCustom *event) {
    __Dictionary *eventData = (__Dictionary *)event->getUserData();
    CCPurchasableVirtualItem *purchasable = dynamic_cast<CCPurchasableVirtualItem *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_PURCHASABLE));
    CCSoomlaUtils::logDebug(TAG, __String::createWithFormat("MarketPurchaseVerification: %s", purchasable->getItemId()->getCString())->getCString());
}