Download the PHP package apruvd/php_sdk_v3 without Composer
On this page you can find all versions of the php package apruvd/php_sdk_v3. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download apruvd/php_sdk_v3
More information about apruvd/php_sdk_v3
Files in apruvd/php_sdk_v3
Package php_sdk_v3
Short Description Lightweight PHP SDK for version 3 of the Apruvd API.
License MIT
Homepage https://app.apruvd.com/
Informations about the package php_sdk_v3
apruvd_v3_php
Lightweight PHP SDK for integrating with the Apruvd API V3 (soon to be legacied).
API documentation found here. https://app.apruvd.com/documentation/
Services
APIService
The main primary service containing 1:1 method mapping on available API endpoints.
APIAsyncResponseService
The optional service to grab/transform $_POST JSON data into the appropriate response model. The
Authentication
There are 2 viable authentication patterns for the v3 API. secret id/key and refresh/access tokens.
Secret ID/Key
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
Using your secret id/key you can request a refresh token using the following method:
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.
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.
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
Transaction and Cart Contents
For model details please refer to the codebase and the API docs
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.
-
- integer | HTTP Response Code
-
- string | Possible 400/500 error response message
-
- boolean | Was HTTP within 200 range
-
- object | Possible 400 validation error response messages. Nested Object.
-
- Httpful\Response | Fully formed response from Httpful service. Useful for debugging.
API Methods and Endpoints
submitTransaction(Transaction $transaction) : SubmitTransactionResponse
Submits to as POST
checkTransaction(String $transaction_id) : CheckTransactionResponse
Submits to as GET
updateTransaction(String $transaction_id, Transaction $transaction) : UpdateTransactionResponse
Submits to as POST
cancelTransaction(String $transaction_id) : CancelTransactionResponse
Submits to as POST
elevateTransaction($transaction_id, $is_order_number = false) : ElevateTransactionResponse
Submits to as POST. Transaction ID or Order Num can be used depending on boolean flag.
authenticateWithOAuth() : OAuthResponse
Submits to as GET.
authenticateWithOAuthRefresh() : OAuthResponse
Submits to as GET.
Helper Methods
onAccessTokenUpdate(Closure $callback)
Registers the single event handler for Token Update events. This maps to a single property, only one callback per event cycle.