Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Stripe
Stripe
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 39
    • Issues 39
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Extensions
  • StripeStripe
  • Issues
  • #43

Closed
Open
Opened Apr 02, 2019 by scardinius@scardiniusReporter

How to handle multiple failed donations

Hi,

as we know Stripe repeats charging when it failed twice (6 days later and 12 days later). Each time stripe endpoint civicrm/payment/ipn/ID receives event invoice.payment_failed type what means that new contribution with Failed status is created. In the end we have three Failed contributions for given month. Of course I'm talking about recurring contributions.

Where is my problem? Shouldn't we have an only one Failed contribution with 3 Failed payments?

First of all CiviCRM's data structure is a bit poorer than Stripe's

Stripe CiviCRM
Subscription -> Recurring contribution
Invoice -> Contribution
Payment -> Contribution + Payment
Charge -> Contribution + Payment

On Stripe side one Invoice has up to 3 payments/charges.

Invoice is unique on civicrm (civicrm_contribution.invoice_id) so it's possible to check when endpoint receive invoice.payment_failed event whether it exists or not. And create it only if needed.

What do you think about this case?

Assignee
Assign to
6.0
Milestone
6.0 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: extensions/stripe#43