Sha256: 60c61dc9b299edafe0bcc567a5182888d9d68846840b17260844eb3b33545339
Contents?: true
Size: 508 Bytes
Versions: 46
Compression:
Stored size: 508 Bytes
Contents
Spree.fetchApiTokens = function () { fetch(Spree.routes.api_tokens, { method: 'GET', credentials: 'same-origin' }).then(function (response) { switch (response.status) { case 200: response.json().then(function (json) { SpreeAPI.orderToken = json.order_token SpreeAPI.oauthToken = json.oauth_token Spree.apiTokensFetched = true }) break } }) } Spree.ready(function () { if (!Spree.apiTokensFetched) Spree.fetchApiTokens() })
Version data entries
46 entries across 46 versions & 1 rubygems