Download the PHP package cmpayments/payments-sdk-php without Composer

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

CMPayments Payment SDK for PHP

Build Status Scrutinizer Coverage Software License Total Downloads

Integrating the CMPayments solutions for online payments with your application is easy using the Payment SDK for PHP.

Installation

To install the SDK, simply use Composer:

Requirements

Dependencies

These are automatically installed by composer.

Bootstrapping

To do anything with the SDK, the first step is to create an instance of the payment Gateway:

List iDEAL issuers

To get a list of iDEAL issuers, simply tell the Gateway to execute the IdealIssuerListRequest:

Start a payment

The CMPayments API supports the concept of a Charge that contains 0..n Payment items underneath it. To start a payment, both a Charge and a Payment must be created. This can be done in one request:

Note: Each payment method has its own {METHOD}Payment class. Each of these classes enforces all required properties trough their constructors. For instance, to create a new CreditCard payment, replace the new IdealPayment(...) line with new CreditCardPayment(Money::EUR(500), ['VISA', 'MasterCard'], 'your-purchase-id', new \DateTime('+1 day'));.

Retreive charge or a payment

Simple tell the Gateway to execute a ViewChargeRequest of ViewPaymentRequest with the correct id, and the details will be retrieved.

Handling errors

Internally, Guzzle is used to make HTTP requests. When the API responds with a 4xx or 5xx HTTP status, either a ClientException or a ServerException is thrown.

In case of a ServerException, the CMPayments platform is having issues. Try the request again later.

For a ClientException, check $exception->getResponse()->getBody()->getContents() to see what is wrong.

Working with Money

The Money library in use requires that any amount is represented in the smallest unig (eg. cents), so EUR 5,- is written as new Money(500, new Currency('EUR')) or shorter as Money::EUR(500).

Because this can be a bit of a hassle, the MoneyConverter class is provided. It can convert a float + currency into a Money object and back.


All versions of payments-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
cmpayments/guzzle-psp-authentication-middleware Version ^1.0
moneyphp/money Version ^3.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 cmpayments/payments-sdk-php contains the following files

Loading the files please wait ....