Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arti0090 committed Oct 3, 2024
1 parent 520baea commit 4ba1229
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
16 changes: 16 additions & 0 deletions config/config/sylius_fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@
],
'enabled' => true,
],
'pbl' => [
'code' => 'tpay_pbl',
'name' => 'Pay by Link (Tpay)',
'gatewayFactory' => 'tpay',
'gatewayName' => 'tpay',
'gatewayConfig' => [
'client_id' => '%env(string:TPAY_CLIENT_ID)%',
'client_secret' => '%env(string:TPAY_CLIENT_SECRET)%',
'type' => 'pay-by-link',
'production_mode' => false,
],
'channels' => [
'FASHION_WEB',
],
'enabled' => true,
],
],
],
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use CommerceWeavers\SyliusTpayPlugin\Payum\Factory\Token\NotifyTokenFactoryInterface;
use CommerceWeavers\SyliusTpayPlugin\Payum\Request\Api\CreateTransaction;
use CommerceWeavers\SyliusTpayPlugin\Tpay\Factory\CreatePayByLinkPayloadFactoryInterface;
use CommerceWeavers\SyliusTpayPlugin\Tpay\TpayApi;
use Payum\Core\Reply\HttpRedirect;
use Payum\Core\Request\Capture;
use Payum\Core\Security\GenericTokenFactoryInterface;
Expand All @@ -17,7 +18,6 @@
use Prophecy\Prophecy\ObjectProphecy;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\PaymentInterface;
use Tpay\OpenApi\Api\TpayApi;
use Tpay\OpenApi\Api\Transactions\TransactionsApi;
use Webmozart\Assert\InvalidArgumentException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\GetTpayTransactionsChannelsAction;
use CommerceWeavers\SyliusTpayPlugin\Payum\Request\Api\GetTpayTransactionsChannels;
use CommerceWeavers\SyliusTpayPlugin\Payum\Request\Api\Notify;
use CommerceWeavers\SyliusTpayPlugin\Payum\Request\Api\Notify\NotifyData;
use CommerceWeavers\SyliusTpayPlugin\Tpay\TpayApi;
use Payum\Core\Model\PaymentInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Tpay\OpenApi\Api\TpayApi;
use Tpay\OpenApi\Api\Transactions\TransactionsApi;

final class GetTpayTransactionsChannelsActionTest extends TestCase
Expand All @@ -35,7 +36,7 @@ public function test_it_supports_only_get_bank_groups_request(): void
{
$action = new GetTpayTransactionsChannelsAction();

$this->assertFalse($action->supports(new Notify(new \stdClass(), new \ArrayObject())));
$this->assertFalse($action->supports(new Notify(new \stdClass(), $this->createNotifyDataObject())));
$this->assertTrue($action->supports(new GetTpayTransactionsChannels($this->model->reveal())));
}

Expand All @@ -55,4 +56,8 @@ public function test_it_returns_bank_groups_on_execute(): void
$action->execute($this->request->reveal());
}

private function createNotifyDataObject(string $jws = 'jws', string $content = 'content', array $parameters = []): NotifyData
{
return new NotifyData($jws, $content, $parameters);
}
}

0 comments on commit 4ba1229

Please sign in to comment.