Skip to content

Store credits leaving insufficient balance for Stripe payments #311

@rainerdema

Description

@rainerdema

Originally posted by @loicginoux in #307 (comment)

To Reproduce

  1. Create an order with a total of $50
  2. Apply store credits of $49.70 to the order
  3. Attempt to complete the order using Stripe as the payment method

Current behavior
Currently, when store credits are applied and they cover almost all of the order, it can leave a balance that's insufficient for Stripe to process.
For instance, if we have an order total of $50, and store credits of $49.70 are applied, the remaining amount to pay is $0.30. However, Stripe requires a minimum of $0.50 to process a payment, resulting in a Stripe::InvalidRequestError - Amount must be at least €0.50 $.

Expected behavior
The system should handle scenarios where store credits leave a balance that falls below the minimum payment threshold of the payment gateway (Stripe, in this case).
The customer should not be left with a balance that they cannot pay.

Screenshots
In this specific example, the order total is < 0.50$
Screenshot 2023-07-05 at 17 51 06

Additional context
The current logic covers scenarios where an order is fully covered by store credits,, but fails to handle cases where store credits almost fully cover the order, leaving a balance that's below the minimum payment threshold for certain payment methods.
We need to figure out how to manage this situation, particularly as different currencies, other than USD, have varying minimum amounts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions