Download the PHP package ryanwinchester/netsuite-php without Composer
On this page you can find all versions of the php package ryanwinchester/netsuite-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ryanwinchester/netsuite-php
More information about ryanwinchester/netsuite-php
Files in ryanwinchester/netsuite-php
Package netsuite-php
Short Description NetSuite PHP API wrapper
License Apache-2.0
Informations about the package netsuite-php
NetSuite PHP API Client
A PHP API client package for NetSuite, pried from the
NetSuite PHP Toolkit
and made more consumable for modern PHP application development. All of the
classes in the NetSuite\Classes
namespace are code provided by NetSuite
with a license allowing redistribution. The custom work provided
by this library separates these nearly 2,000 classes out into their own files
and allows the classes to be installed with composer and accessed using
standard autoloading support. It allows configuration to be read from the
environment, adds support to log requests and responses and provides a
simplified client wrapper class (NetSuiteService
).
- Installation
- Quickstart
- w/Laravel
- Account-Specific Data Center URLs
- Examples
- Logging
- Generating Classes
- Roadmap
- Support
- Contributing
- License
Installation
Require with composer:
Quickstart:
Instantiating the NetSuiteService class:
Any of the examples herein will assume you have already instantiated a client object using token-based authentication. The method of authenticating with user credentials was dropped from support by NetSuite in 2020.
You can alternatively place your config in environment variables. This is
helpful in hosted environments where deployment of config files is either
not desired or practical. You can find the valid keys in the included
.env.example
file with sample values.
Previously, instantiating the NetSuiteClient with ENV data entailed using the
static method createFromEnv
. This method is now marked as deprecated
and
if you are using it, please change your code to use the standard constructor
which will extract your configuration out of the $_ENV superglobal for you.
Laravel Integration
If you're implementing NetSuite web services in a
Laravel application, you might want to look at the
netsuite-laravel package
to streamline instantiating and making the client available to your app
via the service container. In that case, you'll simply need to require the
netsuitephp/netsuite-laravel
package in your application and then as long
as the client configuration is present in the application's environment,
you'll have a client instance in the container.
Account-Specific Data Center URLs
With 2021_1
, this library provides support to utilize NetSuite's new
account-specific data center URL detection on each request. In practice, this
lookup does have a measurable overhead cost. As such, I'd suggest using this
feature only if your manner of NetSuite integration is such that you make
fewer connections, handling integration in batches. If your manner of
integration is to instead make many frequent, brief requests from NetSuite,
then you will probably prefer to provide your data center URL explicitly and
remove the lookup from every session.
Examples
See EXAMPLES.md
Logging
The most common way to enable logging will be to do so at the configuration level, see the quickstart examples.
You can also set logging on or off during runtime with methods. Note that if you don't specify a logging directory in the config or at runtime, then no logs will be created. There must be a valid target location.
If you require more flexibility in relation to logging, you can provide your
own PSR-3 compatible logger (as of 2023.1.0
).
Generating Classes
This repository always contains classes generated from the version of the
NetSuite PHP Toolkit corresponding with the web services version denoted
by the specific release. Release v2021.1.0
, for instance, is the first
release built against NetSuite's 2021_1
web services toolkit. If you want
to generate the class files yourself, for whatever reason, there is code
included with the package to do so, using the following steps:
- Download the NetSuite PHP Toolkit
- Unzip the contents into the
./original/
folder - Run
./utilities/separate_classes.php
orcomposer generate
Roadmap
PHP Version Support
See: https://www.php.net/supported-versions.php
With official support for PHP5 gone since the end of 2018 and with PHP7 moving to security-only by the end of 2021, the versions of PHP supported by this package will start to be gradually moved forward.
For the time being, expect the following for netsuitephp/netsuite-php
:
- require
"php": ">=7.1"
as of the2021_1
build - require
"php": ">=8"
as of the2023_1
build
This will apply only to new releases of the package, so you will still be able to continue using the last supported version for your PHP release if you can't or won't update PHP.
Support
If you need help with implementation, see the resources section of the examples file for some useful links.
If you believe that your issue is a bug specific to the custom work provided by this package (and not NetSuite's own classes that are packaged therein), then you can file an issue in github. Per the issue template, please include a clear description of the problem, how it is reproduced and the logs of relevant requests/responses using the logging features of this package.
Contributing
Contributions are welcome in the form of pull requests. Please include a clear explanation of the reason for the change and try to keep changes as small as possible, which will increase the speed with which we can get them reviewed and the likelihood of being included into the master branch.
- Make sure to respect the current required
php
version incomposer.json
- Avoid introducing new dependencies (no framework hooks, etc)
- Please try to make all additions comply with PSR-12
License
Original work is Copyright © 2010-2015 NetSuite Inc. and provided "as is." Refer to the NetSuite Toolkit License Agreement file.
All additional work is licensed under the Apache 2.0 open source software license according to the included LICENSE file.
All versions of netsuite-php with dependencies
ext-soap Version *
ext-simplexml Version *
ext-openssl Version *
paragonie/random_compat Version >=1
psr/log Version ^1|^2|^3