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.
This commit is contained in:
38
assets/mollie/src/Resources/ClientLink.php
Normal file
38
assets/mollie/src/Resources/ClientLink.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Mollie\Api\Resources;
|
||||
|
||||
use Mollie\Api\Types\ApprovalPrompt;
|
||||
class ClientLink extends \Mollie\Api\Resources\BaseResource
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $resource;
|
||||
/**
|
||||
* Id of the client link.
|
||||
*
|
||||
* @example csr_vZCnNQsV2UtfXxYifWKWH
|
||||
* @var string
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* An object with several URL objects relevant to the client link. Every URL object will contain an href and a type field.
|
||||
*
|
||||
* @var \stdClass
|
||||
*/
|
||||
public $_links;
|
||||
/**
|
||||
* Get the redirect URL where the customer can complete the payment.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRedirectUrl(string $client_id, string $state, array $scopes = [], string $approval_prompt = \Mollie\Api\Types\ApprovalPrompt::AUTO)
|
||||
{
|
||||
if (!\in_array($approval_prompt, [\Mollie\Api\Types\ApprovalPrompt::AUTO, \Mollie\Api\Types\ApprovalPrompt::FORCE])) {
|
||||
throw new \Exception('Invalid approval_prompt. Please use "auto" or "force".');
|
||||
}
|
||||
$query = \http_build_query(['client_id' => $client_id, 'state' => $state, 'approval_prompt' => $approval_prompt, 'scope' => \implode(' ', $scopes)], '', '&', \PHP_QUERY_RFC3986);
|
||||
return "{$this->_links->clientLink->href}?{$query}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user