diff --git a/src/PaymentServer/Processors/Stripe.hs b/src/PaymentServer/Processors/Stripe.hs index 5b00b486ca99cd81f629fc888b0c9b679ca517c2..26d8967277fafcbb65966d78ecb2fdeb68319d7f 100644 --- a/src/PaymentServer/Processors/Stripe.hs +++ b/src/PaymentServer/Processors/Stripe.hs @@ -38,6 +38,7 @@ import Servant ( Server , Handler , err400 + , err500 , ServerError(errBody) , throwError ) @@ -169,7 +170,7 @@ charge d key (Charges token voucher amount currency) = do liftIO $ payForVoucher d voucher return Ok else - throwError err400 { errBody = "Voucher code mismatch" } + throwError err500 { errBody = "Voucher code mismatch" } _ -> throwError err400 { errBody = "Voucher code not found" } Left StripeError {} -> throwError err400 { errBody = "Stripe charge didn't succeed" } where