Skip to content

Commit

Permalink
Merge pull request #13 from vindi/feature/payment_profile_verify
Browse files Browse the repository at this point in the history
Add method verify [MOD-30]
  • Loading branch information
asagalo authored Aug 19, 2016
2 parents 1f06150 + 1bec376 commit 2bf208c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Todas as mudanças notáveis serão documentadas neste arquivo.

## 1.0.9 - 19/08/2016
- Add method verify in PaymentProfiles

## 1.0.8 - 04/02/2016
- Add params to Delete method

Expand Down
12 changes: 12 additions & 0 deletions src/PaymentProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,16 @@ public function endpoint()
{
return 'payment_profiles';
}

/**
* Make a POST request to payment_profiles/{id}/verify
*
* @param int $id The resource's id.
*
* @return mixed
*/
public function verify($id)
{
return $this->post($id, 'verify');
}
}
2 changes: 1 addition & 1 deletion src/Vindi.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Vindi
* This Package SDK Version.
* @var string
*/
public static $sdkVersion = '1.0.8';
public static $sdkVersion = '1.0.9';

/**
* The base URL for the Vindi API.
Expand Down
13 changes: 13 additions & 0 deletions tests/PaymentProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Vindi\ApiRequester;
use Vindi\PaymentProfile;
use stdClass;

class PaymentProfileTest extends ResourceTest
{
Expand All @@ -18,4 +19,16 @@ public function it_should_have_an_endpoint()
{
$this->assertSame($this->resource->endpoint(), 'payment_profiles');
}

/** @test */
public function it_should_verify_a_payment_profile()
{
$stdClass = new stdClass;

$this->resource->apiRequester->method('request')->willReturn($stdClass);

$response = $this->resource->verify(1);

$this->assertSame($response, $stdClass);
}
}

0 comments on commit 2bf208c

Please sign in to comment.