mirror of
https://github.com/anikeen-com/id.git
synced 2026-11-01 05:09:35 +00:00
Fixed (called endpoints that don't exist):
- charge(): POST v1/billing/charge (Stripe options aren't passed through anymore)
- Invoice::getInvoiceTemporaryUrl(): GET instead of a non-existent PUT
- OrderItems::create(): POST v1/orders/{order}/items
- createUser() / isEmailExisting(): admin endpoints with the app token
- sshKeysByUserId(): app endpoint; no longer returns the first user's keys for every user
- createOrderPreview(): country_iso goes into billing_address as the API expects
- public endpoints (products, order preview) work without a token
- SshKeys::find() results can be deleted
Added:
- Billable: sshKeys() (create, update, delete), billingOverview(), PaymentMethod::delete()
- AnikeenId: products(), boxes(), shipping labels (list, show, pdf, issue, ship, price list),
createOrderForUser(), createTransactionForUser(), findOrCreateSocialiteUser()
Requirements: PHP 8.2+, Laravel 11-13 (Laravel 10 and PHP 8.1 are end of life).
Docs generator handles union types; README regenerated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
889 B
PHP
34 lines
889 B
PHP
<?php
|
|
|
|
namespace Anikeen\Id\Resources;
|
|
|
|
use Anikeen\Id\Concerns\HasParent;
|
|
use Throwable;
|
|
|
|
class SshKeys extends BaseCollection
|
|
{
|
|
use HasParent;
|
|
|
|
/**
|
|
* Creates ssh key for the currently authed user.
|
|
*
|
|
* @param string $publicKey The public key to be added
|
|
* @param string|null $name The name of the key (optional)
|
|
* @throws Throwable
|
|
*/
|
|
public function create(string $publicKey, ?string $name = null): SshKey
|
|
{
|
|
return (new SshKey(fn() => $this->parent->post('v1/ssh-keys', [
|
|
'public_key' => $publicKey,
|
|
'name' => $name,
|
|
])))->setParent($this->parent);
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public function find(string $id): ?SshKey
|
|
{
|
|
return (new SshKey(fn() => $this->parent->get(sprintf('v1/ssh-keys/%s', $id))))->setParent($this->parent);
|
|
}
|
|
}
|