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

Stripe: Stripe_AuthenticationError exception used as array instead of object

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6.0
    • Fix Version/s: 4.0.0-b1
    • Component/s: Gateways
    • Labels:
      None

      Description

      Issue mentioned here:
      http://www.blesta.com/forums/index.php?/topic/6310-paypal-to-stripe-switch/

      It looks like there are a couple instances in /components/gateways/merchant/stripe_gateway/stripe_gateway.php where the Stripe_AuthenticationError exception is caught, but the $response is handled as an array rather than as an object. There are other instances in the file where the exception $response is correctly treated as an object.

      After all responses are evaluated in a try/catch, the $response should be converted to an array. If an exception occurs, the response will remain as an object. This appears to be the case with the forum thread. There are also cases where the $response from the API can be an array or an object, so it is best to just convert it to an array for our use.

      ALSO, check ::refundCc for the "Stripe_InvalidRequestError". I noticed an error with undefined index 'param' here.
      To duplicate:
      1. Process a Stripe payment.
      2. Refund the Stripe payment using the "Refund" option.
      3. Update the transaction to Void the payment, and check the box to process it through the gateway.

      The rest of the response failures should be re-evaluated to ensure the expected data is received according to the Stripe docs.

        Activity

          People

          • Assignee:
            tyson Tyson Phillips (Inactive)
            Reporter:
            tyson Tyson Phillips (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              15/Sep/16