sapioweb / omnivore
Laravel 5 对 omnivore 的封装
1.0.4
2017-05-08 16:20 UTC
Requires
- guzzlehttp/guzzle: ^6.2
This package is not auto-updated.
Last update: 2024-09-14 19:47:52 UTC
README
将这些值放入你的 .ENV 文件中
OMNIVORE_API_URL
OMNIVORE_API_KEY
OMNIVORE_LOCATION_ID
ES_FROM
ES_SIZE
OMNIVORE_API_URL
将以下代码添加到使用包装器的构建中
function locationList() { $this->omnivoreGeneral = new OmnivoreGeneral; $this->omnivoreTickets = new OmnivoreTickets; $this->omnivoreTables = new OmnivoreTables; }
类 OmnivoreTickets
与 POS 中声明的位置的票证交互。
可用函数
列出位置的票证
$ticketList = $this->omnivoreTickets->ticketList($locationId) return response()->json($ticketList);
创建新的票证
$ticketOpen = $this->omnivoreTickets->ticketOpen($locationId, $content) return response()->json($ticketOpen);
检索特定票证的数据
$ticketRetrieve = $this->omnivoreTickets->ticketRetrieve($locationId, $ticketId); return response()->json($ticketRetrieve);
作废位置票证
$ticketVoid = $this->omnivoreTickets->ticketVoid($locationId, $ticketId) return response()->json($ticketVoid);
列出票证的折扣
$ticketDiscountList = $this->omnivoreTickets->ticketDiscountList($locationId, $ticketId) return response()->json($ticketDiscountList);
将折扣应用到票证上
$ticketDiscountApply = $this->omnivoreTickets->ticketDiscountApply($locationId, $ticketId, $discount, $value) return response()->json($ticketDiscountApply);
检索应用到票证上的折扣
$ticketDiscountRetrieve = $this->omnivoreTickets->ticketDiscountRetrieve($locationId, $ticketId, $ticketDiscountId) return response()->json($ticketDiscountRetrieve);
列出票证上的商品
$ticketItemList = $this->omnivoreTickets->ticketItemList($locationId, $ticketId) return response()->json($ticketItemList);
向票证添加商品
$ticketItemAdd = $this->omnivoreTickets->ticketItemAdd($locationId, $ticketId, $content) return response()->json($ticketItemAdd);
从票证中检索商品
$ticketItemRetrieve = $this->omnivoreTickets->ticketItemRetrieve($locationId, $ticketId, $ticketItemId) return response()->json($ticketItemRetrieve);
从票证中作废商品
$ticketItemVoid = $this->omnivoreTickets->ticketItemVoid($locationId, $ticketId, $ticketItemId) return response()->json($ticketItemVoid);
列出票证中的修饰项
$ticketItemModifierList = $this->omnivoreTickets->ticketItemModifierList($locationId, $ticketId, $ticketItemId) return response()->json($ticketItemModifierList);
从票证中检索修饰项
$ticketItemModifierRetrieve = $this->omnivoreTickets->ticketItemModifierRetrieve($locationId, $ticketId, $ticketItemId, $ticketItemModifierId) return response()->json($ticketItemModifierRetrieve);
列出票证上的折扣
$ticketItemDiscountList = $this->omnivoreTickets->ticketItemDiscountList($locationId, $ticketId, $ticketItemId) return response()->json($ticketItemDiscountList);
从票证中检索折扣
$ticketItemDiscountRetrieve = $this->omnivoreTickets->ticketItemDiscountRetrieve($locationId, $ticketId, $ticketItemId, $ticketItemDiscountId) return response()->json($ticketItemDiscountRetrieve);
列出支付
$paymentList = $this->omnivoreTickets->paymentList($locationId, $ticketId) return response()->json($paymentList);
检索支付
$paymentRetrieve = $this->omnivoreTickets->paymentRetrieve($locationId, $ticketId, $paymentId) return response()->json($paymentRetrieve);
进行无卡支付
$paymentCardNotPresent = $this->omnivoreTickets->paymentCardNotPresent($locationId, $ticketId, $content) return response()->json($paymentCardNotPresent);
进行有卡支付
$paymentCardPresent = $this->omnivoreTickets->paymentCardPresent($locationId, $ticketId, $content) return response()->json($paymentCardPresent);
使用第三方进行支付
$payment3rdParty = $this->omnivoreTickets->payment3rdParty($locationId, $ticketId, $content) return response()->json($payment3rdParty);
使用卡进行支付
$paymentGiftCard = $this->omnivoreTickets->paymentGiftCard($locationId, $ticketId, $content) return response()->json($paymentGiftCard);
使用现金支付
$paymentCash = $this->omnivoreTickets->paymentCash($locationId, $ticketId, $content) return response()->json($paymentCash);
类 OmnivoreTables
与 POS 中声明的位置的桌子交互。
可用函数
列出声明的位置的桌子
$tableList = $this->omnivoreTables->tableList($locationId) return response()->json($tableList);
检索特定桌子的数据
$tableRetrieve = $this->omnivoreTables->tableRetrieve($locationId, $tableId) return response()->json($tableRetrieve);
类 OmnivoreGeneral
与 POS 中声明的位置的一般标记动作交互。
可用函数
列出所有声明的位置
$locations = $this->omnivoreGeneral->locationList(); return response()->json($locations);
检索位置信息
$locationRetrieve = $this->omnivoreGeneral->locationRetrieve($locationId) return response()->json($locationRetrieve);
列出位置员工
$employeeList = $this->omnivoreGeneral->employeeList($locationId) return response()->json($employeeList);
检索特定位置的数据
$employeeRetrieve = $this->omnivoreGeneral->employeeRetrieve($locationId, $employeeId) return response()->json($employeeRetrieve);
列出位置类型
$orderTypeList = $this->omnivoreGeneral->orderTypeList($locationId) return response()->json($orderTypeList);
检索位置类型
$orderTypeRetrieve = $this->omnivoreGeneral->orderTypeRetrieve($locationId, $orderTypeId) return response()->json($orderTypeRetrieve);
列出位置接受的资金类型
$tenderTypeList = $this->omnivoreGeneral->tenderTypeList($locationId) return response()->json($tenderTypeList);
检索资金类型
$tenderTypeRetrieve = $this->omnivoreGeneral->tenderTypeRetrieve($locationId, $tenderTypeId) return response()->json($tenderTypeRetrieve);
列出位置的收入中心
$revenueCenterList = $this->omnivoreGeneral->revenueCenterList($locationId) return response()->json($revenueCenterList);
检索支付中心信息
$revenueCenterRetrieve = $this->omnivoreGeneral->revenueCenterRetrieve($locationId, $revenueCenterId) return response()->json($revenueCenterRetrieve);
列出位置的折扣
$discountList = $this->omnivoreGeneral->discountList($locationId) return response()->json($discountList);
检索折扣
$discountRetrieve = $this->omnivoreGeneral->discountRetrieve($locationId, $discountId) return response()->json($discountRetrieve);
从 POS 获取菜单
$menu = $this->omnivoreGeneral->menu($locationId) return response()->json($menu);
列出菜单分类
$categoryList = $this->omnivoreGeneral->categoryList($locationId) return response()->json($categoryList);
检索分类
$categoryRetrieve = $this->omnivoreGeneral->categoryRetrieve($locationId, $categoryId) return response()->json($categoryRetrieve);
列出菜单中的商品
$menuItemList = $this->omnivoreGeneral->menuItemList($locationId) return response()->json($menuItemList);
检索菜单商品
$menuItemRetrieve = $this->omnivoreGeneral->menuItemRetrieve($locationId, $menuItemId) return response()->json($menuItemRetrieve);
列出位置修饰项
$modifierList = $this->omnivoreGeneral->modifierList($locationId) return response()->json($modifierList);
检索修饰项
$modifierRetrieve = $this->omnivoreGeneral->modifierRetrieve($locationId, $modifierId) return response()->json($modifierRetrieve);
列出修饰项分组
$modifierGroupList = $this->omnivoreGeneral->modifierGroupList($locationId, $menuItemId) return response()->json($modifierGroupList);
检索修饰项分组
$modifierGroupRetrieve = $this->omnivoreGeneral->modifierGroupRetrieve($locationId, $menuItemId, $modifierGroupId) return response()->json($modifierGroupRetrieve);