Sha256: 49ea8f9fbdaf8aad4ebdad41c2c3dbb4303f44c6b387c6385baddf499723a50f

Contents?: true

Size: 1.22 KB

Versions: 10

Compression:

Stored size: 1.22 KB

Contents

object @order
extends "spree/api/orders/order"

child :available_payment_methods => :payment_methods do
  attributes :id, :name, :environment, :method_type
end

child :billing_address => :bill_address do
  extends "spree/api/addresses/show"
end

child :shipping_address => :ship_address do
  extends "spree/api/addresses/show"
end

child :line_items => :line_items do
  extends "spree/api/line_items/show"
end

child :payments => :payments do
  attributes *payment_attributes

  child :payment_method => :payment_method do
    attributes :id, :name, :environment
  end

  child :source => :source do
    attributes *payment_source_attributes
    if @current_user_roles.include?('admin')
      attributes *(payment_source_attributes + [:gateway_customer_profile_id, :gateway_payment_profile_id])
    else
      attributes *payment_source_attributes
    end
  end
end

child :shipments => :shipments do
  extends "spree/api/shipments/small"
end

child :adjustments => :adjustments do
  extends "spree/api/adjustments/show"
end

# Necessary for backend's order interface
node :permissions do
  { can_update: current_ability.can?(:update, root_object) }
end

child :valid_credit_cards => :credit_cards do
  extends "spree/api/credit_cards/show"
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
solidus_api-1.0.7 app/views/spree/api/orders/show.v1.rabl
solidus_api-1.0.6 app/views/spree/api/orders/show.v1.rabl
solidus_api-1.0.5 app/views/spree/api/orders/show.v1.rabl
solidus_api-1.0.4 app/views/spree/api/orders/show.v1.rabl
solidus_api-1.0.3 app/views/spree/api/orders/show.v1.rabl
solidus_api-1.0.2 app/views/spree/api/orders/show.v1.rabl
solidus_api-1.0.1 app/views/spree/api/orders/show.v1.rabl
solidus_api-1.0.0 app/views/spree/api/orders/show.v1.rabl
solidus_api-1.0.0.rc2 app/views/spree/api/orders/show.v1.rabl
solidus_api-1.0.0.rc1 app/views/spree/api/orders/show.v1.rabl