Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-4171

Stripe Payments: Failed payment attempts always marked as error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.3
    • Component/s: None
    • Labels:
      None

      Description

      StripePayments::processStoredCc() needs to be updated. It contains the following code block (starting around line 615):

              $payment = $this->handleApiRequest(
                  ['Stripe\PaymentIntent', 'create'],
                  [$charge],
                  $this->base_url . 'payment_intents - create'
              );
              $errors = $this->Input->errors();
      
              // Set whether there was an error
              $status = 'error';
              if (isset($payment->error) && $this->ifSet($payment->error->code) === 'card_declined') {
                  $status = 'declined';
              } elseif (!isset($payment->error)
                  && empty($errors)
                  && isset($payment->status)
                  && $payment->status === 'succeeded'
              ) {
                  $status = 'approved';
              } else {
                  $message = isset($payment->error) ? $this->ifSet($payment->error->message) : '';
              }
      

      The problem is that $payment->error will never be defined by the logic of handleApiRequest() so transactions are never marked as declined, always error. One consequence of this is that autodebit will continue to try and charge a card rather than disabling autodebit for the payment account.

        Activity

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              23/Feb/21

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours, 3 minutes
              2h 3m

                Agile