-
Notifications
You must be signed in to change notification settings - Fork 100
added transaction fee support to sale class #232
added transaction fee support to sale class #232
Conversation
Thank you so much for your Pull Request. I will go through this tomorrow morning, and get this merged in as soon as possible. Thanks. |
Hey @chaitanyakuber ! I have updated the master branch with the field added. I had to make changes to your pull request. Actually, we didnt need to create a new TransactionFee class, it is actually a currency object. You could create an instance of that as shown here. Let me know if you run into any such issues. Thank you so much for your pull request. |
Thanks @jaypatel512 |
@chaitanyakuber @jaypatel512 we are having the same issues pulling in 1.1.* did this get push to composer yet? |
Hey @jaypatel512 Thanks! Can you go into your process for the minor versioning? 1.0 to 1.1 had sweeping breaking API changes, but a bug fix in 1.1.1 was pushed to a new minor 1.2.0? We had locked down on 1.1.* to avoid breaking changes in minors. |
We do try our level best to semver standards as much as possible. When a new public API is introduced, we make a new MINOR version update. However, if there is only a small bug fix, where we fix something that is broken in current version goes into PATCH update. MAJOR updates are only done when we introduce a big breaking change. The changes from 1.0 to 1.1 was:
The changes from 1.1 to 1.2 includes:
Again, If I have accidentally made a backward compatible change without making a major version change, please let me know and I will definitely make sure about that in future. |
More so that the addition of transaction_fee to the API caused a breaking error in 1.1.1 that the fix for (this pull) was put into 1.2.0 forcing us to upgrade. I'll pay more attention to the repro going forward as the SDK matures. Thanks!
|
Agreed. We do discourage branching each minor version, and doing fix versions on older minor versions. It keeps external developers encouraged to use latest SDK. However, even so, upgrading from 1.1.1 to 1.2.0 should not have any breaking changes at all. But I would definitely keep a sharp eye on doing upgrades for things like this, with as much ideal way possible. |
I am raising this PR mostly for discussion while I wait for PayPal support engineers to respond.
Last week we discovered that a new "transaction_fee" element had been added to the response for a POST request to /v1/payments/payment. This causes an issue with this SDK as reflection is used to map the JSON to PHP Objects.
Problem JSON
Reflection Code is https://github.com/chaitanyakuber/PayPal-PHP-SDK/blob/master/lib/PayPal/Common/PayPalModel.php#L184
When the above JSON is processed by this code we see "Method PayPal\Api\Sale::getTransactionFee() does not exist" in our logs.
Questions