address: Set a dummy zipcode if none was returned from paypal

This is an attempt to fix a case where paypal does not provide any
zipcode back to us and then validation is failing. It is difficult
to test misconduct of paypal.
This commit is contained in:
Holger Hans Peter Freyther 2012-01-02 09:54:15 +01:00
parent bab9d6b8a7
commit d2db33ad1d
1 changed files with 5 additions and 0 deletions

View File

@ -100,6 +100,11 @@ module Spree
order_ship_address.state_name = "N/A"
end
# Paypal returned an address without zipcode
if order_ship_address.zipcode.nil?
order_ship_address.zipcode = "N/A"
end
order_ship_address.save!
@order.sysmocom_paypal_ship_address = order_ship_address