Download the PHP package cakasim/payone-sdk without Composer

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

SDK for PAYONE Payment Integration

CI Status Build Status Scrutinizer Code Quality Coverage Status Total Downloads

Introduction

The SDK for PAYONE Payment Integration helps you to integrate payment into your app. The SDK makes use of the PAYONE Server API which is quite feature rich but has aged and direct use may be uncomfortable.

Features

Requirements

Although the SDK uses Composer, it does not have extensive dependencies on other packages. Currently, the only dependencies are on PSR interfaces.

License

The SDK for PAYONE Payment Integration is open-sourced software licensed under the MIT license.

Installing the SDK

Just run composer require cakasim/payone-sdk to install the SDK via composer.

Core Concepts

The SDK is based on several core principles that should make it easy to use and flexible to integrate.

PSR Interfaces

The use of PSR interfaces allows a high degree of adaptability to an existing system that already provides PSR compatible components.

The SDK makes use of the following PSR interfaces:

Using the SDK

This section explains how to use the SDK. Various code examples are given. For reasons of clarity, general code components have been omitted (e.g. use statements).

Construct the SDK

To use the SDK, the main class Sdk must be instantiated. There are three different ways to do that.

Variant 1 – Using All Defaults

This variant is the easiest to get started. The SDK will be constructed using all defaults which requires you to install some default PSR implementation packages:

Now you are able to construct the SDK with just a single line of code:

Variant 2 – Replacing Defaults by Providing Other Bindings

In order to change defaults you may override the default container bindings with your own or even third-party implementations. This enables a deep integration of the SDK into any existing environment which already provides PSR implementations.

Variant 3 – Deeply Integrate with Existing IoC Environments

Often you will have a scenario with an already existing PSR-11 compatible IoC container which provides constructor parameter DI. In such cases you may replace the SDK container completely with the existing one.

You will have to provide all necessary bindings by yourself. Have a look at the src/ContainerBuilder.php source to get an idea of the required bindings.

Once you have configured the existing container you may use it to instantiate the SDK:

For all following examples we assume that the variable $sdk contains the Sdk instance.

Configure the SDK

The SDK requires various configuration parameters to be set. These parameters must be provided via the Config class. Some parameters have sane defaults and others need to be set. Have a look at the table below which lists all parameters.

Parameter Type Default Description
api.endpoint string https://api.pay1.de/post-gateway/ PAYONE Server API endpoint
api.merchant_id string required Merchant ID of your PAYONE account
api.portal_id string required Portal ID which can be configured in your PAYONE account
api.sub_account_id string required ID of your configured sub-account
api.mode string test API mode, choose between test or live
api.key string required PAYONE Server API endpoint
api.key_hash_type string sha384 API key hashing method
api.integrator_name string required Name of your app or company
api.integrator_version string required Version of your app
notification.sender_address_whitelist string[] Valid sender IP list List of valid sender IPs
redirect.url string required Redirect URL template, use $token as placeholder for the actual token value
redirect.token_lifetime int 3600 Redirect token lifetime (in seconds)
redirect.token_encryption_key string required Encryption key for redirect tokens
redirect.token_encryption_method string aes-256-ctr Encryption method for redirect tokens
redirect.token_signing_key string required Signing key for redirect tokens
redirect.token_signing_algo string sha256 Signing algorithm for redirect tokens

The following example shows how to set all required parameters.

Sending API Requests

The following example shows how to send a simple API request that pre-authorizes a debit payment. There is no need to set global API parameters (e.g your API credentials) because the SDK uses the config to set them before sending the actual request.

Handling Notifications From PAYONE

With the SDK, PAYONE notifications can be easily processed. The SDK takes important steps in the verification and mapping of notifications.

The Redirect Service

For certain payment methods the customer will be redirected to a third party service (PayPal, Sofortüberweisung, etc.) in order to authenticate and authorize the payment.

The SDK can set the successurl, errorurl and backurl API request parameters for you to specify the target URL a customer will be redirected to after he finishes the third party service process. Furthermore, the SDK appends a token to the target URL.

The token holds metadata (e.g. creation timestamp) as well as custom data you may set. The token itself will be encrypted and signed which ensures protection of the payload data against unauthorized access and modification. Additionally, the SDK verifies the age of the token and ensures it does not exceed the configured max age.

Apply Redirect Parameters to an API Request

The example below shows how to apply redirect parameters to a (pre-)authorization API request. The API response has a status of REDIRECT and a redirecturl parameter which must be used to redirect the customer. In some scenarios a redirect is not always necessary, the example covers this as well.

Process a Redirect Token

If a customer returns to your app you first need to read the redirect token. The SDK does not make any assumptions how this should be done. Basically using a simple query parameter is a sane and totally valid approach.

Have a look at the example below which shows you how to process the token and access the token payload data.


All versions of payone-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
ext-json Version *
ext-openssl Version *
psr/http-message Version ^1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/log Version ^1.1
psr/container 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 cakasim/payone-sdk contains the following files

Loading the files please wait ....