Safe Haskell | None |
---|
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
- = Sandbox
- | Production
- | Custom ByteString
- 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
- 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
- = Business
- | Organization
- 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 => 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 -> 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
- createTransfer :: MPUsableMonad m => Transfer -> AccessToken -> MangoPayT m Transfer
- fetchTransfer :: MPUsableMonad m => TransferId -> AccessToken -> MangoPayT m Transfer
- listTransactions :: MPUsableMonad m => WalletId -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Transaction)
- listTransactionsForUser :: MPUsableMonad m => AnyUserId -> 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
- = CREATED
- | VALIDATION_ASKED
- | VALIDATED
- | REFUSED
- 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]
- data BankAccount = BankAccount {}
- type BankAccountId = Text
- data BankAccountDetails
- = IBAN { }
- | GB { }
- | US {
- atAccountNumber :: Text
- atABA :: Text
- | CA { }
- | Other {
- atAccountNumber :: Text
- atBIC :: Text
- atCountry :: CountryCode
- data PaymentType
- = CARD
- | BANK_WIRE
- | AUTOMATIC_DEBIT
- | DIRECT_DEBIT
- createAccount :: MPUsableMonad m => BankAccount -> AccessToken -> MangoPayT m BankAccount
- fetchAccount :: MPUsableMonad m => AnyUserId -> BankAccountId -> AccessToken -> MangoPayT m BankAccount
- listAccounts :: MPUsableMonad m => AnyUserId -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList BankAccount)
- 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
- 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 -> 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 :: POSIXTime
- rType :: TransactionType
- rNature :: TransactionNature
- rCreditedUserId :: Maybe AnyUserId
- rInitialTransactionId :: TransactionId
- rInitialTransactionType :: TransactionType
- rDebitedWalletId :: WalletId
- rCreditedWalletId :: Maybe WalletId
- data RefundRequest = RefundRequest {}
- 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) | |
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) | |
Alternative m => Alternative (MangoPayT m) | |
MonadThrow m => MonadThrow (MangoPayT m) | |
MonadLogger m => MonadLogger (MangoPayT m) | |
MonadIO m => MonadIO (MangoPayT m) | |
MonadResource m => MonadResource (MangoPayT m) |
:: 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 aSource
Run a ResourceT
inside a MangoPayT
.
data MpException Source
an exception that a call to MangoPay may throw
Show MpException | |
Typeable MpException | |
ToJSON MpException | to json |
FromJSON MpException | |
Exception MpException | 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 | |
Ord Credentials | |
Read Credentials | |
Show Credentials | |
Typeable Credentials | |
ToJSON Credentials | to json as per MangoPay format |
FromJSON Credentials | 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 | |
Ord OAuthToken | |
Read OAuthToken | |
Show OAuthToken | |
Typeable OAuthToken | |
ToJSON OAuthToken | to json as per MangoPay format |
FromJSON OAuthToken | 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 | |
|
type MPUsableMonad m = (MonadBaseControl IO m, MonadResource m, MonadLogger m)Source
put our constraints in one synonym
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 | |
Typeable CardExpiration | |
IsString CardExpiration | |
FromJSON CardExpiration | read Card Expiration from JSON string (MMYY) |
readCardExpiration :: Reader CardExpirationSource
read Card Expiration from text representation (MMYY)
writeCardExpiration :: CardExpiration -> TextSource
write card expiration
data KindOfAuthentication Source
the kind of authentication data the user has provided
createCredentialsSecret :: MPUsableMonad m => MangoPayT m CredentialsSource
Populate the passphrase for our clientId IFF we don't have one.
oauthLogin :: MPUsableMonad m => Text -> Text -> MangoPayT m OAuthTokenSource
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 -> AccessTokenSource
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 | |
Typeable NaturalUser | |
ToJSON NaturalUser | to json as per MangoPay format |
FromJSON NaturalUser | from json as per MangoPay format |
FromJSON (Either NaturalUser LegalUser) |
data IncomeRange Source
supported income ranges
Bounded IncomeRange | |
Enum IncomeRange | |
Eq IncomeRange | |
Ord IncomeRange | |
Read IncomeRange | |
Show IncomeRange | |
Typeable 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... |
incomeBounds :: IncomeRange -> (Amount, Amount)Source
bounds in euros for income range
incomeRange :: Amount -> IncomeRangeSource
get Income Range for given Euro amount
type NaturalUserId = TextSource
User Id
LegalUser | |
|
data LegalUserType Source
the type of legal user
Bounded LegalUserType | |
Enum LegalUserType | |
Eq LegalUserType | |
Ord LegalUserType | |
Read LegalUserType | |
Show LegalUserType | |
Typeable LegalUserType | |
ToJSON LegalUserType | to json as per MangoPay format |
FromJSON LegalUserType | from json as per MangoPay format |
type LegalUserId = TextSource
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 | |
Typeable PersonType | |
ToJSON PersonType | to json as per MangoPay format |
FromJSON PersonType | from json as per MangoPay format |
createNaturalUser :: MPUsableMonad m => NaturalUser -> AccessToken -> MangoPayT m NaturalUserSource
create a natural user
modifyNaturalUser :: MPUsableMonad m => NaturalUser -> AccessToken -> MangoPayT m NaturalUserSource
modify a natural user
fetchNaturalUser :: MPUsableMonad m => NaturalUserId -> AccessToken -> MangoPayT m NaturalUserSource
fetch a natural user from her Id
createLegalUser :: MPUsableMonad m => LegalUser -> AccessToken -> MangoPayT m LegalUserSource
create a legal user
modifyLegalUser :: MPUsableMonad m => LegalUser -> AccessToken -> MangoPayT m LegalUserSource
modify a legal user
fetchLegalUser :: MPUsableMonad m => LegalUserId -> AccessToken -> MangoPayT m LegalUserSource
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 => Maybe Pagination -> AccessToken -> MangoPayT m (PagedList UserRef)Source
list all user references
getExistingUserId :: Either NaturalUser LegalUser -> AnyUserIdSource
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 WalletSource
create a wallet
modifyWallet :: MPUsableMonad m => Wallet -> AccessToken -> MangoPayT m WalletSource
modify a wallet
fetchWallet :: MPUsableMonad m => WalletId -> AccessToken -> MangoPayT m WalletSource
fetch a wallet from its Id
listWallets :: MPUsableMonad m => AnyUserId -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Wallet)Source
list all wallets for a given user
transfer between wallets
Transfer | |
|
type TransferId = TextSource
Id of a transfer
data TransferStatus Source
status of a transfer
Bounded TransferStatus | |
Enum TransferStatus | |
Eq TransferStatus | |
Ord TransferStatus | |
Read TransferStatus | |
Show TransferStatus | |
Typeable TransferStatus | |
ToJSON TransferStatus | to json as per MangoPay format |
FromJSON TransferStatus | from json as per MangoPay format |
data Transaction Source
any transaction
Transaction | |
|
Eq Transaction | |
Ord Transaction | |
Show Transaction | |
Typeable Transaction | |
ToJSON Transaction | to json as per MangoPay format |
FromJSON Transaction | from json as per MangoPay format |
type TransactionId = TextSource
data TransactionType Source
type of transaction
Bounded TransactionType | |
Enum TransactionType | |
Eq TransactionType | |
Ord TransactionType | |
Read TransactionType | |
Show TransactionType | |
Typeable TransactionType | |
ToJSON TransactionType | to json as per MangoPay format |
FromJSON TransactionType | 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 | |
Enum TransactionNature | |
Eq TransactionNature | |
Ord TransactionNature | |
Read TransactionNature | |
Show TransactionNature | |
Typeable TransactionNature | |
ToJSON TransactionNature | to json as per MangoPay format |
FromJSON TransactionNature | from json as per MangoPay format |
createTransfer :: MPUsableMonad m => Transfer -> AccessToken -> MangoPayT m TransferSource
create a new fund transfer
fetchTransfer :: MPUsableMonad m => TransferId -> AccessToken -> MangoPayT m TransferSource
fetch a transfer from its Id
listTransactions :: MPUsableMonad m => WalletId -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList Transaction)Source
list transfers for a given wallet
listTransactionsForUser :: MPUsableMonad m => AnyUserId -> 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 BoolSource
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 | |
Typeable HookStatus | |
ToJSON HookStatus | to json as per MangoPay format |
FromJSON HookStatus | from json as per MangoPay format |
data HookValidity Source
validity of notification hook
Bounded HookValidity | |
Enum HookValidity | |
Eq HookValidity | |
Ord HookValidity | |
Read HookValidity | |
Show HookValidity | |
Typeable HookValidity | |
ToJSON HookValidity | to json as per MangoPay format |
FromJSON HookValidity | from json as per MangoPay format |
a notification hook
Hook | |
|
createHook :: MPUsableMonad m => Hook -> AccessToken -> MangoPayT m HookSource
create a hook
modifyHook :: MPUsableMonad m => Hook -> AccessToken -> MangoPayT m HookSource
modify a hook
fetchHook :: MPUsableMonad m => HookId -> AccessToken -> MangoPayT m HookSource
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 EventSource
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 EventSource
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 = TextSource
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 | |
Typeable DocumentType | |
ToJSON DocumentType | to json as per MangoPay format |
FromJSON DocumentType | from json as per MangoPay format |
data DocumentStatus Source
status of a document
Bounded DocumentStatus | |
Enum DocumentStatus | |
Eq DocumentStatus | |
Ord DocumentStatus | |
Read DocumentStatus | |
Show DocumentStatus | |
Typeable DocumentStatus | |
ToJSON DocumentStatus | to json as per MangoPay format |
FromJSON DocumentStatus | from json as per MangoPay format |
createDocument :: MPUsableMonad m => AnyUserId -> Document -> AccessToken -> MangoPayT m DocumentSource
create a document
modifyDocument :: MPUsableMonad m => AnyUserId -> Document -> AccessToken -> MangoPayT m DocumentSource
fetchDocument :: MPUsableMonad m => AnyUserId -> DocumentId -> AccessToken -> MangoPayT m DocumentSource
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] -> KindOfAuthenticationSource
Calculate the MangoPay authentication level. http://docs.mangopay.com/api-references/kyc-rules/
getRequiredDocumentTypesSource
:: Either NaturalUser LegalUser | The MangoPay user. |
-> [DocumentType] |
Get the document types that may be required from the given user to enhance authorization level.
data BankAccount Source
bank account details
Eq BankAccount | |
Ord BankAccount | |
Show BankAccount | |
Typeable BankAccount | |
ToJSON BankAccount | to json as per MangoPay format |
FromJSON BankAccount | from json as per MangoPay format |
type BankAccountId = TextSource
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 | |
Typeable BankAccountDetails | |
FromJSON BankAccountDetails | from json as per MangoPay format |
data PaymentType Source
type of payment
Bounded PaymentType | |
Enum PaymentType | |
Eq PaymentType | |
Ord PaymentType | |
Read PaymentType | |
Show PaymentType | |
Typeable PaymentType | |
ToJSON PaymentType | to json as per MangoPay format |
FromJSON PaymentType | from json as per MangoPay format |
createAccount :: MPUsableMonad m => BankAccount -> AccessToken -> MangoPayT m BankAccountSource
create an account
fetchAccount :: MPUsableMonad m => AnyUserId -> BankAccountId -> AccessToken -> MangoPayT m BankAccountSource
fetch an account from its Id
listAccounts :: MPUsableMonad m => AnyUserId -> Maybe Pagination -> AccessToken -> MangoPayT m (PagedList BankAccount)Source
list all accounts for a given user
data PaymentExecution Source
Bounded PaymentExecution | |
Enum PaymentExecution | |
Eq PaymentExecution | |
Ord PaymentExecution | |
Read PaymentExecution | |
Show PaymentExecution | |
Typeable PaymentExecution | |
ToJSON PaymentExecution | to json as per MangoPay format |
FromJSON PaymentExecution | from json as per MangoPay format |
type BankWireId = TextSource
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 BankWireSource
create a bankwire pay-in
fetchBankWirePayIn :: MPUsableMonad m => BankWireId -> AccessToken -> MangoPayT m BankWireSource
fetch a bank wire pay-in from its Id
mkBankWire :: AnyUserId -> AnyUserId -> WalletId -> Amount -> Amount -> BankWireSource
helper function to create a new bank wire with the needed information
type CardPayinId = TextSource
Id of a direct pay in
direct pay in via registered card
CardPayin | |
|
createCardPayin :: MPUsableMonad m => CardPayin -> AccessToken -> MangoPayT m CardPayinSource
create a direct card pay in
fetchCardPayin :: MPUsableMonad m => CardPayinId -> AccessToken -> MangoPayT m CardPayinSource
fetch a direct card pay in from its Id
mkCardPayin :: AnyUserId -> AnyUserId -> WalletId -> Amount -> Amount -> Text -> CardId -> CardPayinSource
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 -> PayoutSource
make a simplep payout for creation
createPayout :: MPUsableMonad m => Payout -> AccessToken -> MangoPayT m PayoutSource
create a payout
fetchPayout :: MPUsableMonad m => PayoutId -> AccessToken -> MangoPayT m PayoutSource
fetch an payout from its Id
data CardRegistration Source
a card registration
CardRegistration | |
|
Eq CardRegistration | |
Ord CardRegistration | |
Show CardRegistration | |
Typeable CardRegistration | |
ToJSON CardRegistration | to json as per MangoPay format |
FromJSON CardRegistration | from json as per MangoPay format |
type CardRegistrationId = TextSource
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 | |
Typeable CardValidity | |
ToJSON CardValidity | to json as per MangoPay format |
FromJSON CardValidity | from json as per MangoPay format |
mkCardRegistration :: AnyUserId -> Currency -> CardRegistrationSource
helper function to create a new card registration
createCardRegistration :: MPUsableMonad m => CardRegistration -> AccessToken -> MangoPayT m CardRegistrationSource
create a card registration
modifyCardRegistration :: MPUsableMonad m => CardRegistration -> AccessToken -> MangoPayT m CardRegistrationSource
modify a card registration
fetchCard :: MPUsableMonad m => CardId -> AccessToken -> MangoPayT m CardSource
fetch a card from its Id
listCards :: MPUsableMonad m => AnyUserId -> 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 | |
Typeable RefundRequest | |
ToJSON RefundRequest | to json as per MangoPay format |
refundTransfer :: MPUsableMonad m => TransferId -> AnyUserId -> AccessToken -> MangoPayT m RefundSource
refund a transfer
refundPayin :: MPUsableMonad m => AnyPayinId -> RefundRequest -> AccessToken -> MangoPayT m RefundSource
refund a pay-in
fetchRefund :: MPUsableMonad m => RefundId -> AccessToken -> MangoPayT m RefundSource
fetch a refund from its Id