Closed (duplicate)
Project:
Ubercart Atos/Sips
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Jan 2010 at 14:22 UTC
Updated:
26 Apr 2010 at 16:30 UTC
I'm using Ubercart Atos/Sips Credit Card payment with ubercart 2.2 and mercanet (bnp paribas services)
For some of my orders, when the user come back grom the banks site, everything is fine, I get this in the order comments:
In checkout Order paid via website with Ubercart ATOS/SIPS
Pending The user came back from the bank site and validated the payment with ATOS/SIPS
And this is the admin comments
The stock level for CD1387 has been decreased to 35.
Order created through website.
But for other orders, I think that the user don't click on the return button, I get this in the order comments:
In checkout Order paid via website with Ubercart ATOS/SIPS
And this is the admin comments
This order has no admin comments associated with it.
Does someone see where things could be wrong ?
thanks
Comments
Comment #1
eme commentedSimple : some clients come back from the store, clicking on "back to the store" (retour à la boutique), and then the order is validated.
But the order is not validated for the others that do not come back. This is a huge issue.
Are you using 3D Secure? Cause everything worked well till I went to 3D Secure : then there is no "autoresponse" : you have to come back to validate, which is not an excellent thing...
Comment #2
hades666evil commentedTo solve this issue I've added
uc_cart_complete_sale($order);Just after
uc_payment_enter($order->order_id, 'atos', $response['amount'] / 100, $user->uid, array('authorisation_id' => $response['authorisation_id'], 'autoresponse' => $autoresponse), $message);And removed
uc_order_update_status($order->order_id, uc_order_state_default('post_checkout'));Then, the order is set to "payment received" immediately, the stock is decreased, but to not have a double stock decreasing (same issue for paypal IPN), in conditionnal actions, under the "Customer completes checkout" Trigger, for each predicate, I check that the order status is "In checkout".
Because if not, when the customer return to the shop by clicking on the return button from the payment form, the order is recompleted.
Comment #3
eme commentedBut if I understand well, it means that your stock will be decreased even if the customer eventually do not pay. And your order is officially validated even if it is not paid... How do you know if it has been really paid?
So I'll go to your shop and validate averything but the payment on the bank server!
Comment #4
hades666evil commentedat this state, the payment is considered as validated, isn't it ?
All checks are done above :
Comment #5
eme commentedI'll study this as I have a similar issue. I would say that your method has drawbacks.
I'll tell you more later on.
Comment #6
eme commentedWell it seems your are entirely right : you spotted the right line. Indeed the order is definitely validated at this stage.
About your double decreased stock, I understand the issue : your order is validated twice : once when the user is back to cart/checkout/complete and once with you calling uc_cart_complete_sale($order) with the autoresponse.
One interesting thing with your way is that by calling uc_cart_complete_sale($order) you create the user associated to the order if the user do not exist, which is not the case I think with the other way. We'll have to check what is triggered when this function is called twice (which is not normal, but I think it is fine).
Is it all right for you? I mean do the customer goes back to cart/checkout/complete or do they land on just cart?
See also http://drupal.org/node/338079, which would be related to this.
Comment #7
hades666evil commentedMy website is running, and everything seems to go well
About the user account creation, I can't really tell about what is going on because I don't allow unregistered user to order
Comment #8
anrikun commentedThis is a duplicate of #338079: Order user ID == 0 if autoresponse.