adrzei / php-lib-blesta-api
There is no license information available for the latest version (dev-master) of this package.
PHP Library Blesta API
dev-master
2018-12-04 13:22 UTC
This package is auto-updated.
Last update: 2024-09-05 02:09:10 UTC
README
This development kit includes the following:
- An API processor to make interfacing with the Blesta API super simple
- Sample Merchant and Non-merchant Gateway implementations
Requirements
- PHP 5.2.0 or greater
- Blesta 3.0.0 or greater
Using the API
Documentation on the API can be found in the API section of the Developer Manual
<?php require_once "blesta_api.php"; $user = "YOUR_API_USER"; $key = "YOUR_API_KEY"; $url = "http://yourdomain.com/installpath/api/"; $api = new BlestaApi($url, $user, $key); $response = $api->get("users", "get", array('user_id' => 1)); print_r($response->response()); print_r($response->errors()); ?>
Plugin models are accessible as well:
<?php require_once "blesta_api.php"; $user = "YOUR_API_USER"; $key = "YOUR_API_KEY"; $url = "http://yourdomain.com/installpath/api/"; $api = new BlestaApi($url, $user, $key); $response = $api->post("support_manager.support_manager_tickets", "close", array('ticket_id' => 1)); print_r($response->response()); print_r($response->errors()); ?>
Working with Gateways
Documentation on gateways can be found in the Payment Gateways section of the Developer Manual
Included in this SKD are two example gateways:
- Merchant Credit Card Gateway /components/gateways/merchant/merchant_demo_cc/
- Non-merchant Gateway /components/gateways/nonmerchant/nonmerchant_demo/