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 8, 2021
1 parent bcfa2ca commit 1ca3184
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:)

@experience = order.flow_io_experience_key
@order = order
@client = FlowcommerceSpree.client(session_id: fetch_session_id)
@client = FlowcommerceSpree.client(
default_headers: { "Authorization": "Session #{fetch_session_id}" },
authorization: nil
)
end

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

0 comments on commit 1ca3184

Please sign in to comment.