Browse Source

paypal: Add hack to accept paypal from US and Germany...

we had to make the State mandantory for US customers using Paypal,
but now for EU members we don't get a state and fail to save the
order.

Move it down as we might overwrite it
1-2-stable-sysmocom
Holger Hans Peter Freyther 10 years ago
committed by Holger Hans Peter Freyther
parent
commit
4883afb265
  1. 6
      app/controllers/spree/checkout_controller_decorator.rb

6
app/controllers/spree/checkout_controller_decorator.rb

@ -94,6 +94,12 @@ module Spree
else
order_ship_address.state_name = ship_address["state"]
end
# Paypal requires us to have a state for US and on some states it is empty
if order_ship_address.state_name.nil? && order_ship_address.state.nil?
order_ship_address.state_name = "N/A"
end
order_ship_address.save!
@order.sysmocom_paypal_ship_address = order_ship_address

Loading…
Cancel
Save