本文整理汇总了Python中mangopaysdk.entities.kycdocument.KycDocument类的典型用法代码示例。如果您正苦于以下问题:Python KycDocument类的具体用法?Python KycDocument怎么用?Python KycDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KycDocument类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_Users_CreateKycPage_CorrectFilePath
def test_Users_CreateKycPage_CorrectFilePath(self) :
user = self.getJohn()
kycDocumentInit = KycDocument()
kycDocumentInit.Status = KycDocumentStatus.CREATED
kycDocumentInit.Type = KycDocumentType.IDENTITY_PROOF
kycDocument = self.sdk.users.CreateUserKycDocument(kycDocumentInit, user.Id)
self.sdk.users.CreateKycPageFromFile(user.Id, kycDocument.Id, os.path.join(os.path.dirname(__file__), "TestKycPageFile.png"))
示例2: create
def create(self, tag=''):
document = KycDocument()
document.Tag = tag
document.Type = DOCUMENT_TYPE_CHOICES_DICT[self.type]
client = get_mangopay_api_client()
created_document = client.users.CreateUserKycDocument(
document, self.mangopay_user.mangopay_id)
self.mangopay_id = created_document.Id
self.status = STATUS_CHOICES_DICT[created_document.Status]
self.save()
示例3: test_Users_CreateKycPage_WrongFilePath
def test_Users_CreateKycPage_WrongFilePath(self) :
user = self.getJohn()
kycDocumentInit = KycDocument()
kycDocumentInit.Status = KycDocumentStatus.CREATED
kycDocumentInit.Type = KycDocumentType.IDENTITY_PROOF
kycDocument = self.sdk.users.CreateUserKycDocument(kycDocumentInit, user.Id)
try:
self.sdk.users.CreateKycPageFromFile(user.Id, kycDocument.Id, 'notExistFileName.tmp')
except Exception as exc:
self.assertTrue(str(exc).find('File not exist') != -1)
示例4: test_Users_CreateKycPage_EmptyFilePath
def test_Users_CreateKycPage_EmptyFilePath(self):
user = self.getJohn()
kycDocumentInit = KycDocument()
kycDocumentInit.Status = KycDocumentStatus.CREATED
kycDocumentInit.Type = KycDocumentType.IDENTITY_PROOF
kycDocument = self.sdk.users.CreateUserKycDocument(kycDocumentInit, user.Id)
try:
self.sdk.users.CreateKycPageFromFile(user.Id, kycDocument.Id, '')
except Exception as exc:
self.assertEqual(str(exc), 'Path of file cannot be empty')
示例5: getUserKycDocument
def getUserKycDocument(self):
"""Creates KycDocument
return KycDocument
"""
if (self._johnsKycDocument == None):
user = self.getJohn()
kycDocument = KycDocument()
kycDocument.Tag = 'test tag 1'
kycDocument.Type = KycDocumentType.IDENTITY_PROOF
self._johnsKycDocument = self.sdk.users.CreateUserKycDocument(kycDocument, user.Id)
return self._johnsKycDocument
示例6: test_Users_CreateKycPage_CorrectFileString
def test_Users_CreateKycPage_CorrectFileString(self):
user = self.getJohn()
kycDocumentInit = KycDocument()
kycDocumentInit.Status = KycDocumentStatus.CREATED
kycDocumentInit.Type = KycDocumentType.IDENTITY_PROOF
kycDocument = self.sdk.users.CreateUserKycDocument(kycDocumentInit, user.Id)
kycPage = KycPage()
kycPage.File = 'dGVzdCB0ZXN0IHRlc3QgdGVzdA=='
kycPageResponse = self.sdk.users.CreateUserKycPage(kycPage, user.Id, kycDocument.Id)
self.assertEqual(kycPageResponse, None)
示例7: ask_for_validation
def ask_for_validation(self):
if self.status == CREATED:
document = KycDocument()
document.Id = self.mangopay_id
document.Status = "VALIDATION_ASKED"
client = get_mangopay_api_client()
updated_document = client.users.UpdateUserKycDocument(
document, self.mangopay_user.mangopay_id, self.mangopay_id)
self.status = STATUS_CHOICES_DICT[updated_document.Status]
self.save()
else:
raise BaseException('Cannot ask for validation of a document'
'not in the created state')
示例8: GetUserKycDocument
def GetUserKycDocument(self, document_id, user_id):
document = KycDocument()
document.Id = document_id
document.Status = "VALIDATED"
return document