Laravel 10 – 13
PHP 8.2+
Low commit activity in last 18 months
A long-lived project that still receives updates
Official PHP Pingen SDK for API V2
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

php-parallel-lint/php-parallel-lint
^1.2
nikic/php-parser
4.15.*|^5.4
phpunit/phpunit
^11.5|^12.5.23
mockery/mockery
^1.4
symplify/easy-coding-standard-prefixed
9.2.6
^0.12.16|^2.0
phpstan/phpstan
^1.4|^2.1

Runtime

league/oauth2-client
^2.6
^10.0|^11.0|^12.0|^13.0
^10.0|^11.0|^12.0|^13.0
 Project Readme

Requirements

You need to have an account in pingen v2 and obtain oauth credentials for your desired grant type (usually client_credentials).

How to obtain these are described here: https://api.pingen.com/documentation#section/Authentication/How-to-obtain-a-Client-ID

Installation

Require the package via composer (Get composer here: https://getcomposer.org/download/)

composer require pingencom/pingen2-sdk-php

Environments

We have two Environments available: Production and Staging (see https://api.pingen.com/documentation#section/Basics/Environments)

This SDK supports staging as well. When initiating the provider (see Usage), the optional 'staging' attribute should be set, as well as when creating an endpoint object.

Usage

The simplest way to integrate is using the client credentials grant (see https://api.pingen.com/documentation#section/Authentication/Which-grant-type-should-i-use)

require __DIR__ . '/vendor/autoload.php';

$provider = new \Pingen\Provider\Pingen(
    array(
        'clientId' => 'YOUR_OAUTH2_CLIENT_ID',
        'clientSecret' => 'YOUR_OAUTH2_CLIENT_SECRET',
        'staging' => true,
    )
);

$access_token = $provider->getAccessToken('client_credentials');

$lettersEndpoint = (new \Pingen\Endpoints\LettersEndpoint($access_token))
    ->setOrganisationId('INSERT_YOUR_ORGANISATION_UUID_HERE')
    ->useStaging();

$lettersEndpoint->uploadAndCreate(
    (new \Pingen\Endpoints\DataTransferObjects\Letter\LetterCreateAttributes())
        ->setFileOriginalName('your_original_pdf_name.pdf')
        ->setAddressPosition('left')
        ->setAutoSend(false),
    fopen('path_to_your_original_pdf_name.pdf', 'r')
);

Examples & Docs

Our API Docs are here: https://api.pingen.com/documentation

On the right-hand side of every endpoint you can see request samples for PHP and other languages, which you can copy and paste into your application.

Bugreport & Contribution

If you find a bug, please either create a ticket in github, or initiate a pull request.

Versioning

We adhere to semantic (major.minor.patch) versioning (https://semver.org/). This means that:

  • Patch (x.x.patch) versions fix bugs
  • Minor (x.minor.x) versions introduce new, backwards compatible features or improve existing code.
  • Major (major.x.x) versions introduce radical changes which are not backwards compatible.

In your automation or procedure you can always safely update patch & minor versions without the risk of your application failing.

Testing

PHPUnit: vendor/bin/phpunit

ECS: vendor/bin/ecs check src

PHPStan: vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=512M

Lint: vendor/bin/parallel-lint --exclude vendor .