-
Notifications
You must be signed in to change notification settings - Fork 141
After returning from PayPal, Validation fails, "State can't be blank" #58
Comments
Same issue here. Have you already solved this problem? |
The missing "State" attribute refers to address, not to a state machine model. Looking deeper... |
I upgraded to 1.0 and was hoping it might solve the issue, which I have only seen with one customer. One problem is that I can't reproduce the error. Later today, I will take a look at my production logs to see if the issue has recurred. |
The issue has recurred ... this time with a customer from Norway. It looks to me that the error must be raised when the checkout controller assigns the returning PayPal address to @order.ship_address and then tries to save it. One way to fix would be to check whether the returning state is blank, and if so, to skip changing the ship_address. Actually, I think my preferred solution would be to eliminate the overwriting of the Spree shipping address altogether. In my experience, the Spree address is more likely to be correct, since they must enter it at the time of order - while it is more difficult to change a PayPal address, which is stored over a longer period of time. Or, at least, if we are going to override what they entered, we should ideally give them the opportunity to confirm that. |
Ok, so setting "No shipping" via admin interface will solve the issue. |
I have this issue today ... but it happens only when selecting credit card in Paypal account .. It seems that using CreditCard in Paypal is returning user infos ( address ) without the 'state' info |
sorry I may have posted in the wrong git .. should have posted it in Spree .. but it's related ... |
@kennyadsl Can you elaborate on the effects of changing |
@jumph4x As far as I can remember ( it's a 8 months ago comment :) ) setting to |
I have a customer in Germany who successfully goes to PayPal and completes the order there, but upon returning to our site, she gets redirected to her cart, which still has a "payment" state and looks full to her.
In production.log, on the return from PayPal, an Unprocessable Entity error is raised because an ActiveRecord validation (that state can't be blank) fails:
I assume that the state in question is the one in the address, not the one in the state_machine. But my customer has an entry for :state_name in both billing and shipping addresses associated with her order.
One other thing is that PayPal gives me no record of the transaction in my history. I am running Spree 0.70.5.
The text was updated successfully, but these errors were encountered: