Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions Client/KycAttachmentClient.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace Smoney\Smoney\Client;

use Smoney\Smoney\Client\AbstractClient;
use Smoney\Smoney\Facade\KycAttachmentFacade;

/**
* Class KycAttachmentClient
*/
class KycAttachmentClient extends AbstractClient
{
/**
* @param string $appUserId
* @param array $files with key as filename and value as file content
*
* @return KycFacade
*/
public function create($appUserId, $files)
{
$uri = 'users/'.$appUserId.'/kyc';

$multiparts = [];

$i = 1;
foreach ($files as $key => $value) {
$multiparts[] = [
'name' => 'file-'.$i,
'contents' => $value,
'filename' => $key
];
$i ++;
}

$res = $this->action('POST', $uri, ['multipart' => $multiparts], ['Content-Type'=>null]);

return $this->serializer->deserialize($res, 'Smoney\Smoney\Facade\KycFacade', 'json');
}

/**
* @param string $appUserId
* @param string $kycAtatchmentId
*
* @return KycAttachmentFacade
*/
public function get($appUserId, $kycAttachmentId)
{
$uri = 'users/'.$appUserId.'/attachments/'.$kycAttachmentId;
$res = $this->action('GET', $uri);

return $this->serializer->deserialize($res, 'Smoney\Smoney\Facade\KycAttachmentFacade', 'json');
}

/**
* @param string $appUserId
* @param string $kycAtatchmentId
*
* @return void
*/
public function delete($appUserId, $kycAttachmentId)
{
$uri = 'users/'.$appUserId.'/attachments/'.$kycAttachmentId;
$res = $this->action('DELETE', $uri);
}
}
7 changes: 7 additions & 0 deletions Facade/CompanyFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ class CompanyFacade
* @Type("string")
*/
public $siret;

/**
* @var string $nafCode
* @SerializedName("NAFCode")
* @Type("string")
*/
public $nafCode;
}
89 changes: 89 additions & 0 deletions Facade/KycAttachmentFacade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php

namespace Smoney\Smoney\Facade;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

/**
* Class KycFacade
*/
class KycAttachmentFacade
{
/**
* @var int $id
* @SerializedName("Id")
* @Type("integer")
*/
public $id;

/**
* @var string $name
* @SerializedName("Name")
* @Type("string")
*/
public $name;

/**
* @var int $type
* @SerializedName("Type")
* @Type("integer")
*/
public $type;

/**
* @var string $contentType
* @SerializedName("ContentType")
* @Type("string")
*/
public $contentType;

/**
* @var integer $size
* @SerializedName("Size")
* @Type("integer")
*/
public $size;

/**
* @var integer $status
* @SerializedName("Status")
* @Type("integer")
*/
public $status;

/**
* @var string $message
* @SerializedName("Message")
* @Type("string")
*/
public $message;

/**
* @var integer $additionalStatus
* @SerializedName("AdditionalStatus")
* @Type("integer")
*/
public $additionalStatus;

/**
* @var DateTime $treatmentDate
* @SerializedName("TreatmentDate")
* @Type("DateTime<'Y-m-d\TH:i:s+'>")
*/
public $treatmentDate;

/**
* @var DateTime $receivedDate
* @SerializedName("ReceivedDate")
* @Type("DateTime<'Y-m-d\TH:i:s+'>")
*/
public $receivedDate;

/**
* @var string $href
* @SerializedName("Href")
* @Type("href")
*/
public $href;
}
9 changes: 8 additions & 1 deletion Facade/UserCardRegistrationFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ class UserCardRegistrationFacade
* @Type("string")
*/
public $urlReturn;
}

/**
* @var string $urlCallback
* @SerializedName("UrlCallback")
* @Type("string")
*/
public $urlCallback;
}
42 changes: 42 additions & 0 deletions Facade/VoucherCopyFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,46 @@ class VoucherCopyFacade
* @Type("string")
*/
public $href;

/**
* @var string $contentType
* @SerializedName("ContentType")
* @Type("string")
*/
public $contentType;

/**
* @var string $status
* @SerializedName("Status")
* @Type("integer")
*/
public $status;

/**
* @var string $message
* @SerializedName("Message")
* @Type("string")
*/
public $message;

/**
* @var string $additionalStatus
* @SerializedName("AdditionalStatus")
* @Type("integer")
*/
public $additionnalStatus;

/**
* @var string $treatmentDate
* @SerializedName("TreatmentDate")
* @Type("DateTime<'Y-m-d\TH:i:s+'>")
*/
public $treatmentDate;

/**
* @var string $receivedDate
* @SerializedName("ReceivedDate")
* @Type("DateTime<'Y-m-d\TH:i:s+'>")
*/
public $receivedDate;
}