I think the code supplied can't work with Sagepay Server Integration. I'm not clear about all the actions required but I'm sure Sagepay Server doesn't use an encryption key, it doesn't send all the details as one encrypted item and there are 2 separate loops of transfer of information, not just one redirect and return.
Is this an error? Has there been code here which could work with Sagepay Server or is more work required.

Colin

CommentFileSizeAuthor
#5 sagepay_server-5.patch45.03 KBrlmumford
#4 sagepay_server-4.patch45.18 KBdippers

Comments

aireworth’s picture

Title: Code supplied can't work with Spagepay Server Integration » Code supplied can't work with Sagepay Server Integration
aireworth’s picture

Issue summary: View changes

spelling error in title

ikos’s picture

Hi,

Of the 3 SagePay modules, this one is the least developed and is not production ready yet.

I'm working on it, but in the meantime, have a look at SagePay Form and SagePay Direct.

I'll update this issue as the module work processes.

Richard

aireworth’s picture

I only ask because it seems so out of sync with what's required of Sagepay Server that I thought it might have been a mistake, that the wrong code might have been posted. I use Sagepay Server as (opposed to Form or Direct) mostly because we don't need the same level of PCI DSS compliance with Server, so they're no good to me - sorry.

I've managed to get Leopitt's Sagepay Server for Ubercart migrated and working on Ubercart 3 Drupal 7. The internals of that seem to work well with the Sagepay side of things. If this module is still early work in progress I'll have a go at migrating that to Commerce.

Colin

dippers’s picture

Status: Active » Needs review
StatusFileSize
new45.18 KB

This module needed a compete rewrite to make it work with SagePay server protocol v2.23. The attached patch is a working version which is currently undergoing testing on a commerce site.

rlmumford’s picture

Status: Needs review » Patch (to be ported)
StatusFileSize
new45.03 KB

Applied that patch and can confirm that it works well. Here is a version without white-space errors:

thewelshmike’s picture

How do I apply the patch? I've tried in Net beans, but says it cannot apply in this context.

M

rlmumford’s picture

in Unix systems you can do patch -p0 file.patch or git apply file.patch

rlmumford’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

We've been using this for several months now without any problems

NecroHill’s picture

I have applied this patch but receive an error message at sagepay transaction report: "Transaction completed but Vendor systems returned INVALID or ERROR in response to notification POST. Transaction CANCELLED by the Vendor."
same error on live and test servers.

no error messages at watchdog report.

ikos’s picture

Hi,

I have been working on a rewrite to the module for a project so I've finally been able to give it some proper attention. I'll be pushing new code up on Monday which incorporates code from the posted patch and also many other changes.

If anyone is able to test it, I'd appreciate the feedback and we can try to get to a 1.0 release.

many thanks

Richard

NecroHill’s picture

Hi Richard, thank you for your work.
have you pushed the new code yet? I tried to play with the most recent dev version today but still receiving this message at sagepay transaction report: "Transaction completed but Vendor systems returned INVALID or ERROR in response to notification POST. Transaction CANCELLED by the Vendor."
I've added some code from uc_sagepayserver module to your previous dev version:

$transaction->status = COMMERCE_PAYMENT_STATUS_SUCCESS;
$transaction->message = 'OK';
$status = "OK";
$reason = 'OK';
$data['Status'] = 'OK';
$data['RedirectURL'] = url('checkout/' . $order->order_id . '/payment/return/' . $order->data['payment_redirect_key']);
echo _commerce_sagepayserver_encode_response($data);
watchdog('commerce_sagepay', 'Transaction was ok for order %order_id', array('%order_id' => $order->order_id), WATCHDOG_INFO);

and

/**
 * Encode the notification response data into the appropriate format for Sagepay
 */
function _commerce_sagepayserver_encode_response($data) {
$output = '';
foreach ($data as $key => $value) {
$output .= $key . "=" . $value . "\r\n";
}
return $output;
}

and live transactions went through just fine but I am not a php programmer and not sure that it was a right approach )
another issue I see is that all discounts applied displayed as negative Item tax value at SagePay, not a big deal but confusing.

rlmumford

We've been using this for several months now without any problems

how thats possible? on live server? no errors?

ikos’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Hi,

The latest -dev version is working well now and is being used in a few production sites that I am aware of.

Can you see if this is working ok for you now and I can close this issue and get an official release rolled.

many thanks

Richard

ikos’s picture

Issue summary: View changes

typos again