Skip to content

Conversation

julienbourdeau
Copy link
Contributor

@julienbourdeau julienbourdeau commented May 14, 2025

A payment has payable which can be an Invoice or a PaymentRequest.

When a dispute is lost, Stripe sends a charge.dispute.closed webhook with the payment details included. When attached to an invoice, the invoice is flagged as disputed but it it was a PaymentRequest, it wasn't handled.

This PR loops over each invoices of the PaymentRequest and mark them as disputed.

The Adyen service was also updated and since the test don't mock the service call, but check the result, they don't need to be updated.

Note that the original Invoices::LoseDisputeService is still used by GraphQL when marking an invoice as last.

@julienbourdeau julienbourdeau self-assigned this May 14, 2025
@julienbourdeau julienbourdeau force-pushed the feat/payment-request-dispute branch from 7398adf to b99e8a5 Compare May 21, 2025 14:03
@julienbourdeau julienbourdeau changed the title Feat/payment request dispute feat(stripe): Mark invoice as disputed for PaymentRequest May 21, 2025
@julienbourdeau julienbourdeau force-pushed the feat/payment-request-dispute branch from b99e8a5 to 774ca61 Compare May 21, 2025 14:13
@julienbourdeau julienbourdeau marked this pull request as ready for review May 21, 2025 14:24
Copy link
Contributor

@ancorcruz ancorcruz left a comment

Choose a reason for hiding this comment

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

Looks great, still I would improve the invoices method in payment model

@julienbourdeau julienbourdeau force-pushed the feat/payment-request-dispute branch from 774ca61 to 330cdf9 Compare May 23, 2025 08:33
Copy link
Contributor

@ancorcruz ancorcruz left a comment

Choose a reason for hiding this comment

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

LGTM! thanks

@julienbourdeau julienbourdeau merged commit 84cc1a9 into main May 26, 2025
14 checks passed
@julienbourdeau julienbourdeau deleted the feat/payment-request-dispute branch May 26, 2025 14:22
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.

2 participants