PHPackages                             apruvd/php\_sdk\_v3 - 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. [API Development](/categories/api)
4. /
5. apruvd/php\_sdk\_v3

ActiveLibrary[API Development](/categories/api)

apruvd/php\_sdk\_v3
===================

Lightweight PHP SDK for version 3 of the Apruvd API.

v0.2.1(6y ago)19MITPHP

Since May 28Pushed 6y ago1 watchersCompare

[ Source](https://github.com/apruvd/apruvd-php-v3)[ Packagist](https://packagist.org/packages/apruvd/php_sdk_v3)[ Docs](https://app.apruvd.com/)[ RSS](/packages/apruvd-php-sdk-v3/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

apruvd\_v3\_php
===============

[](#apruvd_v3_php)

Lightweight PHP SDK for integrating with the Apruvd API V3 (soon to be legacied).

API documentation found here.

Services
--------

[](#services)

### APIService

[](#apiservice)

The main primary service containing 1:1 method mapping on available API endpoints.

```
$service = new APIService('secret_id', 'secret_key', 'optional_refresh_token', 'optional_access_token');
$service->{endpoint_method}();

```

### APIAsyncResponseService

[](#apiasyncresponseservice)

The optional service to grab/transform $\_POST JSON data into the appropriate response model. The `$s`

```
$callback = function($post_response){ ... };
\Apruvd\V3\APIAsyncResponseService::handle($callback);
// or if you don't require a callback function, you can get the response directly in your route/controller
$response = \Apruvd\V3\APIAsyncResponseService::handle();
// or if your framework supports JSON request parsing, you can create a response model from that object/array.
$response = \Apruvd\V3\APIAsyncResponseService::transactionResponse($json_object)

```

Authentication
--------------

[](#authentication)

There are 2 viable authentication patterns for the v3 API. secret id/key and refresh/access tokens.

#### Secret ID/Key

[](#secret-idkey)

This key pair is generated in the application settings page and is used as a basic authentication scheme. All calls can be made using this key key set. The refresh/access token authentication method is completely optional

#### Refresh/Access Tokens

[](#refreshaccess-tokens)

Using your secret id/key you can request a refresh token using the following method:

```
$token = $service->authenticateWithOAuth();

```

A token set will be returned and automatically binded to the service class. When new tokens are generated an optional anonymous callback function can be passed to the API service as an event handler.

```
$service->onAccessTokenUpdate(function($token){ ... });

```

If a refresh token has been binded via service constructor, subsequent API calls will automatically request a new access token on missing or failed attempts. This process can additionally be handled via direct call.

```
$token = $service->authenticateWithOAuthRefresh();

```

It's recommended that the onAccessTokenUpdate method be used with your prefered storage routine and that the refresh and access tokens can be recalled and passed via service constructor.

Models
------

[](#models)

#### Transaction and Cart Contents

[](#transaction-and-cart-contents)

For model details please refer to the codebase and the API docs

```
$transaction = new Transaction([
    'mode' => 'Live',
    'total' => 123.45,
    'order_num' => '12345',
]);
$transaction->cart_contents[] = new CartContents(['item' => 'Foo', 'quantity' => 25, 'is_high_risk' => false]);
$response = $service->submitTransaction($transaction);

```

Responses
---------

[](#responses)

All responses are well formed and documented. The following properties of the APIModel class are available to all responses, with each response binding it's own additional properties.

- `$response->code` - integer | HTTP Response Code
- `$response->detail` - string | Possible 400/500 error response message
- `$response->success` - boolean | Was HTTP within 200 range
- `$response->validation_errors` - object | Possible 400 validation error response messages. Nested Object.
- `$response->response` - Httpful\\Response | Fully formed response from Httpful service. Useful for debugging.

API Methods and Endpoints
-------------------------

[](#api-methods-and-endpoints)

##### submitTransaction(Transaction $transaction) : SubmitTransactionResponse

[](#submittransactiontransaction-transaction--submittransactionresponse)

Submits to `api/transactions/submit/` as POST

##### checkTransaction(String $transaction\_id) : CheckTransactionResponse

[](#checktransactionstring-transaction_id--checktransactionresponse)

Submits to `api/transactions/status/?transaction_id={$transaction_id}` as GET

##### updateTransaction(String $transaction\_id, Transaction $transaction) : UpdateTransactionResponse

[](#updatetransactionstring-transaction_id-transaction-transaction--updatetransactionresponse)

Submits to `api/transactions/{$transaction_id}/update/` as POST

##### cancelTransaction(String $transaction\_id) : CancelTransactionResponse

[](#canceltransactionstring-transaction_id--canceltransactionresponse)

Submits to `api/transactions/{$transaction_id}/cancel/` as POST

##### elevateTransaction($transaction\_id, $is\_order\_number = false) : ElevateTransactionResponse

[](#elevatetransactiontransaction_id-is_order_number--false--elevatetransactionresponse)

Submits to `api/transactions/elevate/` as POST. Transaction ID or Order Num can be used depending on boolean flag.

##### authenticateWithOAuth() : OAuthResponse

[](#authenticatewithoauth--oauthresponse)

Submits to `o/token/?grant_type=password` as GET.

##### authenticateWithOAuthRefresh() : OAuthResponse

[](#authenticatewithoauthrefresh--oauthresponse)

Submits to `o/token/?grant_type=refresh` as GET.

Helper Methods
--------------

[](#helper-methods)

##### onAccessTokenUpdate(Closure $callback)

[](#onaccesstokenupdateclosure-callback)

Registers the single event handler for Token Update events. This maps to a single property, only one callback per event cycle.

##### setToken(String $token)

[](#settokenstring-token)

##### getToken() : String

[](#gettoken--string)

##### setRefreshToken(String $token)

[](#setrefreshtokenstring-token)

##### getRefreshToken() : String

[](#getrefreshtoken--string)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.7% 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 ~11 days

Total

3

Last Release

2517d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d1cbd42f8e1be470eaf00fdcb8612502550a5aadb3e39c0d8359d42575107857?d=identicon)[apruvd\_johnbrodie](/maintainers/apruvd_johnbrodie)

---

Top Contributors

[![JohnBrodie](https://avatars.githubusercontent.com/u/1018476?v=4)](https://github.com/JohnBrodie "JohnBrodie (8 commits)")[![BossRighteous](https://avatars.githubusercontent.com/u/972810?v=4)](https://github.com/BossRighteous "BossRighteous (2 commits)")[![corwin-cole](https://avatars.githubusercontent.com/u/30836284?v=4)](https://github.com/corwin-cole "corwin-cole (1 commits)")

### Embed Badge

![Health badge](/badges/apruvd-php-sdk-v3/health.svg)

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

###  Alternatives

[asana/asana

A PHP client for the Asana API

1381.6M4](/packages/asana-asana)[balanced/balanced

Client for Balanced API

72372.9k](/packages/balanced-balanced)[kontent-ai/delivery-sdk-php

Kontent.ai Delivery SDK for PHP

4628.8k](/packages/kontent-ai-delivery-sdk-php)[maksekeskus/maksekeskus-php

Maksekeskus PHP SDK

12179.8k](/packages/maksekeskus-maksekeskus-php)[nlpcloud/nlpcloud-client

NLP Cloud serves high performance pre-trained or custom models for NER, sentiment-analysis, classification, summarization, paraphrasing, grammar and spelling correction, keywords and keyphrases extraction, chatbot, product description and ad generation, intent classification, text generation, image generation, code generation, question answering, automatic speech recognition, machine translation, language detection, semantic search, semantic similarity, tokenization, POS tagging, speech synthesis, embeddings, and dependency parsing. It is ready for production, served through a REST API. This is the PHP client for the API. More details here: https://nlpcloud.com. Documentation: https://docs.nlpcloud.com. Github: https://github.com/nlpcloud/nlpcloud-php

2523.9k](/packages/nlpcloud-nlpcloud-client)[slakbal/gotowebinar

GotoWebinar API wrapper for laravel 5+

1713.1k](/packages/slakbal-gotowebinar)

PHPackages © 2026

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