PHPackages                             wdevkit/sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. wdevkit/sdk

ActiveLibrary

wdevkit/sdk
===========

A sdk to wdevkit services.

v1.0.3(5y ago)0234MITPHPPHP ^7.4|^8.0

Since Oct 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/wdevkit/sdk)[ Packagist](https://packagist.org/packages/wdevkit/sdk)[ Docs](https://github.com/wdevkit/sdk)[ RSS](/packages/wdevkit-sdk/feed)WikiDiscussions develop Synced 1w ago

READMEChangelogDependencies (5)Versions (6)Used By (0)

[![](https://camo.githubusercontent.com/6e290532525e1e1efc48b65e8c9ebb62aef89f195fd7bb75af482a754ac06404/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f576465766b697425323053444b2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d776465766b697425324673646b267061747465726e3d63697263756974426f617264267374796c653d7374796c655f31266465736372697074696f6e3d412b73646b2b746f2b776465766b69742b7365727669636573266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d637562652d7472616e73706172656e74)](https://camo.githubusercontent.com/6e290532525e1e1efc48b65e8c9ebb62aef89f195fd7bb75af482a754ac06404/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f576465766b697425323053444b2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d776465766b697425324673646b267061747465726e3d63697263756974426f617264267374796c653d7374796c655f31266465736372697074696f6e3d412b73646b2b746f2b776465766b69742b7365727669636573266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d637562652d7472616e73706172656e74)

A sdk to wdevkit services
=========================

[](#a-sdk-to-wdevkit-services)

[![Latest Version on Packagist](https://camo.githubusercontent.com/00a56e778c81540e27de79354e3a9d5a28e811bc35dbf3125073c988ae9cdb1a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776465766b69742f73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wdevkit/sdk)[![GitHub Tests Action Status](https://camo.githubusercontent.com/47d0a4c28c49664cfce69ece5e80029b4d5545b9975f9cea86de505ffd21f647/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f776465766b69742f73646b2f54657374732f6d61737465723f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/wdevkit/sdk/actions?query=workflow%3ATests+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/97bacd48589ba30b4ede469d0afd334842b2295053ed5a9bd793701b191ea7d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776465766b69742f73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wdevkit/sdk)

A sdk that simplifies the usage of many wdevkit services, with a tested, clean and easy to use api.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require wdevkit/sdk
```

Usage
-----

[](#usage)

The `wdevkit/sdk` provides api to multiple *wdevkit* services. The services are provided by the `\Wdevkit\Sdk\Api` class, by calling the respective service name as a static method, as you can see below:

```
$accounts = \Wdevkit\Sdk\Api::auth($settings);
$payments = \Wdevkit\Sdk\Api::payments($settings);
$checkout = \Wdevkit\Sdk\Api::checkout($settings);
$orders = \Wdevkit\Sdk\Api::orders($settings);
$inventory = \Wdevkit\Sdk\Api::inventory($settings);
```

By calling the static method, a new instance of the service handler will be instantiated, with the given `$settings` array. In this settings, you must a `base_uri` and a `token`, on order to correctly make the requests to each service. You also can pass a `client` instance to the service. If not provided, a default client using [Guzzle](https://github.com/guzzle/guzzle) will be used, with the given request headers:

```
'headers' => [
    'User-Agent' => 'wdevkit/sdk:1.x',
    'Accept'     => 'application/json',
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer ' . ,
]
```

Each service handler instantiated may have its own methods, wich will be described in the respective service documentation.

### Auth

[](#auth)

##### Fetch User

[](#fetch-user)

In order to check if you are authenticated, you can make a request to a wdevkit auth service `/sanctum/user` endpoint by using the `\Wdevkit\Sdk\Api::auth($settings)->fetchUser([])` method.

```
$settings = [
    'base_uri' => 'https://auth.your_domain.dev',
    'token' => 'some_token'
];

$checkout = \Wdevkit\Sdk\Api::auth($settings)->fetchUser([]);

// response

'data' => [
    'uuid' => 'a25d81de-8715-480e-a6cb-df24649e7479',
    'name' => 'John Doe',
    'email' => 'john@email.com',
]
```

### Checkout

[](#checkout)

##### Create a Checkout

[](#create-a-checkout)

In order to create a checkout, you can use the `\Wdevkit\Sdk\Api::checkout($settings)->create([])` method from the sdk, and you need to provide the required data.

```
$settings = [
    'base_uri' => 'https://checkout.your_domain.dev',
    'token' => 'some_token'
];

$checkout = \Wdevkit\Sdk\Api::checkout($settings)->create([
    'items' => [
        [
            'name' => 'Black shirt #1', // required
            'sku' => 'black_shirt_1', // required
            'qty' => 2, // required
            'price' => 15.10, // required
        ],
    ],
    'meta' => [
        'source_type' => 'acme_system', // required
        'source_id' => '123456', // required
    ],
]);

// response

'data' => [
    'uuid' => '2dcdf759-1ba1-4d25-aca9-9c0c11224cfd',
    'actions' => [
        'get' => 'https://checkout.your_domain.dev/checkouts/2dcdf759-1ba1-4d25-aca9-9c0c11224cfd/profiles',
    ]
]
```

### Payments

[](#payments)

##### Fetch Methods

[](#fetch-methods)

To fetch payment methods options, you can use the `\Wdevkit\Sdk\Api::payments($settings)->fetchMethods([])` method from the sdk.

```
$settings = [
    'base_uri' => 'https://payments.your_domain.dev',
    'token' => 'some_token'
];

$methods = \Wdevkit\Sdk\Api::payments($settings)->fetchMethods([]);

// response

'data' => [
    'methods' => [
        ['code' => 'credit_card', 'title' => 'Credit Card', 'driver' => 'stripe'],
        ['code' => 'transfer', 'title' => 'Transfer', 'driver' => 'bank_acme'],
    ]
]
```

##### Create a Payment

[](#create-a-payment)

To create a payment, you can use the `\Wdevkit\Sdk\Api::payments($settings)->create([])` method from the sdk, and you need to provide the required data.

```
$settings = [
    'base_uri' => 'https://payments.your_domain.dev',
    'token' => 'some_token'
];

$methods = \Wdevkit\Sdk\Api::payments($settings)->create([
    'customer' => [
        'name' => 'John Doe', // required
        'document' => '12345678909', // required
        'email' => 'john@test.dev', // required
    ],
    'payment' => [
        'method' => 'credit_card', // required
        'amount' => 125.35, // required,
        'installments' => 1, // required
        'method_data' => [], // required, and attributes required depending on method.
    ],
    'meta' => [
        'source_type' => 'acme_system', // required
        'source_id' => '123456', // required
    ],
]);

// response

'data' => [
    'payment_uuid' => 'fb624d85-5a13-47c7-8ea7-b917490d5e12',
    'payment_method' => 'credit_card',
    'amount' => '42',
    'state' => 'processed',
    'status' => 'success',
    'errors' => null,
    'actions' => [
        ['title' => 'Refund', 'code' => 'refund', 'url' => 'https://refund_route'],
        ['title' => 'Details', 'code' => 'details', 'url' => 'https://details_route'],
    ],
]
```

##### Fetch a Payment

[](#fetch-a-payment)

To fetch a previously created payment, you can use the `\Wdevkit\Sdk\Api::payments($settings)->fetch($uuid)` method from the sdk. You need to provide a *payment uuid* on the *fetch* method.

```
$settings = [
    'base_uri' => 'https://payments.your_domain.dev',
    'token' => 'some_token'
];

$methods = \Wdevkit\Sdk\Api::payments($settings)->fetch('fb624d85-5a13-47c7-8ea7-b917490d5e12');

// response

'data' => [
    'id' => 50,
    'uuid' => 'fb624d85-5a13-47c7-8ea7-b917490d5e12',
    'driver' => 'acme',
    'method' => 'credit_card',
    'state' => 'processed',
    'status' => 'success',
    'amount' => '119.0000',
    'installments' => 1,
    'description' => 'test payment',
    'recurring' => null,
    'customer' => [
        'name' => 'John Doe',
        'email' => 'johndoe@email.com',
        'phone' => '999999999',
        'document' => '999999999999'
    ]
]
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Gilmar Pereira](https://github.com/wdarking)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~37 days

Total

4

Last Release

1938d ago

PHP version history (2 changes)v1.0.0PHP ^7.4

v1.0.2PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1df50df19479560f6cefd3df3f66da90e12a567fda75523f9b986794d9c19b0f?d=identicon)[wdevkit](/maintainers/wdevkit)

---

Top Contributors

[![wdarking](https://avatars.githubusercontent.com/u/14166369?v=4)](https://github.com/wdarking "wdarking (20 commits)")

---

Tags

sdkwdevkit

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wdevkit-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/wdevkit-sdk/health.svg)](https://phpackages.com/packages/wdevkit-sdk)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k511.3M2.2k](/packages/aws-aws-sdk-php)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

682104.9k7](/packages/guanguans-notify)[azure-oss/storage

Azure Blob Storage PHP SDK

37985.0k5](/packages/azure-oss-storage)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
