A zero-dependency Go client for U.CASH Pay: create crypto + card checkouts and verify settlement webhooks. Non-custodial.
go get github.com/UdotCASH/ucashpay-goimport "github.com/UdotCASH/ucashpay-go"
client := ucashpay.New(os.Getenv("UCASH_CLOUD_TOKEN"), "https://pay.u.cash")
res, err := client.CreateCheckout("10.00", "USD", orderID, "Order #"+orderID, "https://yoursite.com/thanks")
if err != nil { /* ... */ }
if res.OK {
http.Redirect(w, r, res.PaymentURL, http.StatusFound) // send buyer to hosted checkout
}func webhook(w http.ResponseWriter, r *http.Request) {
raw, _ := io.ReadAll(r.Body)
sig := r.Header.Get("X-Webhook-Signature")
client := ucashpay.New("", "")
v := client.VerifyWebhook(string(raw), sig, os.Getenv("UCASH_WEBHOOK_SECRET"))
if !v.Verified {
http.Error(w, v.Error, http.StatusUnauthorized)
return
}
// parse the body, mark the order paid, respond 200
w.WriteHeader(http.StatusOK)
}Set the webhook URL in pay.u.cash to your handler, save, then Test Webhook.
- Sign up at pay.u.cash with email + password, then click the verification link in the email.
- Set your receive addresses under Settings → Addresses (a wallet per coin, or ENS/Unstoppable/FIO names). Crypto settles here.
- Create a store at Account → Stores → + Add Store.
- Copy the Store Cloud Token + Store Webhook Secret into your env. Use the store-level token, not the account-wide one.
- Set the webhook URL as above, then Test Webhook.
MIT.