/** * Test Method for creating the User in App42 Cloud. */ public function createUser() { $api = new ServiceAPI("30de7e0dcf044cb4c5b46b606868a619a7057e727312392a0f346aafb3036e0f", "80375913972b990a07495686c40ebe012672aa9821d1999e19b9459a3f133191"); $response = null; // FOR Test Create USER $objUser = $api->buildUser(); try { $userService = $this->sp->buildUserService(); $userName = "******" . time(); $eName = $userName . time() . "*****@*****.**"; $createUserObj = $userService->createUser($userName, "password", $eName); print_r($createUserObj->toString()); } catch (App42BadParameterException $ex) { // Exception Caught // Check if User already Exist by checking app error code if ($ex->getAppErrorCode() == 2001) { // Do exception Handling for Already created User. } } catch (App42SecurityException $ex) { // Exception Caught // Check for authorization Error due to invalid Public/Private Key if ($ex . getAppErrorCode() == 1401) { // Do exception Handling here } } catch (App42Exception $ex) { // Exception Caught due to other Validation } // Render the JSON response. This will return the Successful created // User response App42Log::debug($response); }
$buildTwitter = new TwitterService($this->apiKey, $this->secretKey, $this->url); return $buildTwitter; } public function buildPushNotificationService() { $buildPushNotification = new PushNotificationService($this->apiKey, $this->secretKey, $this->url); return $buildPushNotification; } } //Serer details //$serviceAPIObj = new ServiceAPI("c8274620e0a4f73baffa35239333600198614fb8b6f5230617906131f3ada4d3", "cfc9e90170ae16e3f0f010d9b48165dc992cb3ec585646181d0c62a173ad4e94"); //Local //$serviceAPIObj = new ServiceAPI("9ff49a60d1e86392cd406f9ff9944a8d9a3e606f72ed9ee6fb43c7663b70fd7c", "e1ef3a75420ea581a368a65d2e9f47084f2aec30b8ddb6d0d5065b713e2b2847"); //NEW //$serviceAPIObj = new ServiceAPI("760d2ee83d3f2fda7e69c1de84ff597546f550e057f1b76215c7e21df3dd2fb6", "8d18691a4b9c29dc480eb696dc64ea24bd99a3078eabed700c8e558762b77884"); $serviceAPIObj = new ServiceAPI("3d93b0796e2c8b99a1c7312d015adac709c79345de17593b94a9172921868a6c", "8268f3a39b87ce0f83a57c6454d3cedddf3ea95c7a1cc389518d0cb53dbf2c57"); //---------------------apptap--------------------------// $usage = $serviceAPIObj->buildUsageService(); $usage1 = $serviceAPIObj->buildUsageService(); $usage2 = $serviceAPIObj->buildUsageService(); $bill = $serviceAPIObj->buildBillService(); $license = $serviceAPIObj->buildLicenseService(); $license1 = $serviceAPIObj->buildLicenseService(); $license2 = $serviceAPIObj->buildLicenseService(); $levelName = "nvnbvvxvxffdsvvn"; $oneTmeCharge = "dsfdfdfxvvcx55vgggdgvcvdf"; //$createOneTimeObj = $usage->createOneTimeCharge($oneTmeCharge, 333, Currency::ASD, "OneTimeCharge"); //$getOneTimeObj = $usage1->getOneTime($oneTmeCharge); //$getAllOneTimeUsageObj = $usage1->getAllOneTimeUsage(); // $chargeOneTimeObj = $usage1->chargeOneTime("nareshdffdgfgfhwivfdffedi", $oneTmeCharge); //$removeoneTimeObj = $usage2->removeOneTime($oneTmeCharge);