Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Changes to BatchPayment to avoid timezone Issue #398

Merged
merged 2 commits into from
Apr 27, 2020

Conversation

LukeKirbyDG
Copy link
Contributor

The payment date of the batch payment should be passed as a string in the format yyyy-MM-dd according to the Xero API docs page however as it was being parsed as a date, it was subject to the timezone difference between the API user and Xero, so if you parsed a date object without a timepart, you could end up with yesterday's date being set for the payment date.

See https://developer.xero.com/documentation/api/batch-payments#PUT

Example request and response where using the current version published on nuget, sets the date incorrectly.

batch payment request.xml.txt
response.json.txt

The payment date of the batch payment should be passed as a string in the format yyyy-MM-dd according to the Xero API docs page however as it was being parsed as a date, it was subject to the timezone difference between the API user and Xero, so if you parsed a date object without a timepart, you could end up with yesterday's date being set for the payment date.

See https://developer.xero.com/documentation/api/batch-payments#PUT
@MJMortimer
Copy link
Member

Thanks for this @LukeKirbyDG, props on including some tests

@MJMortimer MJMortimer merged commit 89ac0c3 into XeroAPI:master Apr 27, 2020
@LukeKirbyDG LukeKirbyDG deleted the bugfix-batchpayments branch April 29, 2020 14:51
@LukeKirbyDG LukeKirbyDG restored the bugfix-batchpayments branch April 29, 2020 14:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants