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

        tyson Tyson Phillips (Inactive) created issue -
        tyson Tyson Phillips (Inactive) made changes -
        Field Original Value New Value
        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.
        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.

        *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.
        tyson Tyson Phillips (Inactive) made changes -
        Fix Version/s 4.0.0 [ 10603 ]
        Fix Version/s Short Term [ 10800 ]
        tyson Tyson Phillips (Inactive) made changes -
        Assignee Tyson Phillips [ tyson ]
        Automated transition triggered when Tyson Phillips (Inactive) created a branch in Stash -
        Status Open [ 1 ] In Progress [ 3 ]
        tyson Tyson Phillips (Inactive) made changes -
        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.

        *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.
        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. There are 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.
        tyson Tyson Phillips (Inactive) made changes -
        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. There are 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.
        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.
        Automated transition triggered when Tyson Phillips (Inactive) created pull request #3 in Stash -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        Automated transition triggered when Cody Phillips (Inactive) merged pull request #3 in Stash -
        Status In Review [ 5 ] Closed [ 6 ]

          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