Ошибка в пользовательском переопределении DibsPaymentMethodService ProcessCallback

Я пытаюсь настроить диалог между uCommerce и DIBS, чтобы разрешить регистрацию билетов.

До сих пор мне удалось скопировать DibsPageBuilder и добавить параметр maketicket. Однако мне нужно настроить обратный вызов, сделанный для функции ProcessCallcack в классе DibsPaymentMethodService.

Я тщательно скопировал ProcessCallback и его содержимое и добавил его в свой пользовательский класс, но когда я запускаю конвейер извлечения, я получаю следующую ошибку:

 UCommerce.Pipelines.PipelineException: Exception occoured while processing pipeline 
'UCommerce.Pipelines.Checkout.CheckoutPipeline'. See inner exception for details. 
 ---> System.Security.SecurityException: Payment insufficient to cover order total 
 for OrderGuid xxx. Please ensure that payments cover the entire value of the order 
 before checking out. at 
 Commerce.Pipelines.Checkout.ValidatePaymentsMadeAgainstOrderTotalTask.Execute(PurchaseOrder subject) 
 at UCommerce.Pipelines.Pipeline`1.Execute(T subject) --- End of inner exception 
 stack trace ---...

Я не понимаю, почему конвейер извлечения не удается, когда я вручную перезаписываю ProcessCallback тем же кодом, из которого обычно делается функция. Другими словами, если я не переопределю ProcessCallback, функция будет работать гладко, но тогда я не смогу выполнить настройку. Я должен сказать, что ошибка происходит, прежде чем я что-то настраиваю.

Моя текущая платформа uCommerce работает под управлением версии 2.6.1. Код, который я скопировал:

 public override void ProcessCallback(Payment payment)
 {
    if (payment.PaymentStatusId != 10000001)
            return;
    DibsPaymentMethodServiceConfigurationSection instance = 
            DibsPaymentMethodServiceConfigurationSection.Instance;
    string s = HttpContext.Current.Request["transact"];
    if (string.IsNullOrEmpty(s))
            throw new ArgumentException("transact must be present in query string.");
    int result;
    if (!int.TryParse(s, out result))
            throw new FormatException("transact must be a valid int32");
    PaymentStatusCode paymentStatusCode = PaymentStatusCode.Authorized;
    if (instance.UseMd5)
    {
            string parameter1 = this.GetParameter("authkey", "When using md5 \"{0}\" cannot be null or empty", new string[1]
            {
            "authkey"
            });
            string parameter2 = this.GetParameter("currency", "When using md5 \"{0}\" cannot be null or empty", new string[1]
            {
            "currency"
            });
            string parameter3 = this.GetParameter("amount", "When using md5 \"{0}\" cannot be null or empty", new string[1]
            {
            "amount"
            });
            int currencyNumber = new CurrencyCodeTranslater().FromIsoCode(parameter2);
            string postMd5Key = new DibsMd5Computer().GetPostMd5Key(result.ToString(), parameter3, currencyNumber);
            if (!parameter1.Equals(postMd5Key))
                   paymentStatusCode = PaymentStatusCode.Declined;
    }
    payment.PaymentStatus = PaymentStatus.Get((object) paymentStatusCode);
    payment.TransactionId = result.ToString();
    this.ProcessPaymentRequest(new PaymentRequest(payment.PurchaseOrder, payment));
}

Спасибо заранее.

/ brinck10

0 ответов

Другие вопросы по тегам