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 ?
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:
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.
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)
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With