mangopay 1.6.1 → 1.6.2
raw patch · 3 files changed
+30/−19 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Web.MangoPay: getRequiredDocumentTypes :: Either NaturalUser LegalUser -> [DocumentType]
Files
- mangopay.cabal +1/−1
- src/Web/MangoPay.hs +12/−11
- src/Web/MangoPay/Documents.hs +17/−7
mangopay.cabal view
@@ -1,5 +1,5 @@ name: mangopay-version: 1.6.1+version: 1.6.2 cabal-version: >= 1.8 build-type: Simple author: JP Moresmau <jpmoresmau@gmail.com>
src/Web/MangoPay.hs view
@@ -6,7 +6,7 @@ ,runResourceInMp ,MpException ,getAll- + -- useful types ,Credentials(..) ,AccessPoint(..)@@ -20,12 +20,12 @@ ,readCardExpiration ,writeCardExpiration ,KindOfAuthentication(..)- + -- access ,createCredentialsSecret ,oauthLogin ,toAccessToken- + -- Users ,NaturalUser(..) ,IncomeRange(..)@@ -45,7 +45,7 @@ ,getUser ,listUsers ,getExistingUserID- + -- Wallets ,Wallet(..) ,Amount(..)@@ -65,7 +65,7 @@ ,fetchTransfer ,listTransactions ,listTransactionsForUser- + -- Events and Hooks ,Event(..) ,EventType(..)@@ -82,7 +82,7 @@ ,listHooks ,eventFromQueryString ,eventFromQueryStringT- + -- Documents and pages ,Document(..) ,DocumentID@@ -92,7 +92,8 @@ ,fetchDocument ,storePage ,getKindOfAuthentication- + ,getRequiredDocumentTypes+ -- Accounts ,BankAccount(..) ,BankAccountID@@ -101,7 +102,7 @@ ,storeAccount ,fetchAccount ,listAccounts- + -- Payins ,PaymentExecution(..) ,BankWireID@@ -114,14 +115,14 @@ ,storeCardPayin ,fetchCardPayin ,mkCardPayin- + -- Payouts ,PayoutID ,Payout(..) ,mkPayout ,storePayout ,fetchPayout- + -- Cards ,CardRegistration(..) ,CardRegistrationID@@ -133,7 +134,7 @@ ,storeCardRegistration ,fetchCard ,listCards- + -- Refunds ,RefundID ,Refund(..)
src/Web/MangoPay/Documents.hs view
@@ -1,4 +1,5 @@-{-# LANGUAGE DeriveDataTypeable, ScopedTypeVariables, OverloadedStrings, FlexibleContexts, FlexibleInstances, ConstraintKinds #-}+{-# LANGUAGE ConstraintKinds, DeriveDataTypeable, FlexibleContexts,+ FlexibleInstances, OverloadedStrings, ScopedTypeVariables #-} -- | handle documents and pages module Web.MangoPay.Documents where @@ -85,12 +86,12 @@ -- | a document data Document = Document {- dId :: Maybe DocumentID- ,dCreationDate :: Maybe POSIXTime- ,dTag :: Maybe Text -- ^ custom data for client- ,dType :: DocumentType- ,dStatus :: Maybe DocumentStatus- ,dRefusedReasonType :: Maybe Text+ dId :: Maybe DocumentID+ ,dCreationDate :: Maybe POSIXTime+ ,dTag :: Maybe Text -- ^ custom data for client+ ,dType :: DocumentType+ ,dStatus :: Maybe DocumentStatus+ ,dRefusedReasonType :: Maybe Text ,dRefusedReasonMessage :: Maybe Text } deriving (Show,Ord,Eq,Typeable) @@ -143,3 +144,12 @@ hasValidatedDocument SHAREHOLDER_DECLARATION docs) of (Just _, Just _, Just _, True, True, True) -> Regular _ -> Light+++-- | Get the document types that may be required from the given user to enhance authorization level.+getRequiredDocumentTypes+ :: Either NaturalUser LegalUser+ -- ^ The MangoPay user.+ -> [DocumentType]+getRequiredDocumentTypes (Left _) = [IDENTITY_PROOF, ADDRESS_PROOF]+getRequiredDocumentTypes (Right _) = [ARTICLES_OF_ASSOCIATION, REGISTRATION_PROOF, SHAREHOLDER_DECLARATION]