Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Sep 14, 2020
1 parent ddc7033 commit 6141876
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/Behat/Context/Setup/PaymentPayPalContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ private function createPaymentMethod(
'client_id' => $this->clientId,
'client_secret' => 'SECRET',
'partner_attribution_id' => $this->partnerAttributionId,
'merchant_id' => 'MERCHANT-ID',
'reports_sftp_username' => 'USERNAME',
'reports_sftp_password' => 'PASSWORD',
]);
Expand Down
5 changes: 5 additions & 0 deletions tests/Behat/Resources/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
class="Tests\Sylius\PayPalPlugin\Behat\Service\DummyAuthorizeClientApi"
/>

<service
id="Sylius\PayPalPlugin\Api\OrderDetailsApiInterface"
class="Tests\Sylius\PayPalPlugin\Behat\Service\DummyOrderDetailsApi"
/>

<service
id="Sylius\PayPalPlugin\Api\RefundPaymentApiInterface"
class="Tests\Sylius\PayPalPlugin\Behat\Service\DummyRefundPaymentApi"
Expand Down
15 changes: 15 additions & 0 deletions tests/Behat/Service/DummyOrderDetailsApi.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

namespace Tests\Sylius\PayPalPlugin\Behat\Service;

use Sylius\PayPalPlugin\Api\OrderDetailsApiInterface;

final class DummyOrderDetailsApi implements OrderDetailsApiInterface
{
public function get(string $token, string $orderId): array
{
return ['status' => 'COMPLETED', 'purchase_units' => [['payments' => ['captures' => [['id' => '123123']]]]]];
}
}

0 comments on commit 6141876

Please sign in to comment.