/** * @return array */ public function toArray() { $data = array('Street1' => Taxify::toString($this->street1), 'Street2' => Taxify::toString($this->street2), 'City' => Taxify::toString($this->city), 'Region' => Taxify::toString($this->region), 'PostalCode' => Taxify::toString($this->postal_code), 'Options' => array()); if ($this->tax_request_options) { foreach ($this->tax_request_options as $tax_request_option) { $data['Request']['Options'][] = $tax_request_option->toArray(); } } return $data; }
/** * @return array */ public function toArray() { $data = array('LineNumber' => Taxify::toString($this->line_number), 'ItemKey' => Taxify::toString($this->item_key), 'ActualExtendedPrice' => empty($this->actual_extended_price) ? 0 : $this->actual_extended_price, 'TaxIncludedInPrice' => $this->tax_included_in_price, 'Quantity' => empty($this->quantity) ? 0 : $this->quantity, 'ItemDescription' => Taxify::toString($this->item_description), 'ItemTaxabilityCode' => Taxify::toString($this->item_taxability_code), 'ItemCategories' => Taxify::toString($this->item_categories), 'ItemTags' => Taxify::toString($this->item_tags), 'Options' => array()); if ($this->tax_request_options) { foreach ($this->tax_request_options as $tax_request_option) { $data['Request']['Options'][] = $tax_request_option->toArray(); } } return $data; }
/** * @return array */ public function toArray() { return array('Discount' => array('Order' => is_numeric($this->order) ? $this->order : 0, 'Code' => Taxify::toString($this->code), 'Amount' => is_numeric($this->amount) ? $this->amount : 0, 'DiscountType' => Taxify::toString($this->discount_type))); }
/** * @return array */ public function toArray() { return array('TaxRequestOption' => array('Key' => Taxify::toString($this->key), 'Value' => Taxify::toString($this->value))); }
public function commitTax() { if (empty($this->document_key)) { throw new Exception(self::ERROR_NO_DOCUMENT_KEY); } $data = array('DocumentKey' => Taxify::toString($this->document_key), 'CommitedDocumentKey' => Taxify::toString($this->committed_document_key)); $communicator = new Communicator($this->taxify); $return = $communicator->call(self::CALL_COMMIT_TAX, $data); $tax_response = new TaxResponse(); $tax_response->setResponseStatus(1); $tax_response->setExtendedProperties($return['ExtendedProperties']); return $tax_response; }
/** * @return array */ public function toArray() { return array('string' => Taxify::toString($this->string)); }