Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghost-ucashpay

Adds a U.CASH Pay support / membership button to a Ghost theme. Readers can pay with crypto or card. Fully non-custodial: funds go straight to the wallet addresses you set on your pay.u.cash store, never to a middleman.

This package is frontend-only. No Ghost Admin API, no plugin, no server route required. You either drop a theme partial into your theme and re-upload it, or paste an HTML snippet into Ghost Code Injection.

U.CASH Pay is a hosted checkout. The link uses your store Cloud Token, which is publishable and safe to put in the browser. It can create checkouts for that store only; it cannot move funds or read balances.

How it works

The button links to a hosted U.CASH checkout page:

https://pay.u.cash/embed.php?cloud=<STORE_CLOUD_TOKEN>&amount=<AMOUNT>&currency=<CURRENCY>&title=<TITLE>&redirect=<REDIRECT>

When a reader clicks it, pay.u.cash renders a checkout where they pick a coin (or pay by card if you connected Stripe) and pay your store's receive addresses directly.

Install

Option A: Theme partial (recommended)

  1. Copy members-support.hbs into your theme, e.g. partials/members-support.hbs.

  2. Configure your store Cloud Token and amount in your theme's package.json under config:

    "config": {
      "ucash_cloud": "st_your_store_cloud_token",
      "ucash_amount": "5",
      "ucash_currency": "USD",
      "ucash_title": "Support My Blog"
    }

    (The partial also reads @custom.ucash_* settings, so you can wire these up as theme custom settings.)

  3. Include it in any template, for example at the end of post.hbs:

    {{> members-support}}
  4. Zip and upload your theme under Ghost Admin -> Settings -> Theme -> Upload theme.

Option B: Code Injection (no theme edit)

  1. Open code-injection-snippet.hbs and replace the placeholders: __CLOUD_TOKEN__, __AMOUNT__, __CURRENCY__, TITLE.
  2. Go to Ghost Admin -> Settings -> Code Injection.
  3. Paste the resulting HTML into Site Header (site-wide) or Post Header (single post).

Because Option B is plain HTML/CSS, it works everywhere without touching theme files.

Usage

Whichever option you choose, set:

Field Required Example Notes
cloud yes st_your_store_cloud_token Store Cloud Token from Account -> Stores.
amount yes 5 Numeric amount in currency.
currency no USD Defaults to USD.
title no Support My Blog Shown on the pay page.
redirect no https://yoursite.com/thanks Where to send the reader after payment.

Membership vs one-off support

Ghost's native memberships track recurring tiers inside Ghost. U.CASH Pay handles one-off payments here, so this button is best for tips / support / one-time contributions. Crypto recurring billing is not something the hosted pay link can do automatically today, so each click is a single payment. To gate content after a one-off payment, set redirect to a members-only URL on success.

Set up your pay.u.cash account

  1. Sign up at pay.u.cash, then click the verification link in the email.
  2. Set receive addresses under Settings -> Addresses (raw address, ENS, Unstoppable Domains, or FIO).
  3. Create a store under Account -> Stores and copy its Store Cloud Token (use the store-level token, not the account-wide one).
  4. For fiat cards, connect your own Stripe under Settings -> Payment processors.

Files

  • members-support.hbs - theme partial (Option A).
  • code-injection-snippet.hbs - plain HTML snippet for Code Injection (Option B).
  • LICENSE - MIT.

Security notes

  • The cloud value is a publishable store Cloud Token, safe to expose in the browser. Treat it like a publishable key, not a secret.

  • If you ever rotate the store Cloud Token in pay.u.cash, update the value in your theme config or Code Injection.

  • This integration does not handle order confirmation webhooks. For server-side order tracking (e.g. to mark a payment complete), use the pay.u.cash server-side checkout endpoint from a server route, not from the browser. That endpoint is idempotent per external_reference:

    POST https://pay.u.cash/payment/ajax.php
    Content-Type: application/x-www-form-urlencoded
    
    function=create-transaction
    &amount=5
    &currency_code=USD
    &cryptocurrency_code=
    &external_reference=<your_unique_ref>
    &title=Support
    &redirect=https://yoursite.com/thanks
    &cloud=st_your_store_cloud_token
    &idempotent=1
    

    The response is JSON { "success": true, "response": [paymentUrl, transactionId, ...] }. The element starting with http(s):// is the payment URL to redirect the payer to.

License

MIT. See LICENSE.

Releases

Packages

Contributors

Languages