Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets/js/blocks/tax-exemption/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import { useDispatch } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { getSetting } from '@woocommerce/settings';
import { Select } from '@woocommerce/base-components/select/index';
import { Title } from '@woocommerce/blocks-components';
import { Select } from '@woocommerce/components';
import { Title } from '@woocommerce/components';
import { extensionCartUpdate } from '@woocommerce/blocks-checkout';
import { CHECKOUT_STORE_KEY } from '@woocommerce/block-data';

Expand Down
6 changes: 3 additions & 3 deletions assets/js/blocks/tax-exemption/new-certificate-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
RadioControl,
ValidatedTextInput,
} from '@woocommerce/blocks-components';
import { Select } from '@woocommerce/base-components/select/index';
import { StateInput } from '@woocommerce/base-components/state-input/index';
import { ALLOWED_STATES } from '@woocommerce/block-settings';
import { Select } from '@woocommerce/components';
import { StateInput } from '@woocommerce/components';
import { ALLOWED_STATES } from '@woocommerce/settings';

/**
* Internal dependencies
Expand Down
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Changelog for Simple Sales Tax

Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- [9.0.0] - 2025-01-15 =
For taxcloud V3

- [8.2.1] - 2024-10-24 =

Expand Down
4 changes: 0 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"config": {
"vendor-dir": "includes/vendor",
"allow-plugins": {
"composer/installers": true,
"automattic/jetpack-autoloader": true
Expand All @@ -9,9 +8,6 @@
"name": "simplesalestax/simplesalestax",
"description": "Sales tax compliance solution for WooCommerce.",
"type": "project",
"require": {
"bporcelli/php-taxcloud": "1.1.0"
},
"license": "GPL-3.0+",
"authors": [
{
Expand Down
62 changes: 2 additions & 60 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 97 additions & 0 deletions includes/TaxCloud/AddTransactionCartItem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

/**
* Portions Copyright (c) 2009-2012 The Federal Tax Authority, LLC (FedTax).
* All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code as
* defined in and that are subject to the FedTax Public Source License (the
* ‘License’). You may not use this file except in compliance with the License.
* Please obtain a copy of the License at http://FedTax.net/ftpsl.pdf or
* http://dev.taxcloud.net/ftpsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an ‘AS IS’ basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND FEDTAX HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR
* A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
*
* Please see the License for the specific language governing rights and
* limitations under the License.
*/

namespace TaxCloud;

/**
* Class AddTransactionCartItem
*
* @package TaxCloud
* @author Taxcloud <integrations@taxcloud.com>
*/
class AddTransactionCartItem extends CartItem
{
/**
* The decimal representation of the sales tax rate charged to the customer at the time of sale, e.g. 0.0355
*
* @var float
*/
protected $Rate;

/**
* The Order ID. This must match the OrderID for the transaction.
*
* @var string
*/
protected $OrderID;

/**
* AddTransactionCartItem constructor.
*
* @param int $index
* @param string $itemId
* @param string $tic
* @param float $price
* @param int $qty
* @param float $rate
* @param string $orderId
*/
public function __construct($index, $itemId, $tic, $price, $qty, $rate, $orderId)
{
parent::__construct($index, $itemId, $tic, $price, $qty);

$this->setRate($rate);
$this->setOrderID($orderId);
}

/**
* @return float
*/
public function getRate()
{
return $this->Rate;
}

/**
* @param float $rate
*/
public function setRate($rate)
{
$this->Rate = $rate;
}

/**
* @return string
*/
public function getOrderID()
{
return $this->OrderID;
}

/**
* @param string $orderId
*/
public function setOrderID($orderId)
{
$this->OrderID = $orderId;
}
}
118 changes: 118 additions & 0 deletions includes/TaxCloud/Address.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?php

/**
* Portions Copyright (c) 2009-2012 The Federal Tax Authority, LLC (FedTax).
* All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code as
* defined in and that are subject to the FedTax Public Source License (the
* ‘License’). You may not use this file except in compliance with the License.
* Please obtain a copy of the License at http://FedTax.net/ftpsl.pdf or
* http://dev.taxcloud.net/ftpsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an ‘AS IS’ basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND FEDTAX HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR
* A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
*
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* Modifications made April 15, 2017 by Taxcloud
*/

namespace TaxCloud;

use TaxCloud\Exceptions\AddressException;

class Address extends Serializable
{
protected $Address1;
protected $Address2;
protected $City;
protected $State;
protected $Zip5;
protected $Zip4;

public function __construct($Address1, $Address2, $City, $State, $Zip5, $Zip4 = NULL)
{
$this->setAddress1($Address1);
$this->setAddress2($Address2);
$this->setCity($City);
$this->setState($State);
$this->setZip5($Zip5);
$this->setZip4($Zip4);
}

public function setAddress1($address1)
{
$this->Address1 = $address1;
}

public function getAddress1()
{
return $this->Address1;
}

public function setAddress2($address2)
{
$this->Address2 = $address2;
}

public function getAddress2()
{
return (isset($this->Address2)) ? $this->Address2 : NULL;
}

public function setCity($city)
{
$this->City = $city;
}

public function getCity()
{
return $this->City;
}

public function setState($state)
{
$this->State = $state;
}

public function getState()
{
return $this->State;
}

public function setZip5($zip5)
{
if (!preg_match('#[0-9]{5}#', $zip5)) {
throw new AddressException('Zip5 must be five numeric characters.');
}
$this->Zip5 = $zip5;
}

public function getZip5()
{
return $this->Zip5;
}

public function setZip4($zip4)
{
if (!empty($zip4) && !preg_match('#[0-9]{4}#', $zip4)) {
throw new AddressException('Zip4 must be four numeric characters.');
}
$this->Zip4 = $zip4;
}

public function getZip4()
{
return $this->Zip4;
}

public function getZip()
{
return $this->Zip5 . '-' . $this->Zip4;
}
}
51 changes: 51 additions & 0 deletions includes/TaxCloud/BusinessType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

/**
* Portions Copyright (c) 2009-2012 The Federal Tax Authority, LLC (FedTax).
* All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code as
* defined in and that are subject to the FedTax Public Source License (the
* ‘License’). You may not use this file except in compliance with the License.
* Please obtain a copy of the License at http://FedTax.net/ftpsl.pdf or
* http://dev.taxcloud.net/ftpsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an ‘AS IS’ basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND FEDTAX HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR
* A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
*
* Please see the License for the specific language governing rights and
* limitations under the License.
*
*
*
* Modifications made August 20, 2013 by TaxCloud
*/

namespace TaxCloud;

class BusinessType
{
const AccommodationAndFoodServices = 'AccommodationAndFoodServices';
const Agricultural_Forestry_Fishing_Hunting = 'Agricultural_Forestry_Fishing_Hunting';
const Construction = 'Construction';
const FinanceAndInsurance = 'FinanceAndInsurance';
const Information_PublishingAndCommunications = 'Information_PublishingAndCommunications';
const Manufacturing = 'Manufacturing';
const Mining = 'Mining';
const RealEstate = 'RealEstate';
const RentalAndLeasing = 'RentalAndLeasing';
const RetailTrade = 'RetailTrade';
const TransportationAndWarehousing = 'TransportationAndWarehousing';
const Utilities = 'Utilities';
const WholesaleTrade = 'WholesaleTrade';
const BusinessServices = 'BusinessServices';
const ProfessionalServices = 'ProfessionalServices';
const EducationAndHealthCareServices = 'EducationAndHealthCareServices';
const NonprofitOrganization = 'NonprofitOrganization';
const Government = 'Government';
const NotABusiness = 'NotABusiness';
const Other = 'Other';
}
Loading