Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe error : unable to perform color detection

im currently attempting to integrate Stripe into a little website.

I can see within Firebug, that this get request runs correctly

https://checkout.stripe.com/api/bootstrap?locale=en&key=******************

However another request comes back with a NetworkError : 400 Bad Request

https://checkout.stripe.com/api/color?image_url=https%3A%2F%2Fwww.*******.com%2Fassets%2Fimages%2Flayout-images%2Fstripe-logo.jpg&key=

The JSON response when opening the URL in a browser is

{
"error": {
"type": "invalid_request",
"message": "Unable to perform color detection."
}
}

some posts on the message indicate that it shouldnt be worried about. but I havent been able to find anything really informative on the specific error. Does anyon ehappen to know what is causing this error ?

like image 955
user125264 Avatar asked Apr 22 '15 02:04

user125264


People also ask

What is a stripe error code?

Learn more about common error codes and how to resolve them. Stripe uses HTTP response status codes to indicate the success or failure of your API requests. If your request fails, Stripe returns an error using the appropriate status code. In general, there are three status code ranges you can expect:

How do I review errors in my stripe integration?

Use the Developers section of the Dashboard to review errors and monitor your integration. Stripe uses HTTP response status codes to indicate the success or failure of your API requests. If your request fails, Stripe returns an error using the appropriate status code.

What happens if my stripe request fails?

If your request fails, Stripe returns an error using the appropriate status code. In general, there are three status code ranges you can expect: 2xx success status codes confirm that your request worked as expected 4xx error status codes indicate an error because of the information provided (e.g., a required parameter was omitted)

How does stripe Notify me of suspected fraud?

Most fraudulent payments are made using stolen cards or card numbers. When a cardholder is notified that the payment has been made or they review their card statement, they contact their card issuer to dispute it. Notifying you of suspected fraud Stripe’s machine learning system continuously monitors all payments processed by our users.


Video Answer


3 Answers

This can happen if the image URL is not publicly accessible, as Stripe has to be able to request the image from their servers. This can happen if you are running a local copy of the application which isn't accessible from the outside world, or if it is behind a VPN or authentication.

like image 191
andrhamm Avatar answered Oct 26 '22 06:10

andrhamm


So I changed the handler to include another paramter of color and it appears to have resolved the issue.

  var handler = StripeCheckout.configure({
    key: '******************',
    image: '/assets/images/layout-images/stripe-logo.jpg',
    color: 'black',
    token: function(token) {
      // Use the token to create the charge with a server-side script.
      // You can access the token ID with `token.id`
    }
  });

weird as im not quite sure why it wasnt included in the docs.

like image 42
user125264 Avatar answered Oct 26 '22 08:10

user125264


I got the same error and setting color didn't work for me. I changed the path of the image to the one given in Stripe documentation:

Changed

https://stripe.com/template/img/documentation/checkout/marketplace.png

to

https://stripe.com/img/documentation/checkout/marketplace.png
like image 33
Nisal Gunawardana Avatar answered Oct 26 '22 08:10

Nisal Gunawardana