定制 pashkevich/loyverse-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

pashkevich/loyverse-sdk

最新稳定版本:2.0.3

Composer 安装命令:

composer require pashkevich/loyverse-sdk

包简介

A simple to use PHP class to work with the Loyverse API

README 文档

README

Build Status Total Downloads Latest Stable Version License

To work with this package, firstly you must have a Loyverse account, and secondly you must create an API token through Loyverse itself.

Documentation

Installation

To install the SDK in your project you need to require the package via composer:

composer require pashkevich/loyverse-sdk

Basic Usage

You can create an instance of the SDK like so:

$loyverse = new Pashkevich\Loyverse\Loyverse(PERSONAL_ACCESS_TOKEN_HERE);

Using the Loyverse instance you may perform multiple actions as well as retrieve the different resources Loyverse's API provides:

$categories = $loyverse->categories();

This will give you an array of categories that you have access to, where each category is represented by an instance of Pashkevich\Loyverse\Resources\Category, this instance has multiple public properties like $id, $name, $color , and others.

You may also retrieve a single category using:

$category = $loyverse->category(CATEGORY_ID_HERE);

On multiple actions supported by this SDK you may need to pass some parameters, for example when creating a new category:

$category = $loyverse->createCategory([ 'name' => 'Fruits', 'color' => 'ORANGE', ]);

These parameters will be used in the POST request sent to Loyverse servers, you can find more information about the parameters needed for each action on Loyverse's official API documentation.

You can also set the desired timeout value:

$loyverse->setTimeout(120)->createCategory(array $data);

Managing Categories

$loyverse->categories(array $parameters); $loyverse->category(string $categoryId); $loyverse->createCategory(array $data); $loyverse->deleteCategory(string $categoryId);

On a Category instance you may also call:

$category->update(array $data); $category->delete();

Managing Customers

$loyverse->customers(array $parameters); $loyverse->customer(string $customerId); $loyverse->createCustomer(array $data); $loyverse->deleteCustomer(string $customerId);

On a Customer instance you may also call:

$customer->update(array $data); $customer->delete();

Managing Discounts

$loyverse->discounts(array $parameters); $loyverse->discount(string $discountId); $loyverse->createDiscount(array $data); $loyverse->deleteDiscount(string $discountId);

On a Discount instance you may also call:

$discount->update(array $data); $discount->delete();

Managing Employees

$loyverse->employees(array $parameters); $loyverse->employee(string $employeeId);

Managing Inventory

$loyverse->inventory(array $parameters); $loyverse->updateInventory(array $data);

Managing Items

$loyverse->items(array $parameters); $loyverse->item(string $itemId); $loyverse->createItem(array $data); $loyverse->deleteItem(string $itemId);

On a Item instance you may also call:

$item->update(array $data); $item->delete();

Managing Merchants

$loyverse->merchant();

Managing Modifiers

$loyverse->modifiers(array $parameters); $loyverse->modifier(string $modifierId); $loyverse->createModifier(array $data); $loyverse->deleteModifier(string $modifierId);

On a Modifier instance you may also call:

$modifier->update(array $data); $modifier->delete();

Managing Payment Types

$loyverse->paymentTypes(array $parameters); $loyverse->paymentType(string $paymentTypeId);

Managing Pos Devices

$loyverse->posDevices(array $parameters); $loyverse->posDevice(string $posDeviceId); $loyverse->createPosDevice(array $data); $loyverse->deletePosDevice(string $posDeviceId);

On a PosDevice instance you may also call:

$posDevice->update(array $data); $posDevice->delete();

Managing Receipts

$loyverse->receipts(array $parameters); $loyverse->receipt(string $receiptNumber); $loyverse->createReceipt(array $data); $loyverse->createReceiptRefund(string $receiptNumber, array $data);

On a Receipt instance you may also call:

$receipt->refund(array $data);

Managing Shifts

$loyverse->shifts(array $parameters); $loyverse->shift(string $shiftId);

Managing Stores

$loyverse->stores(array $parameters); $loyverse->store(string $storeId);

Managing Suppliers

$loyverse->suppliers(array $parameters); $loyverse->supplier(string $supplierId); $loyverse->createSupplier(array $data); $loyverse->deleteSupplier(string $supplierId);

On a Supplier instance you may also call:

$supplier->update(array $data); $supplier->delete();

Managing Taxes

$loyverse->taxes(array $parameters); $loyverse->tax(string $taxId); $loyverse->createTax(array $data); $loyverse->deleteTax(string $taxId);

On a Tax instance you may also call:

$tax->update(array $data); $tax->delete();

Managing Variants

$loyverse->variants(array $parameters); $loyverse->variant(string $variantId); $loyverse->createVariant(array $data); $loyverse->deleteVariant(string $variantId);

On a Variant instance you may also call:

$variant->update(array $data); $variant->delete();

Managing Webhooks

$loyverse->webhooks(array $parameters); $loyverse->webhook(string $webhookId); $loyverse->createWebhook(array $data); $loyverse->deleteWebhook(string $webhookId);

On a Webhook instance you may also call:

$webhook->update(array $data); $webhook->delete();

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email siarheipashkveich@gmail.com instead of using the issue tracker.

Credits

License

Loyverse SDK is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

  • Stars: 22
  • Watchers: 4
  • Forks: 10
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固