stripe-haskell: Stripe API for Haskell
- 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.
- 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 -- You will be prompted to enter your *TEST* key
- 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:
import Web.Stripe import Web.Stripe.Customer main :: IO () main = do let config = StripeConfig "secret key" result <- stripe config $ getCustomers (Just 30 :: Maybe Limit) -- Defaults to 10 if Nothing, 100 is Max (StartingAfter $ CustomerId "customer_id0") (EndingBefore $ CustomerId "customer_id30") case result of Right stripelist -> print (list stripelist :: [Customer]) Left stripeError -> print stripeError
- 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 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 - 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, aCustomer
object contains a Card ID hash on the default_card field. This default_card hash can be expanded into a fullCard
object inside aCustomer
object. As an example:
import Web.Stripe import Web.Stripe.Customer main :: IO () main = do let config = StripeConfig "secret key" result <- stripe config $ getCustomerExpandable (CustomerId "customerid") (["default_card"] :: ExpandParams) case result of Right customer -> print (defaultCard customer) -- Will be an `ExpandedCard` Left stripeError -> print stripeError
- 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:
import Web.Stripe import Web.Stripe.Coupon main :: IO () main = do let config = StripeConfig "secret key" result <- stripe config $ updateCoupon (CouponId "couponid") [("key1", "value2"), ("key2", "value2")] case result of Right coupon -> print $ couponMetaData coupon Left stripeError -> print stripeError
- Issues - https://github.com/dmjio/stripe-haskell/issues
- Any API recommendations or bugs can be reported on the GitHub issue tracker. Pull requests welcome!
[Skip to Readme]
Modules
[Index]
- Web
- Web.Stripe
- Web.Stripe.Account
- Web.Stripe.ApplicationFee
- Web.Stripe.ApplicationFeeRefund
- Web.Stripe.Balance
- Web.Stripe.Bitcoin
- Web.Stripe.Card
- Web.Stripe.Charge
- Web.Stripe.Coupon
- Web.Stripe.Customer
- Web.Stripe.Discount
- Web.Stripe.Dispute
- Web.Stripe.Event
- Web.Stripe.Invoice
- Web.Stripe.InvoiceItem
- Web.Stripe.Plan
- Web.Stripe.Recipient
- Web.Stripe.Refund
- Web.Stripe.Subscription
- Web.Stripe.Token
- Web.Stripe.Transfer
- Web.Stripe
Downloads
- stripe-haskell-0.1.4.3.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.0.6, 0.1.1.0, 0.1.1.1, 0.1.1.2, 0.1.3.0, 0.1.3.1, 0.1.4.0, 0.1.4.1, 0.1.4.2, 0.1.4.3, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.4.0, 2.4.1, 2.5.0, 2.6.0, 2.6.1, 2.6.2 |
---|---|
Dependencies | aeson (>=0.9 && <0.10), base (>=4.6 && <5), bytestring (>=0.10 && <0.11), either (>=4.4 && <4.5), HsOpenSSL (>=0.11 && <0.12), http-streams (>=0.8 && <0.9), io-streams (>=1.3 && <1.4), mtl (>=2.2 && <2.3), random (>=1.1 && <1.2), text (>=1.2 && <1.3), time (>=1.5 && <1.6), transformers (>=0.4 && <0.5), unordered-containers (>=0.2 && <0.3) [details] |
License | MIT |
Copyright | Copyright (c) 2015 David M. Johnson |
Author | David Johnson |
Maintainer | djohnson.m@gmail.com |
Category | Web |
Home page | https://github.com/dmjio/stripe |
Bug tracker | https://github.com/dmjio/stripe/issues |
Source repo | head: git clone git://github.com/dmjio/stripe.git |
Uploaded | by DavidJohnson at 2015-09-25T03:00:42Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Downloads | 20033 total (79 in the last 30 days) |
Rating | 2.25 (votes: 2) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] Last success reported on 2015-09-25 [all 1 reports] |