stripe-haskell-0.1.3.0: Stripe API for Haskell

Copyright(c) David Johnson, 2014
Maintainerdjohnson.m@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Web.Stripe.Refund

Contents

Description

https://stripe.com/docs/api#refunds

import Web.Stripe         
import Web.Stripe.Customer
import Web.Stripe.Charge
import Web.Stripe.Refund

main :: IO ()
main = do
  let config = SecretKey "secret_key"
      credit = CardNumber "4242424242424242"
      em  = ExpMonth 12
      ey  = ExpYear 2015
      cvc = CVC "123"
  result <- stripe config $ do
    Customer { customerId = cid }  <- createCustomerByCard cn em ey cvc
    Charge   { chargeId   = chid } <- chargeCustomer cid USD 100 Nothing
    createRefund chid ([] :: MetaData)
  case result of
    Right refund     -> print refund
    Left stripeError -> print stripeError

Synopsis

API

createRefund Source

Arguments

:: ChargeId

ChargeId associated with the Charge to be refunded

-> MetaData

MetaData associated with a Refund

-> Stripe Refund 

getRefund Source

Arguments

:: ChargeId

ChargeId associated with the Refund to be retrieved

-> RefundId

RefundId associated with the Refund to be retrieved

-> Stripe Refund 

Retrieve a Refund by ChargeId and RefundId

getRefundExpandable Source

Arguments

:: ChargeId

ChargeId associated with the Charge to be retrieved

-> RefundId

RefundId associated with the Refund to be retrieved

-> ExpandParams

ExpandParams of object for expansion

-> Stripe Refund 

Retrieve a Refund by ChargeId and RefundId with ExpandParams

getRefunds Source

Arguments

:: ChargeId

ChargeId associated with the Charge to be updated

-> Limit

Defaults to 10 if Nothing specified

-> StartingAfter RefundId

Paginate starting after the following RefundId

-> EndingBefore RefundId

Paginate ending before the following RefundId

-> Stripe (StripeList Refund) 

Retrieve a lot of Refunds by ChargeId

getRefundsExpandable Source

Arguments

:: ChargeId

ChargeId associated with the Charge to be updated

-> Limit

Defaults to 10 if Nothing specified

-> StartingAfter RefundId

Paginate starting after the following RefundId

-> EndingBefore RefundId

Paginate ending before the following RefundId

-> ExpandParams

MetaData associated with a Refund

-> Stripe (StripeList Refund) 

Retrieve a lot of Refunds by ChargeId with ExpandParams

updateRefund Source

Arguments

:: ChargeId

ChargeId associated with the Charge to be updated

-> RefundId

RefundId associated with the Refund to be retrieved

-> MetaData

MetaData associated with a Refund

-> Stripe Refund 

Update a Refund by ChargeId and RefundId

Types

newtype RefundId Source

Constructors

RefundId Text 

Instances

data ChargeId Source

ChargeId associated with a Charge

Instances

data StripeList a Source

Generic handling of Stripe JSON arrays

Constructors

StripeList 

Fields

list :: [a]
 
stripeUrl :: Text
 
object :: Text
 
totalCount :: Maybe Int
 
hasMore :: Bool
 

Instances

Eq a => Eq (StripeList a) 
Show a => Show (StripeList a) 
FromJSON a => FromJSON (StripeList a)

JSON Instance for StripeList