Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discourse-ucashpay

A Discourse plugin that adds a Pay-with-U.CASH tip button to every post in a topic. Readers can tip a post's author in crypto or by card. Payments are non-custodial: funds go straight to the store's configured receive addresses via pay.u.cash.

  • One button per post, styled to match your Discourse theme.
  • Crypto (BTC, ETH, USDC, and more) plus card payments via Stripe.
  • Non-custodial. The plugin only ever holds your publishable store Cloud token, which is safe to expose in the browser.

How it works

Each tip opens the hosted U.CASH checkout at https://pay.u.cash/embed.php with your store's Cloud token, the tip amount, the currency, and an external_reference that ties the payment back to the specific Discourse post (so you can reconcile tips in your pay.u.cash dashboard).

The Cloud token used here is publishable: it can only create checkouts that pay your store, it cannot move funds or read balances. Keep your secret account-level keys off the forum.

Install

Option A: via your Discourse app.yml (recommended)

Add the plugin repo to the hooks block in /var/discourse/containers/app.yml:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/UdotCASH/discourse-ucashpay.git

Then rebuild the container:

cd /var/discourse
./launcher rebuild app

Option B: manual clone (development)

Inside your Discourse source checkout:

cd plugins
git clone https://github.com/UdotCASH/discourse-ucashpay.git

Restart Discourse (or bin/ember serve in development).

Configure

  1. Go to Admin -> Settings -> Plugins -> discourse-ucashpay (or search "ucashpay" in settings).
  2. Enable discourse ucashpay enabled.
  3. Paste your store Cloud Token into discourse ucashpay cloud token.
  4. Optionally set the currency (default USD), the per-tip amount, the title shown at checkout, and the button label.

The tip button now appears under every post.

Usage

A reader clicks the Tip button under a post. The U.CASH hosted checkout opens in a new tab with the amount, currency, and a reference (discourse:<topic_id>:<post_number>) identifying that post. They pay in crypto or by card. You reconcile tips in your pay.u.cash dashboard using the external_reference.

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.

API contract

This plugin uses the publishable, client-side hosted pay link:

GET https://pay.u.cash/embed.php
  cloud                # your store Cloud Token (publishable)
  amount
  currency             # default USD
  title
  external_reference   # e.g. discourse:<topic_id>:<post_number>
  redirect

No server secret is required. If you later want server-side tracked, idempotent checkouts (e.g. from a webhook listener), pay.u.cash also exposes:

POST https://pay.u.cash/payment/ajax.php   (application/x-www-form-urlencoded)
  function=create-transaction
  amount
  currency_code
  cryptocurrency_code=     # empty string
  external_reference
  title
  redirect
  cloud
  idempotent=1
-> JSON { success: true, response: [paymentUrl, transactionId, ...] }
   (the payment URL is the array element beginning with http(s)://)

The browser-side embed.php link is sufficient for the tip button.

License

MIT. See LICENSE.

About

Discourse plugin: add a Pay-with-U.CASH tip button to topics. Crypto + cards, non-custodial.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages