From 53e3619b6cc6c1871714ec0e30e50075fecc0a07 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Fri, 18 Sep 2020 08:50:09 -0400 Subject: [PATCH] Same argument order for simpler implementation --- src/PaymentServer/Processors/Stripe.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PaymentServer/Processors/Stripe.hs b/src/PaymentServer/Processors/Stripe.hs index 8506c6b..5e78f3f 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 -- GitLab