Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Kansas SOAP Call For Taxes


Yacko1975

Recommended Posts

I through together a quick example of using Kansas's SOAP call to get tax rates based on Zip (Zip+4, Address). I am not sure I could build an addon for osC but maybe someone else can put this to use.

 

<?php

$wsdl = "sstp.wsdl";
$client = new SoapClient($wsdl);

// var_dump($client->__getFunctions());
// var_dump($client->__gettypes());

$ReturnData = $client->GetFIPSBy5ZipOnly(66612,"2008-01-28");

//var_dump($ReturnData);
//echo $ReturnData->strReturnShortDesc;
//echo $ReturnData->strConfirmationNum;
//foreach ($ReturnData->FIPSRecordList as &$FipsRecord) {
//	echo $FipsRecord->strGeneralTaxRateIntrastate;


//}

?> 

<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
  <HEAD>
  <TITLE>
	 A Small Hello 
  </TITLE>
  </HEAD>
<BODY>
  <H1>Streamlined Sales Example</H1><br />
  <br />
  Return Code: <?php echo $ReturnData->intReturnCode ?><br />
  Return Short Description: <?php echo $ReturnData->strReturnShortDesc ?><br />
  Confirmation Number: <?php echo $ReturnData->strConfirmationNum ?><br />
  Time Stamp: <?php echo $ReturnData->strEventTimeStamp ?><br />
<table width="700px">
<thead>
<tr>
	<td>State</td>
	<td>Juris Type</td>
	<td>CompositeSER</td>
	<td>FIPS Code</td>
	<td>General Intrastate Rate</td>
	<td>General Interstate Rate</td>
	<td>Food/Drug Intrastate Rate</td>
	<td>Food/Drug Interstate Rate</td>
</tr>
</thead>
<?php foreach ($ReturnData->FIPSRecordList as &$FipsRecord) { ?>
<tr>
	<td><?php echo $FipsRecord->intState ?></td>
	<td><?php echo $FipsRecord->strJurisdictionType ?></td>
	<td><?php echo $FipsRecord->strCompositeSER ?></td>
	<td><?php echo $FipsRecord->intJurisdictionFIPS ?></td>
	<td><?php echo $FipsRecord->strGeneralTaxRateIntrastate ?></td>
	<td><?php echo $FipsRecord->strGeneralTaxRateInterstate ?></td>
	<td><?php echo $FipsRecord->strFoodDrugTaxRateIntrastate ?></td>
	<td><?php echo $FipsRecord->strFoodDrugTaxRateInterstate ?></td>
</tr>
<?php } ?>	
</table>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...