diff --git a/app/services/order_factory.rb b/app/services/order_factory.rb index 85c887411a..9aa5c9fb05 100644 --- a/app/services/order_factory.rb +++ b/app/services/order_factory.rb @@ -15,6 +15,7 @@ class OrderFactory set_user build_line_items set_addresses + set_shipping_method create_payment @order end @@ -65,6 +66,10 @@ class OrderFactory @order.update_attributes(attrs.slice(:bill_address_attributes, :ship_address_attributes)) end + def set_shipping_method + @order.select_shipping_method(attrs[:shipping_method_id]) + end + def create_payment @order.update_distribution_charge! @order.payments.create(payment_method_id: attrs[:payment_method_id], amount: @order.reload.total)