A Laravel package for U.CASH Pay: create crypto + card checkouts and receive verified settlement webhooks. Non-custodial.
composer require ucash/ucashpay-laravel
php artisan vendor:publish --tag=ucashpay-configSet your store credentials in .env:
UCASH_CLOUD_TOKEN=st_your_store_cloud_token
UCASH_WEBHOOK_SECRET=your_store_webhook_secret
UCASH_BASE_URL=https://pay.u.cash
use UdotCASH\UcashPay\Facades\UcashPay;
$r = UcashPay::createCheckout(
amount: '10.00',
currency: 'USD',
external_reference: $order->id, // idempotent; returned in the webhook
title: 'Order #' . $order->id,
redirect_url: route('orders.thanks', $order),
);
if ($r['ok']) {
return redirect($r['payment_url']); // send the buyer to hosted checkout
}The package mounts POST /ucashpay/webhook that verifies the X-Webhook-Signature (HMAC-SHA256 over t.raw_body, 300s window, timing-safe) and fires a PaymentReceived event. Listen for it:
// app/Providers/EventServiceProvider.php
protected $listen = [
\UdotCASH\UcashPay\Events\PaymentReceived::class => [
\App\Listeners\MarkOrderPaid::class,
],
];Set the webhook URL in pay.u.cash to https://your-app.test/ucashpay/webhook, 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.
app('ucashpay')->testConnection('https://your-app.test/ucashpay/webhook');MIT.