stripe-haskell 0.1.0.2 → 0.1.0.3
raw patch · 8 files changed
+52/−101 lines, 8 filesdep −vectordep ~hspecPVP ok
version bump matches the API change (PVP)
Dependencies removed: vector
Dependency ranges changed: hspec
API changes (from Hackage documentation)
Files
- src/Web/Stripe/Account.hs +1/−1
- src/Web/Stripe/ApplicationFee.hs +2/−2
- src/Web/Stripe/ApplicationFeeRefund.hs +2/−2
- src/Web/Stripe/Charge.hs +1/−1
- src/Web/Stripe/Client.hs +0/−1
- src/Web/Stripe/Recipient.hs +1/−47
- stripe-haskell.cabal +21/−25
- tests/Main.hs +24/−22
src/Web/Stripe/Account.hs view
@@ -18,7 +18,7 @@ -- let config = SecretKey "secret_key" -- result <- stripe config getAccountDetails -- case result of--- Right accountId -> print accountId+-- Right account -> print account -- Left stripeError -> print stripeError -- @ module Web.Stripe.Account
src/Web/Stripe/ApplicationFee.hs view
@@ -18,8 +18,8 @@ -- let config = SecretKey "secret_key" -- result <- stripe config $ getApplicationFee (FeeId "fee_4xtEGZhPNDEt3w") -- case result of--- Right ApplicationFee {..} -> print accountId--- Left stripeError -> print stripeError+-- Right applicationFee -> print applicationFee+-- Left stripeError -> print stripeError -- @ module Web.Stripe.ApplicationFee ( -- * API
src/Web/Stripe/ApplicationFeeRefund.hs view
@@ -18,8 +18,8 @@ -- let config = SecretKey "secret_key" -- result <- stripe config $ getApplicationFeeRefund (FeeId "fee_id") (RefundId "refund_id") -- case result of--- Right ApplicationFeeRefund {..} -> print applicationFeeRefundId--- Left stripeError -> print stripeError+-- Right applicationFeeRefund -> print applicationFeeRefund+-- Left stripeError -> print stripeError -- @ module Web.Stripe.ApplicationFeeRefund ( -- * API
src/Web/Stripe/Charge.hs view
@@ -149,7 +149,7 @@ chargeBase :: Amount -- ^ Required, Integer value of 100 represents $1 -> Currency -- ^ Required, 3-letter ISO Code- -> Maybe Description -- ^ Optional, default is nullo+ -> Maybe Description -- ^ Optional, default is null -> Maybe CustomerId -- ^ Optional, either `CustomerId` or `TokenId` has to be specified -> Maybe TokenId -- ^ Optional, either `CustomerId` or `TokenId` has to be specified -> Maybe StatementDescription -- ^ Optional, Arbitrary string to include on CC statements
src/Web/Stripe/Client.hs view
@@ -11,7 +11,6 @@ , Stripe -- * `Stripe` Secret Key , StripeConfig (..)- -- * Error type for Request , module Web.Stripe.Client.Error ) where
src/Web/Stripe/Recipient.hs view
@@ -19,7 +19,7 @@ -- result <- stripe config $ -- createRecipient (FirstName "simon") -- (LastName "marlow")--- Nothing -- what is Simon Marlow's middle initial?+-- Nothing -- What is Simon Marlow's middle initial? -- (Invidiual :: RecipientType) -- case result of -- Right recipient -> print recipient@@ -40,7 +40,6 @@ , updateRecipientTaxID , updateRecipientBankAccount , updateRecipientTokenID--- , updateRecipientCard , updateRecipientDefaultCard , updateRecipientEmail , updateRecipientDescription@@ -412,9 +411,6 @@ ------------------------------------------------------------------------------ -- | Update a `Recipient` `TaxID`------ > runStripe config $ updateRecipientTaxID (RecipientId "rp_4lpjaLFB5ecSks") "SampleTaxID"--- updateRecipientTaxID :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated -> TaxID -- ^ `TaxID` of `Recipient` to be updated@@ -429,9 +425,6 @@ ------------------------------------------------------------------------------ -- | Update a `Recipient` `Card` by `TokenId`------ > runStripe config $ updateRecipientTokenId (RecipientId "rp_4lpjaLFB5ecSks") (TokenId "tok_aksdjfh9823")--- updateRecipientTokenID :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated -> TokenId -- ^ `TaxID` of `Recipient` to be updated@@ -443,33 +436,6 @@ Nothing Nothing Nothing Nothing (Just tokenId) Nothing Nothing Nothing Nothing Nothing Nothing Nothing [] ---------------------------------------------------------------------------------- | Update a 'Recipient' 'Card'------ > runStripe config $ updateRecipientCard (RecipientId "rp_4lpjaLFB5ecSks") number month year cvc--- > where--- > number = CardNumber "4242424242424242"--- > month = ExpMonth 12--- > year = ExpYear 2018--- > cvc = 117------ updateRecipientDefaultCard--- :: RecipientId -- ^ The 'RecipientId' of the 'Recipient' to be updated--- -> CardNumber -- ^ 'CardNumber' to attach to 'Card' of 'Recipient'--- -> ExpMonth -- ^ Expiration Month of 'Card'--- -> ExpYear -- ^ Expiration Year of 'Card'--- -> CVC -- ^ CVC of Card--- -> Stripe Recipient--- updateRecipientCard--- recipientid--- cardNumber--- expMonth--- expYear--- cvc = updateRecipientBase--- recipientid Nothing Nothing Nothing--- Nothing Nothing Nothing Nothing Nothing (Just cardNumber)--- (Just expMonth) (Just expYear) (Just cvc)--- Nothing Nothing Nothing [] ------------------------------------------------------------------------------ -- | Update default `Card` of `Recipient`@@ -490,9 +456,6 @@ ------------------------------------------------------------------------------ -- | Update a `Recipient` `Email` Address------ > runStripe config $ updateRecipientEmail (RecipientId "rp_4lpjaLFB5ecSks") (Email "name@domain.com")--- updateRecipientEmail :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated -> Email -- ^ `Email` of `Recipient` to be updated@@ -507,9 +470,6 @@ ------------------------------------------------------------------------------ -- | Update a `Recipient` `Description`------ > runStripe config $ updateRecipientDescription (RecipientId "rp_4lpjaLFB5ecSks") (Email "name@domain.com")--- updateRecipientDescription :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated -> Description -- ^ `Description` of `Recipient` to be updated@@ -524,9 +484,6 @@ ------------------------------------------------------------------------------ -- | Update a `Recipient` `MetaData`------ > runStripe config $ updateRecipientMetaData (RecipientId "rp_4lpjaLFB5ecSks") [("key", "value")]--- updateRecipientMetaData :: RecipientId -- ^ The `RecipientId` of the `Recipient` to be updated -> MetaData -- ^ The `MetaData` associated with the `Recipient`@@ -541,9 +498,6 @@ ------------------------------------------------------------------------------ -- | Delete a `Recipient`------ >>> runStripe config $ deleteRecipient (RecipientId "rp_4lpjaLFB5ecSks")--- deleteRecipient :: RecipientId -- ^ `RecipiendId` of `Recipient` to delete -> Stripe StripeDeleteResult
stripe-haskell.cabal view
@@ -1,5 +1,5 @@ name: stripe-haskell-version: 0.1.0.2+version: 0.1.0.3 synopsis: Stripe API for Haskell license: MIT license-file: LICENSE@@ -15,22 +15,25 @@ . <<https://stripe.com/img/navigation/logo@2x.png>> .- [100% Stripe API Coverage:] - (<https://stripe.com/docs/api>) All Stripe commands are supported,+ [100% Stripe API Coverage - <https://stripe.com/docs/api>]+ All Stripe commands are supported, including but not limited to Charges, Refunds, Customers, Cards, Subscriptions, Plans, Coupons, Discounts, Invoices, Invoice Items, Disputes, Transfers, Recipients, Application Fees, Application Fee Refunds,- Account, Balance, Events and Tokens+ Account, Balance, Events and Tokens. .- [100+ Hspec Tests:] Thoroughly unit-tested with hspec.+ [100% Haddock Coverage]+ All code written for this library is documented to completion with the haddock documentation tool+ .+ [100+ Hspec Tests] Thoroughly unit-tested with hspec. All API commands are unit-tested before inclusion into the API (see the tests directory). To run the tests, perform the following: .- > cabal clean && cabal configure --enable-tests && cabal build tests && dist/build/tests/tests+ > cabal clean && cabal configure --enable-tests && cabal build tests && dist/build/tests/tests -- You will be prompted to enter your *TEST* key . - [Pagination:] Pagination is possible on all API calls that return a JSON array.- (<https://stripe.com/docs/api#pagination>)+ [Pagination - <https://stripe.com/docs/api#pagination>]+ Pagination is possible on all API calls that return a JSON array. Any API call that returns a `StripeList` is eligible for pagination. To use in practice do the following: .@@ -49,17 +52,16 @@ > Left stripeError -> print stripeError > .- [Versioning:] All versioning is hard-coded (for safety)- (<https://stripe.com/docs/api#versioning>)+ [Versioning - <https://stripe.com/docs/api#versioning>]+ All versioning is hard-coded (for safety). Stripe API versions specified in the HTTP headers of Stripe requests take precedence over the API version specified in your Stripe Dashboard. In an attempt to ensure- API consistency and correct parsing of returned JSON, all Stripe versions are hard-coded, and + API consistency and correct parsing of returned JSON, all Stripe versions are hard-coded, and are inaccessible to the end-users of this library. When a new Stripe API version is released this library will increment the hard-coded API version. . - [Expansion:] Object expansion is supported on Stripe objects eligible for expansion though the `ExpandParams` type- (<https://stripe.com/docs/api#expansion>)+ [Expansion - <https://stripe.com/docs/api#expansion>] Object expansion is supported on Stripe objects eligible for expansion though the `ExpandParams` type. Object expansion allows normal Stripe API calls to return expanded objects inside of other objects. For example, a `Customer` object contains a Card ID hash on the default_card field. This default_card hash can be expanded into a full `Card` object inside a `Customer` object.@@ -80,8 +82,8 @@ > . - [MetaData:] Stripe objects allow the embedding of arbitrary metadata- (<https://stripe.com/docs/api#metadata>)+ [MetaData - <https://stripe.com/docs/api#metadata>]+ Stripe objects allow the embedding of arbitrary metadata. Any Stripe object that supports the embedding of metadata is available via this API. As an example: . @@ -91,12 +93,13 @@ > main :: IO () > main = do > let config = StripeConfig "secret key"- > result <- stripe config $ updateCoupon (CouponId "couponid") [("key1", value2"), ("key2", "value2")]+ > result <- stripe config $ updateCoupon (CouponId "couponid") [("key1", "value2"), ("key2", "value2")] > case result of > Right coupon -> print $ couponMetaData coupon > Left stripeError -> print stripeError .- [Issues:] Any API recommendations or bugs can be reported here: (<https://github.com/dmjio/stripe-haskell/issues>)+ [Issues - <https://github.com/dmjio/stripe-haskell/issues>]+ Any API recommendations or bugs can be reported on the GitHub issue tracker. Pull requests welcome! . @@ -109,17 +112,12 @@ , base >=4.7 && <4.8 , bytestring , either- , hspec- , http-streams- , io-streams- , mtl >= 2.1.3.1+ , hspec >= 1.11.4 , random >= 1.1 , stripe-haskell , text , time , transformers- , unordered-containers- , vector default-language: Haskell2010 ghc-options: -Wall -threaded -rtsopts @@ -130,7 +128,6 @@ , base >=4.7 && <4.8 , bytestring , either- , hspec , http-streams , io-streams , mtl >= 2.1.3.1@@ -139,7 +136,6 @@ , time , transformers , unordered-containers- , vector default-language: Haskell2010 other-modules: Web.Stripe.Client
tests/Main.hs view
@@ -2,7 +2,8 @@ {-# LANGUAGE RecordWildCards #-} module Main where -import Test.Hspec+import Test.Hspec (hspec)+import Test.Config (getConfig) import Test.Account (accountTests) import Test.ApplicationFee (applicationFeeTests)@@ -24,29 +25,30 @@ import Test.Transfer (transferTests) import Test.Event (eventTests) - ------------------------------------------------------------------------------ -- | Main test function entry point main :: IO ()-main = hspec $ do- chargeTests- refundTests- customerTests- cardTests- subscriptionTests- planTests- couponTests- discountTests- invoiceTests- invoiceItemTests- disputeTests- transferTests- recipientTests- applicationFeeTests- applicationFeeRefundTests- accountTests- balanceTests- tokenTests- eventTests+main = do+ config <- getConfig+ hspec $ do+ chargeTests config+ refundTests config+ customerTests config+ cardTests config+ subscriptionTests config+ planTests config+ couponTests config+ discountTests config+ invoiceTests config+ invoiceItemTests config+ disputeTests config+ transferTests config+ recipientTests config+ applicationFeeTests config+ applicationFeeRefundTests config+ accountTests config+ balanceTests config+ tokenTests config+ eventTests config