Skip to content

Commit

Permalink
Add Tpay as a payment method to default's fixtures (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubtobiasz authored Sep 4, 2024
2 parents fd9df25 + 2c94cea commit feafac6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return function(ContainerConfigurator $container): void {
$container->import('config/**/*.php');
};
33 changes: 33 additions & 0 deletions config/config/sylius_fixtures.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

declare(strict_types=1);

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Config\SyliusFixturesConfig;

return function(SyliusFixturesConfig $fixtures): void {
$fixtures->suites('default')
->fixtures('payment_method', [
'options' => [
'custom' => [
'tpay' => [
'code' => 'tpay',
'name' => 'Tpay',
'gatewayFactory' => 'tpay',
'gatewayName' => 'Tpay',
'gatewayConfig' => [
'client_id' => '%env(string:TPAY_CLIENT_ID)%',
'client_secret' => '%env(string:TPAY_CLIENT_SECRET)%',
'production_mode' => false,
],
'channels' => [
'FASHION_WEB',
],
'enabled' => true,
],
],
],
])
;
};
2 changes: 2 additions & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

$parameters = $container->parameters();
$parameters
->set('env(TPAY_CLIENT_ID)', '')
->set('env(TPAY_CLIENT_SECRET)', '')
->set('commerce_weavers_tpay.payum.create_transaction.success_route', 'sylius_shop_order_thank_you')
->set('commerce_weavers_tpay.payum.create_transaction.error_route', 'sylius_shop_order_thank_you')
->set('commerce_weavers_tpay.payum.create_transaction.notify_route', 'commerce_weavers_tpay_payment_notification')
Expand Down
2 changes: 2 additions & 0 deletions tests/Application/config/packages/commerce_weavers_tpay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- { resource: "@CommerceWeaversSyliusTpayPlugin/config/config.php" }

0 comments on commit feafac6

Please sign in to comment.