Пример #1
0
void MOAIApp::VerifyPaymentMainThread ( void * userData, int32_t result )  {
#if PRODUCTION_URLS
	std::string url = "http://services.moaicloud.com//zipline/ziplinereceiptverification?action=getPurchaseStatus&userId=";
#else
	std::string url = "http://services.moaicloud.com//zipline/sandbox_ziplinereceiptverification?action=getPurchaseStatus&userId=";
#endif
	url.append ( g_openID );
	url.append ( "&productId=" );
	url.append ( g_productID );
	url.append ( "&applicationId=WolfToss" );

	GetURLHandler* handler = GetURLHandler::Create( g_instance, url );
	
	if (handler != NULL) {

		handler->SetMethod ( GetURLHandler::GET );
		//handler->SetUserData ( NULL );

		handler->Start( HttpLoaded );
	}
}
Пример #2
0
void MOAIApp::RedeemProduct ( ) {
#if PRODUCTION_URLS
	std::string url = "http://services.moaicloud.com//zipline/ziplinereceiptverification?action=redeemPurchase&userId=";
#else
	std::string url = "http://services.moaicloud.com//zipline/sandbox_ziplinereceiptverification?action=redeemPurchase&userId=";
#endif
	url.append ( g_openID );
	url.append ( "&productId=" );
	url.append ( g_productID );
	url.append ( "&applicationId=WolfToss" );

	GetURLHandler* handler = GetURLHandler::Create( g_instance, url );
	
	if (handler != NULL) {

		handler->SetMethod ( GetURLHandler::GET );
		//handler->SetUserData ( NULL );

		handler->Start( DummyHttpLoaded );
	}
}
Пример #3
0
//----------------------------------------------------------------//
void MOAIHttpTaskNaCl::HttpGetMainThread ( void* userData, int32_t result ) {

	MOAIHttpTaskNaCl * taskInfo = static_cast < MOAIHttpTaskNaCl * > ( userData );

	GetURLHandler* handler = GetURLHandler::Create( g_instance, taskInfo->mUrl );
	
	if ( handler != NULL ) {

		handler->SetMethod ( taskInfo->mMethod );
		handler->SetUserData ( taskInfo );

		if ( taskInfo->mBody.Size () > 0 ) {
			NACL_LOG ( "\nSet Body: %s\n", taskInfo->mBody.Data ());
			handler->SetBody ( taskInfo->mBody.Data (), taskInfo->mBody.Size ());
		}

		taskInfo->Prepare ( handler );

		handler->Start( HttpLoaded );
	}

	taskInfo->mLock = false;
}