diff --git a/src/PaymentServer/Processors/Stripe.hs b/src/PaymentServer/Processors/Stripe.hs index 8506c6b697b2981627fee02edefceca617f2653b..5e78f3f64cdacca08977073828006035a48abd24 100644 --- a/src/PaymentServer/Processors/Stripe.hs +++ b/src/PaymentServer/Processors/Stripe.hs @@ -102,7 +102,7 @@ getVoucher (MetaData (("Voucher", value):xs)) = Just value getVoucher (MetaData (x:xs)) = getVoucher (MetaData xs) stripeServer :: VoucherDatabase d => StripeConfig -> d -> Server StripeAPI -stripeServer stripeConfig d = charge d stripeConfig +stripeServer = charge -- | Browser facing API that takes token, voucher and a few other information -- and calls stripe charges API. If payment succeeds, then the voucher is stored @@ -128,8 +128,8 @@ instance FromJSON Charges where -- | call the stripe Charge API (with token, voucher in metadata, amount, currency etc -- and if the Charge is okay, then set the voucher as "paid" in the database. -charge :: VoucherDatabase d => d -> StripeConfig -> Charges -> Handler Acknowledgement -charge d stripeConfig (Charges token voucher amount currency) = do +charge :: VoucherDatabase d => StripeConfig -> d -> Charges -> Handler Acknowledgement +charge stripeConfig d (Charges token voucher amount currency) = do currency' <- getCurrency currency result <- liftIO (try (payForVoucher d voucher (completeStripeCharge currency'))) case result of