Which eWay are you implementing?
We have used eWAY Rapid Direct with no issues for over a year now with Commerce.
They key most people seem to miss is that you must implement the CSE - Client Side Encryption part of the eWay process before the gateway submission to eWay will wok. This is documented by eWay here:
https://eway.io/api-v3/#how-it-works
In essense you just need to include some JS on your payment form page. On that page you accept the card number etc pretty much as normal, but before you pass it to eway is must be encrypted on the client machine. Here's some scrappy JS to show what I mean first include the eWay JS:
{# Include EWAY CSE JS #}
{% if craft.config.devMode %}
<script src="https://secure.ewaypayments.com/scripts/eCrypt.debug.js"></script>
{% else %}
<script src="https://secure.ewaypayments.com/scripts/eCrypt.js"></script>
{% endif %}
...and in your payment form have something like this as you will need it later (I store my key in the commerce config file so I can set a dev vs live one based on environment, but you could jstu hardcode it below or whatever):
{% set paymentMethods = craft.commerce.paymentMethods %}
<input type="hidden" name="CSEKey" value="{{ paymentMethods[1].settings.CSEKey }}">
Then, you need to deal with the actual encryption side of things...something like this should do it for you:
var method = $('input[name=paymentMethodId]:checked', '#submitOrder').val();
if (method == 1) {
// EWAY Client Side Encryption - See https://eway.io/api-v3/#encrypt-function
// EWAY CSE - encrypt the card number and the CCV on the client's machine so it's never seen by us or anyone else.
// Pull the values from the test input fields (fake*)
// and inject the encrypted version into the real fields
var $fakeCardNumber = $("#fakeNumber");
var $fakeCcv = $("#fakeCvv");
var $cardNumber = $("input[name=encryptedCardNumber]");
var $ccv = $("input[name=encryptedCardCvv]");
// get the unencrypted values and remove all spaces from the numbers
var cardNumber = $fakeCardNumber.val().replace(/\s/g, "");
var ccv = $fakeCcv.val().replace(/\s/g, "");
// and now re-set them to the encrypted values if these are actually filled in
if (cardNumber) {
$cardNumber.val(eCrypt.encryptValue(cardNumber, CSEKey));
}
if (ccv) {
$ccv.val(eCrypt.encryptValue(ccv, CSEKey));
}
}
That's not the most beautiful code, but I think once you've implemented that (which you need tom to be compliant with eWay) - you will find things drop into place easily enough from there.