Conversation
includes/TaxCloud/Client.php
Outdated
| "states" => $states | ||
| ]; | ||
| break; | ||
| case "get-exempt-certificates": |
There was a problem hiding this comment.
There isn't a post for this search
includes/TaxCloud/Client.php
Outdated
| ]; | ||
| break; | ||
| case "carts/orders": | ||
| $xApiKey = $payload->getApiLoginID(); |
There was a problem hiding this comment.
xAPIKey isn't 1-1 with api login id. It's actually a different concept that didn't exist in v1 and can be pulled from the API key section of the taxcloud UI.
There was a problem hiding this comment.
HI Ben,
For V3, it is 1-many. whether it means one connection id has many xapikey? if yes, what is the UI in wordpress tax dashboard?
There was a problem hiding this comment.
Sorry when I said 1 - 1, I meant that the api login id is not equal to the xapikey value, it is a totally different concept created for v3. I don't know that it has a value in the wordpress tax dashboard. I was wondering if the plan was to re-use the api login id field, or if a new field needed to be added to that page?
includes/TaxCloud/Client.php
Outdated
| } | ||
| $destinationLine1 = $payload->getDestination()->getAddress1(); | ||
| if(!$destinationLine1){ | ||
| $destinationLine1 = "650 street"; |
There was a problem hiding this comment.
usually if address1 is not known, we will default to unknown instead of an address so we don't accidentally match some address logic for a specific address.
There was a problem hiding this comment.
For the V3 API, the requirement is that line1 must be provided. However, considering that the street field is not essential for tax calculation purposes, it would be beneficial to make line1 optional in the V3 API. This adjustment aligns with the behavior of the V1 API, which also does not mandate the street field. By modifying the V3 API to allow line1 to be optional then we do not need to process $destinationLine1. How do you think?
includes/TaxCloud/Client.php
Outdated
| switch ($endpoint){ | ||
| case "get-exempt-certificates": | ||
| $customerId = $payload->getCustomerID(); | ||
| $url = 'https://api.v3.taxcloud.com/tax/exemption-certificates?customerId='.$customerId; |
There was a problem hiding this comment.
You probably want to use connectionID here where connectionID is the old api key. This will get all the exemption certificates for this currently hooked up connection.
Also this is a cursor paged endpoint, so if a user has over 20 exemption certificates, they will only be shown the first 20 results.
includes/TaxCloud/Client.php
Outdated
| "line1" => $destinationLine1, | ||
| "line2" => $payload->getAddress2(), | ||
| "state"=> $payload->getState(), | ||
| "zip" => $payload->getZip5() |
There was a problem hiding this comment.
Any chance there would be a +4 on this zip?
There was a problem hiding this comment.
@bjongbloedt i have updated the code, please have a check again
|
Looks like some cypress tests are failing post update. @taxcloud-havlek can you look into these? |
includes/TaxCloud/Client.php
Outdated
| switch ($endpoint){ | ||
| case "get-exempt-certificates": | ||
| $customerId = $payload->getCustomerID(); | ||
| $url = 'https://api.v3.taxcloud.com/tax/exemption-certificates?customerId='.$customerId."&&limit=100"; |
There was a problem hiding this comment.
Do you have the connection id available here for the connectionID param? It would make the query quicker, and this current setup could return certs that may not be associated with the current setup
includes/TaxCloud/Client.php
Outdated
| { | ||
| try { | ||
| $response = $this->postV3('refunds', $parameters); | ||
| if ($response->getResponseType() == 'OK') { |
There was a problem hiding this comment.
I don't think this old ok field applies anymore. It should check for status and errors
| * @param Captured $parameters | ||
| * @return bool | ||
| */ | ||
| public function Captured(Captured $parameters) |
There was a problem hiding this comment.
This action would need to be done on an existing order with the update order endpoint where completedDate is the date it was captured
| * @param AuthorizedWithCapture $parameters | ||
| * @return bool | ||
| */ | ||
| public function AuthorizedWithCapture(AuthorizedWithCapture $parameters) |
There was a problem hiding this comment.
Capturing is done in the new system by converting a cart to an order. To capture at the same time, you need to set the completed flag to true
| * @param Authorized $parameters | ||
| * @return bool | ||
| */ | ||
| public function Authorized(Authorized $parameters) |
There was a problem hiding this comment.
Authorizing is done in the new system by converting a cart to an order. To capture at the same time, you need to set the completed flag to false
includes/TaxCloud/Client.php
Outdated
| public function AddTransactions(AddTransactions $parameters) | ||
| { | ||
| try { | ||
| $response = new AddTransactionsResponse($this->post('AddTransactions', $parameters)); |
There was a problem hiding this comment.
You might want to pivot this into the create transaction endpoint instead. It doesn't have the multiple at a time functionality, but it is v3 vs v1
includes/TaxCloud/Client.php
Outdated
| break; | ||
| case "ping": | ||
| $connectionId = $payload->getApiKey(); | ||
| $url = "https://api.v3.taxcloud.com/tax/connections/$connectionId/ping"; |
There was a problem hiding this comment.
Could you interpolate these 2 urls with the base url for v3 above?
includes/TaxCloud/Client.php
Outdated
| "itemId" => (string)$eachItem->getItemID(), | ||
| "price" => (double)$eachItem->getPrice(), | ||
| "quantity" => $eachItem->getQty(), | ||
| "tic" => (int) $eachItem->getTIC() |
There was a problem hiding this comment.
In the new world, if there is no tic we would prefer this value to be set to null or omitted. That way the default tic and/or product mapping logic could automatically assign the tic



apply V3 api https://api.v3.taxcloud.com/tax/docs#