Skip to content

Detect refunds that have already been performed #262

Description

@waiting-for-dev

On #180, we're handling the charge.refunded webhook event to generate a Spree::Refund copy. However, we're not checking whether the incoming webhook has already been processed in the past.

Although we're skipping the processing when the associated payment has already been fully refunded, it might be the case that we handle twice a partial amount refund. As noted in a comment from the referenced issue, we can't use the transaction ARN as that's something not always available at the moment the event is created.

There're two ways to handle that:

  • Generally, through Be resilient against duplicated webhook events #188, making the system resilient against duplicated webhook events.
  • Specifically, as another layer of security, associating every created refund with the charge id in another database table.

Another scenario for a duplicated refund would be one that has been initiated by Solidus, calling the Stripe API and getting the corresponding webhook event.

Metadata

Metadata

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions