Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Svea Laravel Package

nordkit/svea

Modern PHP SDK for Svea Checkout, Payment Admin, webhook subscriptions and inbound webhook verification. Fluent API with typed value objects, retries, idempotency, async task polling, and a robust testing fake. Includes first-class Laravel integration.

View on GitHub
Deep Wiki
Context7

Subscriptions

Webhook subscriptions are how Svea notifies your application when order lifecycle events occur. Register a HTTPS endpoint once per merchant; Svea pushes a signed JSON payload to that URL whenever a subscribed event fires.

::: warning Subscriptions vs task polling These are two different mechanisms. Subscriptions are Svea → you (push), fired on lifecycle changes. Task polling is you → Svea (pull), used to wait for an async Admin operation to finish. See the README disambiguation table. :::

Event types

EventType case Svea event string When it fires
CheckoutOrderCreated CheckoutOrder.Created Order created
CheckoutOrderUpdated CheckoutOrder.Updated Order edited or sync
CheckoutOrderDelivered CheckoutOrder.Delivered Captured
CheckoutOrderCreditSucceeded CheckoutOrder.CreditSucceeded Credit succeeded
CheckoutOrderCreditFailed CheckoutOrder.CreditFailed Credit failed
CheckoutOrderClosed CheckoutOrder.Closed Cancelled or expired
CheckoutOrderPendingStatusReleased CheckoutOrder.PendingStatusReleased Pending order approved
StandaloneOrderPendingStatusReleased StandaloneOrder.PendingStatusReleased Standalone pending order approved
StandaloneOrderClosed StandaloneOrder.Closed Standalone order closed
Ping Ping Sent by verify() to confirm reachability

::: warning Checkout Finalized is not a subscription event When a customer completes payment, Svea POSTs {"type": "Finalized"} to the per-order pushUri configured on MerchantSettings — not via the subscription system. Your pushUri endpoint must then call Svea::admin()->order($orderId)->get() to read the Payment Admin status. :::

Registration

use Svea\Subscriptions\EventType;

$subscription = Svea::subscriptions()->add(
    callbackUrl: 'https://myapp.com/webhooks/svea',
    eventTypes: [
        EventType::CheckoutOrderCreated,
        EventType::CheckoutOrderDelivered,
        EventType::CheckoutOrderCreditSucceeded,
        EventType::CheckoutOrderCreditFailed,
        EventType::CheckoutOrderClosed,
    ],
);

Svea::subscriptions()->verify($subscription->id());

Or via the fluent builder (calls verify() automatically):

$subscription = Svea::subscriptions()
    ->on(EventType::CheckoutOrderCreated, EventType::CheckoutOrderDelivered)
    ->notifyAt('https://myapp.com/webhooks/svea')
    ->register();

CRUD

Svea::subscriptions()->list();
Svea::subscriptions()->get('sub-id');
Svea::subscriptions()->update('sub-id', 'https://...', [EventType::CheckoutOrderCreated]);
Svea::subscriptions()->verify('sub-id');
Svea::subscriptions()->remove('sub-id');

Re-verification: Changing a subscription's URL invalidates verification — call verify() again before events resume.

Inspect

$subscription->id();           // 'fbb6c74a-...'
$subscription->callbackUrl();
$subscription->events();       // EventType[]
$subscription->isVerified();
$subscription->createdAt();

Manage via Artisan

In a Laravel app you can manage subscriptions without writing code — see Laravel → Artisan commands.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
craftcms/url-validator
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony