stripe-concepts 1.0.2.8 → 1.0.3
raw patch · 3 files changed
+32/−14 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.ApiVersion
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.CouponId
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.CustomerId
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.InvoiceId
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.Mode
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.PlanId
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.ProductId
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.PublishableApiKey
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.RequestApiVersion
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.SubscriptionId
+ Stripe.Concepts: instance Data.Data.Data Stripe.Concepts.TokenId
+ Stripe.Concepts: instance Data.Data.Data a => Data.Data.Data (Stripe.Concepts.BothModes a)
+ Stripe.Concepts: instance GHC.Classes.Eq Stripe.Concepts.ApiSecretKey
+ Stripe.Concepts: instance GHC.Classes.Eq Stripe.Concepts.Mode
+ Stripe.Concepts: instance GHC.Classes.Eq Stripe.Concepts.PublishableApiKey
+ Stripe.Concepts: instance GHC.Classes.Eq Stripe.Concepts.WebhookSecretKey
+ Stripe.Concepts: instance GHC.Classes.Eq a => GHC.Classes.Eq (Stripe.Concepts.BothModes a)
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.ApiSecretKey
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.ApiVersion
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.CouponId
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.CustomerId
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.InvoiceId
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.Mode
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.PlanId
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.ProductId
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.PublishableApiKey
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.RequestApiVersion
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.SubscriptionId
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.TokenId
+ Stripe.Concepts: instance GHC.Classes.Ord Stripe.Concepts.WebhookSecretKey
+ Stripe.Concepts: instance GHC.Enum.Bounded Stripe.Concepts.Mode
+ Stripe.Concepts: instance GHC.Enum.Enum Stripe.Concepts.Mode
+ Stripe.Concepts: instance GHC.Generics.Generic (Stripe.Concepts.BothModes a)
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.ApiVersion
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.CouponId
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.CustomerId
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.InvoiceId
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.Mode
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.PlanId
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.ProductId
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.PublishableApiKey
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.RequestApiVersion
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.SubscriptionId
+ Stripe.Concepts: instance GHC.Generics.Generic Stripe.Concepts.TokenId
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.ApiVersion
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.CouponId
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.CustomerId
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.InvoiceId
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.Mode
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.PlanId
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.ProductId
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.PublishableApiKey
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.RequestApiVersion
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.SubscriptionId
+ Stripe.Concepts: instance GHC.Show.Show Stripe.Concepts.TokenId
+ Stripe.Concepts: instance GHC.Show.Show a => GHC.Show.Show (Stripe.Concepts.BothModes a)
Files
- changelog.md +4/−0
- library/Stripe/Concepts.hs +27/−13
- stripe-concepts.cabal +1/−1
changelog.md view
@@ -31,3 +31,7 @@ ## 1.0.2.8 - 2021-06-05 Support GHC 9.0, `bytestring` 0.11++## 1.0.3 - 2021-07-01++Add standard instances to many types
library/Stripe/Concepts.hs view
@@ -1,4 +1,5 @@ {-# OPTIONS_GHC -Wall #-}+{-# language DeriveFunctor, DerivingStrategies, DeriveDataTypeable, DeriveGeneric #-} module Stripe.Concepts (@@ -26,6 +27,10 @@ ) where +-- base+import Data.Data (Data)+import GHC.Generics (Generic)+ -- bytestring import qualified Data.ByteString @@ -48,6 +53,7 @@ - 'isTestMode' (and its inverse, 'isTestMode'') -} data Mode = LiveMode | TestMode+ deriving stock (Eq, Ord, Show, Enum, Bounded, Data, Generic) -- | LiveMode → True; TestMode → False isLiveMode :: Mode -> Bool@@ -76,10 +82,7 @@ and test mode. -} data BothModes a = BothModes { liveMode :: a, testMode :: a }--instance Functor BothModes- where- fmap f (BothModes a b) = BothModes (f a) (f b)+ deriving stock (Eq, Show, Data, Generic, Functor) applyMode :: Mode -> BothModes a -> a applyMode LiveMode = liveMode@@ -111,6 +114,7 @@ 'textToApiSecretKey' to do this conversion. -} newtype ApiSecretKey = ApiSecretKey Data.ByteString.ByteString+ deriving stock (Eq, Ord) {- | Publishable API keys are used in client-side code. @@ -121,6 +125,7 @@ -} newtype PublishableApiKey = PublishableApiKey Data.Text.Text+ deriving stock (Eq, Ord, Show, Data, Generic) {- | Webhook secrets are used to verify the authenticity of webhook events that you receive from Stripe.@@ -137,6 +142,7 @@ 'textToWebhookSecretKey' to do this conversion. -} newtype WebhookSecretKey = WebhookSecretKey Data.ByteString.ByteString+ deriving stock (Eq, Ord) {- | Convert a 'Data.Text.Text' representation of a Stripe API key (that looks something like @"sk_test_BQokikJOvBiI2HlWgH4olfQ2"@) to an 'ApiSecretKey'. -}@@ -160,7 +166,8 @@ integration to operate in a PCI-compliant way." - <https://stripe.com/docs/api/tokens Stripe> -} -newtype TokenId = TokenId Data.Text.Text deriving Eq+newtype TokenId = TokenId Data.Text.Text+ deriving stock (Eq, Ord, Show, Data, Generic) {- | A customer identifier assigned by Stripe. @@ -168,7 +175,8 @@ charges, that are associated with the same customer." - <https://stripe.com/docs/api/customers Stripe> -} -newtype CustomerId = CustomerId Data.Text.Text deriving Eq+newtype CustomerId = CustomerId Data.Text.Text+ deriving stock (Eq, Ord, Show, Data, Generic) {- | The ID of a Stripe product. @@ -176,7 +184,8 @@ Subscription. An associated Plan determines the product pricing." - <https://stripe.com/docs/api/service_products Stripe> -} -newtype ProductId = ProductId Data.Text.Text deriving Eq+newtype ProductId = ProductId Data.Text.Text+ deriving stock (Eq, Ord, Show, Data, Generic) {- | The ID of a Stripe subscription plan. @@ -185,7 +194,8 @@ products, and a $15/month plan that allows full access." - <https://stripe.com/docs/api/plans Stripe> -} -newtype PlanId = PlanId Data.Text.Text deriving Eq+newtype PlanId = PlanId Data.Text.Text+ deriving stock (Eq, Ord, Show, Data, Generic) {- | Identifier for a customer's subscription to a product. @@ -193,7 +203,8 @@ subscription ties a customer to a particular plan you've created." - <https://stripe.com/docs/api/subscriptions Stripe> -} -newtype SubscriptionId = SubscriptionId Data.Text.Text deriving Eq+newtype SubscriptionId = SubscriptionId Data.Text.Text+ deriving stock (Eq, Ord, Show, Data, Generic) {- | The ID of a Stripe invoice. @@ -201,7 +212,8 @@ one-off, or generated periodically from a subscription." - <https://stripe.com/docs/api/invoices Stripe> -} -newtype InvoiceId = InvoiceId Data.Text.Text deriving Eq+newtype InvoiceId = InvoiceId Data.Text.Text+ deriving stock (Eq, Ord, Show, Data, Generic) {- | The ID of a Stripe coupon. @@ -210,7 +222,8 @@ orders." - <https://stripe.com/docs/api/coupons Stripe> -} -newtype CouponId = CouponId Data.Text.Text deriving Eq+newtype CouponId = CouponId Data.Text.Text+ deriving stock (Eq, Ord, Show, Data, Generic) ------------------------------------------------------------ @@ -218,7 +231,8 @@ a new API version. The versions are named by the date of their release (e.g. "2019-09-09"). -} -newtype ApiVersion = ApiVersion Data.Text.Text deriving Eq+newtype ApiVersion = ApiVersion Data.Text.Text+ deriving stock (Eq, Ord, Show, Data, Generic) {- | Your account API settings specify: @@ -236,4 +250,4 @@ {- ^ Use a specific API version for this request. (Please note however that any webhook events generated as a result of this request will still use your account's default API version.) -}- deriving Eq+ deriving stock (Eq, Ord, Show, Data, Generic)
stripe-concepts.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.0 name: stripe-concepts-version: 1.0.2.8+version: 1.0.3 synopsis: Types for the Stripe API category: Web