Hello, I've implimented a few e-commerce sites using uCommerce 2. To save time, I've created a few different libraries out to help manage the basket and perform updates. I've also created a custom Payment Method Service as described in the following tutorial.
In uCommerce 3, I noticed that I had to make some modifications to my libraries as some methods have changed. In my shopping cart, when I get to the end of the checkout process, I execute:
UCommerce.Xslt.Library.Checkout();
However, I get an error: Payment insufficient to cover order total for OrderGuid
39c8e04b-81e1-4c69-85f1-8bd1393673c2. Please ensure that payments cover
the entire value of the order before checking out.
My question is, has something changed in uCommerce 3 that I need to impliment with my custom Payment Method Service? Is there something else I need to perform before I checkout? I do execute UCommerce.Xslt.Library.ExecuteBasketPipeline(); to make sure that everything has been updated.
Thanks @Nickolaj for the link - I'm not sure how I didn't find that. It still doesn't appear to solve my problem, but it may be something unrelated all toghether. I'll update this status shortly.
With the error now stating: "not-null property references a null or transient value UCommerce.EntitiesV2.Payment.PaymentMethodName." I have tried to explicitly set this in my custom PaymentMethodService under CreatePayment, however it doesn't appear to change this error in this context.
public Payment CreatePayment(PaymentRequest request) { var payment = new Payment { TransactionId = Guid.NewGuid().ToString(), PaymentMethod = request.PaymentMethod, PaymentMethodName = request.PaymentMethod.Name, Created = DateTime.Now, Fee = CalculatePaymentFee(request).Value, FeePercentage = request.PaymentMethod.FeePercent, PaymentStatus = PaymentStatus.SingleOrDefault(x => x.Name == "Authorized"), Amount = request.Amount.Value };
I found the issue. It had to do with an incorrect configuration with my custom payment service. In the DB, I had an incorrect value for PaymentMethodServiceName (there were spaces). Updating this solved my issues.
uCommerce 3 and UCommerce.Xslt.Library.Checkout()
Hello, I've implimented a few e-commerce sites using uCommerce 2. To save time, I've created a few different libraries out to help manage the basket and perform updates. I've also created a custom Payment Method Service as described in the following tutorial.
In uCommerce 3, I noticed that I had to make some modifications to my libraries as some methods have changed. In my shopping cart, when I get to the end of the checkout process, I execute:
UCommerce.Xslt.Library.Checkout();
However, I get an error: Payment insufficient to cover order total for OrderGuid 39c8e04b-81e1-4c69-85f1-8bd1393673c2. Please ensure that payments cover the entire value of the order before checking out.
My question is, has something changed in uCommerce 3 that I need to impliment with my custom Payment Method Service? Is there something else I need to perform before I checkout? I do execute UCommerce.Xslt.Library.ExecuteBasketPipeline(); to make sure that everything has been updated.
Maybe it's the same problem as this guy:
http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/34239-Payment-insufficient-to-cover-order-total-(When-using-no-payment)
(sorry about the link - you have to copy paste it)
Thanks @Nickolaj for the link - I'm not sure how I didn't find that. It still doesn't appear to solve my problem, but it may be something unrelated all toghether. I'll update this status shortly.
I'm starting to narrow this down to an error that happens during Library.CreatePayment(). The code that I'm using is the following:
PaymentMethod method = PaymentMethod.SingleOrDefault(x => x.PaymentMethodId == helper.DefaultPaymentMethodID);
decimal total = orderbasket.PurchaseOrder.OrderTotal != null ? (decimal)orderbasket.PurchaseOrder.OrderTotal : 0.00M;
Library.CreatePayment(method.PaymentMethodId, total, true, false);
With the error now stating: "not-null property references a null or transient value UCommerce.EntitiesV2.Payment.PaymentMethodName." I have tried to explicitly set this in my custom PaymentMethodService under CreatePayment, however it doesn't appear to change this error in this context.
public Payment CreatePayment(PaymentRequest request)
{
var payment = new Payment
{
TransactionId = Guid.NewGuid().ToString(),
PaymentMethod = request.PaymentMethod,
PaymentMethodName = request.PaymentMethod.Name,
Created = DateTime.Now,
Fee = CalculatePaymentFee(request).Value,
FeePercentage = request.PaymentMethod.FeePercent,
PaymentStatus = PaymentStatus.SingleOrDefault(x => x.Name == "Authorized"),
Amount = request.Amount.Value
};
return payment;
}
I found the issue. It had to do with an incorrect configuration with my custom payment service. In the DB, I had an incorrect value for PaymentMethodServiceName (there were spaces). Updating this solved my issues.
is working on a reply...