[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: OrderLineEndpoint.php
<?php namespace Mollie\Api\Endpoints; use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Resources\Order; use Mollie\Api\Resources\OrderLine; use Mollie\Api\Resources\OrderLineCollection; use Mollie\Api\Resources\ResourceFactory; class OrderLineEndpoint extends CollectionEndpointAbstract { protected $resourcePath = "orders_lines"; /** * @var string */ public const RESOURCE_ID_PREFIX = 'odl_'; /** * Get the object that is used by this API endpoint. Every API endpoint uses one * type of object. * * @return OrderLine */ protected function getResourceObject() { return new OrderLine($this->client); } /** * Get the collection object that is used by this API endpoint. Every API * endpoint uses one type of collection object. * * @param int $count * @param \stdClass $_links * * @return OrderLineCollection */ protected function getResourceCollectionObject($count, $_links) { return new OrderLineCollection($count, $_links); } /** * Update a specific OrderLine resource. * * Will throw an ApiException if the order line id is invalid or the resource cannot be found. * * @param string|null $orderId * @param string $orderlineId * * @param array $data * * @return \Mollie\Api\Resources\BaseResource|null * @throws \Mollie\Api\Exceptions\ApiException */ public function update($orderId, $orderlineId, array $data = []) { $this->parentId = $orderId; if (empty($orderlineId) || strpos($orderlineId, self::RESOURCE_ID_PREFIX) !== 0) { throw new ApiException("Invalid order line ID: '{$orderlineId}'. An order line ID should start with '".self::RESOURCE_ID_PREFIX."'."); } return parent::rest_update($orderlineId, $data); } /** * @param string $orderId * @param array $operations * @param array $parameters * @return Order|\Mollie\Api\Resources\BaseResource * @throws \Mollie\Api\Exceptions\ApiException */ public function updateMultiple(string $orderId, array $operations, array $parameters = []) { if (empty($orderId)) { throw new ApiException("Invalid resource id."); } $this->parentId = $orderId; $parameters['operations'] = $operations; $result = $this->client->performHttpCall( self::REST_UPDATE, "{$this->getResourcePath()}", $this->parseRequestBody($parameters) ); return ResourceFactory::createFromApiResult($result, new Order($this->client)); } /** * Cancel lines for the provided order. * The data array must contain a lines array. * You can pass an empty lines array if you want to cancel all eligible lines. * Returns null if successful. * * @param Order $order * @param array $data * * @return null * @throws ApiException */ public function cancelFor(Order $order, array $data) { return $this->cancelForId($order->id, $data); } /** * Cancel lines for the provided order id. * The data array must contain a lines array. * You can pass an empty lines array if you want to cancel all eligible lines. * Returns null if successful. * * @param string $orderId * @param array $data * * @return null * @throws ApiException */ public function cancelForId($orderId, array $data) { if (! isset($data['lines']) || ! is_array($data['lines'])) { throw new ApiException("A lines array is required."); } $this->parentId = $orderId; $this->client->performHttpCall( self::REST_DELETE, "{$this->getResourcePath()}", $this->parseRequestBody($data) ); return null; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.77 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002