Safe Haskell | None |
---|---|
Language | Haskell98 |
API entry point
- data MangoPayT m a
- runMangoPayT :: Credentials -> Manager -> AccessPoint -> MangoPayT m a -> m a
- runResourceInMp :: MPUsableMonad m => MangoPayT (ResourceT m) a -> MangoPayT m a
- data MpException
- getAll :: (MPUsableMonad m, FromJSON v) => (Maybe Pagination -> AccessToken -> MangoPayT m (PagedList v)) -> AccessToken -> MangoPayT m [v]
- data Credentials = Credentials {}
- data AccessPoint
- newtype AccessToken = AccessToken ByteString
- data OAuthToken = OAuthToken {
- oaAccessToken :: Text
- oaTokenType :: Text
- oaExpires :: Int
- data Pagination = Pagination {}
- data PagedList a = PagedList {
- plData :: [a]
- plItemCount :: Integer
- plPageCount :: Integer
- type MPUsableMonad m = (MonadBaseControl IO m, MonadResource m, MonadLogger m)
- class ToHtQuery a where
- (?+) :: ByteString -> a -> (ByteString, Maybe ByteString)
- data CardExpiration = CardExpiration {}
- readCardExpiration :: Reader CardExpiration
- writeCardExpiration :: CardExpiration -> Text
- data KindOfAuthentication
- data SortDirection
- data GenericSort
- createCredentialsSecret :: MPUsableMonad m => MangoPayT m Credentials
- oauthLogin :: MPUsableMonad m => Text -> Text -> MangoPayT m OAuthToken
- toAccessToken :: OAuthToken -> AccessToken
- data NaturalUser = NaturalUser {
- uId :: Maybe NaturalUserId
- uCreationDate :: Maybe POSIXTime
- uEmail :: Text
- uFirstName :: Text
- uLastName :: Text
- uAddress :: Maybe Text
- uBirthday :: POSIXTime
- uNationality :: CountryCode
- uCountryOfResidence :: CountryCode
- uOccupation :: Maybe Text
- uIncomeRange :: Maybe IncomeRange
- uTag :: Maybe Text
- uProofOfIdentity :: Maybe Text
- uProofOfAddress :: Maybe Text
- data IncomeRange
- incomeBounds :: IncomeRange -> (Amount, Amount)
- incomeRange :: Amount -> IncomeRange
- type NaturalUserId = Text
- data LegalUser = LegalUser {
- lId :: Maybe Text
- lCreationDate :: Maybe POSIXTime
- lEmail :: Text
- lName :: Text
- lLegalPersonType :: LegalUserType
- lHeadquartersAddress :: Maybe Text
- lLegalRepresentativeFirstName :: Text
- lLegalRepresentativeLastName :: Text
- lLegalRepresentativeAddress :: Maybe Text
- lLegalRepresentativeEmail :: Maybe Text
- lLegalRepresentativeBirthday :: POSIXTime
- lLegalRepresentativeNationality :: CountryCode
- lLegalRepresentativeCountryOfResidence :: CountryCode
- lStatute :: Maybe Text
- lTag :: Maybe Text
- lProofOfRegistration :: Maybe Text
- lShareholderDeclaration :: Maybe Text
- data LegalUserType
- type LegalUserId = Text
- data UserRef = UserRef {
- urId :: AnyUserId
- urCreationDate :: POSIXTime
- urPersonType :: PersonType
- urEmail :: Text
- urTag :: Maybe Text
- data PersonType
- type AnyUserId = Text
- createNaturalUser :: MPUsableMonad m => NaturalUser -> AccessToken -> MangoPayT m NaturalUser
- modifyNaturalUser :: MPUsableMonad m => NaturalUser -> AccessToken -> MangoPayT m NaturalUser
- fetchNaturalUser :: MPUsableMonad m => NaturalUserId -> AccessToken -> MangoPayT m NaturalUser
- createLegalUser :: MPUsableMonad m => LegalUser -> AccessToken -> MangoPayT m LegalUser
- modifyLegalUser :: MPUsableMonad m => LegalUser -> AccessToken -> MangoPayT m LegalUser
- fetchLegalUser :: MPUsableMonad m => LegalUserId -> AccessToken -> MangoPayT m LegalUser
- getUser :: MPUsableMonad m => AnyUserId -> AccessToken -> MangoPayT m (Either NaturalUser LegalUser)
- listUsers :: MPUsableMonad m => GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList UserRef)
- getExistingUserId :: Either NaturalUser LegalUser -> AnyUserId
- data Wallet = Wallet {}
- data Amount = Amount {}
- type WalletId = Text
- type Currency = Text
- createWallet :: MPUsableMonad m => Wallet -> AccessToken -> MangoPayT m Wallet
- modifyWallet :: MPUsableMonad m => Wallet -> AccessToken -> MangoPayT m Wallet
- fetchWallet :: MPUsableMonad m => WalletId -> AccessToken -> MangoPayT m Wallet
- listWallets :: MPUsableMonad m => AnyUserId -> GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Wallet)
- data Transfer = Transfer {
- tId :: Maybe TransferId
- tCreationDate :: Maybe POSIXTime
- tTag :: Maybe Text
- tAuthorId :: AnyUserId
- tCreditedUserId :: Maybe AnyUserId
- tDebitedFunds :: Amount
- tFees :: Amount
- tDebitedWalletId :: WalletId
- tCreditedWalletId :: WalletId
- tCreditedFunds :: Maybe Amount
- tStatus :: Maybe TransferStatus
- tResultCode :: Maybe Text
- tResultMessage :: Maybe Text
- tExecutionDate :: Maybe POSIXTime
- type TransferId = Text
- data TransferStatus
- data Transaction = Transaction {
- txId :: Maybe TransactionId
- txCreationDate :: Maybe POSIXTime
- txTag :: Maybe Text
- txAuthorId :: AnyUserId
- txCreditedUserId :: Maybe AnyUserId
- txDebitedFunds :: Amount
- txFees :: Amount
- txDebitedWalletId :: Maybe WalletId
- txCreditedWalletId :: Maybe WalletId
- txCreditedFunds :: Maybe Amount
- txStatus :: Maybe TransferStatus
- txResultCode :: Maybe Text
- txResultMessage :: Maybe Text
- txExecutionDate :: Maybe POSIXTime
- txType :: TransactionType
- txNature :: TransactionNature
- type TransactionId = Text
- data TransactionType
- data TransactionNature
- = REGULAR
- | REFUND
- | REPUDIATION
- data TransactionFilter = TransactionFilter {}
- data TransactionSort
- createTransfer :: MPUsableMonad m => Transfer -> AccessToken -> MangoPayT m Transfer
- fetchTransfer :: MPUsableMonad m => TransferId -> AccessToken -> MangoPayT m Transfer
- listTransactions :: MPUsableMonad m => WalletId -> TransactionFilter -> TransactionSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Transaction)
- listTransactionsForUser :: MPUsableMonad m => AnyUserId -> TransactionFilter -> TransactionSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Transaction)
- data Event = Event {
- eResourceId :: Text
- eEventType :: EventType
- eDate :: POSIXTime
- data EventType
- = PAYIN_NORMAL_CREATED
- | PAYIN_NORMAL_SUCCEEDED
- | PAYIN_NORMAL_FAILED
- | PAYOUT_NORMAL_CREATED
- | PAYOUT_NORMAL_SUCCEEDED
- | PAYOUT_NORMAL_FAILED
- | TRANSFER_NORMAL_CREATED
- | TRANSFER_NORMAL_SUCCEEDED
- | TRANSFER_NORMAL_FAILED
- | PAYIN_REFUND_CREATED
- | PAYIN_REFUND_SUCCEEDED
- | PAYIN_REFUND_FAILED
- | PAYOUT_REFUND_CREATED
- | PAYOUT_REFUND_SUCCEEDED
- | PAYOUT_REFUND_FAILED
- | TRANSFER_REFUND_CREATED
- | TRANSFER_REFUND_SUCCEEDED
- | TRANSFER_REFUND_FAILED
- | KYC_CREATED
- | KYC_VALIDATION_ASKED
- | KYC_SUCCEEDED
- | KYC_FAILED
- data EventSearchParams = EventSearchParams {}
- searchEvents :: MPUsableMonad m => EventSearchParams -> AccessToken -> MangoPayT m (PagedList Event)
- searchAllEvents :: MPUsableMonad m => EventSearchParams -> AccessToken -> MangoPayT m [Event]
- checkEvent :: MPUsableMonad m => Event -> AccessToken -> MangoPayT m Bool
- data HookStatus
- data HookValidity
- type HookId = Text
- data Hook = Hook {
- hId :: Maybe HookId
- hCreationDate :: Maybe POSIXTime
- hTag :: Maybe Text
- hUrl :: Text
- hStatus :: HookStatus
- hValidity :: Maybe HookValidity
- hEventType :: EventType
- createHook :: MPUsableMonad m => Hook -> AccessToken -> MangoPayT m Hook
- modifyHook :: MPUsableMonad m => Hook -> AccessToken -> MangoPayT m Hook
- fetchHook :: MPUsableMonad m => HookId -> AccessToken -> MangoPayT m Hook
- listHooks :: MPUsableMonad m => Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Hook)
- eventFromQueryString :: Query -> Maybe Event
- eventFromQueryStringT :: [(Text, Text)] -> Maybe Event
- data Document = Document {}
- type DocumentId = Text
- data DocumentType
- data DocumentStatus
- data DocumentFilter = DocumentFilter {}
- createDocument :: MPUsableMonad m => AnyUserId -> Document -> AccessToken -> MangoPayT m Document
- modifyDocument :: MPUsableMonad m => AnyUserId -> Document -> AccessToken -> MangoPayT m Document
- fetchDocument :: MPUsableMonad m => AnyUserId -> DocumentId -> AccessToken -> MangoPayT m Document
- createPage :: MPUsableMonad m => AnyUserId -> DocumentId -> ByteString -> AccessToken -> MangoPayT m ()
- getKindOfAuthentication :: Either NaturalUser LegalUser -> [Document] -> KindOfAuthentication
- getRequiredDocumentTypes :: Either NaturalUser LegalUser -> [DocumentType]
- listDocuments :: MPUsableMonad m => AnyUserId -> DocumentFilter -> GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Document)
- listAllDocuments :: MPUsableMonad m => DocumentFilter -> GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Document)
- data BankAccount = BankAccount {}
- type BankAccountId = Text
- data BankAccountDetails
- data PaymentType
- createAccount :: MPUsableMonad m => BankAccount -> AccessToken -> MangoPayT m BankAccount
- fetchAccount :: MPUsableMonad m => AnyUserId -> BankAccountId -> AccessToken -> MangoPayT m BankAccount
- listAccounts :: MPUsableMonad m => AnyUserId -> GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList BankAccount)
- accountCountry :: BankAccount -> Maybe CountryCode
- data PaymentExecution
- type BankWireId = Text
- data BankWire = BankWire {
- bwId :: Maybe BankWireId
- bwCreationDate :: Maybe POSIXTime
- bwTag :: Maybe Text
- bwAuthorId :: AnyUserId
- bwCreditedUserId :: AnyUserId
- bwFees :: Maybe Amount
- bwCreditedWalletId :: WalletId
- bwDebitedWalletId :: Maybe WalletId
- bwDebitedFunds :: Maybe Amount
- bwCreditedFunds :: Maybe Amount
- bwDeclaredDebitedFunds :: Amount
- bwDeclaredFees :: Amount
- bwWireReference :: Maybe Text
- bwBankAccount :: Maybe BankAccount
- bwStatus :: Maybe TransferStatus
- bwResultCode :: Maybe Text
- bwResultMessage :: Maybe Text
- bwExecutionDate :: Maybe POSIXTime
- bwType :: Maybe TransactionType
- bwNature :: Maybe TransactionNature
- bwPaymentType :: Maybe PaymentType
- bwExecutionType :: Maybe PaymentExecution
- createBankWirePayIn :: MPUsableMonad m => BankWire -> AccessToken -> MangoPayT m BankWire
- fetchBankWirePayIn :: MPUsableMonad m => BankWireId -> AccessToken -> MangoPayT m BankWire
- mkBankWire :: AnyUserId -> AnyUserId -> WalletId -> Amount -> Amount -> BankWire
- type CardPayinId = Text
- data CardPayin = CardPayin {
- cpId :: Maybe CardPayinId
- cpCreationDate :: Maybe POSIXTime
- cpTag :: Maybe Text
- cpAuthorId :: AnyUserId
- cpCreditedUserId :: AnyUserId
- cpFees :: Amount
- cpCreditedWalletId :: WalletId
- cpDebitedWalletId :: Maybe WalletId
- cpDebitedFunds :: Amount
- cpCreditedFunds :: Maybe Amount
- cpSecureModeReturnURL :: Maybe Text
- cpSecureMode :: Maybe Text
- cpSecureModeRedirectURL :: Maybe Text
- cpCardId :: CardId
- cpStatus :: Maybe TransferStatus
- cpResultCode :: Maybe Text
- cpResultMessage :: Maybe Text
- cpExecutionDate :: Maybe POSIXTime
- cpType :: Maybe TransactionType
- cpNature :: Maybe TransactionNature
- cpPaymentType :: Maybe Text
- cpExecutionType :: Maybe PaymentExecution
- createCardPayin :: MPUsableMonad m => CardPayin -> AccessToken -> MangoPayT m CardPayin
- fetchCardPayin :: MPUsableMonad m => CardPayinId -> AccessToken -> MangoPayT m CardPayin
- mkCardPayin :: AnyUserId -> AnyUserId -> WalletId -> Amount -> Amount -> Text -> CardId -> CardPayin
- type PayoutId = Text
- data Payout = Payout {
- ptId :: Maybe PayoutId
- ptCreationDate :: Maybe POSIXTime
- ptTag :: Maybe Text
- ptAuthorId :: AnyUserId
- ptDebitedWalletId :: WalletId
- ptDebitedFunds :: Amount
- ptFees :: Amount
- ptBankAccountId :: BankAccountId
- ptCreditedUserId :: Maybe AnyUserId
- ptCreditedFunds :: Maybe Amount
- ptStatus :: Maybe TransferStatus
- ptResultCode :: Maybe Text
- ptResultMessage :: Maybe Text
- ptExecutionDate :: Maybe POSIXTime
- ptType :: Maybe TransactionType
- ptNature :: Maybe TransactionNature
- ptPaymentType :: Maybe PaymentType
- ptMeanOfPaymentType :: Maybe PaymentType
- ptBankWireRef :: Maybe Text
- mkPayout :: AnyUserId -> WalletId -> Amount -> Amount -> BankAccountId -> Payout
- createPayout :: MPUsableMonad m => Payout -> AccessToken -> MangoPayT m Payout
- fetchPayout :: MPUsableMonad m => PayoutId -> AccessToken -> MangoPayT m Payout
- data CardRegistration = CardRegistration {
- crId :: Maybe CardRegistrationId
- crCreationDate :: Maybe POSIXTime
- crTag :: Maybe Text
- crUserId :: AnyUserId
- crCurrency :: Currency
- crAccessKey :: Maybe Text
- crPreregistrationData :: Maybe Text
- crCardRegistrationURL :: Maybe Text
- crRegistrationData :: Maybe Text
- crCardType :: Maybe Text
- crCardId :: Maybe CardId
- crResultCode :: Maybe Text
- crResultMessage :: Maybe Text
- crStatus :: Maybe DocumentStatus
- type CardRegistrationId = Text
- type CardId = Text
- data CardInfo = CardInfo {}
- data Card = Card {}
- data CardValidity
- mkCardRegistration :: AnyUserId -> Currency -> CardRegistration
- createCardRegistration :: MPUsableMonad m => CardRegistration -> AccessToken -> MangoPayT m CardRegistration
- modifyCardRegistration :: MPUsableMonad m => CardRegistration -> AccessToken -> MangoPayT m CardRegistration
- fetchCard :: MPUsableMonad m => CardId -> AccessToken -> MangoPayT m Card
- listCards :: MPUsableMonad m => AnyUserId -> GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Card)
- type RefundId = Text
- data Refund = Refund {
- rId :: RefundId
- rCreationDate :: POSIXTime
- rTag :: Maybe Text
- rAuthorId :: AnyUserId
- rDebitedFunds :: Amount
- rFees :: Amount
- rCreditedFunds :: Amount
- rStatus :: TransferStatus
- rResultCode :: Text
- rResultMessage :: Maybe Text
- rExecutionDate :: Maybe POSIXTime
- rType :: TransactionType
- rNature :: TransactionNature
- rCreditedUserId :: Maybe AnyUserId
- rInitialTransactionId :: TransactionId
- rInitialTransactionType :: TransactionType
- rDebitedWalletId :: WalletId
- rCreditedWalletId :: Maybe WalletId
- rReason :: RefundReason
- data RefundRequest = RefundRequest {}
- data RefundReason = RefundReason {}
- data RefundReasonType
- refundTransfer :: MPUsableMonad m => TransferId -> AnyUserId -> AccessToken -> MangoPayT m Refund
- refundPayin :: MPUsableMonad m => AnyPayinId -> RefundRequest -> AccessToken -> MangoPayT m Refund
- fetchRefund :: MPUsableMonad m => RefundId -> AccessToken -> MangoPayT m Refund
Documentation
the mangopay monad transformer this encapsulates the data necessary to pass the app credentials, etc
MonadTrans MangoPayT | |
MonadTransControl MangoPayT | |
MonadBaseControl b m => MonadBaseControl b (MangoPayT m) | |
MonadBase b m => MonadBase b (MangoPayT m) | |
Alternative m => Alternative (MangoPayT m) | |
Monad m => Monad (MangoPayT m) | |
Functor m => Functor (MangoPayT m) | |
MonadFix m => MonadFix (MangoPayT m) | |
MonadPlus m => MonadPlus (MangoPayT m) | |
Applicative m => Applicative (MangoPayT m) | |
MonadThrow m => MonadThrow (MangoPayT m) | |
MonadLogger m => MonadLogger (MangoPayT m) | |
MonadIO m => MonadIO (MangoPayT m) | |
MonadResource m => MonadResource (MangoPayT m) | |
type StT MangoPayT a | |
type StM (MangoPayT m) a = ComposeSt MangoPayT m a |
:: Credentials | Your app's credentials. |
-> Manager | Connection manager (see |
-> AccessPoint | |
-> MangoPayT m a | the action to run |
-> m a | the result |
Run a computation in the MangoPayT
monad transformer with
your credentials.
runResourceInMp :: MPUsableMonad m => MangoPayT (ResourceT m) a -> MangoPayT m a Source
Run a ResourceT
inside a MangoPayT
.
data MpException Source
an exception that a call to MangoPay may throw
Show MpException | |
ToJSON MpException | to json |
FromJSON MpException | |
Exception MpException | make our exception type a normal exception |
Typeable * MpException |
getAll :: (MPUsableMonad m, FromJSON v) => (Maybe Pagination -> AccessToken -> MangoPayT m (PagedList v)) -> AccessToken -> MangoPayT m [v] Source
get all items, hiding the pagination system
data Credentials Source
the app credentials
Eq Credentials | |
Ord Credentials | |
Read Credentials | |
Show Credentials | |
ToJSON Credentials | to json as per MangoPay format |
FromJSON Credentials | from json as per MangoPay format |
Typeable * Credentials |
data AccessPoint Source
the MangoPay access point
newtype AccessToken Source
the access token is simply a Text
data OAuthToken Source
the oauth token returned after authentication
OAuthToken | |
|
Eq OAuthToken | |
Ord OAuthToken | |
Read OAuthToken | |
Show OAuthToken | |
ToJSON OAuthToken | to json as per MangoPay format |
FromJSON OAuthToken | from json as per MangoPay format |
Typeable * OAuthToken |
data Pagination Source
Pagination info for searches http://docs.mangopay.com/api-references/pagination/
A partial list with pagination information.
PagedList | |
|
type MPUsableMonad m = (MonadBaseControl IO m, MonadResource m, MonadLogger m) Source
put our constraints in one synonym
class ToHtQuery a where Source
simple class used to hide the serialization of parameters and simplify the calling code
(?+) :: ByteString -> a -> (ByteString, Maybe ByteString) Source
data CardExpiration Source
the expiration date of a card
Eq CardExpiration | |
Ord CardExpiration | |
Read CardExpiration | |
Show CardExpiration | |
IsString CardExpiration | |
ToJSON CardExpiration | show Card Expiration to JSON string (MMYY) |
FromJSON CardExpiration | read Card Expiration from JSON string (MMYY) |
Typeable * CardExpiration |
readCardExpiration :: Reader CardExpiration Source
read Card Expiration from text representation (MMYY)
writeCardExpiration :: CardExpiration -> Text Source
write card expiration
data KindOfAuthentication Source
the kind of authentication data the user has provided
data SortDirection Source
Sort direction for list retrieval
data GenericSort Source
Sort transactions
Eq GenericSort | |
Ord GenericSort | |
Show GenericSort | |
Default GenericSort | Default sort |
Typeable * GenericSort |
createCredentialsSecret :: MPUsableMonad m => MangoPayT m Credentials Source
Populate the passphrase for our clientId IFF we don't have one.
oauthLogin :: MPUsableMonad m => Text -> Text -> MangoPayT m OAuthToken Source
Login with given user name and password. Returns the OAuth token that can be used to generate the opaque AccessToken and carries the expiration delay.
toAccessToken :: OAuthToken -> AccessToken Source
build the access token from the OAuthToken
data NaturalUser Source
a natural user http://docs.mangopay.com/api-references/users/natural-users/
NaturalUser | |
|
Eq NaturalUser | |
Ord NaturalUser | |
Show NaturalUser | |
ToJSON NaturalUser | to json as per MangoPay format |
FromJSON NaturalUser | from json as per MangoPay format |
Typeable * NaturalUser | |
FromJSON (Either NaturalUser LegalUser) |
data IncomeRange Source
supported income ranges
Bounded IncomeRange | |
Enum IncomeRange | |
Eq IncomeRange | |
Ord IncomeRange | |
Read IncomeRange | |
Show IncomeRange | |
ToJSON IncomeRange | to json as per MangoPay format the samples do show string format when writing, integer format when reading... |
FromJSON IncomeRange | from json as per MangoPay format the samples do show string format when writing, integer format when reading... |
Typeable * IncomeRange |
incomeBounds :: IncomeRange -> (Amount, Amount) Source
bounds in euros for income range
incomeRange :: Amount -> IncomeRange Source
get Income Range for given Euro amount
type NaturalUserId = Text Source
User Id
LegalUser | |
|
data LegalUserType Source
the type of legal user
Bounded LegalUserType | |
Enum LegalUserType | |
Eq LegalUserType | |
Ord LegalUserType | |
Read LegalUserType | |
Show LegalUserType | |
ToJSON LegalUserType | to json as per MangoPay format |
FromJSON LegalUserType | from json as per MangoPay format |
Typeable * LegalUserType |
type LegalUserId = Text Source
User Id
a short user reference
UserRef | |
|
data PersonType Source
Type of user.
Bounded PersonType | |
Enum PersonType | |
Eq PersonType | |
Ord PersonType | |
Read PersonType | |
Show PersonType | |
ToJSON PersonType | to json as per MangoPay format |
FromJSON PersonType | from json as per MangoPay format |
Typeable * PersonType |
createNaturalUser :: MPUsableMonad m => NaturalUser -> AccessToken -> MangoPayT m NaturalUser Source
create a natural user
modifyNaturalUser :: MPUsableMonad m => NaturalUser -> AccessToken -> MangoPayT m NaturalUser Source
modify a natural user
fetchNaturalUser :: MPUsableMonad m => NaturalUserId -> AccessToken -> MangoPayT m NaturalUser Source
fetch a natural user from her Id
createLegalUser :: MPUsableMonad m => LegalUser -> AccessToken -> MangoPayT m LegalUser Source
create a legal user
modifyLegalUser :: MPUsableMonad m => LegalUser -> AccessToken -> MangoPayT m LegalUser Source
modify a legal user
fetchLegalUser :: MPUsableMonad m => LegalUserId -> AccessToken -> MangoPayT m LegalUser Source
fetch a natural user from her Id
getUser :: MPUsableMonad m => AnyUserId -> AccessToken -> MangoPayT m (Either NaturalUser LegalUser) Source
get a user, natural or legal
listUsers :: MPUsableMonad m => GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList UserRef) Source
list all user references
getExistingUserId :: Either NaturalUser LegalUser -> AnyUserId Source
Convenience function to extract the user Id of an EXISTING user (one with an id).
a wallet
Wallet | |
|
currency amount
createWallet :: MPUsableMonad m => Wallet -> AccessToken -> MangoPayT m Wallet Source
create a wallet
modifyWallet :: MPUsableMonad m => Wallet -> AccessToken -> MangoPayT m Wallet Source
modify a wallet
fetchWallet :: MPUsableMonad m => WalletId -> AccessToken -> MangoPayT m Wallet Source
fetch a wallet from its Id
listWallets :: MPUsableMonad m => AnyUserId -> GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Wallet) Source
list all wallets for a given user
transfer between wallets
Transfer | |
|
type TransferId = Text Source
Id of a transfer
data TransferStatus Source
status of a transfer
Bounded TransferStatus | |
Enum TransferStatus | |
Eq TransferStatus | |
Ord TransferStatus | |
Read TransferStatus | |
Show TransferStatus | |
ToJSON TransferStatus | to json as per MangoPay format |
FromJSON TransferStatus | from json as per MangoPay format |
Typeable * TransferStatus |
data Transaction Source
any transaction
Transaction | |
|
Eq Transaction | |
Ord Transaction | |
Show Transaction | |
ToJSON Transaction | to json as per MangoPay format |
FromJSON Transaction | from json as per MangoPay format |
Typeable * Transaction |
type TransactionId = Text Source
data TransactionType Source
type of transaction
Bounded TransactionType | |
Enum TransactionType | |
Eq TransactionType | |
Ord TransactionType | |
Read TransactionType | |
Show TransactionType | |
ToJSON TransactionType | to json as per MangoPay format |
FromJSON TransactionType | from json as per MangoPay format |
Typeable * TransactionType |
data TransactionNature Source
REGULAR | just as you created the object |
REFUND | the transaction has been refunded |
REPUDIATION | the transaction has been repudiated |
Bounded TransactionNature | |
Enum TransactionNature | |
Eq TransactionNature | |
Ord TransactionNature | |
Read TransactionNature | |
Show TransactionNature | |
ToJSON TransactionNature | to json as per MangoPay format |
FromJSON TransactionNature | from json as per MangoPay format |
Typeable * TransactionNature |
data TransactionSort Source
Sort transactions
createTransfer :: MPUsableMonad m => Transfer -> AccessToken -> MangoPayT m Transfer Source
create a new fund transfer
fetchTransfer :: MPUsableMonad m => TransferId -> AccessToken -> MangoPayT m Transfer Source
fetch a transfer from its Id
listTransactions :: MPUsableMonad m => WalletId -> TransactionFilter -> TransactionSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Transaction) Source
list transfers for a given wallet
listTransactionsForUser :: MPUsableMonad m => AnyUserId -> TransactionFilter -> TransactionSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Transaction) Source
list transfer for a given user
a event
Event | |
|
Event type
searchEvents :: MPUsableMonad m => EventSearchParams -> AccessToken -> MangoPayT m (PagedList Event) Source
search events, returns a paginated list
searchAllEvents :: MPUsableMonad m => EventSearchParams -> AccessToken -> MangoPayT m [Event] Source
search events, returns the full result
checkEvent :: MPUsableMonad m => Event -> AccessToken -> MangoPayT m Bool Source
Check if an event came from MangoPay. Since notifications are not authenticated, you're advised to always check if the event really comes from MangoPay (cf. https://mangopay.desk.com/customer/portal/questions/6493147).
data HookStatus Source
status of notification hook
Bounded HookStatus | |
Enum HookStatus | |
Eq HookStatus | |
Ord HookStatus | |
Read HookStatus | |
Show HookStatus | |
ToJSON HookStatus | to json as per MangoPay format |
FromJSON HookStatus | from json as per MangoPay format |
Typeable * HookStatus |
data HookValidity Source
validity of notification hook
Bounded HookValidity | |
Enum HookValidity | |
Eq HookValidity | |
Ord HookValidity | |
Read HookValidity | |
Show HookValidity | |
ToJSON HookValidity | to json as per MangoPay format |
FromJSON HookValidity | from json as per MangoPay format |
Typeable * HookValidity |
a notification hook
Hook | |
|
createHook :: MPUsableMonad m => Hook -> AccessToken -> MangoPayT m Hook Source
create a hook
modifyHook :: MPUsableMonad m => Hook -> AccessToken -> MangoPayT m Hook Source
modify a hook
fetchHook :: MPUsableMonad m => HookId -> AccessToken -> MangoPayT m Hook Source
fetch a wallet from its Id
listHooks :: MPUsableMonad m => Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Hook) Source
list all wallets for a given user
eventFromQueryString :: Query -> Maybe Event Source
parse an event from the query string the MangoPay is not very clear on notifications, but see v1 http://docs.mangopay.com/v1-api-references/notifications/ v2 works the same, the event is passed via parameters of the query string
eventFromQueryStringT :: [(Text, Text)] -> Maybe Event Source
parse an event from the query string represented as Text the MangoPay is not very clear on notifications, but see v1 http://docs.mangopay.com/v1-api-references/notifications/ v2 works the same, the event is passed via parameters of the query string
a document
Document | |
|
type DocumentId = Text Source
Id of a document
data DocumentType Source
type of the document
IDENTITY_PROOF | For legal and natural users |
REGISTRATION_PROOF | Only for legal users |
ARTICLES_OF_ASSOCIATION | Only for legal users |
SHAREHOLDER_DECLARATION | Only for legal users |
ADDRESS_PROOF | For legal and natural users |
Bounded DocumentType | |
Enum DocumentType | |
Eq DocumentType | |
Ord DocumentType | |
Read DocumentType | |
Show DocumentType | |
ToJSON DocumentType | to json as per MangoPay format |
FromJSON DocumentType | from json as per MangoPay format |
Typeable * DocumentType |
data DocumentStatus Source
status of a document
Bounded DocumentStatus | |
Enum DocumentStatus | |
Eq DocumentStatus | |
Ord DocumentStatus | |
Read DocumentStatus | |
Show DocumentStatus | |
ToJSON DocumentStatus | to json as per MangoPay format |
FromJSON DocumentStatus | from json as per MangoPay format |
Typeable * DocumentStatus |
createDocument :: MPUsableMonad m => AnyUserId -> Document -> AccessToken -> MangoPayT m Document Source
create a document
modifyDocument :: MPUsableMonad m => AnyUserId -> Document -> AccessToken -> MangoPayT m Document Source
fetchDocument :: MPUsableMonad m => AnyUserId -> DocumentId -> AccessToken -> MangoPayT m Document Source
fetch a document from its Id
createPage :: MPUsableMonad m => AnyUserId -> DocumentId -> ByteString -> AccessToken -> MangoPayT m () Source
create a page note that per the MangoPay API the document HAS to be in CREATED status should we check it here? Since MangoPay returns a 500 Internal Server Error if the document is in another status...
getKindOfAuthentication :: Either NaturalUser LegalUser -> [Document] -> KindOfAuthentication Source
Calculate the MangoPay authentication level. http://docs.mangopay.com/api-references/kyc-rules/
getRequiredDocumentTypes Source
:: Either NaturalUser LegalUser | The MangoPay user. |
-> [DocumentType] |
Get the document types that may be required from the given user to enhance authorization level.
listDocuments :: MPUsableMonad m => AnyUserId -> DocumentFilter -> GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Document) Source
List all documents uploaded for a user. Since http://docs.mangopay.com/release-hamster/
listAllDocuments :: MPUsableMonad m => DocumentFilter -> GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Document) Source
List all documents uploaded. Since http://docs.mangopay.com/release-hamster/
data BankAccount Source
bank account details
Eq BankAccount | |
Ord BankAccount | |
Show BankAccount | |
ToJSON BankAccount | to json as per MangoPay format |
FromJSON BankAccount | from json as per MangoPay format |
Typeable * BankAccount |
type BankAccountId = Text Source
Id of a bank account
data BankAccountDetails Source
account details, depending on the type
IBAN | |
GB | |
| |
US | |
| |
CA | |
| |
Other | |
|
Eq BankAccountDetails | |
Ord BankAccountDetails | |
Read BankAccountDetails | |
Show BankAccountDetails | |
FromJSON BankAccountDetails | from json as per MangoPay format |
Typeable * BankAccountDetails |
data PaymentType Source
type of payment
Bounded PaymentType | |
Enum PaymentType | |
Eq PaymentType | |
Ord PaymentType | |
Read PaymentType | |
Show PaymentType | |
ToJSON PaymentType | to json as per MangoPay format |
FromJSON PaymentType | from json as per MangoPay format |
Typeable * PaymentType |
createAccount :: MPUsableMonad m => BankAccount -> AccessToken -> MangoPayT m BankAccount Source
create an account
fetchAccount :: MPUsableMonad m => AnyUserId -> BankAccountId -> AccessToken -> MangoPayT m BankAccount Source
fetch an account from its Id
listAccounts :: MPUsableMonad m => AnyUserId -> GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList BankAccount) Source
list all accounts for a given user
accountCountry :: BankAccount -> Maybe CountryCode Source
Get the country for a BankAccount
data PaymentExecution Source
Type of payment execution.
Bounded PaymentExecution | |
Enum PaymentExecution | |
Eq PaymentExecution | |
Ord PaymentExecution | |
Read PaymentExecution | |
Show PaymentExecution | |
ToJSON PaymentExecution | to json as per MangoPay format |
FromJSON PaymentExecution | from json as per MangoPay format |
Typeable * PaymentExecution |
type BankWireId = Text Source
id of a bankwire
a bank wire there are a lot of common fields between all kinds of payments so this could probably become a Payment type
BankWire | |
|
createBankWirePayIn :: MPUsableMonad m => BankWire -> AccessToken -> MangoPayT m BankWire Source
create a bankwire pay-in
fetchBankWirePayIn :: MPUsableMonad m => BankWireId -> AccessToken -> MangoPayT m BankWire Source
fetch a bank wire pay-in from its Id
mkBankWire :: AnyUserId -> AnyUserId -> WalletId -> Amount -> Amount -> BankWire Source
helper function to create a new bank wire with the needed information
type CardPayinId = Text Source
Id of a direct pay in
direct pay in via registered card
CardPayin | |
|
createCardPayin :: MPUsableMonad m => CardPayin -> AccessToken -> MangoPayT m CardPayin Source
create a direct card pay in
fetchCardPayin :: MPUsableMonad m => CardPayinId -> AccessToken -> MangoPayT m CardPayin Source
fetch a direct card pay in from its Id
mkCardPayin :: AnyUserId -> AnyUserId -> WalletId -> Amount -> Amount -> Text -> CardId -> CardPayin Source
helper function to create a new direct payin with the needed information | the url is only used in secure mode but is REQUIRED by MangoPay
payout
Payout | |
|
mkPayout :: AnyUserId -> WalletId -> Amount -> Amount -> BankAccountId -> Payout Source
make a simple payout for creation
createPayout :: MPUsableMonad m => Payout -> AccessToken -> MangoPayT m Payout Source
create a payout
fetchPayout :: MPUsableMonad m => PayoutId -> AccessToken -> MangoPayT m Payout Source
fetch an payout from its Id
data CardRegistration Source
a card registration
CardRegistration | |
|
Eq CardRegistration | |
Ord CardRegistration | |
Show CardRegistration | |
ToJSON CardRegistration | to json as per MangoPay format |
FromJSON CardRegistration | from json as per MangoPay format |
Typeable * CardRegistration |
type CardRegistrationId = Text Source
card registration Id
credit card information
a registered card
Card | |
|
data CardValidity Source
validity of a card
Bounded CardValidity | |
Enum CardValidity | |
Eq CardValidity | |
Ord CardValidity | |
Read CardValidity | |
Show CardValidity | |
ToJSON CardValidity | to json as per MangoPay format |
FromJSON CardValidity | from json as per MangoPay format |
Typeable * CardValidity |
mkCardRegistration :: AnyUserId -> Currency -> CardRegistration Source
helper function to create a new card registration
createCardRegistration :: MPUsableMonad m => CardRegistration -> AccessToken -> MangoPayT m CardRegistration Source
create a card registration
modifyCardRegistration :: MPUsableMonad m => CardRegistration -> AccessToken -> MangoPayT m CardRegistration Source
modify a card registration
fetchCard :: MPUsableMonad m => CardId -> AccessToken -> MangoPayT m Card Source
fetch a card from its Id
listCards :: MPUsableMonad m => AnyUserId -> GenericSort -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Card) Source
list all cards for a given user
refund of a transfer
Refund | |
|
data RefundRequest Source
refund request
RefundRequest | |
|
Eq RefundRequest | |
Ord RefundRequest | |
Show RefundRequest | |
ToJSON RefundRequest | to json as per MangoPay format |
Typeable * RefundRequest |
data RefundReason Source
Reason for a refund, since http://docs.mangopay.com/release-lapin/.
Eq RefundReason | |
Ord RefundReason | |
Show RefundReason | |
FromJSON RefundReason | from json as per MangoPay format |
Typeable * RefundReason |
data RefundReasonType Source
Type for redund reason, since http://docs.mangopay.com/release-lapin/.
Bounded RefundReasonType | |
Enum RefundReasonType | |
Eq RefundReasonType | |
Ord RefundReasonType | |
Read RefundReasonType | |
Show RefundReasonType | |
ToJSON RefundReasonType | to json as per MangoPay format |
FromJSON RefundReasonType | from json as per MangoPay format |
Typeable * RefundReasonType |
refundTransfer :: MPUsableMonad m => TransferId -> AnyUserId -> AccessToken -> MangoPayT m Refund Source
refund a transfer
refundPayin :: MPUsableMonad m => AnyPayinId -> RefundRequest -> AccessToken -> MangoPayT m Refund Source
refund a pay-in
fetchRefund :: MPUsableMonad m => RefundId -> AccessToken -> MangoPayT m Refund Source
fetch a refund from its Id