Skip to content

Commit

Permalink
Hide extra button on Bolt iframe display
Browse files Browse the repository at this point in the history
Once a customer displays the Bolt iframe there are two buttons displayed
 - "Pay" and "Submit". This can lead to confusion so to avoid it from
happening this commit hides the extra button.
  • Loading branch information
Naokimi committed May 13, 2022
1 parent c526472 commit 8732ba9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/assets/javascripts/solidus_bolt.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ document.addEventListener("DOMContentLoaded", async function () {
const accountCheckbox = boltEmbedded.create("account_checkbox");
const frontend = boltContainer.dataset.frontend == "true" ? true : false;
const paymentMethodId = boltContainer.dataset.paymentMethodId
const cardButton = document.getElementById("bolt-card-button");

accountCheckbox.on("change", checked => createBoltAccount = checked);
document.getElementById("bolt-card-button").addEventListener("click", () => {
cardButton.addEventListener("click", () => {
const paymentField = boltEmbedded.create("payment_component");
displayBoltInput(paymentField, boltContainer, accountCheckbox);
cardButton.style.display = 'none';

document.getElementById("bolt-submit-button").addEventListener("click", () => {
tokenize(paymentField, paymentMethodId, frontend);
Expand Down

0 comments on commit 8732ba9

Please sign in to comment.