Skip to content
Snippets Groups Projects
Commit e2ba9ef9 authored by Ramakrishnan Muthukrishnan's avatar Ramakrishnan Muthukrishnan
Browse files

report an error for failed payments

parent 98d11b32
No related branches found
No related tags found
1 merge request!30Expose a browser facing API for charge
...@@ -35,6 +35,7 @@ import Servant ...@@ -35,6 +35,7 @@ import Servant
( Server ( Server
, Handler , Handler
, err400 , err400
, ServerError(errBody)
, throwError , throwError
) )
import Servant.API import Servant.API
...@@ -154,4 +155,4 @@ charge d key (Charges token voucher amount currency) = do ...@@ -154,4 +155,4 @@ charge d key (Charges token voucher amount currency) = do
Right (Charge {}) -> do Right (Charge {}) -> do
liftIO $ payForVoucher d voucher liftIO $ payForVoucher d voucher
return Ok return Ok
Left (StripeError {}) -> throwError err400 Left (StripeError {}) -> throwError err400 { errBody = "Stripe charge didn't succeed" }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment