mt_ravipatel / xero_setup
Xero API integration functions
dev-master
2021-11-22 04:53 UTC
This package is not auto-updated.
Last update: 2025-05-20 03:55:29 UTC
README
1 . Within application\config\constants.php add the following lines:
defined('VENDORPATH') OR define('VENDORPATH', FCPATH.'vendor');``
Create composer.json file to Project Root and add the following lines
{ "repositories": [ { "type": "vcs", "url" : "https://{USER_NAME}@bitbucket.org/{USER_NAME}/{PACKAGE_NAME}.git" } ], "require": { "{USER_NAME}/{PACKAGE_NAME}": "dev-master" } }
Run
`composer update
` Command run in Project root.Run
`composer require xeroapi/xero-php-oauth2
` Command run in Project root.Create a file application\controllers\Xero_connection.php with the following content:
<?php
if (is_file(VENDORPATH.'\{USER_NAME}\{PACKAGE_NAME}\Xero_connection.php')) {
require_once VENDORPATH.'\{USER_NAME}\{PACKAGE_NAME}\Xero_connection.php';
}
?>
- Within Existing autoload helper in add the following lines:
<?php
if (is_file(VENDORPATH.'\{USER_NAME}\{PACKAGE_NAME}\helpers\xero_helper.php')) {
require_once VENDORPATH.'\{USER_NAME}\{PACKAGE_NAME}\helpers\xero_helper.php';
}
?>
- Create a file application\libraries\Xero.php with the following content:
<?php
if (is_file(VENDORPATH.'\{USER_NAME}\{PACKAGE_NAME}\libraries\Xero.php')) {
require_once VENDORPATH.'\{USER_NAME}\{PACKAGE_NAME}\libraries\Xero.php';
}
?>
- Within application\config\autoload.php add the following lines:
<?php
$autoload['libraries'] = array('xero');
?>
- Within application\config\config.php add the following lines:
/*
|--------------------------------------------------------------------------
| Xero Setting Key
|--------------------------------------------------------------------------
|
*/
$config['clientId'] = '8BF3030CE98844938291859FCF546174';
$config['clientSecret'] = 'O7owAqJBUkZKDXzJ7vlgwRiIBuP5e2WrqXKotBwVOWfZa_6w';
$config['redirectUri'] = '{PROJECT_PATH}/xero_connection/xero_callback';
-> Above redirectUri add xero account when create credential for xero api.
- Run this url {PROJECT_PATH}/Xero_connection.