| Safe Haskell | None |
|---|
Web.MangoPay
Description
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
- storeNaturalUser :: MPUsableMonad m => NaturalUser -> AccessToken -> MangoPayT m NaturalUser
- fetchNaturalUser :: MPUsableMonad m => NaturalUserID -> AccessToken -> MangoPayT m NaturalUser
- storeLegalUser :: 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)
- data Wallet = Wallet {}
- data Amount = Amount {}
- type WalletID = Text
- type Currency = Text
- storeWallet :: 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
- storeHook :: 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
- storeDocument :: MPUsableMonad m => AnyUserID -> Document -> AccessToken -> MangoPayT m Document
- fetchDocument :: MPUsableMonad m => AnyUserID -> DocumentID -> AccessToken -> MangoPayT m Document
- storePage :: MPUsableMonad m => AnyUserID -> DocumentID -> ByteString -> AccessToken -> MangoPayT m ()
- getKindOfAuthentication :: Either NaturalUser LegalUser -> [Document] -> KindOfAuthentication
- 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
- storeAccount :: 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
- storeBankWire :: MPUsableMonad m => BankWire -> AccessToken -> MangoPayT m BankWire
- fetchBankWire :: 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
- storeCardPayin :: 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
- storePayout :: 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
- storeCardRegistration :: 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
Instances
| MonadTrans MangoPayT | |
| MonadTransControl MangoPayT | |
| MonadBase b m => MonadBase b (MangoPayT m) | |
| MonadBaseControl b m => MonadBaseControl 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) |
Arguments
| :: 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
Instances
| Show MpException | |
| Typeable 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
Constructors
| Credentials | |
Instances
| 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 OAuthToken Source
the oauth token returned after authentication
Constructors
| OAuthToken | |
Fields
| |
Instances
| 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/
Constructors
| Pagination | |
A partial list with pagination information.
Constructors
| PagedList | |
Fields
| |
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
Methods
(?+) :: ByteString -> a -> (ByteString, Maybe ByteString)Source
data CardExpiration Source
the expiration date of a card
Constructors
| CardExpiration | |
Instances
| 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/
Constructors
| NaturalUser | |
Fields
| |
Instances
| 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
Instances
| 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
Constructors
| LegalUser | |
Fields
| |
data LegalUserType Source
the type of legal user
Constructors
| Business | |
| Organization |
Instances
| 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
Constructors
| UserRef | |
Fields
| |
data PersonType Source
Type of user.
Instances
| 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 |
storeNaturalUser :: MPUsableMonad m => NaturalUser -> AccessToken -> MangoPayT m NaturalUserSource
create or edit a natural user
fetchNaturalUser :: MPUsableMonad m => NaturalUserID -> AccessToken -> MangoPayT m NaturalUserSource
fetch a natural user from her ID
storeLegalUser :: MPUsableMonad m => LegalUser -> AccessToken -> MangoPayT m LegalUserSource
create or edit a natural 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
a wallet
Constructors
| Wallet | |
Fields
| |
currency amount
storeWallet :: MPUsableMonad m => Wallet -> AccessToken -> MangoPayT m WalletSource
create or edit 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
Constructors
| Transfer | |
Fields
| |
type TransferID = TextSource
ID of a transfer
data TransferStatus Source
status of a transfer
Instances
| 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
Constructors
| Transaction | |
Fields
| |
Instances
| 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
Instances
| 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
Constructors
| REGULAR | just as you created the object |
| REFUND | the transaction has been refunded |
| REPUDIATION | the transaction has been repudiated |
Instances
| 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
Constructors
| Event | |
Fields
| |
Event type
Constructors
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
Instances
| 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
Instances
| 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
Constructors
| Hook | |
Fields
| |
storeHook :: MPUsableMonad m => Hook -> AccessToken -> MangoPayT m HookSource
create or edit 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
Constructors
| Document | |
Fields
| |
type DocumentID = TextSource
ID of a document
data DocumentType Source
type of the document
Constructors
| 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 |
Instances
| 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
Constructors
| CREATED | |
| VALIDATION_ASKED | |
| VALIDATED | |
| REFUSED |
Instances
| 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 |
storeDocument :: MPUsableMonad m => AnyUserID -> Document -> AccessToken -> MangoPayT m DocumentSource
create or edit a document
fetchDocument :: MPUsableMonad m => AnyUserID -> DocumentID -> AccessToken -> MangoPayT m DocumentSource
fetch a document from its ID
storePage :: 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/
data BankAccount Source
bank account details
Constructors
| BankAccount | |
Fields
| |
Instances
| 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
Constructors
| IBAN | |
| GB | |
Fields
| |
| US | |
Fields
| |
| CA | |
Fields
| |
| Other | |
Fields
| |
Instances
| Eq BankAccountDetails | |
| Ord BankAccountDetails | |
| Read BankAccountDetails | |
| Show BankAccountDetails | |
| Typeable BankAccountDetails | |
| FromJSON BankAccountDetails | from json as per MangoPay format |
data PaymentType Source
type of payment
Constructors
| CARD | |
| BANK_WIRE | |
| AUTOMATIC_DEBIT | |
| DIRECT_DEBIT |
Instances
| 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 |
storeAccount :: 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
Instances
| 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
Constructors
| BankWire | |
Fields
| |
storeBankWire :: MPUsableMonad m => BankWire -> AccessToken -> MangoPayT m BankWireSource
create or edit a bankwire
fetchBankWire :: MPUsableMonad m => BankWireID -> AccessToken -> MangoPayT m BankWireSource
fetch a bank wire 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
Constructors
| CardPayin | |
Fields
| |
storeCardPayin :: MPUsableMonad m => CardPayin -> AccessToken -> MangoPayT m CardPayinSource
create or edit a direct card pay in
fetchCardPayin :: MPUsableMonad m => CardPayinID -> AccessToken -> MangoPayT m CardPayinSource
fetch a direct 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
Constructors
| Payout | |
Fields
| |
mkPayout :: AnyUserID -> WalletID -> Amount -> Amount -> BankAccountID -> PayoutSource
make a simplep payout for creation
storePayout :: 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
Constructors
| CardRegistration | |
Fields
| |
Instances
| 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
Constructors
| Card | |
Fields
| |
data CardValidity Source
validity of a card
Instances
| 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
storeCardRegistration :: MPUsableMonad m => CardRegistration -> AccessToken -> MangoPayT m CardRegistrationSource
create or edit 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
Constructors
| Refund | |
Fields
| |
data RefundRequest Source
refund request
Constructors
| RefundRequest | |
Fields
| |
Instances
| 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