Jump to content

Stripe 403 error response


Nelsa

Recommended Posts

Few days ago one of our clients made mistake and add Publishable key insted secret key to stripe module, and few hours latter blesta try to charge from his client credit card, stripe reject charge request as it should with 403 error  but blesta has accepted transaction as sucessfull.Now few minutes ago I wanted to replicate same situation and it happen again,while blesta throw error  " An error occured when processing the request with the gateway " on payment form, in background it accept payment and tag invoice as succesfully paid,send confirmation email and activate service...Blesta version is 4.0

 

Stripe response 

 
{


"error": {

"type": "invalid_request_error",

"message": "This API call cannot be made with a publishable API key. Please use a secret API key. You can find a list of your API keys at https://dashboard.stripe.com/account/apikeys."

}

}

 

Here is screenshot from gateway log in Blesta

 

Screenshot_10.png

 

Error on payment form

Screenshot_11.png

 

 

In same time invoice shown as paid and service activated

Screenshot_12.png

 
Link to comment
Share on other sites

I have confirmed this as a bug (CORE-2447).

If you wanted to fix this yourself, in /components/gateways/merchant/stripe_gateway/strip_gateway.php on lines 336, 534, and 956 change

if (!isset($response['error'])) {

to

if (!isset($response['error']) && empty($errors)) {

 

 

That should prevent this kind of bug from happening.

Link to comment
Share on other sites

  • 2 weeks later...

 

On 9/1/2017 at 4:42 PM, Lucas said:

Line 1272 doesn't need to be changed?

Fair point.  That line will not affect the error message, or cause any transaction to be approved that shouldn't, but it will affect whether the logs correctly mark the response as an error.

Link to comment
Share on other sites

  • Tyson locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...