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

Added refund fields to invoice export #3968

Conversation

rustywave
Copy link
Contributor

@rustywave rustywave commented Jul 13, 2022

Draft-only, will wait for feedback before proceeding.

Notes:

  • Only first refund is included, if available. There can be multiple refunds, however. See ticket for clarification.
  • .IncludeRefunds not added into InvoiceQuery call because does not filter the list
  • Added as strings; there are a mix of number and string for currency fields. Can change if needed
  • Added to end of list in order to not break client-side integrations
  • If no refunds, field will be empty instead of 0 to indicate no refund present

image

#3597

Only first refund is included, if available
Copy link
Member

@Kukks Kukks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start, but:

  • You need to also check the payouts inside the pull payment and see if the refund has been done. You can use
var progress = pullPaymentHostedService.CalculatePullPaymentProgress(pp, DateTimeOffset.UtcNow);

to get the amount refunded so far: var remaining = progress.Limit - progress.Completed - progress.Awaiting;

@rustywave
Copy link
Contributor Author

Good call -- I actually did it that way because it looks like the invoice is tagged with Refund on the list view as soon as a refund is issued. Should I add extra fields in the export to account for any of this? If not, I will proceed with what you have above. Also, left some comments on the ticket that may or may not need clarification.

@rustywave
Copy link
Contributor Author

Okay I think I need to add the refunds as separate line items -- you can have multiple payments but currently only one refund per invoice. It kind of doesn't make sense to add the refund as a column because refunds are not tied to payments. Will see what I can do here and reply back.

@Kukks
Copy link
Member

Kukks commented Jul 15, 2022 via email

@rustywave
Copy link
Contributor Author

I started down the road of adding refunds as a separate line item but then realized refunds have multiple payouts (from your suggestion)...I think it makes sense to list payouts out if we are listing payments out. But I agree with your point -- this isn't exactly an invoice export now and it's probably best to clarify what is desired for this.

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

Successfully merging this pull request may close these issues.

None yet

3 participants