Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

square-ucashpay

U.CASH Pay bridge for Square POS. Offer crypto + card on a sale; a verified webhook records the payment in Square. Non-custodial.

Status: scaffold. The platform API call in markPaid() is stubbed (documented below). Wire it, validate in the sandbox, then list on the platform marketplace.

Flow

  • GET /pay?orderId=..&amount=..&currency=.. redirects to a hosted U.CASH Pay checkout for the sale.
  • POST /ucashpay/webhook verifies the X-Webhook-Signature (HMAC-SHA256, 300s window) and records the payment.

Run

npm install
UCASH_CLOUD_TOKEN=st_your_store_cloud_token \
UCASH_WEBHOOK_SECRET=your_store_webhook_secret \
SQUARE_ACCESS_TOKEN=.. SQUARE_ENV=sandbox \
PORT=3000 npm start

Set up your pay.u.cash account

  1. Sign up at pay.u.cash, verify email.
  2. Set receive addresses under Settings -> Addresses.
  3. Create a store at Account -> Stores -> + Add Store; copy the Store Cloud Token + Store Webhook Secret.
  4. Set the webhook URL to https://your-host/ucashpay/webhook, then Test Webhook.

Square setup

Create a Square app at the Square Developer Dashboard, grab an access token. In markPaid(): create an external payment against the order via the Payments API - POST https://connect.{env}.squareupsandbox.com/v2/payments (production: https://connect.squareup.com/v2/payments) with body { source_id: 'EXTERNAL', amount_money, external_details: { type: 'EXTERNAL_TYPE_U_CASH', source: 'U.CASH Pay' } } using Authorization: Bearer . Square App Marketplace listing is a separate review.

License

MIT.

About

U.CASH Pay bridge for Square POS: accept crypto + card on sales with verified webhooks. Scaffold.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages