mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Switching Checkout service to use CurrentOrder
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
Darkswarm.factory 'Checkout', (Order, ShippingMethods, PaymentMethods, $http, Navigation, CurrentHub, RailsFlashLoader, Loading)->
|
||||
Darkswarm.factory 'Checkout', (CurrentOrder, ShippingMethods, PaymentMethods, $http, Navigation, CurrentHub, RailsFlashLoader, Loading)->
|
||||
new class Checkout
|
||||
errors: {}
|
||||
secrets: {}
|
||||
order: Order.order
|
||||
order: CurrentOrder.order
|
||||
ship_address_same_as_billing: true
|
||||
|
||||
submit: ->
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
%i.ofn-i_005-caret-down
|
||||
|
||||
-# TODO render this in Angular instead of server-side
|
||||
-# The problem being how to render the partials
|
||||
- current_order.available_payment_methods.each do |method|
|
||||
.row
|
||||
.small-12.columns
|
||||
|
||||
@@ -39,10 +39,10 @@ describe 'Checkout service', ->
|
||||
ship_address: {test: "bar"}
|
||||
user_id: 901
|
||||
|
||||
angular.module('Darkswarm').value('order', orderData)
|
||||
module 'Darkswarm'
|
||||
module ($provide)->
|
||||
$provide.value "RailsFlashLoader", FlashLoaderMock
|
||||
$provide.value "currentOrder", orderData
|
||||
$provide.value "shippingMethods", shippingMethods
|
||||
$provide.value "paymentMethods", paymentMethods
|
||||
null
|
||||
|
||||
Reference in New Issue
Block a user