I'm running Commerce Kickstart 7.x-2.21 with Drupal 7.36 (tried upgrading but too many bugs) on a VPS, CentOS linux 6.0, Apache, PHP 5.3.3. I installed and enabled the eway_integration-7.x-1.2 module and attempted to test my Commerce Kickstart 2 checkout with my eWAY sandbox. I go through the checkout process and fill in the CC details on the Review pane. All good until I click 'continue to next step' and then I get this error - 'Payment failed due to eWAY connection issues'. I checked the module's code (eway_integration_commerce_module) and found the function where the error gets thrown. It starts at line 45:

function eway_integration_commerce_transaction($method_id = '', $payment_method, $payment, $configs, $order, $charge) {
if (empty($method_id)) {
return FALSE;
}

// Submit the request to eWAY.
$response = eway_integration_commerce_api_request($payment, $configs, $payment_method, $order);

$transaction = commerce_payment_transaction_new($method_id, $order->order_id);
$transaction->instance_id = $payment_method['instance_id'];
$transaction->amount = $charge['amount'];
$transaction->currency_code = $charge['currency_code'];
$transaction->remote_id = (string) isset($response->TransactionID) ? $response->TransactionID : '';
$transaction->remote_status = (string) isset($response->ResponseCode) ? $response->ResponseCode : '';
$transaction->payload = print_r($response, TRUE);

if ($response && isset($response->status)) {
if ($response->TransactionStatus) {
$message = t('Payment Successful : ') . implode(",", $response->status);
$transaction->status = COMMERCE_PAYMENT_STATUS_SUCCESS;
}
else {
$message = t('Payment failed: ') . implode(",", $response->status);
drupal_set_message($message, 'error');
$transaction->status = COMMERCE_PAYMENT_STATUS_FAILURE;
}
}
else {
$message = t('Payment failed due to eWAY connection issues');
if (isset($response->ErrorPhases)) {
$message = $message . ' - ' . implode(",", $response->ErrorPhases);
}
drupal_set_message($message, 'error');
$transaction->status = COMMERCE_PAYMENT_STATUS_FAILURE;
}

$transaction->message = $message;
commerce_payment_transaction_save($transaction);
return $transaction;
}

The process does not move on to the next step 'Checkout complete' pane but stays in 'Review'. On my MYeWAY page, I can see that eWAY is recieving the request and the transaction result shows 'successful.' All good on that end, and I've checked with the support staff who have confirmed that the problem is not with them. eWAY also sends back the payload and other info. But here's what I get:

Transaction ID 288
Order 6
Payment method eWAY Direct Connection
Remote ID -
Message Payment failed due to eWAY connection issues
Amount $24.95 AUD
Status Failure
Remote status
Created 18 May, 2015 - 12:34
Payload

{"AuthorisationCode":"1111111","ResponseCode":"00","ResponseMessage":"A2000","TransactionID":11558088,"TransactionStatus":true,"TransactionType":"Purchase","BeagleScore":0,"Verification":{"CVN":0,"Address":0,"Email":0,"Mobile":0,"Phone":0},"Customer":{"CardDetails":{"Number":"444433XXXXXX1111","Name":"myfirstname mylastname","ExpiryMonth":"05","ExpiryYear":"16","StartMonth":null,"StartYear":null,"IssueNumber":null},"TokenCustomerID":null,"Reference":"1","Title":"Mr.","FirstName":"myfirstname","LastName":"mylastname","CompanyName":"","JobDescription":"","Street1":"10 Foo Street","Street2":"","City":"Foo City","State":"NSW","PostalCode":"2000","Country":"au","Email":"webmaster@mydomain.com.au","Phone":"","Mobile":"","Comments":"1x 9781611800920","Fax":"","Url":""},"Payment":{"TotalAmount":2495,"InvoiceNumber":"6","InvoiceDescription":"","InvoiceReference":"6","CurrencyCode":"AUD"},"Errors":null}

See attached images for more info.

There is nothing revealing in watchdog and no errors on my server logs to throw any light on this problem.
Am I missing something really obvious here? This is my first ecommerce site.

Much appreciate any feedback.

Comments

KShips’s picture

I'm getting 'Payment failed due to eWAY connection issues' although nothing is showing up on eways end either. Nothing in logs.

Also newbie, maybe I'm missing something but not sure what to try now.

carpenii’s picture

I am having the same problem with eWAY integration when I run it on my live server, however it works OK when run in my VMWare instance of Ubuntu.

I am a newbie with regards PHP programming but I did run a debugger on the two server instances mentioned. With my local server the $response variable comes back from the eway_integration_commerce_api_request() function call as an object(stdClass) whereas from my online server it comes back as a string. As a string $response->status is undefined and hence the code above gives COMMERCE_PAYMENT_STATUS_FAILURE.

Further to the patch below I found that php://temp still did not work. Looking at PHP.net at bug52820 (https://bugs.php.net/bug.php?id=52820) I see that it seems to have been fixed after (or at) php version 5.3.3. So if this is a problem you are experiencing check the version of PHP your server is using.

pandaski’s picture

Assigned: Unassigned » pandaski
Priority: Major » Critical
Status: Active » Needs work
StatusFileSize
new741 bytes

There is a very old bug at PHP.net

https://bugs.php.net/bug.php?id=43468

I did a patch here which adds a fallback if CURL cannot work with php://memory

  • Joseph Zhao committed c9c7b2d on 7.x-1.x
    Issue #2490430: Payment failed due to eWAY connection issues
    
pandaski’s picture

Status: Needs work » Closed (fixed)
developmenticon’s picture

I am getting same issue "Payment failed due to eWAY connection issues" in Drupal 7.x with Sandbox account, I have checked log but there is no response data. even curl have been enabled, I am using 5.5.9-1ubuntu4.21 and testing this on local localhost. What I am doing wrong ?

localnetwork’s picture

Needs your support. Still got the error says " Payment failed due to eWay connection issues: Invalid ProcessRequest CVN". On the checkout process.

localnetwork’s picture

Parent issue: » #2490430: Payment failed due to eWAY connection issues
StatusFileSize
new32.47 KB
mnrvr’s picture

This error seems to be still causing problems, so this module does not seem currently usable.

- Fails in PHP 5.5.38 Apache/2.2.15 (Unix)
- Fails in PHP 5.4.45 Apache/2.2.15 (Unix)
- Fails under both SSL and non-SSL configuration

Same error as above: 'Payment failed due to eWAY connection issues' using eWAY Sandbox a/c
eWAY support staff confirm that the request is not reaching their system.

Oddly, the identical code/configuration setup works fine on a local system - OSX 10.9.5, Apache/2.2.29, PHP 5.4.35 (Brew install)
Transactions appear in the eWAY sandbox using identical test CC info.

In both cases
- commerce_payment_eway_dc: enabled
- Client Side Encryption: turned off
- Require credit card security code (i.e. CVV): enabled
- emulation for PCI-approved turned on in eWAY Sandbox

inteja’s picture

Same issue here and the patch in #4 doesn't apply to either 7.x-1.8 or dev.

Did anyone else manage to fix this?

montesajudy’s picture

Make sure to double check the API keys you are using if you are in sandbox or production mode.

I was having this error also while in sandbox, double checked if I was using the sandbox api, was not, I changed it, then boom, FIXED.