Safe Haskell | None |
---|---|
Language | Haskell2010 |
Web.PayPal.Adaptive
- data PpClient = PpClient {}
- data PpEnv
- class AdaptiveAPI a where
- data AdaptiveErr
- data ReceiverList = ReceiverList {}
- data SendPayment = SendPayment {}
- data CreatePayment = CreatePayment {}
- data LookupPayment a where
- data PayResp = PayResp {}
- data PayExecStatus
- newtype PayKey = PayKey {}
- data PayInfo = PayInfo {}
- data Receiver = Receiver {}
- newtype TransactionId = TransactionId {}
- data TransactionStatus
- data Money = USD {}
- m2Currency :: Money -> Text
- m2PayPal :: Money -> String
Documentation
Constructors
PpClient | |
class AdaptiveAPI a where Source
Instances
data AdaptiveErr 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?
Constructors
AeNoResponse | |
AeConnectionErr Text | |
AeDecodeFailed ByteString Text | |
AeErrCodes [Int] | |
AePending PayResp | |
AeRefused PayResp | |
AeShouldNotHappen PayResp Text |
Instances
data SendPayment Source
Send a single payment from your account.
Pay operation docs: https://developer.paypal.com/docs/classic/api/adaptive-payments/Pay_API_Operation/
This is a "Simple Payment" which means there's a single sender and receiver (same as CreatePayment).
It uses the Implicit payment approval type, meaning the application making the API call must also be the sender of the payment.
Constructors
SendPayment | |
Fields |
data CreatePayment Source
Start the process of someone paying you. You have to redirect the payer's browser to PayPal to finish it.
Pay operation docs: https://developer.paypal.com/docs/classic/api/adaptive-payments/Pay_API_Operation/
This is a "Simple Payment" which means there's a single sender and receiver (same as SendPayment).
It uses the Explicit payment approval type, meaning the payer must go to PayPal in their browser to approve the payment. Here's an example payment approval URL with a PayKey of "foo":
https://www.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=foo
Constructors
CreatePayment | |
Fields |
data LookupPayment a where Source
Lookup information about a payment.
https://developer.paypal.com/docs/classic/api/adaptive-payments/PaymentDetails_API_Operation/
Constructors
LookupTrID :: TransactionId -> LookupPayment TransactionId | |
LookupPayKey :: PayKey -> LookupPayment PayKey |
Instances
ToJSON (LookupPayment a) | |
AdaptiveAPI (LookupPayment a) |
Constructors
PayResp | |
Fields
|
data PayExecStatus Source
This is "paymentExecStatus" in responses to sendPayment and createPayment. It's called "status" in responses to lookupPayment.
Defaults to expiring after three hours:
https://developer.paypal.com/docs/classic/api/adaptive-payments/Pay_API_Operation/
All the API calls we support return a PayInfo along with three Justs, with two exceptions.
- toPayPal CreatePayment returns no PayInfo at all.
- toPayPal LookupPayment on such a payment does return a PayInfo, but with three Nothings.
NOTE: _piSenderTransactionId and _piTransactionStatus will be different, but both can be used to look up a payment.
Constructors
PayInfo | |
newtype TransactionId Source
Constructors
TransactionId | |
Fields |
data TransactionStatus Source
m2Currency :: Money -> Text Source