Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am having been struggling to set up my first payment gateway in Merchello...
My client has gone for SagePay (Form Integration), and I have been attempting to work from the posts here and here (Thanks Barry, Chris & Gordon!) in order to get my checkout process complete.
Thus far I have:
After this, I attempt AuthorizePayment, and I receive an error message that says:
SagePay: request initialization error: Specified initialization vector (IV) does not match the block size for this algorithm.
I also am not sure how to validate the payment after the user has completed their checkout on SagePay. I presume there is a callback URL, we have to receive the Invoice Key back from the return call and mark it as paid? I can't find anything that shows how to do this...
Any help much appreciated! :)
Here is my controller code:
public ActionResult ConfirmSagePayPayment()
var preparation = Basket.SalePreparation();
preparation.RaiseCustomerEvents = false;
// PAYMENT - Only one payment method so auto-select it (SagePay)
var paymentGatewayMethod = MerchelloContext.Current.Gateways.Payment.GetPaymentGatewayMethods().FirstOrDefault();
var paymentMethod = Payment.GetPaymentGatewayMethodByKey(paymentGatewayMethod.PaymentMethod.Key).PaymentMethod;
// AuthorizePayment will save the invoice with an Invoice Number.
var attempt = PerformProcessPayment(preparation, paymentMethod);
// store the invoice key in the CustomerContext for use on the receipt page.
if (attempt.Payment.Result.ExtendedData != null && attempt.Payment.Result.ExtendedData.ContainsKey("SagePayPaymentUrl"))
return new RedirectResult(attempt.Payment.Result.ExtendedData["SagePayPaymentUrl"]);
var nullref = new NullReferenceException("SagePay payment URL not found in extended data");
LogHelper.Error<CheckoutController>("SagePay payment URL not found in extended data", nullref);
protected IPaymentResult PerformProcessPayment(SalePreparationBase preparation, IPaymentMethod paymentMethod)
This is resolved now. I downloaded the source for Merchello.Plugin.Payments..SagePay and went into debug...
Turns out I had an incorrect encryption password in my backoffice settings 😳
So, if anyone else has this same error message... check your encryption password in the back office settings!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted