On Thu, Sep 18, 2008 at 1:16 AM, Bojan Mihelac <[EMAIL PROTECTED]> wrote:
> > Hello all, > > I am working on integrating new payment module in satchmo. If you are on trunk, you are going to want to closely watch the checkins today or tomorrow to see the newly cleaned-up and easier-to-use checkout/payment system. This will only affect you if you are using custom views. If you are using satchmo.payment.common.views.confirm.credit_confirm_info without modification, then this will not require any changes, as it is backwards-compatible. Most payment gateways use that function, and did not require any updates. > When > payment gateway notify shop that payment is succesful I am doing > following actions with order and tempCart: > > record_payment (from payment.common.utils) Good, but out of order. Pending must be on the order for record_payment to work. > > order.add_status(status='Pending', notes = "Order successfully > submitted") You should be using: payment.common.utils.create_pending_payment instead of manually doing the Pending assignment, and in any case "record_payment" requires the pending statement first > > tempCart.empty() > for item in order.orderitem_set.all(): product = item.product; > product.total_sold += item.quantity; product.items_in_stock -= > item.quantity; product.save() > del request.session['orderID'] > Use payment.common.views.success to do this unless you have good reason not to. Also, this functionality will soon be moving back into the Product objects, as it is not appropriate for views to be doing this. -- Bruce Kroeze http://solidsitesolutions.com Dynamic Designs, Optimized --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en -~----------~----~----~----~------~----~------~--~---
