Merge branch 'master' into feature/create-order-intent-authorize

This commit is contained in:
Mészáros Róbert 2020-04-14 12:11:41 +03:00
commit 5042ab9e45
2 changed files with 4 additions and 2 deletions

View file

@ -5,8 +5,8 @@ namespace Inpsyde\PayPalCommerce\ApiClient;
use Dhii\Data\Container\ContainerInterface; use Dhii\Data\Container\ContainerInterface;
use Inpsyde\CacheModule\Provider\CacheProviderInterface; use Inpsyde\CacheModule\Provider\CacheProviderInterface;
use Inpsyde\PayPalCommerce\ApiClient\Config\Config;
use Inpsyde\PayPalCommerce\ApiClient\Authentication\Bearer; use Inpsyde\PayPalCommerce\ApiClient\Authentication\Bearer;
use Inpsyde\PayPalCommerce\ApiClient\Config\Config;
use Inpsyde\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; use Inpsyde\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
use Inpsyde\PayPalCommerce\ApiClient\Factory\AddressFactory; use Inpsyde\PayPalCommerce\ApiClient\Factory\AddressFactory;
use Inpsyde\PayPalCommerce\ApiClient\Factory\AmountFactory; use Inpsyde\PayPalCommerce\ApiClient\Factory\AmountFactory;
@ -120,7 +120,8 @@ return [
return new ShippingFactory($addressFactory); return new ShippingFactory($addressFactory);
}, },
'api.factory.amount' => function (ContainerInterface $container) : AmountFactory { 'api.factory.amount' => function (ContainerInterface $container) : AmountFactory {
return new AmountFactory(); $itemFactory = $container->get('api.factory.item');
return new AmountFactory($itemFactory);
}, },
'api.factory.payer' => function (ContainerInterface $container) : PayerFactory { 'api.factory.payer' => function (ContainerInterface $container) : PayerFactory {
$addressFactory = $container->get('api.factory.address'); $addressFactory = $container->get('api.factory.address');

View file

@ -104,6 +104,7 @@ class AmountFactory
$total, $total,
$breakdown $breakdown
); );
return $amount;
} }
public function fromPayPalResponse(\stdClass $data) : Amount public function fromPayPalResponse(\stdClass $data) : Amount