for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Apache OSL-2
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
*/
namespace SprykerEco\Zed\Amazonpay\Business\Payment\Handler\Transaction;
use Generated\Shared\Transfer\AmazonpayCallTransfer;
use SprykerEco\Shared\Amazonpay\AmazonpayConstants;
class CancelOrderTransaction extends AbstractAmazonpayTransaction
{
* @param \Generated\Shared\Transfer\AmazonpayCallTransfer $amazonpayCallTransfer
*
* @return \Generated\Shared\Transfer\AmazonpayCallTransfer
public function execute(AmazonpayCallTransfer $amazonpayCallTransfer)
$amazonpayCallTransfer = parent::execute($amazonpayCallTransfer);
if ($this->paymentEntity) {
$isPartialProcessing = $this->isPartialProcessing($this->paymentEntity, $amazonpayCallTransfer);
if (!$this->apiResponse->getHeader()->getIsSuccess()) {
return $amazonpayCallTransfer;
}
if ($isPartialProcessing) {
$this->paymentEntity = $this->duplicatePaymentEntity($this->paymentEntity);
$this->paymentEntity->setStatus(AmazonpayConstants::OMS_STATUS_CANCELLED);
$this->paymentEntity->save();
$this->assignAmazonpayPaymentToItemsIfNew($this->paymentEntity, $amazonpayCallTransfer);
* @return bool
protected function allowPartialProcessing()
return false;