MangoPay/ApiUsers.php
public function CreateKycPageFromFile($userId, $kycDocumentId, $filePath, $idempotencyKey = null)
    {
        if (empty($filePath)) {
            throw new \MangoPay\Libraries\Exception('Path of file cannot be empty');
        }

        if (!file_exists($filePath)) {
            throw new \MangoPay\Libraries\Exception('File not exist');
        }

        $kycPage = new \MangoPay\KycPage();
        $kycPage->File = base64_encode(file_get_contents($filePath));

        if (empty($kycPage->File)) {
            throw new \MangoPay\Libraries\Exception('Content of the file cannot be empty');
        }

        return $this->CreateKycPage($userId, $kycDocumentId, $kycPage, $idempotencyKey);
    }
public function CreateKycPageFromFile($userId, $kycDocumentId, $filePath, $idempotencyKey = null)
    {
        if (empty($filePath)) {
            throw new \MangoPay\Libraries\Exception('Path of file cannot be empty');
        }

        if (!file_exists($filePath)) {
            throw new \MangoPay\Libraries\Exception('File not exist');
        }

        $kycPage = new \MangoPay\KycPage();
        $kycPage->File = base64_encode(file_get_contents($filePath));

        if (empty($kycPage->File)) {
            throw new \MangoPay\Libraries\Exception('Content of the file cannot be empty');
        }

        return $this->CreateKycPage($userId, $kycDocumentId, $kycPage, $idempotencyKey);
    }
public function CreateKycPageFromFile ( $ userId , $ kycDocumentId , $ filePath , $ idempotencyKey = null ) { if ( empty ( $ filePath ) ) { throw new \ MangoPay \ Libraries \ Exception ( 'Path of file cannot be empty' ) ; } if ( ! file_exists ( $ filePath ) ) { throw new \ MangoPay \ Libraries \ Exception ( 'File not exist' ) ; } $ kycPage = new \ MangoPay \ KycPage ( ) ; $ kycPage -> File = base64_encode ( file_get_contents ( $ filePath ) ) ; if ( empty ( $ kycPage -> File ) ) { throw new \ MangoPay \ Libraries \ Exception ( 'Content of the file cannot be empty' ) ; } return $ this -> CreateKycPage ( $ userId , $ kycDocumentId , $ kycPage , $ idempotencyKey ) ; }
Create page for Kyc document from file
@param string $userId User Id
@param int $kycDocumentId KYC Document Id
@param string $filePath File path
@return bool `true` if the upload was successful, `false` otherwise
@throws \MangoPay\Libraries\Exception
Create page for Kyc document from file