Passed
Branch feature/ECO-573-per-item-proce... (fe5bf4)
by Andrey
04:56
created

AmazonpayStub   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 57
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A confirmPurchase() 0 3 1
A __construct() 0 3 1
A addSelectedAddressToQuote() 0 3 1
A addSelectedShipmentMethodToQuote() 0 5 1
A handleCartWithAmazonpay() 0 3 1
1
<?php
2
3
/**
4
 * Apache OSL-2
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Client\Amazonpay\Zed;
9
10
use Generated\Shared\Transfer\QuoteTransfer;
11
use Spryker\Client\ZedRequest\ZedRequestClientInterface;
12
13
class AmazonpayStub implements AmazonpayStubInterface
14
{
15
16
    /**
17
     * @var \Spryker\Client\ZedRequest\ZedRequestClientInterface
18
     */
19
    protected $zedStub;
20
21
    /**
22
     * @param \Spryker\Client\ZedRequest\ZedRequestClientInterface $zedStub
23
     */
24
    public function __construct(ZedRequestClientInterface $zedStub)
25
    {
26
        $this->zedStub = $zedStub;
27
    }
28
29
    /**
30
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
31
     *
32
     * @return \Spryker\Shared\Kernel\Transfer\TransferInterface
33
     */
34
    public function handleCartWithAmazonpay(QuoteTransfer $quoteTransfer)
35
    {
36
        return $this->zedStub->call('/amazonpay/gateway/handle-cart-with-amazonpay', $quoteTransfer);
37
    }
38
39
    /**
40
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
41
     *
42
     * @return \Spryker\Shared\Kernel\Transfer\TransferInterface
43
     */
44
    public function addSelectedAddressToQuote(QuoteTransfer $quoteTransfer)
45
    {
46
        return $this->zedStub->call('/amazonpay/gateway/add-selected-address-to-quote', $quoteTransfer);
47
    }
48
49
    /**
50
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
51
     *
52
     * @return \Spryker\Shared\Kernel\Transfer\TransferInterface
53
     */
54
    public function addSelectedShipmentMethodToQuote(QuoteTransfer $quoteTransfer)
55
    {
56
        return $this->zedStub->call(
57
            '/amazonpay/gateway/add-selected-shipment-method-to-quote',
58
            $quoteTransfer
59
        );
60
    }
61
62
    /**
63
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
64
     *
65
     * @return \Spryker\Shared\Kernel\Transfer\TransferInterface
66
     */
67
    public function confirmPurchase(QuoteTransfer $quoteTransfer)
68
    {
69
        return $this->zedStub->call('/amazonpay/gateway/confirm-purchase', $quoteTransfer);
70
    }
71
72
}
73