-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #425 from pagarme/feat/pcag-772-add-kyc-link-route-v3
feat: add generate kyc link route v3
- Loading branch information
Showing
4 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace PagarMe\Sdk\Recipient\Request; | ||
|
||
use PagarMe\Sdk\RequestInterface; | ||
use PagarMe\Sdk\Recipient\Recipient; | ||
|
||
class RecipientGenerateKycLink implements RequestInterface | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
private $recipientId; | ||
|
||
/** | ||
* @param int $recipientId | ||
*/ | ||
public function __construct($recipientId) | ||
{ | ||
$this->recipientId = $recipientId; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getPayload() | ||
{ | ||
return []; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getPath() | ||
{ | ||
return sprintf( | ||
'recipients/%s/kyc_link', | ||
$this->recipientId | ||
); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getMethod() | ||
{ | ||
return self::HTTP_POST; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
tests/unit/Recipient/Request/RecipientGenerateKycLinkTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace PagarMe\SdkTests\Recipient; | ||
|
||
use PagarMe\Sdk\Recipient\Request\RecipientGenerateKycLink; | ||
use PagarMe\Sdk\RequestInterface; | ||
|
||
class RecipientGenerateKycLinkTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
const ID = 're_x1y2z3'; | ||
const PATH = 'recipients/re_x1y2z3/kyc_link'; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function mustPathBeCorrect() | ||
{ | ||
$recipientGenerateKycLink = new RecipientGenerateKycLink(self::ID); | ||
|
||
$this->assertEquals(self::PATH, $recipientGenerateKycLink->getPath()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function mustMethodBeCorrect() | ||
{ | ||
$recipientGenerateKycLink = new RecipientGenerateKycLink(self::ID); | ||
|
||
$this->assertEquals(RequestInterface::HTTP_POST, $recipientGenerateKycLink->getMethod()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function mustPayloadBeCorrect() | ||
{ | ||
$recipientGenerateKycLink = new RecipientGenerateKycLink(self::ID); | ||
|
||
$this->assertEquals( | ||
[], | ||
$recipientGenerateKycLink->getPayload() | ||
); | ||
} | ||
} |