Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PaymentMethod.php #57

Open
wants to merge 2 commits into
base: 5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Base/Collection/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ public function get(string $collectionId): Response
*/
public function update(string $collectionId, array $codes = []): Response
{
$payments = [];
$payments['payment_methods'] = [];

foreach ($codes as $code) {
array_push($payments, compact('code'));
array_push($payments['payment_methods'], compact('code'));
}

return $this->send('PUT', "collections/{$collectionId}/payment_methods", [], $payments);
return $this->send('PUT', "collections/{$collectionId}/payment_methods", [
'Content-Type' => 'application/json',
], $payments);
}
}
2 changes: 1 addition & 1 deletion src/Base/PaymentCompletion.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ final protected function validateAgainstSignature(array $bill, Signature $signat
}

if (! $signature->verify($bill, $bill['x_signature'])) {
throw new FailedSignatureVerification();
throw new FailedSignatureVerification;
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ protected function responseWith(ResponseInterface $message): ResponseContract
*/
protected function sanitizeWith(): Sanitizer
{
return new Sanitizer();
return new Sanitizer;
}
}
8 changes: 4 additions & 4 deletions tests/Casts/DateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ class DateTimeTest extends TestCase
/** @test */
public function it_can_cast_datetime_to_string()
{
$cast = new DateTime();
$cast = new DateTime;

$this->assertSame('2018-01-01', $cast->from(new \DateTime('2018-01-01 11:00:01')));
}

/** @test */
public function it_wouldnt_cast_datetime_if_not_validated()
{
$cast = new DateTime();
$cast = new DateTime;

$this->assertSame('foo', $cast->from('foo'));
}

/** @test */
public function it_can_cast_string_to_datetime()
{
$cast = new DateTime();
$cast = new DateTime;

$this->assertInstanceOf('DateTimeInterface', $cast->to('2018-01-01'));
}

/** @test */
public function it_can_cast_none_string_to_datetime()
{
$cast = new DateTime();
$cast = new DateTime;

$this->assertNull($cast->to(null));
}
Expand Down
2 changes: 1 addition & 1 deletion tests/SanitizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ class SanitizerTest extends PHPUnit
/** @test */
public function it_has_proper_signature()
{
$this->assertInstanceOf('Laravie\Codex\Filter\Sanitizer', new Sanitizer());
$this->assertInstanceOf('Laravie\Codex\Filter\Sanitizer', new Sanitizer);
}
}