Download the PHP package dodopayments/client without Composer

On this page you can find all versions of the php package dodopayments/client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package client

Dodo Payments PHP API library

[!NOTE] The Dodo Payments PHP API Library is currently in beta and we're excited for you to experiment with it!

This library has not yet been exhaustively tested in production environments and may be missing some features you'd expect in a stable release. As we continue development, there may be breaking changes that require updates to your code.

We'd love your feedback! Please share any suggestions, bug reports, feature requests, or general thoughts by filing an issue.

The Dodo Payments PHP library provides convenient access to the Dodo Payments REST API from any PHP 8.1.0+ application.

It is generated with Stainless.

Documentation

The REST API documentation can be found on docs.dodopayments.com.

Installation

Usage

This library uses named parameters to specify optional arguments. Parameters with a default value must be set by name.

Value Objects

It is recommended to use the static with constructor AttachExistingCustomer::with(customerID: "customer_id", ...) and named parameters to initialize value objects.

However, builders are also provided (new AttachExistingCustomer)->withCustomerID("customer_id").

Pagination

List methods in the Dodo Payments API are paginated.

This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:

Handling errors

When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of Dodopayments\Core\Exceptions\APIException will be thrown:

Error codes are as follows:

Cause Error Type
HTTP 400 BadRequestException
HTTP 401 AuthenticationException
HTTP 403 PermissionDeniedException
HTTP 404 NotFoundException
HTTP 409 ConflictException
HTTP 422 UnprocessableEntityException
HTTP 429 RateLimitException
HTTP >= 500 InternalServerException
Other HTTP error APIStatusException
Timeout APITimeoutException
Network error APIConnectionException

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff.

Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.

You can use the maxRetries option to configure or disable this:

Advanced concepts

Making custom or undocumented requests

Undocumented properties

You can send undocumented parameters to any endpoint, and read undocumented response properties, like so:

Note: the extra* parameters of the same name overrides the documented parameters.

Undocumented request params

If you want to explicitly send an extra param, you can do so with the extra_query, extra_body, and extra_headers under the request_options: parameter when making a request, as seen in the examples above.

Undocumented endpoints

To make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using client.request, like so:

Versioning

This package follows SemVer conventions. As the library is in initial development and has a major version of 0, APIs may change at any time.

This package considers improvements to the (non-runtime) PHPDoc type definitions to be non-breaking changes.

Requirements

PHP 8.1.0 or higher.

Contributing

See the contributing documentation.


All versions of client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
php-http/discovery Version ^1
psr/http-client Version ^1
psr/http-client-implementation Version ^1
psr/http-factory-implementation Version ^1
psr/http-message Version ^1|^2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dodopayments/client contains the following files

Loading the files please wait ....