Utilizing the Transaction during Checkout process

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 14 ans
Hi guys,

I just spot one issue with nopCommerce. that is I could not find any method or function which utilizes the transaction (begin trans, end trans, commit, rollback, etc). especially in the checkout process. obviously it is more than serious if the transaction model could not implemented into it. even not to say the enterprise edition.

anyone has any idea with it? or maybe i am wrong with it?


Regards
Dave
Il y a 14 ans
Find the following comment in the source code "uncomment this line to support transactions". Then uncomment the source code below (such as "scope.Complete()").
Il y a 14 ans
Hi Andrei,

That is great of your reply.  I do find the comment line in V1.5.
Since I am still with V1.4, I wonder whether it is possible to implement the same way in V1.4 to achieve the transactions (like scope etc).

Anyway thank you for your great product.

Cheers
Dave
Il y a 14 ans
espresso74 wrote:
Since I am still with V1.4, I wonder whether it is possible to implement the same way in V1.4 to achieve the transactions (like scope etc).

Yes, but you'll have to manually add transaction support
Il y a 14 ans
yes, i already implemented the same way into V1.4 in the function of PlaceOrder.

however I have a worry thing, let me explain to you.

PaymentManager.ProcessPayment(paymentInfo, customer, OrderGuid, ref processPaymentResult);

using (var scope = new System.Transactions.TransactionScope())
  {

     var order = InsertOrder(OrderGuid, ......);
     ...
     scope.complete();
  }


obviously the ProcessPayment function is beyond the Transaction Scope, which means theoretically it gonna happy when the payment has been done, but could not place the order into database. I know it is very almost not happening. but it does exists.


Cheers
Dave
Il y a 14 ans
espresso74 wrote:
obviously the ProcessPayment function is beyond the Transaction Scope, which means theoretically it gonna happy when the payment has been done, but could not place the order into database.

It's an issue. We haven't found a good solution yet.
Il y a 14 ans
Yes, i know it is pretty hard to cope with this scenario.

I could possible think of a way to cope with it

   Execute the PlaceOrder function (without payment process, just InserOrder etc) (this could be done in frontend or backend) and manually Map the OrderGuid (previously returned from PaymentProcess, cannot get it from the database, maybe have to approach the Payment Gateway or financial provider, bank etc) into the Order table.

   This could be fine under the condition of the customer has not yet change their shopping cart, otherwise have to refund the customer.

Cheers
Dave
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.