Download the PHP package wdevkit/sdk without Composer
On this page you can find all versions of the php package wdevkit/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package sdk
Short Description A sdk to wdevkit services.
License MIT
Homepage https://github.com/wdevkit/sdk
Informations about the package sdk
A sdk to wdevkit services
A sdk that simplifies the usage of many wdevkit services, with a tested, clean and easy to use api.
Installation
You can install the package via composer:
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:
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 will be used, with the given request headers:
Each service handler instantiated may have its own methods, wich will be described in the respective service documentation.
Auth
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.
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.
Payments
Fetch Methods
To fetch payment methods options, you can use the \Wdevkit\Sdk\Api::payments($settings)->fetchMethods([])
method from the sdk.
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.
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.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Gilmar Pereira
- All Contributors
License
The MIT License (MIT). Please see License File for more information.