lib/solidus_subscriptions/checkout.rb in solidus_subscriptions-1.0.0.rc1 vs lib/solidus_subscriptions/checkout.rb in solidus_subscriptions-1.0.0
- old
+ new
@@ -30,18 +30,11 @@
end
private
def create_order
- ::Spree::Order.create(
- user: installment.subscription.user,
- email: installment.subscription.user.email,
- store: installment.subscription.store || ::Spree::Store.default,
- subscription_order: true,
- subscription: installment.subscription,
- currency: installment.subscription.currency
- )
+ SolidusSubscriptions.configuration.order_creator_class.new(installment).call
end
def populate_order(order)
installment.subscription.line_items.each do |line_item|
order.contents.add(line_item.subscribable, line_item.quantity)
@@ -59,10 +52,10 @@
order.bill_address = installment.subscription.billing_address_to_use
when 'payment'
order.payments.create(
payment_method: installment.subscription.payment_method_to_use,
source: installment.subscription.payment_source_to_use,
- amount: order.total,
+ amount: order.total
)
end
order.next!
end