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

Adding Payments to an Issued Invoice #527

Open
Leestex opened this issue Apr 3, 2024 · 1 comment
Open

Adding Payments to an Issued Invoice #527

Leestex opened this issue Apr 3, 2024 · 1 comment

Comments

@Leestex
Copy link

Leestex commented Apr 3, 2024

Hello billy team,

I am testing the “Fatura” type of Invoice, which, as per standard practice, is issued first and paid afterwards. However, I’ve encountered a challenge with adding Payments to an Invoice after it has been issued. Specifically, I noticed that the framework does not seem to provide a direct API method for persisting Payment records to an already issued Invoice within the Payments utility package:
https://github.com/premium-minds/billy/blob/master/billy-portugal/src/main/java/com/premiumminds/billy/portugal/util/Payments.java

Furthermore, the GenericInvoiceBuilderImpl class’s addPayment function is annotated with @NotOnUpdate, preventing the update of an Invoice instance after it has been persisted:

@NotOnUpdate
public <T extends Payment> TBuilder addPayment(Builder<T> paymentBuilder) {

Given this context, is there a recommended approach within the Billy framework to add Payment information to an Invoice after the initial issuance? Essentially, I’m looking to establish a flow where an Invoice is created and issued, and then, once payments are made, those payments are added to the corresponding Invoice.

Alternatively, if there's a workaround or a planned feature update that could address this issue, I'd appreciate any information you can share.

@froque
Copy link
Member

froque commented Apr 5, 2024

This is something not currently supported. We are persistent payment information before persisting invoice information.

Can not think of a workaround.

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