Skip to content
ArionPay

Laravel package

Accept crypto payments in your Laravel app

Create an invoice with ArionPay::createInvoice and deliver the order in an InvoicePaid listener. The package checks the signature, the test or live mode and duplicate deliveries for you.

Install

composer require arionpay/arionpay-laravel
Source on GitHub
Example

What it does

ArionPay for Laravel developers

arionpay/arionpay-laravel builds on the official PHP library for Laravel 10 to 13 on PHP 8.1 or newer. It adds a webhook route that checks every signed update and fires it once as a normal Laravel event.
Read moreIn test mode every new invoice is a test invoice, so you can try the whole flow without real money. Payments go straight to your own wallet: ArionPay never holds them.
  • ArionPay::createInvoice([...]) gives you the payment page address (invoiceUrl).
  • Payment updates arrive as Laravel events: InvoicePaid, InvoicePending, InvoicePartial, InvoiceExpired, InvoiceNeedsReview and TestWebhookReceived.
  • The route POST /arionpay/webhook checks the ArionPay-Signature over the exact body (5-minute window). Anything else gets 401 and no event fires.
  • Each event fires once: it is remembered in your cache for 96 hours.
  • ARIONPAY_TEST_MODE=true makes new invoices test invoices and accepts only test webhooks. A mismatch gets 409.
  • php artisan arionpay:check checks your keys and shows the webhook address. php artisan arionpay:test-webhook asks ArionPay for a signed sample event.
  • Every event has matches($amount, $currency), invoiceId(), orderId() and metadata() for matching the order.

Requirements and licence

Works with
Laravel 10 to 13 · PHP 8.1 or newer · built on arionpay/arionpay-php
Tested
Laravel 13.42 and 12, against a real ArionPay server
Cost
The library is free. ArionPay charges 0.5% per payment, with no monthly fee.
Source
Open source (MIT) on GitHub.

Setup

Set it up in 5 steps

  1. Step 1

    Install the package

    Run composer require arionpay/arionpay-laravel. Laravel picks up the service provider and the ArionPay facade by itself.

  2. Step 2

    Add your keys to .env

    Set ARIONPAY_API_KEY (pk_), ARIONPAY_API_SECRET (sk_) and ARIONPAY_WEBHOOK_SECRET (whsec_) from your ArionPay dashboard, and ARIONPAY_TEST_MODE=true. Then run php artisan arionpay:check.

  3. Step 3

    Create an invoice

    Call ArionPay::createInvoice with the amount, orderId and an idempotencyKey such as 'order-' . $order->id, and redirect to $invoice['invoiceUrl']. The invoice sends its updates to your app's webhook route unless you pass your own callbackUrl.

  4. Step 4

    Deliver on InvoicePaid

    Listen for ArionPay\Laravel\Events\InvoicePaid, find the order, check $event->matches($order->total, $order->currency), then deliver. If a listener throws, the route answers 500 and ArionPay delivers again later.

  5. Step 5

    Test, then go live

    In test mode, create an invoice with 'asset' => 'USDT_TRC20' and call ArionPay::simulatePayment($invoice['id'], 'exact'), or use the Try a test payment buttons in the dashboard. Set ARIONPAY_TEST_MODE=false for real payments.

After the setup

How a payment reaches your code

  • InvoicePaid: fully paid and confirmed, so deliver. It also fires for late payments, small differences inside your payment tolerance (default 1%) and payments you accept in Payment Radar.
  • InvoicePending: the payment was seen on the network and waits for confirmations. Don't deliver yet.
  • InvoicePartial and InvoiceExpired: not fully paid. A late payment can still follow as InvoicePaid.
  • InvoiceNeedsReview: decide in your ArionPay dashboard. If you accept, InvoicePaid follows.
  • TestWebhookReceived: a sample from "Send test webhook" about a made-up invoice. Never deliver for it.

16 coins and tokens on 9 networks

All coins
  • BTCBitcoin
  • ETHEthereum
  • USDTEthereum
  • USDCEthereum
  • BNBBNB Smart Chain
  • USDTBNB Smart Chain
  • USDCBNB Smart Chain
  • POLPolygon
  • USDTPolygon
  • USDCPolygon
  • TRXTRON
  • USDTTRON
  • LTCLitecoin
  • DOGEDogecoin
  • BCHBitcoin Cash
  • DASHDash

Questions about the ArionPay Laravel library

Short answers before you add it to your code.

Laravel 10 to 13 with PHP 8.1 or newer. It was tested on Laravel 13.42 and 12 against a real ArionPay server.

Developer libraries