generated from Sylius/PluginSkeleton
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ebed29
commit dc88ace
Showing
8 changed files
with
108 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
<services> | ||
|
||
<defaults public="true" autoconfigure="false" autowire="false"/> | ||
<defaults public="true"/> | ||
|
||
<service id="bitbag.imoje_plugin.form.type.gateway_configuration" class="BitBag\SyliusImojePlugin\Form\Type\ImojeGatewayConfigurationType"> | ||
<tag name="sylius.gateway_configuration_type" type="imoje" label="bitbag.imoje_plugin.gateway_label"/> | ||
<tag name="form.type"/> | ||
</service> | ||
|
||
</services> | ||
</container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
<services> | ||
|
||
<defaults public="true" autoconfigure="false" autowire="false"/> | ||
|
||
<service id="bitbag.imoje_plugin.gateway_factory" class="Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder"> | ||
<argument>BitBag\SyliusImojePlugin\ImojeGatewayFactory</argument> | ||
<tag name="payum.gateway_factory_builder" factory="imoje"/> | ||
</service> | ||
|
||
</services> | ||
</container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BitBag\SyliusImojePlugin\Api; | ||
|
||
class ImojeApi implements ImojeApiInterface | ||
{ | ||
public function __construct( | ||
private readonly string $environment, | ||
private readonly string $merchantId, | ||
private readonly string $serviceId, | ||
private readonly string $serviceKey, | ||
private readonly string $authorizationToken, | ||
) {} | ||
|
||
public function getApiUrl(): string | ||
{ | ||
return $this->environment === 'production' ? self::PRODUCTION_PAYWALL_URL : self::SANDBOX_PAYWALL_URL; | ||
} | ||
|
||
public function getMerchantId(): string | ||
{ | ||
return $this->merchantId; | ||
} | ||
|
||
public function getServiceId(): string | ||
{ | ||
return $this->serviceId; | ||
} | ||
|
||
public function getServiceKey(): string | ||
{ | ||
return $this->serviceKey; | ||
} | ||
|
||
public function getAuthorizationToken(): string | ||
{ | ||
return $this->authorizationToken; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace BitBag\SyliusImojePlugin\Api; | ||
|
||
interface ImojeApiInterface | ||
{ | ||
public const SANDBOX_ENVIRONMENT = 'sandbox'; | ||
public const PRODUCTION_ENVIRONMENT = 'production'; | ||
|
||
public const SANDBOX_PAYWALL_URL = 'https://sandbox.paywall.imoje.pl/payment'; | ||
public const PRODUCTION_PAYWALL_URL = 'https://paywall.imoje.pl/payment'; | ||
|
||
public const NEW_STATUS = 'new'; | ||
public const PENDING_STATUS = 'pending'; | ||
public const SETTLED_STATUS = 'settled'; | ||
public const REJECTED_STATUS = 'rejected'; | ||
public const CANCELLED_STATUS = 'cancelled'; | ||
|
||
public const HASHING_ALGORITHM = 'sha256'; | ||
|
||
public function getApiUrl(): string; | ||
|
||
public function getMerchantId(): string; | ||
|
||
public function getServiceId(): string; | ||
|
||
public function getServiceKey(): string; | ||
|
||
public function getAuthorizationToken(): string; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
bitbag: | ||
imoje_plugin: | ||
configuration: | ||
production: Production | ||
sandbox: Sandbox | ||
merchant_id: Merchant ID | ||
service_id: Service ID | ||
service_key: Service key | ||
authorization_token: Authorization token |