How I WAS NOT able to add "Pay with STEEM / SBD" options to a Shopify Store using Steem Connect

in #steemdev7 years ago (edited)

Hey guys I have been trying all day to test the SCRIPT graciously provided to us by @adept for their @paywithsteem store. It seemed fairly easy as it has steps and pictures to guide you along the way. I commenced with a trail version of shopify and was able to get @bitpay's api integrated seamlessly. After testing a transaction, I moved over to #steem. I followed the directions step by step and did my first transaction. It confirmed, but did not give me an option to pay with steem or steem dollars via steemconnect.com. I tried to make minor adjustments to my shopify store but to no avail. This is the only screen I get...

NEXT STEP

I copied the code exactly as it's written in @adeptd's post into

var steem = new XMLHttpRequest();
  steem.open("GET", "https://api.coinmarketcap.com/v1/ticker/steem/", false);
  steem.send();
  steem = parseFloat(JSON.parse(steem.response)[0].price_usd);

  window.onload = function () {
    total = parseFloat(document.getElementsByClassName('payment-method-list__item__amount')[0].innerHTML.replace("$",""));
    order = document.getElementsByClassName('os-order-number')[0].innerHTML.replace("Order #", "").replace(/\s/g, '');

    steemTotal = total / steem;
    sbdTotal   = total;

    steemitAccount = "thesteemitshop" //Change this to your Steemit account name where you would like to receive payments.

    steemURL = "https://v2.steemconnect.com/sign/transfer?to=" + steemitAccount + "&memo=" + order + "&amount=" + steemTotal.toFixed(3).toString().split(".")[0] + "%2E" + steemTotal.toFixed(3).toString().split(".")[1] + "%20STEEM";
    sbdURL   = "https://v2.steemconnect.com/sign/transfer?to=" + steemitAccount + "&memo=" + order + "&amount=" + sbdTotal.toFixed(3).toString().split(".")[0] + "%2E" + sbdTotal.toFixed(3).toString().split(".")[1] + "%20SBD";

    instructions  = "<span><button class='btn btn-success' style='display: block;width: 100%;' onclick=\"window.open('" + steemURL + "','_blank')\">Pay " + steemTotal.toFixed(3) + " STEEM</button></span><br><br>";
    instructions += "<span><button class='btn btn-success' style='display: block;width: 100%;' onclick=\"window.open('" + sbdURL + "','_blank')\">Pay " + sbdTotal.toFixed(3) + " SBD</button></span>";

    if (document.getElementsByClassName('payment-method-list__item__info')[0].innerHTML === 'Pay with STEEM or Steem Dollars —') {
      Shopify.Checkout.OrderStatus.addContentBox(
       '<h1>Select Payment Method</h1>',
       instructions
    )};

  };


Process of Elimination

This time I decided to copy the code into a Script editor to ensure it's viability. These were the results I received... I saw that @bhagchandbana said that he had success with the same exact tutorial. @phelimint has also integrated his into phelimint.com. It feels as though there is something very simple that I am missing. Perhaps I need to check or uncheck a box within shopify? Maybe there are extra"{}" or ";"in the code that was overlooked. I assure you @paywithsteem, I will in no way try to compete with your store. @adept @btcvenom @zord189 @perennial @sam.shuu and @pennsif If either one of you could kindly explain what you think I am doing wrong, IT WILL BE GOOD FOR YOUR KARMA CASH ME ON DISCORD, HOW BOUT DAT? The room is called 1-800-HELP A BROTHA

Logo provided by @Daddykirbs

Sort:  

The error you're getting in the script editor is because you copied the <script> tags. You needed to just paste the contents of it.

I'm not sure about the additional scripts section of Shopify.

Thanks @someguy123 yeah I see that just worked on the editor. Now I need to try it on Shopify 🤞

Can you try asking @adept for help?

I did on discord, no response, yet.

Let me know as I may be able to help. Have experience with crypto and eCommerce just not in this way. Also shared on twitter in case someone who follows me may be able to help out!

Thanks VG, I will hit you up on discord.

virtualtoken Virtual Growth tweeted @ 15 Jan 2018 - 01:29 UTC

How I WAS NOT able to add "Pay with STEEM / SBD" options to a Shopify Store using Steem Connect — @Steemit

steemit.com/steemdev/@xtro… / https://t.co/rt7iJdW8Vn

Disclaimer: I am just a bot trying to be helpful.

Hey man, I'm actually been looking for ways to accept other cryptos on our site besides BTC and Steem if you've had any experience with that and shopify I'd love to hear it.

I have someone working on ethereum right now. I'll let you know how that turns out.

Strange stuff. I think @adept is your best bet at the moment.

Hey man, it did work perfectly for me! I honestly just copied and pasted the script. I know I couldn't get the logo since it went into the wrong box. The only thing I needed to change was the steem user name from "thesteemitshop" to mine.
The only thing I wonder is that step that said "make sure your google analytics is enabled" maybe that has something to do with it. I'm honestly not a coder to the whole thing was way over my head. I know the SBD is permanently linked to 1USD and I couldn't change that, but otherwise it's been working great for many transactions.

Thaks for the input. I suppose I shouls try another browser maybe.

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63342.09
ETH 2658.68
USDT 1.00
SBD 2.81