Download the PHP package smart2pay/sdk-php without Composer

On this page you can find all versions of the php package smart2pay/sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk-php

Smart2Pay SDK

NB: If you installed our SDK using composer, please read the note at the end of the file.

For quick information about available SDK methods and functionalities, please open {SDK directory}/play.php script in a browser (requires a web server).

For live demo of methods and functionalities available in current version of SDK, please open {SDK directory}/demo.php script in a browser (requires a web server).

Please note that in order to test a full end-to-end transaction you will require a valid Smart2Pay test account which you can obtain at https://www.smart2pay.com/en/SignUpStart. After you registered a test account, use API Key and Site ID found at Technical Integration > Integration Roadmap > Integration Site and configure your SDK by copying config.dist.php to config.php and fill in S2P_SDK_SITE_ID, S2P_SDK_API_KEY and S2P_SDK_ENVIRONMENT constants.

Creating your test merchant account

  1. Go to https://www.smart2pay.com/en/SignUpStart and complete the form. Make sure you tick the checkbox REST API interface to let system know you will integrate SDK solution. If you will also use any e-commerce plugins specify this by ticking plugins checkbox.
  2. Log into your account and go to Technical Integration > Integration Roadmap > Integration Site.
  3. You should use Site ID and API Ke
  4. y found on that page to fill constants in config.php of your test SDK environment.

Configuring your SDK

  1. Copy config.dist.php file located in root directory of your SDK to config.php and edit the file.
  2. Paste Site ID (from Technical Integration > Integration Roadmap > Integration Site) in constant definition S2P_SDK_SITE_ID like below:

  3. Paste API Key (from Technical Integration > Integration Roadmap > Integration Site) in constant definition S2P_SDK_API_KEY like below:

  4. Configure environment to test:

  5. When environment is set to custom, you can provide a custom REST API base URL (used for debugging purposes). In production leave this empty:

  6. Setup return URL. This URL is the location where end-user will be redirected after a transaction finishes (successful or not):

Once all above steps are completed you can test a full end-to-end transaction and check log files generated.

demo.php script will generate logs when redirected back to return page in log_return.log and also for notifications in log_demo.log. Please make sure PHP has rights to create and write in these files located in root of SDK directory. If PHP doesn't have creation rights on SDK directory create these two log files first and give PHP write rights on them.

For quick samples on how you should implement SDK methods and functionalities please check samples directory.

Composer installs note

If you installed our SDK using composer and you don't want to create a custom config.php file, you will have to define S2P_SDK_SITE_ID, S2P_SDK_API_KEY and S2P_SDK_ENVIRONMENT constants in SDK wrapper script. Please check files in samples directory.

There were reports about composer deleting config.php file in SDK root dir when updating the SDK. To overcome this, you can define S2P_SDK_CONFIG_PATH constant in your wrapper script which contains directory where config.php file resides in your project.


All versions of sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
ext-curl Version *
ext-json Version *
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package smart2pay/sdk-php contains the following files

Loading the files please wait ....