Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

U.CASH Pay for LearnDash

A WordPress plugin that registers U.CASH Pay as a LearnDash LMS payment gateway. Sell LearnDash courses with crypto and cards. Funds settle directly to your pay.u.cash receive addresses. Non-custodial.

On course checkout the plugin redirects the learner to the pay.u.cash hosted checkout for the course price. After payment they return to the course page and LearnDash grants access using the recorded external reference. This release handles one-time course access payments.

Status

v0.1.0 - initial release. Stable for one-time course access. Crypto recurring billing is not universally supported on-chain, so recurring subscriptions are out of scope for this release; use a one-time access fee instead.

Requirements

  • WordPress 5.8+
  • PHP 7.2+
  • LearnDash LMS 3.5+ (the learndash_payment_gateways filter is required)

Install

  1. Install and activate LearnDash LMS.
  2. Upload this folder to /wp-content/plugins/learndash-ucashpay/ (or zip it and use Plugins -> Add New -> Upload Plugin).
  3. Activate U.CASH Pay for LearnDash.
  4. Go to LearnDash -> Settings -> Payments, enable U.CASH Pay, and paste your Store Cloud Token.

Usage

  1. Create a LearnDash course and set a price (Access Mode: "Open" or "Free" disables the gateway; use a paid access mode).
  2. When a learner opens the course, LearnDash shows the configured payment gateways, including U.CASH Pay.
  3. Selecting U.CASH Pay redirects to the pay.u.cash hosted checkout for the course price.
  4. After payment, the learner is returned to the course page and access is granted by LearnDash using the external reference.

Settings

Field Description
Enable U.CASH Pay Turns the gateway on or off.
Store Cloud Token The publishable Cloud Token of your pay.u.cash store (Account -> Stores -> Store Cloud Token). Use the store-level token, not the account-wide one.
Currency ISO 4217 currency code (default USD).
Checkout Title Label shown at checkout (default "Course Access").

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

The gateway uses the pay.u.cash public API contract.

Client-side hosted pay link (default)

The default flow builds a browser redirect to the hosted checkout. The store Cloud Token is publishable and safe to use from the browser.

GET https://pay.u.cash/embed.php
    ?cloud=<STORE_CLOUD_TOKEN>
    &amount=<PRICE>
    &currency=USD
    &title=<COURSE_TITLE>
    &external_reference=<REFERENCE>
    &redirect=<RETURN_URL>

Server-side tracked checkout (optional)

For a server-to-server flow (idempotent per external_reference), call this from a server route using wp_remote_post. Never call this from the browser.

POST https://pay.u.cash/payment/ajax.php
Content-Type: application/x-www-form-urlencoded

function=create-transaction
&amount=<PRICE>
&currency_code=USD
&cryptocurrency_code=
&external_reference=<REFERENCE>
&title=<COURSE_TITLE>
&redirect=<RETURN_URL>
&cloud=<STORE_CLOUD_TOKEN>
&idempotent=1

Response JSON:

{ "success": true, "response": ["<paymentUrl>", "<transactionId>", "..."] }

The payment URL is the array element that starts with http(s)://. See Learndash_Gateway_Ucashpay::create_tracked_checkout() in includes/class-learndash-gateway-ucashpay.php.

Security model

  • Non-custodial. Funds settle directly to your configured pay.u.cash receive addresses. The plugin never holds balances.
  • Publishable token. The store Cloud Token is designed for client-side use. It is safe to embed in the browser.
  • No server secrets. The default flow needs only the publishable Cloud Token. The optional tracked checkout runs server-side via wp_remote_post.

Files

  • learndash-ucashpay.php - main plugin file (header, registration, activation guard).
  • includes/class-learndash-gateway-ucashpay.php - the LearnDash gateway class (checkout URL builder, settings fields, optional tracked checkout).
  • readme.txt - WordPress.org-style readme.
  • README.md - this file.

Limitations

  • One-time course access payments only. Recurring crypto subscriptions are not supported on-chain; use a one-time access fee.
  • The learndash_payment_gateways filter requires LearnDash 3.5+.

License

MIT. See LICENSE.

About

U.CASH Pay payment gateway for LearnDash LMS (sell courses with crypto + cards). Non-custodial.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages