Skip to content

Commit

Permalink
Set cookie path
Browse files Browse the repository at this point in the history
  • Loading branch information
dvnkshl committed Feb 27, 2017
1 parent db39e0f commit 167dc4f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
8 changes: 5 additions & 3 deletions commerce.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ class Commerce
version: 'v1'
methods: ['GET', 'POST', 'PUT', 'DELETE']
debug: false
config: {}

constructor: (publicKey, debug = false) ->
constructor: (publicKey, debug = false, config = {}) ->

@options = @Merge @options, { publicKey: publicKey, debug: debug }
@Storage = new Commerce.Storage
@options = @Merge @options, { publicKey: publicKey, debug: debug, config: config }
@Storage = new Commerce.Storage @

switch window.location.hostname
when 'checkout.chec.dev' then @options.url = 'api.chec.dev'
when 'localhost' then @options.url = 'api.chec.dev'
when 'spaces.chec.dev' then @options.url = 'api.chec.dev'
when 'stage.checkout.chec.io' then @options.url = 'stage.api.chec.io'
when 'checkout.chec.io' then @options.url = 'api.chec.io'
Expand Down
2 changes: 1 addition & 1 deletion dist/commerce.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 167dc4f

Please sign in to comment.