Skip to content

Instantly share code, notes, and snippets.

@mfifth
Created August 31, 2017 21:18
Show Gist options
  • Select an option

  • Save mfifth/92d95ef25f17d35c1c935eeab251afb6 to your computer and use it in GitHub Desktop.

Select an option

Save mfifth/92d95ef25f17d35c1c935eeab251afb6 to your computer and use it in GitHub Desktop.
def self.send_order(order, shopify_signature)
shop = Shop.first
headers = {
"X-Shopify-Topic" => "orders/paid",
"X-Shopify-Hmac-Sha256" => shopify_signature,
"X-Shopify-Shop-Domain" => shop.shopify_domain,
"X-Shopify-Order-Id" => order.id,
"X-Request-Id" => 'some-value',
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
url = 'https://fastserver-jaxrs-dev.fastmodelsports.com/shopify/order/payment'
results = HTTParty.post(url, headers: headers, body: order)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment