Download the PHP package multisafepay/php-sdk without Composer

On this page you can find all versions of the php package multisafepay/php-sdk. 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 php-sdk

MultiSafepay PHP SDK

Latest stable version

About MultiSafepay

MultiSafepay is a Dutch payment services provider, which takes care of contracts, processing transactions, and collecting payment for a range of local and international payment methods. Start selling online today and manage all your transactions in one place!

Installation

Run the following composer command:

WARNING! This SDK does not have a direct dependency on Guzzle or cURL. Instead, it uses the PSR-18 client abstraction and PSR-17 factory abstraction. This lets you choose which PSR-7 implementation and HTTP client to use. You can replace all clients without any side effects.

If you don't have a client implementation installed, run:

If you don't have a factory implementation installed, run:

You should now have installed:

Getting started

Use Composer autoloader to automatically load class dependencies:

Next, instantiate the SDK with your site API key and a flag to identify whether this is the live environment or testing environment.

From the SDK, you can get various managers:

The transaction manager is the most important, because it lets you create orders and refunds.

Example refund:

For examples of building full requests, see USAGE.md and the functional tests in tests/Functional/Api/Transactions.

Advanced usage: Strict mode

Strict mode:

Non-strict mode (default) skips some validation errors.

Example: If there is a mismatch between the number of decimal places of the total amount of the items in the ShoppingCart object and your ecommerce platform, strict mode throws an \MultiSafepay\Exception\InvalidTotalAmountException exception.

Code quality checks

The following checks are in place to maintain code quality:

Testing

Unit tests

To run unit tests from this package:

  1. Clone this repository.
  2. To install all dependencies, run composer install
  3. Run PHPUnit with the following command: ./vendor/bin/phpunit tests/Unit

Functional tests

To run functional tests from this package:

  1. Clone this repository.
  2. To install all dependencies, run composer install.
  3. Copy .env.php.example to .env.php and add your site API key.
  4. Run PHPUnit with the following command: ./vendor/bin/phpunit tests/Functional

Mocking the API for unit and integration tests

Unit and integration tests run without the API, which means that the client is mocking all data calls. To do this, the tests/fixture-data folder contains JSON files to spoof calls. To fill this folder with real data, make sure you have a valid .env.php file, and then use the following command:

php tests/generateApiMocks.php

This commits all generated JSON files into git, so that they serve as fixtures. Files that are not used in tests don't need to be generated.

Support

Create an issue on this repository or email [email protected]

Contributors

If you create a pull request to suggest an improvement, we'll send you some MultiSafepay swag as a thank you!

License

Open Software License (OSL 3.0)

Want to be part of the team?

Are you a developer interested in working at MultiSafepay? Check out our job openings and feel free to get in touch!


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
ext-json Version *
psr/http-client-implementation Version ^1.0
psr/http-message-implementation Version ^1.0
psr/http-factory-implementation Version ^1.0
php-http/discovery Version ^1.0
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 multisafepay/php-sdk contains the following files

Loading the files please wait ....