PirateChain raises anchor on the Shopify Plugin

PirateChain
Mar 16, 2019 · 7 min read
Image for post
Image for post

Disclaimer: This guide assumes you already have a Shopify shop running. It also assumes you have read through the PirateOcean wallet setup guide and acquired an ARRR address that begins with zs and backed up the Private keys and/or wallet.dat safely. If you have not yet, please do so first.

Special thanks to TuringLabs for getting this script done and functional. We did not know it was them at first but we are very grateful for their work on it.

Let’s Get StARRRted!

This guide will help you accept ARRR cryptocurrency as a payment method on Shopify. Getting a Shopify Cryptocurrency payment method usually requires their centralized service, but with the help of HumanAction.io and their ARRR Script, we can now provide for all Shopify users to control the payments on their own with no middleman fees!

Keep in mind, Shopify does not support third party plugins so the payment processing must be acknowledged and completed manually, and we will provide a guide and a quick reference link to provide your customers to in order to achieve this quickly.
This script will automatically convert the total price of your goods to include shipping into an $ARRR value, and it will provide the buyer with your own address that you have set. The clients should put their TXID in the comments section to facilitate linking orders with payments.
- Once the order has been placed by the customer, you will receive a notification from Shopify.
- You will then verify in your wallet that you have received the funds.
This can take up to 10 minutes so check your wallet and make sure you were paid the proper amount before accepting the order!
- Once funds are received, be sure to send them to a separate address in this wallet so new orders don’t have their incoming amounts colliding making accounting a bit more work.

In the next few months, we will work with Shopify to include our payment option as a native option on their plugin which should make this process easier.

If you experience any issues during this setup guide, you can reach out to our support community in Discord 24 hours a day.

Follow these simple steps to add this to your Shopify store:

Step One:
From your Shopify admin home page, click on Settings.

Image for post
Image for post
Click on settings on your admin home page

Step Two:
Click on Payment Providers.

Image for post
Image for post
Click on “Payment Providers”

Step Three:
In the Manual Payments Menu, use the scroll drop down to choose “Activate a custom payment”
Name this option — ARRR payment. This is important.
In the bottom section labelled “Payment instructions” you can include a custom note to your customers about the manual processing.
“Once your order is complete and you go through the check out process, you will be asked to send an exact amount of ARRR to complete the transaction.
We will monitor our records and notify you by email once your payment has been received.”

Image for post
Image for post
Make sure to label this ARRR Payment

Step Four:
Return to your Shopify Admin page, this time choose “Checkout”.
At the bottom is a box labelled Additional Scripts. Copy and paste the script at the end of this guide in that box.

Image for post
Image for post

Step Five:
In this “Additional Scripts” box, you want to edit the address field to show your wallet address you received when setting up your PirateOcean wallet.
YOUR ADDRESS HERE needs to be replaced with a pirate address that starts with zs.
It is the 5th line down in the script.
There is only one place you need to do this.

Image for post
Image for post
window.arrrAddress = ‘YOUR ADDRESS HERE’; — Do not put the ‘ or ;

Save your changes, refresh your shop and now at checkout, clients are able to manually choose an ARRR payment option.

All Done!

If you have any issues, please reach out to our community development and support team in Discord. This can be done on PC or Mobile as Discord also has a mobile app.
If you wish to support the producer of this Script, please stop by www.HumanAction.io and purchase some gear, maybe with ARRR. Follow them on Twitter, @humanaction.io or in discord @human action#7575.

They have a KMD donation address you can donate to and any assistance I am sure is appreciated.
RFo1bMdK2jh2ZaeaU6Y7pCvtsaUsnaEbXp — Human Action

Image for post
Image for post
Human Action KMD QR code for donations

Thank you very much for your efforts and your selfless act to provide this plugin to the community.

We salute you captain!

Happy shopping, selling and sailing!

— — — — — — — —Begin Script — — — — — — — — — — — — — — — — — —

{% if {{checkout.transactions[0].gateway}} == "ARRR payment" %}<br><br>
<div id="root"></div>
<script>
window.arrrAddress = "YOUR ADDRESS HERE";
const app = document.getElementById('root');
const container = document.createElement('div');
app.setAttribute('class', 'content-box');
app.appendChild(container);
const container2 = document.createElement('div');
container2.setAttribute('class', 'content-box__row');
var head = document.createElement('H2');
head.textContent = "Payment Required";
app.appendChild(container2);
container2.appendChild(head);
const container3 = document.createElement('div');
container3.setAttribute('class', 'content-box__row');
app.appendChild(container3);
var request = new XMLHttpRequest();
var partial = {{checkout.total_price}};
var partstring = partial.toString();
var integer = partstring.substring(0, partstring.length - 2);
var float = partstring.substring(partstring.length, partstring.length - 2);
var amount = parseFloat(integer+'.'+float);
var order_number = {{checkout.order_number}};
request.open('GET', 'https://api.coingecko.com/api/v3/coins/pirate-chain', true);
request.onload = function () {
// Begin accessing JSON data here
var data = JSON.parse(this.response);
var price = data.market_data.current_price.usd;
if (request.status >= 200 && request.status < 400) {var arrrNeeded = parseInt(amount / price) + 2;
arrrNeeded = arrrNeeded.toString();
var arrrFormat = arrrNeeded + '.' + order_number;
const p = document.createElement('p');

p.textContent = `Please send payment of ${arrrFormat} arrr to address: ` + window.arrrAddress;
container3.appendChild(p);
const br = document.createElement('br');
container3.appendChild(br);
const p2 = document.createElement('p');
p2.textContent = 'This is your order number: {{checkout.order_number}}';
container3.appendChild(p2);
container3.appendChild(br);
const p3 = document.createElement('p');
p3.textContent = 'Please complete payment in the next 5 minutes. Please right click the outgoing transaction in your wallet after it is sent and choose, "Copy Transaction ID" and paste that in the order comments.';
container3.appendChild(p3);
container3.appendChild(br);
const qr= document.createElement('img');
qr.src = `https://chart.googleapis.com/chart?cht=qr&chl=arrr:` + window.arrrAddress + `%3amount=${arrrFormat}&chs=300x300&chld=L|0`;
container3.appendChild(qr);

} else {
const errorMessage = document.createElement('p');
errorMessage.textContent = `Sorry it's not working! Try refreshing the page.`;
app.appendChild(errorMessage);
}}request.send();
</script>
{% endif %}

— — — — — — — — — — — End ARRR Script — — — — — — — — — — — — —

— — — — — — — — — — —Begin VRSC Script — — — — — — — — — — — — —

{% if {{checkout.transactions[0].gateway}} == "VRSC payment" %}<br><br>
<div id="root"></div>
<script>
window.vrscAddress = "YOUR ADDRESS HERE";
const app = document.getElementById('root');
const container = document.createElement('div');
app.setAttribute('class', 'content-box');
app.appendChild(container);
const container2 = document.createElement('div');
container2.setAttribute('class', 'content-box__row');
var head = document.createElement('H2');
head.textContent = "Payment Required";
app.appendChild(container2);
container2.appendChild(head);
const container3 = document.createElement('div');
container3.setAttribute('class', 'content-box__row');
app.appendChild(container3);
var request = new XMLHttpRequest();
var partial = {{checkout.total_price}};
var partstring = partial.toString();
var integer = partstring.substring(0, partstring.length - 2);
var float = partstring.substring(partstring.length, partstring.length - 2);
var amount = parseFloat(integer+'.'+float);
var order_number = {{checkout.order_number}};
request.open('GET', 'https://api.coingecko.com/api/v3/coins/verus-coin', true);
request.onload = function () {
// Begin accessing JSON data here
var data = JSON.parse(this.response);
var price = data.market_data.current_price.usd;
if (request.status >= 200 && request.status < 400) {var vrscNeeded = parseInt(amount / price) + 2;
vrscNeeded = vrscNeeded.toString();
var vrscFormat = vrscNeeded + '.' + order_number;
const p = document.createElement('p');

p.textContent = `Please send payment of ${vrscFormat} vrsc to address: ` + window.vrscAddress;
container3.appendChild(p);
const br = document.createElement('br');
container3.appendChild(br);
const p2 = document.createElement('p');
p2.textContent = 'This is your order number: {{checkout.order_number}}';
container3.appendChild(p2);
container3.appendChild(br);
const p3 = document.createElement('p');
p3.textContent = 'Please complete payment in the next 15 minutes.';
container3.appendChild(p3);
container3.appendChild(br);
const qr= document.createElement('img');
qr.src = `https://chart.googleapis.com/chart?cht=qr&chl=vrsc:` + window.vrscAddress + `%3amount=${vrscFormat}&chs=300x300&chld=L|0`;
container3.appendChild(qr);

} else {
const errorMessage = document.createElement('p');
errorMessage.textContent = `Sorry it's not working! Try refreshing the page.`;
app.appendChild(errorMessage);
}}request.send();
</script>
{% endif %}

— — — — — — — — — — — End VRSC Script — — — — — — — — — — — — —

Thank you for reading,

Written by FishyGuts @2ndoldest on Twitter — @FishyGuts#5085 on discord

Follow PirateChain on Social Media!

Twitter

Instagram

Reddit

Facebook

Discord

PirateChain

Welcome to the Medium-Blog of PIRATEchain.

PirateChain

Written by

The most private Zcash fork — 99.99% shielded funds with double spend protection from dPoW. https://Pirate.Black

PirateChain

Pirate Chain (ARRR) is an independent blockchain using the mining algorithm Equihash, dPoW. Pirate Chain (ARRR) is by general admission the most anonymous cryptocurrency with privacy by default. The Tor network is supported.

PirateChain

Written by

The most private Zcash fork — 99.99% shielded funds with double spend protection from dPoW. https://Pirate.Black

PirateChain

Pirate Chain (ARRR) is an independent blockchain using the mining algorithm Equihash, dPoW. Pirate Chain (ARRR) is by general admission the most anonymous cryptocurrency with privacy by default. The Tor network is supported.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store