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

flip stripeServer's parameters

let more "fixed" parameters come first and then the dynamic ones so
that one can do currying with the immutable parameters applied.
parent 2d5d43cf
No related branches found
No related tags found
1 merge request!30Expose a browser facing API for charge
...@@ -101,8 +101,8 @@ getVoucher (MetaData []) = Nothing ...@@ -101,8 +101,8 @@ getVoucher (MetaData []) = Nothing
getVoucher (MetaData (("Voucher", value):xs)) = Just value getVoucher (MetaData (("Voucher", value):xs)) = Just value
getVoucher (MetaData (x:xs)) = getVoucher (MetaData xs) getVoucher (MetaData (x:xs)) = getVoucher (MetaData xs)
stripeServer :: VoucherDatabase d => d -> StripeSecretKey -> Server StripeAPI stripeServer :: VoucherDatabase d => StripeSecretKey -> d -> Server StripeAPI
stripeServer d key = webhook d stripeServer key d = webhook d
:<|> charge d key :<|> charge d key
-- | Process charge succeeded events -- | Process charge succeeded events
......
...@@ -42,7 +42,7 @@ type PaymentServerAPI ...@@ -42,7 +42,7 @@ type PaymentServerAPI
-- | Create a server which uses the given database. -- | Create a server which uses the given database.
paymentServer :: VoucherDatabase d => ByteString -> Issuer -> d -> Server PaymentServerAPI paymentServer :: VoucherDatabase d => ByteString -> Issuer -> d -> Server PaymentServerAPI
paymentServer key issuer database = paymentServer key issuer database =
stripeServer database key stripeServer key database
:<|> redemptionServer issuer database :<|> redemptionServer issuer database
paymentServerAPI :: Proxy PaymentServerAPI paymentServerAPI :: Proxy PaymentServerAPI
......
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