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
- newtype MpTime = MpTime {}
- 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 MpTime
- uEmail :: Text
- uFirstName :: Text
- uLastName :: Text
- uAddress :: Maybe Text
- uBirthday :: MpTime
- 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 MpTime
- lEmail :: Text
- lName :: Text
- lLegalPersonType :: LegalUserType
- lHeadquartersAddress :: Maybe Text
- lLegalRepresentativeFirstName :: Text
- lLegalRepresentativeLastName :: Text
- lLegalRepresentativeAddress :: Maybe Text
- lLegalRepresentativeEmail :: Maybe Text
- lLegalRepresentativeBirthday :: MpTime
- 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 :: MpTime
- 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 MpTime
- 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 MpTime
- type TransferId = Text
- data TransferStatus
- data Transaction = Transaction {
- txId :: Maybe TransactionId
- txCreationDate :: Maybe MpTime
- 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 MpTime
- 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 :: MpTime
- 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 MpTime
- 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 MpTime
- 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 MpTime
- 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 MpTime
- 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 MpTime
- 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 MpTime
- 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 MpTime
- 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 MpTime
- 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 :: MpTime
- rTag :: Maybe Text
- rAuthorId :: AnyUserId
- rDebitedFunds :: Amount
- rFees :: Amount
- rCreditedFunds :: Amount
- rStatus :: TransferStatus
- rResultCode :: Text
- rResultMessage :: Maybe Text
- rExecutionDate :: Maybe MpTime
- 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 Source | |
MonadTransControl MangoPayT Source | |
MonadBaseControl b m => MonadBaseControl b (MangoPayT m) Source | |
MonadBase b m => MonadBase b (MangoPayT m) Source | |
Monad m => Monad (MangoPayT m) Source | |
Functor m => Functor (MangoPayT m) Source | |
MonadFix m => MonadFix (MangoPayT m) Source | |
Applicative m => Applicative (MangoPayT m) Source | |
Alternative m => Alternative (MangoPayT m) Source | |
MonadPlus m => MonadPlus (MangoPayT m) Source | |
MonadThrow m => MonadThrow (MangoPayT m) Source | |
MonadLogger m => MonadLogger (MangoPayT m) Source | |
MonadIO m => MonadIO (MangoPayT m) Source | |
MonadResource m => MonadResource (MangoPayT m) Source | |
type StT MangoPayT a Source | |
type StM (MangoPayT m) a = ComposeSt MangoPayT m a Source |
:: 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 Source | |
ToJSON MpException Source | to json |
FromJSON MpException Source | |
Exception MpException Source | make our exception type a normal exception |
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 Source | |
Ord Credentials Source | |
Read Credentials Source | |
Show Credentials Source | |
ToJSON Credentials Source | to json as per MangoPay format |
FromJSON Credentials Source | from json as per MangoPay format |
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 Source | |
Ord OAuthToken Source | |
Read OAuthToken Source | |
Show OAuthToken Source | |
ToJSON OAuthToken Source | to json as per MangoPay format |
FromJSON OAuthToken Source | from json as per MangoPay format |
data Pagination Source
Pagination info for searches http://docs.mangopay.com/api-references/pagination/
A partial list with pagination information.
PagedList | |
|
newtype
of POSIXTime
with MangoPay's JSON format.
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 Source | |
Ord CardExpiration Source | |
Read CardExpiration Source | |
Show CardExpiration Source | |
IsString CardExpiration Source | |
ToJSON CardExpiration Source | show Card Expiration to JSON string (MMYY) |
FromJSON CardExpiration Source | read Card Expiration from JSON string (MMYY) |
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 Source | |
Ord GenericSort Source | |
Show GenericSort Source | |
Default GenericSort Source | Default sort |
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 Source | |
Ord NaturalUser Source | |
Show NaturalUser Source | |
ToJSON NaturalUser Source | to json as per MangoPay format |
FromJSON NaturalUser Source | from json as per MangoPay format |
FromJSON (Either NaturalUser LegalUser) Source |
data IncomeRange Source
supported income ranges
Bounded IncomeRange Source | |
Enum IncomeRange Source | |
Eq IncomeRange Source | |
Ord IncomeRange Source | |
Read IncomeRange Source | |
Show IncomeRange Source | |
ToJSON IncomeRange Source | to json as per MangoPay format the samples do show string format when writing, integer format when reading... |
FromJSON IncomeRange Source | from json as per MangoPay format the samples do show string format when writing, integer format when reading... |
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 Source | |
Enum LegalUserType Source | |
Eq LegalUserType Source | |
Ord LegalUserType Source | |
Read LegalUserType Source | |
Show LegalUserType Source | |
ToJSON LegalUserType Source | to json as per MangoPay format |
FromJSON LegalUserType Source | from json as per MangoPay format |
type LegalUserId = Text Source
User Id
a short user reference
UserRef | |
|
data PersonType Source
Type of user.
Bounded PersonType Source | |
Enum PersonType Source | |
Eq PersonType Source | |
Ord PersonType Source | |
Read PersonType Source | |
Show PersonType Source | |
ToJSON PersonType Source | to json as per MangoPay format |
FromJSON PersonType Source | from json as per MangoPay format |
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 Source | |
Enum TransferStatus Source | |
Eq TransferStatus Source | |
Ord TransferStatus Source | |
Read TransferStatus Source | |
Show TransferStatus Source | |
ToJSON TransferStatus Source | to json as per MangoPay format |
FromJSON TransferStatus Source | from json as per MangoPay format |
data Transaction Source
any transaction
Transaction | |
|
Eq Transaction Source | |
Ord Transaction Source | |
Show Transaction Source | |
ToJSON Transaction Source | to json as per MangoPay format |
FromJSON Transaction Source | from json as per MangoPay format |
type TransactionId = Text Source
data TransactionType Source
type of transaction
Bounded TransactionType Source | |
Enum TransactionType Source | |
Eq TransactionType Source | |
Ord TransactionType Source | |
Read TransactionType Source | |
Show TransactionType Source | |
ToJSON TransactionType Source | to json as per MangoPay format |
FromJSON TransactionType Source | from json as per MangoPay format |
data TransactionNature Source
REGULAR | just as you created the object |
REFUND | the transaction has been refunded |
REPUDIATION | the transaction has been repudiated |
Bounded TransactionNature Source | |
Enum TransactionNature Source | |
Eq TransactionNature Source | |
Ord TransactionNature Source | |
Read TransactionNature Source | |
Show TransactionNature Source | |
ToJSON TransactionNature Source | to json as per MangoPay format |
FromJSON TransactionNature Source | from json as per MangoPay format |
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 Source | |
Enum HookStatus Source | |
Eq HookStatus Source | |
Ord HookStatus Source | |
Read HookStatus Source | |
Show HookStatus Source | |
ToJSON HookStatus Source | to json as per MangoPay format |
FromJSON HookStatus Source | from json as per MangoPay format |
data HookValidity Source
validity of notification hook
Bounded HookValidity Source | |
Enum HookValidity Source | |
Eq HookValidity Source | |
Ord HookValidity Source | |
Read HookValidity Source | |
Show HookValidity Source | |
ToJSON HookValidity Source | to json as per MangoPay format |
FromJSON HookValidity Source | from json as per MangoPay format |
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 Source | |
Enum DocumentType Source | |
Eq DocumentType Source | |
Ord DocumentType Source | |
Read DocumentType Source | |
Show DocumentType Source | |
ToJSON DocumentType Source | to json as per MangoPay format |
FromJSON DocumentType Source | from json as per MangoPay format |
data DocumentStatus Source
status of a document
Bounded DocumentStatus Source | |
Enum DocumentStatus Source | |
Eq DocumentStatus Source | |
Ord DocumentStatus Source | |
Read DocumentStatus Source | |
Show DocumentStatus Source | |
ToJSON DocumentStatus Source | to json as per MangoPay format |
FromJSON DocumentStatus Source | from json as per MangoPay format |
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
BankAccount | |
|
Eq BankAccount Source | |
Ord BankAccount Source | |
Show BankAccount Source | |
ToJSON BankAccount Source | to json as per MangoPay format |
FromJSON BankAccount Source | from json as per MangoPay format |
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 Source | |
Ord BankAccountDetails Source | |
Read BankAccountDetails Source | |
Show BankAccountDetails Source | |
FromJSON BankAccountDetails Source | from json as per MangoPay format |
data PaymentType Source
type of payment
Bounded PaymentType Source | |
Enum PaymentType Source | |
Eq PaymentType Source | |
Ord PaymentType Source | |
Read PaymentType Source | |
Show PaymentType Source | |
ToJSON PaymentType Source | to json as per MangoPay format |
FromJSON PaymentType Source | from json as per MangoPay format |
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 Source | |
Enum PaymentExecution Source | |
Eq PaymentExecution Source | |
Ord PaymentExecution Source | |
Read PaymentExecution Source | |
Show PaymentExecution Source | |
ToJSON PaymentExecution Source | to json as per MangoPay format |
FromJSON PaymentExecution Source | from json as per MangoPay format |
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 Source | |
Ord CardRegistration Source | |
Show CardRegistration Source | |
ToJSON CardRegistration Source | to json as per MangoPay format |
FromJSON CardRegistration Source | from json as per MangoPay format |
type CardRegistrationId = Text Source
card registration Id
credit card information
a registered card
Card | |
|
data CardValidity Source
validity of a card
Bounded CardValidity Source | |
Enum CardValidity Source | |
Eq CardValidity Source | |
Ord CardValidity Source | |
Read CardValidity Source | |
Show CardValidity Source | |
ToJSON CardValidity Source | to json as per MangoPay format |
FromJSON CardValidity Source | from json as per MangoPay format |
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 Source | |
Ord RefundRequest Source | |
Show RefundRequest Source | |
ToJSON RefundRequest Source | to json as per MangoPay format |
data RefundReason Source
Reason for a refund, since http://docs.mangopay.com/release-lapin/.
Eq RefundReason Source | |
Ord RefundReason Source | |
Show RefundReason Source | |
FromJSON RefundReason Source | from json as per MangoPay format |
data RefundReasonType Source
Type for redund reason, since http://docs.mangopay.com/release-lapin/.
Bounded RefundReasonType Source | |
Enum RefundReasonType Source | |
Eq RefundReasonType Source | |
Ord RefundReasonType Source | |
Read RefundReasonType Source | |
Show RefundReasonType Source | |
ToJSON RefundReasonType Source | to json as per MangoPay format |
FromJSON RefundReasonType Source | from json as per MangoPay format |
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