|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Payone\Core\Model\Api\Request\Genericpayment; |
|
4
|
|
|
|
|
5
|
|
|
use Payone\Core\Model\Methods\PayoneMethod; |
|
6
|
|
|
use Payone\Core\Model\Methods\PaypalV2; |
|
7
|
|
|
use Payone\Core\Model\PayoneConfig; |
|
8
|
|
|
use Magento\Quote\Model\Quote; |
|
|
|
|
|
|
9
|
|
|
|
|
10
|
|
|
class UpdateOrder extends Base |
|
11
|
|
|
{ |
|
12
|
|
|
/** |
|
13
|
|
|
* Invoice generator |
|
14
|
|
|
* |
|
15
|
|
|
* @var \Payone\Core\Model\Api\Invoice |
|
16
|
|
|
*/ |
|
17
|
|
|
protected $invoiceGenerator; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Constructor |
|
21
|
|
|
* |
|
22
|
|
|
* @param \Payone\Core\Helper\Shop $shopHelper |
|
23
|
|
|
* @param \Payone\Core\Helper\Environment $environmentHelper |
|
24
|
|
|
* @param \Payone\Core\Helper\Api $apiHelper |
|
25
|
|
|
* @param \Payone\Core\Helper\Toolkit $toolkitHelper |
|
26
|
|
|
* @param \Payone\Core\Model\ResourceModel\ApiLog $apiLog |
|
27
|
|
|
* @param \Payone\Core\Helper\Customer $customerHelper |
|
28
|
|
|
* @param \Payone\Core\Model\Api\Invoice $invoiceGenerator |
|
29
|
|
|
*/ |
|
30
|
|
|
public function __construct( |
|
31
|
|
|
\Payone\Core\Helper\Shop $shopHelper, |
|
32
|
|
|
\Payone\Core\Helper\Environment $environmentHelper, |
|
33
|
|
|
\Payone\Core\Helper\Api $apiHelper, |
|
34
|
|
|
\Payone\Core\Helper\Toolkit $toolkitHelper, |
|
35
|
|
|
\Payone\Core\Model\ResourceModel\ApiLog $apiLog, |
|
36
|
|
|
\Payone\Core\Helper\Customer $customerHelper, |
|
37
|
|
|
\Payone\Core\Model\Api\Invoice $invoiceGenerator |
|
38
|
|
|
) { |
|
39
|
|
|
parent::__construct($shopHelper, $environmentHelper, $apiHelper, $toolkitHelper, $apiLog, $customerHelper); |
|
40
|
|
|
$this->invoiceGenerator = $invoiceGenerator; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Send request to PAYONE Server-API with |
|
45
|
|
|
* request-type "genericpayment" |
|
46
|
|
|
* |
|
47
|
|
|
* @param Quote $oQuote |
|
48
|
|
|
* @param PayoneMethod $oPayment |
|
49
|
|
|
* @param string|bool $sWorkorderId |
|
50
|
|
|
* @return array Response |
|
51
|
|
|
*/ |
|
52
|
|
|
public function sendRequest(Quote $oQuote, PayoneMethod $oPayment, $sWorkorderId = false) |
|
53
|
|
|
{ |
|
54
|
|
|
$this->addParameter('request', 'genericpayment'); |
|
55
|
|
|
$this->addParameter('add_paydata[action]', 'update_order'); |
|
56
|
|
|
$this->addParameter('workorderid', $sWorkorderId); |
|
57
|
|
|
$this->addParameter('mode', $oPayment->getOperationMode()); |
|
58
|
|
|
$this->addParameter('aid', $this->shopHelper->getConfigParam('aid')); // ID of PayOne Sub-Account |
|
59
|
|
|
$this->addParameter('clearingtype', $oPayment->getClearingtype()); |
|
60
|
|
|
$this->addParameter('wallettype', $oPayment->getWallettype()); |
|
61
|
|
|
|
|
62
|
|
|
$this->addParameter('amount', number_format($this->apiHelper->getQuoteAmount($oQuote), 2, '.', '') * 100); // add price to request |
|
63
|
|
|
$this->addParameter('currency', $this->apiHelper->getCurrencyFromQuote($oQuote)); // add currency to request |
|
64
|
|
|
|
|
65
|
|
|
$this->addParameter('add_paydata[payment_action]', $oPayment->getAuthorizationMode() == PayoneConfig::REQUEST_TYPE_AUTHORIZATION ? 'Capture' : 'Authorize'); # Is either Capture (for Authorization call) or Authorize (for preauthorization call) |
|
66
|
|
|
$this->addParameter('add_paydata[request_id]', 'TODO'); |
|
67
|
|
|
|
|
68
|
|
|
$this->addRedirectUrls($oPayment); |
|
69
|
|
|
|
|
70
|
|
|
$this->invoiceGenerator->addProductInfo($this, $oQuote); |
|
71
|
|
|
|
|
72
|
|
|
return $this->send($oPayment); |
|
73
|
|
|
} |
|
74
|
|
|
} |
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