Skip to content

Commit

Permalink
Simplify payment source attributes in order/_big
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Aug 17, 2017
1 parent 01569a7 commit 3013834
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/app/views/spree/api/orders/_big.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ json.payments(order.payments) do |payment|
if payment.source
json.source do
json.(payment.source, *payment_source_attributes)

if @current_user_roles.include?("admin")
json.(payment.source, *(payment_source_attributes + [:gateway_customer_profile_id, :gateway_payment_profile_id]))
else
json.(payment.source, *payment_source_attributes)
json.(payment.source, :gateway_customer_profile_id, :gateway_payment_profile_id)
end
end
end
Expand Down

0 comments on commit 3013834

Please sign in to comment.