Cracking the Code: Integrating Custom Crypto Payments on Shopify (Insights from the Community)

Hey everyone! Your friendly Shopify migration expert here, diving into another fascinating discussion from the community forums. This time, we're talking about something that's gaining a lot of traction: integrating cryptocurrency payments directly into your Shopify store. It's a complex area, balancing the allure of new tech with the practicalities of a smooth checkout experience. Let's dig into a recent thread that perfectly illustrates some of the challenges and solutions.

The Quest for a Custom "Pay with Crypto" Button

Our story starts with max.james, a store owner who wanted to add a custom "Pay with Crypto" button to his Shopify cart page using MakePay.io. His goal was clear: let customers click the button, grab the cart's subtotal, create a MakePay crypto payment session, and then redirect the customer to a hosted checkout page to complete the payment.

Sounds straightforward, right? Well, as many of us know, custom integrations rarely are! max.james found that while his button appeared correctly and the click event was working, the MakePay checkout wasn't being created or opened. Instead, he hit a generic error: "Your account setup is not completed. Please try again."

Here's the basic button structure he was using:


He laid out the expected flow:

  1. Customer clicks Pay with Crypto on the cart page.
  2. Shopify cart data is fetched.
  3. The cart subtotal is converted from Shopify cents to a normal price amount.
  4. A MakePay payment / hosted checkout link is created.
  5. Customer is redirected to MakePay checkout to complete the crypto payment.

The problem was at step 4 – no checkout URL was returned. This led him to some really insightful questions that get to the heart of custom payment integrations:

  • Should the MakePay API request be handled through a backend / app proxy instead of directly inside Shopify theme code?
  • What fields are required when creating a MakePay hosted checkout link from a Shopify cart?
  • Is there a recommended way to pass the Shopify order/cart reference into MakePay?
  • Should the cart page button create a draft order first, or is using the cart subtotal enough?
  • How should webhook/payment confirmation be handled so the Shopify order can be marked correctly?

Community Insight: The Case for Shopify's Native Crypto Support

Before max.james even marked his issue as resolved, another community member, jpaylor, jumped in with a very practical suggestion. He asked if max.james had considered using Shopify’s own support for cryptocurrencies at checkout. jpaylor made a really strong point:

"I think this would be the best route to go down. I’m not sure routing customers through a 3rd party checkout is a good experience, and you may run into all sorts of issues integrating it, as you’ve already faced here."

And he's right! Shopify has been steadily improving its native support for various payment methods, including crypto. Using their built-in solutions often means less headache for you, better customer trust (they're staying within the familiar Shopify checkout flow), and fewer integration bugs.

The "Self-Custody" Angle and a Resolution

Interestingly, max.james later updated the thread, stating: "Thank you for suggestion, I was looking for self-custody solution somehow. I resolved it."

While he didn't elaborate on the exact fix, his comment about seeking a "self-custody solution" is key. This tells us he likely wanted more control over the crypto assets, rather than having them managed by a third-party payment processor – even if that third party is Shopify's integrated partner. This desire for self-custody is a common driver for store owners exploring custom crypto integrations.

It's great that he found a resolution, but his initial detailed questions remain super relevant for anyone venturing into custom payment gateway integrations. Let's break down some expert insights based on those questions.

Expert Insights: Navigating Custom Crypto Integrations Safely

If you're dead set on a custom, self-custody-focused crypto payment solution, here's what you absolutely need to consider, directly addressing max.james's excellent questions:

1. Server-Side vs. Client-Side API Calls: Always Go Server-Side for Payments!

This is probably the most critical point. Your API requests for creating payment sessions (like with MakePay) should never be made directly from your Shopify theme's JavaScript (client-side). Why? Security! Your API keys would be exposed in the browser, making your store vulnerable. Instead, you need a backend service or a Shopify app proxy to handle these sensitive calls. Your theme JavaScript would communicate with your app proxy, which then securely communicates with MakePay's API.

2. Passing Cart Data & Order References

When creating a payment session, you'll need to pass the cart's subtotal, currency, and ideally, some reference back to the Shopify cart or customer. You can fetch the cart data via Shopify's AJAX API from the client-side, send it to your backend/app proxy, and then your backend formats it for MakePay. For a reference, you could pass the Shopify cart_token or even create a draft order first (as max.james suggested!) and pass its ID. Creating a draft order is often a good idea because it reserves inventory and gives you a stable ID to link the crypto payment to.

3. Handling Webhooks and Payment Confirmation

This is where the magic happens for closing the loop. Once a customer completes a crypto payment on MakePay (or any external gateway), MakePay needs to tell Shopify that the payment was successful. This is done via webhooks. Your backend service needs to:

  • Provide a webhook URL to MakePay.
  • Listen for incoming payment success notifications from MakePay at that URL.
  • Upon receiving a success notification, use Shopify's Admin API to mark the corresponding draft order as paid, convert it to a full order, and potentially fulfill it.

Without proper webhook handling, your Shopify orders won't update automatically, leading to manual work and potential errors.

Your Options for Crypto Payments on Shopify

So, what does this all mean for you, the store owner?

Option A: Embrace Shopify's Built-In Solution (Recommended for Most)

If you don't have a strong need for self-custody and just want to offer crypto as a payment option, jpaylor's advice is golden. Shopify integrates with various crypto payment providers (like Coinbase Commerce), making setup relatively simple. You enable it in your Shopify admin under Settings > Payments > Add payment methods. It's secure, integrated, and offers a familiar checkout experience for your customers. For those looking to start their own online store and explore all payment options, Shopify is an incredibly powerful platform that makes managing these complexities much easier.

Option B: Deep Dive into Custom Integration (When Self-Custody is a Must)

If self-custody or a very specific integration is your priority, be prepared for a more involved development process. You'll need:

  1. A Backend Service or Shopify App Proxy: Essential for secure API calls and webhook handling.
  2. Shopify Theme Code Modifications: To trigger your custom button and communicate with your backend.
  3. API Integration: Meticulous handling of your chosen crypto gateway's API (e.g., MakePay), including authentication, payment creation, and status checking.
  4. Robust Webhook Management: To reliably update Shopify orders based on payment confirmations.

While max.james's specific fix for MakePay wasn't detailed, the questions he asked are the exact roadmap for building a robust, secure, custom payment integration on Shopify. It highlights the importance of understanding the underlying architecture – secure API calls, proper data flow, and reliable webhook communication – whether you're dealing with crypto or any other external payment method.

Ultimately, the choice comes down to your priorities: ease of use and native integration versus maximum control and customizability. Both paths are viable, but the latter requires a much deeper dive into development.

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases