Skip to content

Commit

Permalink
Merge branch 'payment-sources' of github.com:Invoiced/invoiced-php in…
Browse files Browse the repository at this point in the history
…to payment-sources
  • Loading branch information
Adam Train committed Dec 4, 2019
2 parents c95cfe7 + 919476f commit 4caa4a6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/BankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class BankAccount extends BaseObject
*/
public function create(array $params = [], array $opts = [])
{
$response = $this->_client->request('post', $this->getEndpointBase() . "/payment_sources", $params, $opts);
$response = $this->_client->request('post', $this->getEndpointBase().'/payment_sources', $params, $opts);

return Util::convertToObject($this, $response['body']);
}
}
}
4 changes: 2 additions & 2 deletions src/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Card extends BaseObject
*/
public function create(array $params = [], array $opts = [])
{
$response = $this->_client->request('post', $this->getEndpointBase() . "/payment_sources", $params, $opts);
$response = $this->_client->request('post', $this->getEndpointBase().'/payment_sources', $params, $opts);

return Util::convertToObject($this, $response['body']);
}
}
}
2 changes: 1 addition & 1 deletion src/PaymentSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public function all(array $opts = [])

return [$output, $metadata];
}
}
}
5 changes: 1 addition & 4 deletions tests/CustomerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
use GuzzleHttp\Psr7\Response;
use Invoiced\Client;
use Invoiced\Customer;
use Invoiced\BankAccount;
use Invoiced\Card;
use Invoiced\PaymentSource;

class CustomerTest extends PHPUnit_Framework_TestCase
{
Expand Down Expand Up @@ -38,7 +35,7 @@ public static function setUpBeforeClass()
new Response(201, [], '{"id":123456,"total":1000}'),
new Response(201, [], '{"id":1231,"object":"card"}'),
new Response(201, [], '{"id":2342,"object":"account"}'),
new Response(200, ['X-Total-Count' => 15, 'Link' => '<https://api.invoiced.com/customers/123/payment_sources?per_page=25&page=1>; rel="self", <https://api.invoiced.com/customers/123/payment_sources?per_page=25&page=1>; rel="first", <https://api.invoiced.com/customers/123/payment_sources?per_page=25&page=1>; rel="last"'], '[{"id":1231,"object":"card"}, {"id":2342,"object":"bank_account"}]')
new Response(200, ['X-Total-Count' => 15, 'Link' => '<https://api.invoiced.com/customers/123/payment_sources?per_page=25&page=1>; rel="self", <https://api.invoiced.com/customers/123/payment_sources?per_page=25&page=1>; rel="first", <https://api.invoiced.com/customers/123/payment_sources?per_page=25&page=1>; rel="last"'], '[{"id":1231,"object":"card"}, {"id":2342,"object":"bank_account"}]'),
]);

self::$invoiced = new Client('API_KEY', false, false, $mock);
Expand Down
5 changes: 1 addition & 4 deletions tests/PaymentSourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use GuzzleHttp\Psr7\Response;
use Invoiced\Client;
use Invoiced\PaymentSource;
use Invoiced\Card;
use Invoiced\BankAccount;

class PaymentSourceTest extends PHPUnit_Framework_TestCase
{
Expand All @@ -26,7 +24,6 @@ public function testGetEndpoint()
$this->assertEquals('/payment_sources/123', $plan->getEndpoint());
}


public function testAll()
{
$source = new PaymentSource(self::$invoiced);
Expand All @@ -41,4 +38,4 @@ public function testAll()
$this->assertInstanceOf('Invoiced\\Collection', $metadata);
$this->assertEquals(15, $metadata->total_count);
}
}
}

0 comments on commit 4caa4a6

Please sign in to comment.