public function validateData(Order $order, array $data)
{
$result = ValidationResult::create();
if (!isset($data['PaymentMethod'])) {
$result->error(_t('PaymentCheckoutComponent.NoPaymentMethod', "Payment method not provided"), "PaymentMethod");
throw new ValidationException($result);
}
$methods = GatewayInfo::getSupportedGateways();
if (!isset($methods[$data['PaymentMethod']])) {
$result->error(_t('PaymentCheckoutComponent.UnsupportedGateway', "Gateway not supported"), "PaymentMethod");
throw new ValidationException($result);
}
}