15 use Magento\Payment\Helper\Formatter;
25 private $payflowFacade;
34 $this->payflowFacade = $payflowFacade;
45 public function execute(array $commandSubject)
48 $amount = $commandSubject[
'amount'];
50 $paymentDO = $commandSubject[
'payment'];
53 $storeId = $paymentDO->getOrder()->getStoreId();
54 $this->payflowFacade->setStore(
$storeId);
56 $request = $this->payflowFacade->buildBasicRequest();
64 $token =
$payment->getExtensionAttributes()->getVaultPaymentToken();
69 $response = $this->payflowFacade->postRequest(
$request, $this->payflowFacade->getConfig());
70 $this->payflowFacade->processErrors(
$response);
73 $this->payflowFacade->getResponceValidator()->validate(
$response, $this->payflowFacade);
74 }
catch (LocalizedException $exception) {
76 $this->payflowFacade->void(
$payment);
77 throw new LocalizedException(
__(
"The payment couldn't be processed at this time. Please try again later."));
__construct(Transparent $payflowFacade)
execute(array $commandSubject)