verschieben des sofortigen verzichts auf das Widerrrufsrecht zum Anlegen des Events
This commit is contained in:
27
app/Services/Paddle/PaddleCustomerPortalService.php
Normal file
27
app/Services/Paddle/PaddleCustomerPortalService.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Paddle;
|
||||
|
||||
class PaddleCustomerPortalService
|
||||
{
|
||||
public function __construct(private readonly PaddleClient $client) {}
|
||||
|
||||
/**
|
||||
* @param array{subscription_ids?: array<int, string>} $options
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function createSession(string $customerId, array $options = []): array
|
||||
{
|
||||
$payload = [
|
||||
'customer_id' => $customerId,
|
||||
];
|
||||
|
||||
if (! empty($options['subscription_ids'])) {
|
||||
$payload['subscription_ids'] = array_values(
|
||||
array_filter($options['subscription_ids'], 'is_string')
|
||||
);
|
||||
}
|
||||
|
||||
return $this->client->post('/customer-portal-sessions', $payload);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user