Skip to content
Browse files

Added ability to use card or js token instead of just card.

  • Loading branch information...
1 parent a5617ba commit f0a4924a5a040e356d4a8f7e02c722bd3734d6db Luke Hoersten committed Nov 11, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −1 src/Web/Stripe/Charge.hs
  2. +4 −4 src/Web/Stripe/Customer.hs
  3. +1 −1 stripe.cabal
View
2 src/Web/Stripe/Charge.hs
@@ -54,7 +54,7 @@ data Charge = Charge
, chargeDescription :: Maybe Description
, chargeCurrency :: Currency
, chargeAmount :: Amount
- , chargeFee :: Int
+ , chargeFee :: Amount
, chargeLive :: Bool
, chargePaid :: Bool
, chargeRefunded :: Bool
View
8 src/Web/Stripe/Customer.hs
@@ -82,19 +82,19 @@ rCardDetailsKV (CDCard rc) = rCardKV rc
rCardDetailsKV (CDToken tid) = [("card", unTokenId tid)]
-- | Update an existing 'Customer' in the Stripe system.
-updateCustomer :: MonadIO m => Customer -> Maybe RequestCard -> Maybe CpnId
+updateCustomer :: MonadIO m => Customer -> Maybe CardDetails -> Maybe CpnId
-> Maybe Email -> Maybe Description -> StripeT m Customer
updateCustomer = updateCustomerById . custId
-- | Update an existing 'Customer', identified by 'CustomerId', in the Stripe
-- system.
-updateCustomerById :: MonadIO m => CustomerId -> Maybe RequestCard
+updateCustomerById :: MonadIO m => CustomerId -> Maybe CardDetails
-> Maybe CpnId -> Maybe Email -> Maybe Description
-> StripeT m Customer
-updateCustomerById (CustomerId cid) mrc mcid me md =
+updateCustomerById (CustomerId cid) mcd mcid me md =
snd `liftM` query (customerRq [cid]) { sMethod = POST, sData = fdata }
where
- fdata = fromMaybe [] (rCardKV <$> mrc) ++ optionalArgs odata
+ fdata = fromMaybe [] (rCardDetailsKV <$> mcd) ++ optionalArgs odata
odata = [ ("coupon", unCpnId <$> mcid)
, ("email", unEmail <$> me)
, ("description", unDescription <$> md)
View
2 stripe.cabal
@@ -1,5 +1,5 @@
Name: stripe
-Version: 0.1
+Version: 0.2
Synopsis: A Haskell implementation of the Stripe API.
Description: This is an implementation of the Stripe API as it is
documented at https://stripe.com/docs/api

0 comments on commit f0a4924

Please sign in to comment.
Something went wrong with that request. Please try again.