Developer forum

Forum » Development » Applying points to cart after order is passed to payment provider

Applying points to cart after order is passed to payment provider

Dan Tomicic
Reply

Hello Dynamicweb coders,

I'm having issues applying a point discount to an order, which has been passed to eg. credit card payment.

The specific scenario is that a customer has forgotten to apply their loyalty points to the order, and after being passed to payment, goes back and tries to apply their points. The cart then does not update when posted with EcomOrderPointsToUse  untill it is manipulated in another way, eg. changing the quantity of an orderline. (then both the quantity and the discount is applied)

Any ideas on how to approach this or knowledge on why it happens?

DW 9.10.13


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

Hi Dan,

This happens because the order is put into a readonly state once payment processing starts. The reason for this is to prevent the order from being manipulated after the amount is sent to the payment gateway. There are some changes that allow the order to be edited, but it has some consequences. A more thorough explanation and a list of the changes that currently cause an order to be editable can be found here: https://doc.dynamicweb.com/forum/development/development/isprocessingcheckout-not-set-to-false

As you can see, the PointsToUse property isn't on the list which is why you don't see the effect of it until something else changes. Also, since the order is downgraded, the current payment will no longer be able to complete. It could still be accepted by the gateway and funds reserved on the card, but Dynamicweb will not complete the order. This can cause some confusion for customers -- especially if they use multiple tabs in their browser. Lastly, this feature was implemented to support those cases where the order absolutely needs be editable. Due to the consequences, you should really consider whether this is the path you want to persue -- letting customers change the points after payment has started. If you still want to allow this, we can add points to the list.

- Jeppe

Votes for this answer: 1
 
Dan Tomicic
Reply

Hi Jeppe,

Thank you for your clear answer.

I understand there are issues with manipulating an order while it is processing payment. I would argue not being able to add points could also cause confusion.

If changing the quantity of an orderline is allowed, I see no reason not to allow changing of points. Unless I'm missing something :-)

I would love to have it added to the list.

Best regards

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

This has now been implemented and is available in the Dynamicweb.Ecommerce.1.12.42 package. It requires Dynamicweb 9.12 and I realize that you're using 9.10, so I'd recommend that you upgrade to the latest 9.12 and install the package. If that's not possible/feasible for you, I can see about getting it ported to 9.10, but I cannot guarantee that it will happen this side of Christmas/New Year.

- Jeppe

 

You must be logged in to post in the forum