regna/urbaniqo-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

regna/urbaniqo-sdk

最新稳定版本:v1.0.1

Composer 安装命令:

composer require regna/urbaniqo-sdk

包简介

Official PHP SDK for the Urbaniqo Transit protocol — sell your tickets, passes and subscriptions through the Urbaniqo app.

README 文档

README

Official PHP client for Urbaniqo Transit — the channel that lets your customers buy your tickets, passes and subscriptions through the Urbaniqo app.

Looking for the JavaScript / Node SDK? It lives in a separate repository: regnatech/urbaniqo-sdk-js.

Package Manager Status
regna/urbaniqo-sdk Composer · PHP ≥ 8.2 v1

Wire-level spec for both SDKs: docs/protocol.md.

Install

composer require regna/urbaniqo-sdk guzzlehttp/guzzle

guzzlehttp/guzzle is the recommended PSR-18 implementation. Bring your own if you already have a different one.

Quick start

use GuzzleHttp\Client as Guzzle;
use GuzzleHttp\Psr7\HttpFactory;
use Regna\UrbaniqoSdk\Client;

$factory = new HttpFactory();
$urbaniqo = new Client(
    agencyId:       $_ENV['URBANIQO_AGENCY_ID'],
    keyId:          $_ENV['URBANIQO_KEY_ID'],
    secret:         $_ENV['URBANIQO_SECRET'],
    httpClient:     new Guzzle(),
    requestFactory: $factory,
    streamFactory:  $factory,
    // baseUrl defaults to https://urbaniqo.com/api/transit/v1
);

$urbaniqo->upsertTariffs([
    [
        'id' => 'AMT-110',
        'name' => ['en' => 'Single ride 110\'', 'it' => 'Corsa singola 110 minuti'],
        'kind' => 'single_ride',
        'fare_cents' => 200,
        'currency' => 'EUR',
        'default_validity_seconds' => 110 * 60,
        'is_active' => true,
    ],
]);

What the SDK gives you

  • HMAC-SHA256 request signing (Authorization header in canonical-request form)
  • Idempotent retries with exponential backoff for safe verbs (PUT, GET, idempotent POSTs)
  • Webhooks\Verifier for inbound webhook signature checking — pass the raw request body
  • Typed exceptions: UrbaniqoApiException, UrbaniqoTransportException, UrbaniqoWebhookException

Webhook handler (Laravel example)

A complete drop-in lives at examples/php-laravel-webhook/routes-snippet.php.

Docs

License

MIT — see LICENSE.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固