20 private static $paymentMethodNodeType =
'payment_method';
27 private static $magentoCodeNodeType =
'magento_code';
34 private static $signifydCodeNodeType =
'signifyd_code';
44 $paymentsList += $this->getPaymentMethodMapping($paymentMethod);
58 private function getPaymentMethodMapping(\DOMElement
$payment)
60 $paymentMethodCode = $this->readSubnodeValue(
$payment, self::$magentoCodeNodeType);
61 $signifyPaymentMethodCode = $this->readSubnodeValue(
$payment, self::$signifydCodeNodeType);
63 return [$paymentMethodCode => $signifyPaymentMethodCode];
74 private function readSubnodeValue(\DOMElement
$element, $subNodeType)
76 $domList =
$element->getElementsByTagName($subNodeType);
77 if (empty($domList[0])) {
78 throw new ValidationSchemaException(
__(
'Only single entrance of "%1" node is required.', $subNodeType));
81 $subNodeValue = trim($domList[0]->nodeValue);
83 throw new ValidationSchemaException(
__(
'Not empty value for "%1" node is required.', $subNodeType));