[FEATURE] Make verification auto-confirm configurable #9

This commit is contained in:
Markus Klein 2021-07-02 15:48:54 +02:00
parent ed1e70100f
commit 3ed3abc0d2

View file

@ -34,7 +34,8 @@ class Issuer
string $useremail, string $useremail,
string $vtype, string $vtype,
bool $isSkillSet = false, bool $isSkillSet = false,
int $campaignId = 0 int $campaignId = 0,
bool $autoConfirm = true
): array { ): array {
if ($isSkillSet) { if ($isSkillSet) {
$requestData['SkillSetId'] = $ID; $requestData['SkillSetId'] = $ID;
@ -45,7 +46,7 @@ class Issuer
$requestData['Level'] = $vtype; $requestData['Level'] = $vtype;
$requestData['VerifierId'] = $this->settings->getVerifierID(); $requestData['VerifierId'] = $this->settings->getVerifierID();
$requestData['Username'] = $useremail; $requestData['Username'] = $useremail;
$requestData['AutoConfirm'] = true; $requestData['AutoConfirm'] = $autoConfirm;
if ($campaignId) { if ($campaignId) {
$requestData['CampaignId'] = $campaignId; $requestData['CampaignId'] = $campaignId;
} }
@ -86,9 +87,10 @@ class Issuer
string $useremail, string $useremail,
string $vtype, string $vtype,
bool $isSkillSet = false, bool $isSkillSet = false,
int $campaignId = 0 int $campaignId = 0,
bool $autoConfirm = true
): ResponseInterface { ): ResponseInterface {
$requestData = $this->generateSignedRequestData($skillID, $useremail, $vtype, $isSkillSet, $campaignId); $requestData = $this->generateSignedRequestData($skillID, $useremail, $vtype, $isSkillSet, $campaignId, $autoConfirm);
$client = new \GuzzleHttp\Client(); $client = new \GuzzleHttp\Client();
$request = new Request( $request = new Request(