Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_invoice returns batch payment ID as if it were payment ID #225

Open
steveh opened this issue May 31, 2022 · 1 comment
Open

get_invoice returns batch payment ID as if it were payment ID #225

steveh opened this issue May 31, 2022 · 1 comment
Assignees

Comments

@steveh
Copy link
Contributor

steveh commented May 31, 2022

Given two invoices with payments created in the same batch, get_invoices returns the correct value for batch_payment_id and payment_id:

xero_client.get_invoices(xero_organisation.id, i_ds: [inv1.invoice_id, inv2.invoice_id]).invoices.flat_map(&:payments).map(&:batch_payment_id)
=> ["137916a0-c94b-4b94-a708-67424f1c1dac", "137916a0-c94b-4b94-a708-67424f1c1dac"]

xero_client.get_invoices(xero_organisation.id, i_ds: [inv1.invoice_id, inv2.invoice_id]).invoices.flat_map(&:payments).map(&:payment_id)
=> ["90462a0c-da8d-492c-8109-85cf41cdcefc", "2ce0c26f-ea1d-46d3-9b62-62a1566cd441"]

However, get_invoice returns the value of batch_payment_id instead:

xero_client.get_invoice(org_id, inv1_id).invoices[0].payments[0].payment_id
=> "137916a0-c94b-4b94-a708-67424f1c1dac"

xero_client.get_invoice(org_id, inv2_id).invoices[0].payments[0].payment_id
=> "137916a0-c94b-4b94-a708-67424f1c1dac"

I expected:

xero_client.get_invoice(org_id, inv1_id).invoices[0].payments[0].payment_id
=> "90462a0c-da8d-492c-8109-85cf41cdcefc"

xero_client.get_invoice(org_id, inv2_id).invoices[0].payments[0].payment_id
=> "2ce0c26f-ea1d-46d3-9b62-62a1566cd441"
@pumpkinball pumpkinball self-assigned this Jan 24, 2023
@pumpkinball
Copy link
Contributor

Hi @steveh - thank you for picking up this. I've replicated the issue, and have raised internally.
Will keep you posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants