paypal-adaptive-hoops-0.13.1.0: Client for a limited part of PayPal's Adaptive Payments API

Safe HaskellNone
LanguageHaskell2010

PayPal.Adaptive

Contents

Synopsis

Client

data Client Source

Constructors

Client 

Fields

_clAppId :: Text
 
_clUserId :: Text
 
_clEnvironment :: Environment
 
_clPassword :: Text
 
_clSignature :: Text
 
_clAccountEmail :: Text

Not needed for authentication, but deposits are sent to here and withdrawals are sent from here. Must be the email associated with your PayPal app.

Error

data AdaptiveError Source

Text is an error message in all the below types.

AeShouldNotHappen is meant to cover PayPal responses to API requests that this library doesn't support sending in the first place. TODO: is this actually how we're using it?

noSuchEmail :: ErrorCode Source

Raised when the Deposit sender email or the Withdrawal account email doesn't exist.

PayResponse

data PayResponse Source

Used for forgiving attempts to parse PayPal responses. For instance, this library never expects more than one PaymentInfo. We still try to parse them as a list here so we can still sucessfully parse a PayResp to use in an AdaptiveError if for some reason more than one PaymentInfo is returned.

https://developer.paypal.com/docs/classic/api/adaptive-payments/Pay_API_Operation/

Constructors

PayResponse 

Fields

_prPayError :: Maybe Text

payErrorList (string) -- Information about why a payment failed.

_prPayStatus :: PayStatus
 
_prPayKey :: PayKey
 
_prPaymentInfos :: [PaymentInfo]
 

Processing

data CompletePayResponse Source

A version of PayResponse for completed transactions.

Status fields are omitted since they should be complete.

Has no separate field for a PaymentInfo list since successful transactions will always have exactly one. Instead the pay info fields have been flattened into the top level of this structure.

Constructors

CompletePayResponse 

Fields

_cpPayKey :: PayKey
 
_cpReceiver :: Receiver
 
_cpTransactionId :: TransactionId
 
_cpSenderTransactionId :: TransactionId
 

data NotComplete Source

A high level data type that tries to summarize the status of a payment in simple terms (meant to be used in an Either, e.g. Either NotComplete CompletePayResponse).

Money

data Money Source

Constructors

USD 

Fields

_usdCents :: Int