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\Zed\AmazonPay\Business\Api\Adapter; |
9
|
|
|
|
10
|
|
|
use AmazonPay\ClientInterface; |
11
|
|
|
use Generated\Shared\Transfer\AmazonpayCallTransfer; |
|
|
|
|
12
|
|
|
use SprykerEco\Shared\AmazonPay\AmazonPayConfig; |
13
|
|
|
use SprykerEco\Zed\AmazonPay\Business\Api\Converter\ResponseParserConverterInterface; |
14
|
|
|
use SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToMoneyInterface; |
15
|
|
|
|
16
|
|
|
class ConfirmQuoteReferenceAdapter extends AbstractAdapter |
17
|
|
|
{ |
18
|
|
|
/** |
19
|
|
|
* @var \SprykerEco\Shared\AmazonPay\AmazonPayConfig |
20
|
|
|
*/ |
21
|
|
|
protected $sharedConfig; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @param \AmazonPay\ClientInterface $client |
25
|
|
|
* @param \SprykerEco\Zed\AmazonPay\Business\Api\Converter\ResponseParserConverterInterface $converter |
26
|
|
|
* @param \SprykerEco\Zed\AmazonPay\Dependency\Facade\AmazonPayToMoneyInterface $moneyFacade |
27
|
|
|
* @param \SprykerEco\Shared\AmazonPay\AmazonPayConfig $sharedConfig |
28
|
|
|
*/ |
29
|
|
|
public function __construct( |
30
|
|
|
ClientInterface $client, |
31
|
|
|
ResponseParserConverterInterface $converter, |
32
|
|
|
AmazonPayToMoneyInterface $moneyFacade, |
33
|
|
|
AmazonPayConfig $sharedConfig |
34
|
|
|
) { |
35
|
|
|
$this->sharedConfig = $sharedConfig; |
36
|
|
|
|
37
|
|
|
parent::__construct($client, $converter, $moneyFacade); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param \Generated\Shared\Transfer\AmazonpayCallTransfer $amazonpayCallTransfer |
42
|
|
|
* |
43
|
|
|
* @return \Generated\Shared\Transfer\AmazonpayResponseTransfer |
|
|
|
|
44
|
|
|
*/ |
45
|
|
|
public function call(AmazonpayCallTransfer $amazonpayCallTransfer) |
46
|
|
|
{ |
47
|
|
|
$result = $this->client->confirmOrderReference([ |
48
|
|
|
AbstractAdapter::AMAZON_ORDER_REFERENCE_ID => $amazonpayCallTransfer->getAmazonpayPayment()->getOrderReferenceId(), |
49
|
|
|
AbstractAdapter::AMAZON_AMOUNT => $this->getAmount($amazonpayCallTransfer), |
50
|
|
|
AbstractAdapter::AMAZON_SUCCESS_URL => $this->sharedConfig->getSuccessPaymentUrl(), |
51
|
|
|
AbstractAdapter::AMAZON_FAILURE_URL => $this->sharedConfig->getFailurePaymentUrl(), |
52
|
|
|
]); |
53
|
|
|
|
54
|
|
|
return $this->converter->convert($result); |
55
|
|
|
} |
56
|
|
|
} |
57
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths