Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 98b1ff3

Browse files
committed
feat(account): added getCreatedAt function
1 parent 45dc5ad commit 98b1ff3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/Resource/Account.php

+11
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,16 @@ public function getTransparentAccount()
373373
return $this->getIfSet('transparentAccount', $this->data);
374374
}
375375

376+
/**
377+
* Get account created at.
378+
*
379+
* @return string
380+
*/
381+
public function getCreatedAt()
382+
{
383+
return $this->getIfSet('createdAt', $this->data);
384+
}
385+
376386
/**
377387
* Mount the seller structure from account.
378388
*
@@ -431,6 +441,7 @@ protected function populate(stdClass $response)
431441
$account->data->accessToken = $this->getIfSet('accessToken', $response);
432442
$account->data->channelId = $this->getIfSet('channelId', $response);
433443
$account->data->transparentAccount = $this->getIfSet('transparentAccount', $response);
444+
$account->data->createdAt = $this->getIfSet('createdAt', $response);
434445

435446
return $account;
436447
}

tests/Resource/AccountTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function testShouldCreateAccount()
3030
$this->assertNotEmpty($account->getId());
3131
$this->assertNotEmpty($account->getAccessToken());
3232
$this->assertNotEmpty($account->getchannelId());
33+
$this->assertNotEmpty($account->getCreatedAt());
3334
$this->assertEquals('144563480', $account->getIdentityDocumentNumber());
3435
$this->assertEquals('SSP', $account->getIdentityDocumentIssuer());
3536
$this->assertEquals('2017-10-25', $account->getIdentityDocumentIssueDate());
@@ -63,6 +64,7 @@ public function testShouldCreateAccountWithCompany()
6364
$this->assertNotEmpty($account->getId());
6465
$this->assertNotEmpty($account->getAccessToken());
6566
$this->assertNotEmpty($account->getchannelId());
67+
$this->assertNotEmpty($account->getCreatedAt());
6668
$this->assertEquals('144563480', $account->getIdentityDocumentNumber());
6769
$this->assertEquals('SSP', $account->getIdentityDocumentIssuer());
6870
$this->assertEquals('RG', $account->getIdentityDocumentType());
@@ -89,6 +91,7 @@ public function testShouldGetAccount()
8991
$account = $this->moip->accounts()->get($account_id);
9092

9193
$this->assertNotEmpty($account->getId());
94+
$this->assertNotEmpty($account->getCreatedAt());
9295
$this->assertEquals(false, $account->getTransparentAccount());
9396
$this->assertEquals('fortestsminecustomer@mailinator.com', $account->getLogin());
9497
$this->assertEquals(true, $account->getEmailConfirmed());

0 commit comments

Comments
 (0)