allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
49
vendor/mollie/mollie-api-php/src/Resources/ClientLink.php
vendored
Normal file
49
vendor/mollie/mollie-api-php/src/Resources/ClientLink.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Mollie\Api\Resources;
|
||||
|
||||
use Mollie\Api\Types\ApprovalPrompt;
|
||||
|
||||
class ClientLink extends 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 = ApprovalPrompt::AUTO)
|
||||
{
|
||||
if (! in_array($approval_prompt, [ApprovalPrompt::AUTO, 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