Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
feat: Add host param to moltin request (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
petro97 authored Aug 18, 2020
1 parent 9e5f1a7 commit 2453f9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
src="./index.js"
data-moltin-client-id="EdP3Gi1agyUF3yFS7Ngm8iyodLgbSR3wY4ceoJl0d2"
data-moltin-stripe-publishable-key="pk_test_mBJXmnGQw61Jt3XVbeHZer7Y006yezKgpL"
data-moltin-endpoint-url="api.moltin.com"
></script>
</body>
</html>
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function init(document) {
const {
moltinClientId: client_id,
moltinStripePublishableKey,
moltinCurrency: currency
moltinCurrency: currency,
moltinEndpointUrl: host
} = script.dataset

if (!moltinStripePublishableKey) {
Expand All @@ -47,7 +48,8 @@ function init(document) {
const api = new MoltinClient({
client_id,
application: 'moltin-btn',
...(currency && { currency })
...(currency && { currency }),
...(host && { host })
})

const store = createStore(model, {
Expand Down

0 comments on commit 2453f9e

Please sign in to comment.