Skip to content

Commit

Permalink
Fix Dotpay payments (#58)
Browse files Browse the repository at this point in the history
* Fix Dotpay payments

* Revert actual currency changes
  • Loading branch information
jakub-groncki authored Jun 6, 2022
1 parent cdb5053 commit 6e85548
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
12 changes: 3 additions & 9 deletions src/Client/ClientPayloadFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Payum\Core\Bridge\Spl\ArrayObject;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\PaymentInterface;
use Sylius\Component\Currency\Context\CurrencyContextInterface;
use Sylius\RefundPlugin\Event\RefundPaymentGenerated;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
Expand All @@ -33,9 +32,6 @@ final class ClientPayloadFactory implements ClientPayloadFactoryInterface
/** @var RequestStack */
private $requestStack;

/** @var CurrencyContextInterface */
private $currencyContext;

/** @var array */
private $allowedMethodsList = [
'ideal',
Expand Down Expand Up @@ -68,13 +64,11 @@ final class ClientPayloadFactory implements ClientPayloadFactoryInterface
public function __construct(
VersionResolverInterface $versionResolver,
NormalizerInterface $normalizer,
RequestStack $requestStack,
CurrencyContextInterface $currencyContext
RequestStack $requestStack
) {
$this->versionResolver = $versionResolver;
$this->normalizer = $normalizer;
$this->requestStack = $requestStack;
$this->currencyContext = $currencyContext;
}

public function createForAvailablePaymentMethods(
Expand All @@ -90,7 +84,7 @@ public function createForAvailablePaymentMethods(
$payload = [
'amount' => [
'value' => $order->getTotal(),
'currency' => $this->currencyContext->getCurrencyCode(),
'currency' => (string) $order->getCurrencyCode(),
],
'merchantAccount' => $options['merchantAccount'],
'countryCode' => $countryCode,
Expand Down Expand Up @@ -133,7 +127,7 @@ public function createForSubmitPayment(
$payload = [
'amount' => [
'value' => $order->getTotal(),
'currency' => (string) $order->getCurrencyCode(),
'currency' => $order->getCurrencyCode(),
],
'reference' => (string) $order->getNumber(),
'merchantAccount' => $options['merchantAccount'],
Expand Down
1 change: 0 additions & 1 deletion src/Resources/config/services/adyen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<argument type="service" id="bitbag.sylius_adyen_plugin.resolver.version.version_resolver"/>
<argument type="service" id="serializer"/>
<argument type="service" id="request_stack"/>
<argument type="service" id="sylius.context.currency"/>
</service>

<service
Expand Down

0 comments on commit 6e85548

Please sign in to comment.