abstracts
3 months ago
admin
3 months ago
frontend
1 month ago
integrations
1 month ago
v3
3 months ago
vendor
6 days ago
views
8 months ago
class-simplesalestax.php
6 days ago
class-sst-addresses.php
1 month ago
class-sst-ajax.php
3 months ago
class-sst-assets.php
6 months ago
class-sst-blocks-integration.php
1 month ago
class-sst-blocks.php
1 year ago
class-sst-certificates.php
6 days ago
class-sst-install.php
6 months ago
class-sst-logger.php
5 months ago
class-sst-marketplaces.php
6 months ago
class-sst-order-controller.php
3 months ago
class-sst-order.php
1 month ago
class-sst-origin-address.php
8 months ago
class-sst-product.php
3 months ago
class-sst-rate-limit.php
5 months ago
class-sst-settings.php
3 months ago
class-sst-shipping.php
3 years ago
class-sst-taxcloud-v3-api.php
3 months ago
class-sst-taxcloud-v3.php
3 months ago
class-sst-tic.php
2 years ago
class-sst-updater.php
3 years ago
sst-compatibility-functions.php
4 months ago
sst-functions.php
6 days ago
sst-message-functions.php
3 years ago
sst-update-functions.php
11 months ago
class-sst-origin-address.php
116 lines
| 1 | <?php |
| 2 | |
| 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | exit; // Exit if accessed directly. |
| 5 | } |
| 6 | |
| 7 | use TaxCloud\Address; |
| 8 | |
| 9 | /** |
| 10 | * Origin Address. |
| 11 | * |
| 12 | * Represents an origin address. |
| 13 | * |
| 14 | * @author Simple Sales Tax |
| 15 | * @package SST |
| 16 | * @since 5.0 |
| 17 | */ |
| 18 | class SST_Origin_Address extends Address { |
| 19 | |
| 20 | /** |
| 21 | * Address ID. |
| 22 | * |
| 23 | * @var string |
| 24 | */ |
| 25 | protected $ID; |
| 26 | |
| 27 | /** |
| 28 | * Is this a default address? |
| 29 | * |
| 30 | * @var bool |
| 31 | */ |
| 32 | protected $Default; |
| 33 | |
| 34 | /** |
| 35 | * Constructor. |
| 36 | * |
| 37 | * @param string $ID Address ID. |
| 38 | * @param bool $Default Whether this is a default address. |
| 39 | * @param string $Address1 Street address 1. |
| 40 | * @param string $Address2 Street address 2. |
| 41 | * @param string $City City. |
| 42 | * @param string $State State. |
| 43 | * @param string $Zip5 5 digit component of ZIP code. |
| 44 | * @param string $Zip4 Optional 4 digit component of ZIP code. |
| 45 | * |
| 46 | * @since 5.0 |
| 47 | */ |
| 48 | public function __construct( $ID, $Default, $Address1, $Address2, $City, $State, $Zip5, $Zip4 = null ) { |
| 49 | $this->setID( $ID ); |
| 50 | $this->setDefault( $Default ); |
| 51 | |
| 52 | parent::__construct( $Address1, $Address2, $City, $State, $Zip5, $Zip4 ); |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Set ID. |
| 57 | * |
| 58 | * @param string $ID Address ID. |
| 59 | * |
| 60 | * @since 5.0 |
| 61 | */ |
| 62 | public function setID( $ID ) { |
| 63 | $this->ID = $ID; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Get ID. |
| 68 | * |
| 69 | * @return string |
| 70 | * @since 5.0 |
| 71 | */ |
| 72 | public function getID() { |
| 73 | return $this->ID; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Set Default. |
| 78 | * |
| 79 | * @param bool $Default Whether the address is a default origin address. |
| 80 | * |
| 81 | * @since 5.0 |
| 82 | */ |
| 83 | public function setDefault( $Default ) { |
| 84 | $this->Default = $Default; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Get Default. |
| 89 | * |
| 90 | * @return bool |
| 91 | * @since 5.0 |
| 92 | */ |
| 93 | public function getDefault() { |
| 94 | return $this->Default; |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Set Zip5. |
| 99 | * |
| 100 | * @param string $Zip5 5 digit ZIP code. |
| 101 | */ |
| 102 | public function setZip5( $Zip5 ) { |
| 103 | $this->Zip5 = substr( $Zip5, 0, 5 ); |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Set Zip4. |
| 108 | * |
| 109 | * @param string $Zip4 4 digit component of ZIP code. |
| 110 | */ |
| 111 | public function setZip4( $Zip4 ) { |
| 112 | $this->Zip4 = substr( (string) $Zip4, 0, 4 ); |
| 113 | } |
| 114 | |
| 115 | } |
| 116 |