stripe-0.8.1: A Haskell implementation of the Stripe API.

Safe HaskellNone

Web.Stripe.Charge

Synopsis

Documentation

data Charge Source

Represents a charge in the Stripe system.

Instances

Show Charge 
FromJSON Charge

Attempts to parse JSON into a Charge.

newtype ChargeId Source

Represents the identifier for a given Charge in the Stripe system.

Constructors

ChargeId 

Fields

unChargeId :: Text
 

Instances

chargeToken :: MonadIO m => Token -> Amount -> Currency -> Maybe Description -> Maybe Amount -> StripeT m ChargeSource

Submit a Charge to the Stripe API using an already constructed Token.

chargeTokenById :: MonadIO m => TokenId -> Amount -> Currency -> Maybe Description -> Maybe Amount -> StripeT m ChargeSource

Submit a Charge to the Stripe API using a TokenId.

chargeCustomer :: MonadIO m => Customer -> Amount -> Currency -> Maybe Description -> Maybe Amount -> StripeT m ChargeSource

Submit a Charge to the Stripe for a specific Customer that already has payment details on file.

chargeCustomerById :: MonadIO m => CustomerId -> Amount -> Currency -> Maybe Description -> Maybe Amount -> StripeT m ChargeSource

Submit a Charge to the Stripe for a specific Customer, identified by its CustomerId, that already has payment details on file.

chargeRCard :: MonadIO m => RequestCard -> Amount -> Currency -> Maybe Description -> Maybe Amount -> StripeT m ChargeSource

Submit a Charge to the Stripe API using a RequestCard to describe payment details.

getCharge :: MonadIO m => ChargeId -> StripeT m ChargeSource

Retrieve a Charge from the Stripe API, identified by ChargeId.

getCharges :: MonadIO m => Maybe CustomerId -> Maybe Count -> Maybe Offset -> StripeT m [Charge]Source

Retrieve a list of Charges from the Stripe API. The query can optionally be refined to a specific:

partialRefund :: MonadIO m => Charge -> Amount -> StripeT m ChargeSource

Requests that Stripe issue a partial refund to a specific Charge for a particular Amount.

partialRefundById :: MonadIO m => ChargeId -> Amount -> StripeT m ChargeSource

Requests that Stripe issue a partial refund to a specific Charge, identified by ChargeId, for a particular Amount.

fullRefund :: MonadIO m => Charge -> StripeT m ChargeSource

Requests that Stripe issue a full refund to a specific Charge.

fullRefundById :: MonadIO m => ChargeId -> StripeT m ChargeSource

Requests that Stripe issue a full refund to a specific Charge, identified by ChargeId.

newtype Amount Source

Represents an amount in cents in the Stripe system.

Constructors

Amount 

Fields

unAmount :: Int
 

Instances

newtype Count Source

A maximum number of objects that the Stripe API will return. This value should be between 1 and 100, inclusive.

Constructors

Count 

Fields

unCount :: Int
 

Instances

newtype Currency Source

Represents a currency (e.g., usd) in the Stripe system. This is a 3-letter ISO code.

Constructors

Currency 

Fields

unCurrency :: Text
 

Instances

newtype Description Source

Describes an object in the Stripe system.

Constructors

Description 

Fields

unDescription :: Text
 

newtype Offset Source

A positive integer that is an offset into the array of objects returned by the Stripe API.

Constructors

Offset 

Fields

unOffset :: Int
 

Instances

data UTCTime

This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.

Constructors

UTCTime 

Fields

utctDay :: Day

the day

utctDayTime :: DiffTime

the time from midnight, 0 <= t < 86401s (because of leap-seconds)

data StripeConfig Source

Configuration for the StripeT monad transformer.

newtype StripeT m a Source

Defines the monad transformer under which all Stripe REST API resource calls take place.

runStripeT :: MonadIO m => StripeConfig -> StripeT m a -> m (Either StripeFailure a)Source

Runs the StripeT monad transformer with a given StripeConfig. This will handle all of the authorization dance steps necessary to utilize the Stripe API.

Its use is demonstrated in other functions, such as query.