|
| 1 | +<?php |
| 2 | +//Replace the line with require "vendor/autoload.php" if you are using the Samples from outside of _Samples folder |
| 3 | +//The TaxService is still the old example. Add TaxService Support will be on later release |
| 4 | +include('../config.php'); |
| 5 | + |
| 6 | +use QuickBooksOnline\API\Core\ServiceContext; |
| 7 | +use QuickBooksOnline\API\DataService\DataService; |
| 8 | +use QuickBooksOnline\API\PlatformService\PlatformService; |
| 9 | +use QuickBooksOnline\API\Core\Http\Serialization\XmlObjectSerializer; |
| 10 | +use QuickBooksOnline\API\Facades\TaxAgency; |
| 11 | + |
| 12 | + |
| 13 | +// Prep Data Services |
| 14 | +$dataService = DataService::Configure(array( |
| 15 | + 'auth_mode' => 'oauth1', |
| 16 | + 'consumerKey' => "lve2eZN6ZNBrjN0Wp26JVYJbsOOFbF", |
| 17 | + 'consumerSecret' => "fUhPIeu6jrq1UmNGXSMsIsl0JaHuHzSkFf3tsmrW", |
| 18 | + 'accessTokenKey' => "qye2etcpyquO3B1t8ydZJI8OTelqJCMiLZlY5LdX7qZunwoo", |
| 19 | + 'accessTokenSecret' => "2lEUtSEIvXf64CEkMLaGDK5rCwaxE9UvfW1dYrrH", |
| 20 | + 'QBORealmID' => "193514489870599", |
| 21 | + 'baseUrl' => "https://qbonline-e2e.api.intuit.com/" |
| 22 | +)); |
| 23 | + |
| 24 | +$dataService->setLogLocation("/Users/hlu2/Desktop/newFolderForLog"); |
| 25 | + |
| 26 | +$taxAgency = TaxAgency::create([ |
| 27 | + 'DisplayName' => 'Indiana Department of Revenue' |
| 28 | +]); |
| 29 | + |
| 30 | +var_dump($taxAgency); |
| 31 | +$result = $dataService->Add($taxAgency); |
| 32 | +$error = $dataService->getLastError(); |
| 33 | +if ($error) { |
| 34 | + echo "The Status code is: " . $error->getHttpStatusCode() . "\n"; |
| 35 | + echo "The Helper message is: " . $error->getOAuthHelperError() . "\n"; |
| 36 | + echo "The Response message is: " . $error->getResponseBody() . "\n"; |
| 37 | + exit(); |
| 38 | +} |
| 39 | + |
| 40 | + |
| 41 | +print_r($result->Id); |
| 42 | + |
| 43 | +#### |
| 44 | +# Var-dump output |
| 45 | +#### |
| 46 | +/** |
| 47 | + * |
| 48 | +object(IPPTaxAgency)#40 (4) { |
| 49 | +} |
| 50 | +
|
| 51 | + */ |
0 commit comments