Files
assetmgt/assets/mollie/src/Endpoints/OrderRefundEndpoint.php
“VeLiTi” 0f968aac14 Add Mollie API integration and webhook for software upgrade payments
- Introduced the `CaBundle.php` class for managing CA certificates.
- Updated `installed.json` and `installed.php` to include the new `composer/ca-bundle` dependency.
- Added `platform_check.php` to enforce PHP version requirements.
- Created `initialize.php` for initializing the Mollie API client with the API key.
- Implemented `webhook_mollie.php` to handle webhook callbacks for software upgrade payments, including transaction status updates and invoice generation.
- Integrated DomPDF for generating invoices and sending them via email.
2025-12-21 14:44:37 +01:00

64 lines
1.9 KiB
PHP

<?php
namespace Mollie\Api\Endpoints;
use Mollie\Api\Resources\Order;
use Mollie\Api\Resources\Refund;
use Mollie\Api\Resources\RefundCollection;
class OrderRefundEndpoint extends \Mollie\Api\Endpoints\CollectionEndpointAbstract
{
protected $resourcePath = "orders_refunds";
/**
* Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
*
* @return Refund
*/
protected function getResourceObject()
{
return new \Mollie\Api\Resources\Refund($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 RefundCollection
*/
protected function getResourceCollectionObject($count, $_links)
{
return new \Mollie\Api\Resources\RefundCollection($this->client, $count, $_links);
}
/**
* Refund some order lines. You can provide an empty array for the
* "lines" data to refund all eligible lines for this order.
*
* @param Order $order
* @param array $data
* @param array $filters
*
* @return Refund
* @throws \Mollie\Api\Exceptions\ApiException
*/
public function createFor(\Mollie\Api\Resources\Order $order, array $data, array $filters = [])
{
return $this->createForId($order->id, $data, $filters);
}
/**
* Refund some order lines. You can provide an empty array for the
* "lines" data to refund all eligible lines for this order.
*
* @param string $orderId
* @param array $data
* @param array $filters
*
* @return \Mollie\Api\Resources\Refund
* @throws \Mollie\Api\Exceptions\ApiException
*/
public function createForId($orderId, array $data, array $filters = [])
{
$this->parentId = $orderId;
return parent::rest_create($data, $filters);
}
}