Skip to content

Commit

Permalink
[TEC-4931] Change client initialization in OrderSync to have the sess…
Browse files Browse the repository at this point in the history
…ion_id specified in default headers

This is a workaround for Missing Session AuthScema proposed by the flow.io dev - flowcommerce/ruby-sdk#26 (review)

Allows to update flowcommerce gem, not depending on a fork.
  • Loading branch information
texpert authored and sebastiandl committed Mar 31, 2021
1 parent 5cbf96c commit fea5a22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/services/flowcommerce_spree/order_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def initialize(order:, flow_session_id:)
@experience = order.flow_io_experience_key
@flow_session_id = flow_session_id
@order = order
@client = FlowcommerceSpree.client(session_id: flow_session_id)
@client = FlowcommerceSpree.client(
default_headers: { "Authorization": "Session #{flow_session_id}" },
authorization: nil
)
end

# helper method to send complete order from Spree to flow.io
Expand Down

0 comments on commit fea5a22

Please sign in to comment.