Comments (3)
The call to the API in the SDK looks like this:
Array (
[query] => Array ([$include] => [documentType] => 1 [useTaxDateOverride] => true)
[body] => { "refundTransactionCode":"1320108-REFUND", "refundDate":"2021-03-27", "refundType":2, refundPercentage":null, "refundLines":null, "referenceCode":"Tax refunded"}
[auth] => Array ([0] => [1] => )
[headers] => Array ([Accept] => application/json [X-Avalara-Client] => FYPapp; 1.0; PhpRestClient; 20.1.0; localhost)
)
But the examples in the Postman collection looks like this:
https://rest.avatax.com/api/v2/companies/DEFAULT/transactions/1319742/refund {"refundTransactionCode":"1319742-REFUND","refundDate":"2021-08-16","refundType":"Full","referenceCode":"Refund for a committed transaction"}
The Postman example works, but notice "refundType":"Full"
Why does the SDK Constants.php make it an integer?
(Same as issue #106 to which there has never been a reply)
from avatax-rest-v2-php-sdk.
BTW, what values can be entered for "refundType" is not documented anywhere in the documentation, neither https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/RefundTransaction/
nor Swagger https://sandbox-rest.avatax.com/swagger/ui/index.html#/Transactions/RefundTransaction
The only place I found them listed was in https://developer.avalara.com/static/pdf/AvaTaxAPIDeveloperGuide2018.pdf
You can choose to use the RefundTransaction API in a few different ways:
•• You can refund the entire transaction by setting “refundType”: “Full”.
•• You can refund specific lines from a transaction by specifying “refundType”: “Partial”, and setting a list of lines to refund using the refundLines parameter to the list of line numbers of the lines that are being refunded.
•• If your customer originally paid sales tax on the transaction, and they later provided a resale exemption certificate, you can call set the “refundType”: “TaxOnly”.
•• If you wish to give a customer a percentage refund, perhaps for a discount, you can specify “refundType”: “Percentage”.
from avatax-rest-v2-php-sdk.
After investigation we found that ENUMS/Constants work fine in PHP SDK. If we pass the ENUMS as String Constant it works and also if we pass ENUM Value as String that works as well.
So in the above example, if we pass "refundType":"2" or "refundType":"TAXONLY" then it will work as expected.
However if we pass ENUM value as INTEGER (like "refundType":2), it doesn’t work. We agree that some of the documentation needs to be more clear about this.
Closing the ticket for now.
from avatax-rest-v2-php-sdk.
Related Issues (20)
- How to CreateCustomers in PHP SDK HOT 1
- how to resolve Address result HOT 1
- Timeout Hardcoded HOT 2
- How do I specify a unit for parameters that accept units? HOT 2
- Magento 2.4.4 setup:di:compile error for lib 23.6.0 HOT 3
- downloadTaxRatesByZipCode endpoint fails with unexpected format HOT 1
- How to handling error? HOT 1
- Avalara\AvaTaxClient" not found
- How to omit tax codes in transactions HOT 2
- Address model cannot be set with locationCode HOT 1
- Keep SDK version in constant and use it across requests HOT 2
- During Composer install, AvaTaxClientBase not passing in params needed to load HOT 2
- File has mixed line endings; this may cause incorrect results HOT 1
- AvaTaxClient methods no longer returning API JSON error message for HTTP 4** etc responses. HOT 1
- Transactions are not being reported in real-time in the dashboard HOT 1
- Try/catch is not firing on exception and server is responding with 502 error for transaction with invalid addresses HOT 1
- Missing method to set $this->_model['email '] (Customer Email) HOT 1
- commitTransaction method not behaving as expected, has incorrect inline documentation HOT 1
- listTransactionsByCompany in Methods.php should make $dataSourceId an optional parameter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avatax-rest-v2-php-sdk.