Skip to content

Commit

Permalink
Merge pull request #69 from commercetools/juanjcamposct/fix-demo-page
Browse files Browse the repository at this point in the history
Adapt demo page to new api
  • Loading branch information
dasanorct authored Mar 25, 2024
2 parents ee7c450 + 20cc760 commit e10ea58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions enabler/dev-utils/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const getSessionId = async(cartId) => {
const accessToken = await fetchAdminToken();

const sessionMetadata = {
processorUrl: __VITE_PROCESSOR_URL__,
allowedPaymentMethods: ['card'], // add here your allowed methods for development purposes
};

Expand Down
9 changes: 6 additions & 3 deletions enabler/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ <h1 class="h3 mb-3 font-weight-normal">Dev Site</h1>
},
});

enabler.createComponent('card', {
config: {},
enabler.createComponentBuilder('card')
.then(builder => {
const paymentElement = builder.build({
config: {},
});
paymentElement.mount('#card-component')
})
.then(e => e.mount('#card-component'));
});

</script>
Expand Down

0 comments on commit e10ea58

Please sign in to comment.