Method: Klarna::Checkout::Client#read_order
- Defined in:
- lib/klarna/checkout/client.rb
#read_order(id) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/klarna/checkout/client.rb', line 50 def read_order(id) response = https_connection.get do |req| req.url "/checkout/orders/#{id}" req.headers['Authorization'] = "Klarna #{sign_payload}" req.headers['Accept'] = 'application/vnd.klarna.checkout.aggregated-order-v2+json' req.headers['Accept-Encoding'] = '' end handle_status_code(response.status, response.body) Order.new(JSON.parse(response.body)) end |