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

rename StripePrivateKey to StripeSecretKey

parent 19d1aa85
No related branches found
No related tags found
1 merge request!30Expose a browser facing API for charge
......@@ -81,7 +81,7 @@ import PaymentServer.Persistence
, VoucherDatabase(payForVoucher)
)
type StripePrivateKey = ByteString
type StripeSecretKey = ByteString
data Acknowledgement = Ok
......@@ -100,7 +100,7 @@ getVoucher (MetaData []) = Nothing
getVoucher (MetaData (("Voucher", value):xs)) = Just value
getVoucher (MetaData (x:xs)) = getVoucher (MetaData xs)
stripeServer :: VoucherDatabase d => d -> StripePrivateKey -> Server StripeAPI
stripeServer :: VoucherDatabase d => d -> StripeSecretKey -> Server StripeAPI
stripeServer d key = webhook d
:<|> charge d key
......@@ -149,7 +149,7 @@ 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 -> StripePrivateKey -> Charges -> Handler Acknowledgement
charge :: VoucherDatabase d => d -> StripeSecretKey -> Charges -> Handler Acknowledgement
charge d key (Charges token voucher amount currency) = do
let config = StripeConfig (StripeKey key) Nothing
tokenId = TokenId token
......
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