Safe Haskell | None |
---|---|
Language | Haskell2010 |
- 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 {}
- approvalUrl :: PpClient -> PayKey -> Text
- m2Currency :: Money -> Text
- m2PayPal :: Money -> String
Documentation
class AdaptiveAPI a where Source
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?
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.
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
data LookupPayment a where Source
Lookup information about a payment.
https://developer.paypal.com/docs/classic/api/adaptive-payments/PaymentDetails_API_Operation/
LookupTrID :: TransactionId -> LookupPayment TransactionId | |
LookupPayKey :: PayKey -> LookupPayment PayKey |
ToJSON (LookupPayment a) | |
AdaptiveAPI (LookupPayment a) |
PayResp | |
|
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.
newtype TransactionId Source
data TransactionStatus Source
approvalUrl :: PpClient -> PayKey -> Text Source
m2Currency :: Money -> Text Source