PHPackages                             vkopytich13/cybersource-rest-client-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. vkopytich13/cybersource-rest-client-php

ActiveLibrary[Payment Processing](/categories/payments)

vkopytich13/cybersource-rest-client-php
=======================================

Client SDK for CyberSource REST APIs

0.0.32(4y ago)03.8k1proprietaryPHPPHP &gt;=5.6

Since Nov 5Pushed 4y agoCompare

[ Source](https://github.com/vkopytich13/cybersource-rest-client-php)[ Packagist](https://packagist.org/packages/vkopytich13/cybersource-rest-client-php)[ Docs](https://github.com/CyberSource)[ RSS](/packages/vkopytich13-cybersource-rest-client-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (38)Used By (0)

PHP Client SDK for CyberSource REST APIs
========================================

[](#php-client-sdk-for-cybersource-rest-apis)

The CyberSource PHP client provides convenient access to the [CyberSource REST API](https://developer.cybersource.com/api/reference/api-reference.html) from your PHP application.

[![Version         ](https://camo.githubusercontent.com/96b6cef9e655e143a49091197cafc2cff0c55f1858e890330c5dec7a02fba43f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6379626572736f757263652f726573742d636c69656e742d7068702e737667)](https://packagist.org/packages/cybersource/rest-client-php)

Requirements
------------

[](#requirements)

- PHP 5.6+
- Enable cURL PHP Extension
- Enable JSON PHP Extension
- Enable MBString PHP Extension
- Enable PHP\_APCU PHP Extension. You will need to download it for your platform (Windows/Linux/Mac)
- [CyberSource Account](https://developer.cybersource.com/api/developer-guides/dita-gettingstarted/registration.html)
- [CyberSource API Keys](https://prod.developer.cybersource.com/api/developer-guides/dita-gettingstarted/registration/createCertSharedKey.html)

Dependencies
------------

[](#dependencies)

- PHP-JWT : JWT token Generation
- CURL : Http communication with the payment gateway
- PHP\_APCU : Caching
- phpunit-5.7.25 : unit testing
- phpunit-5.7.25 code coverage : Sonar coverage

Installation
------------

[](#installation)

### Composer

[](#composer)

We recommend using [`Composer`](http://getcomposer.org). *(Note: we never recommend you override the new secure-http default setting)*. *Update your composer.json file as per the example below and then run `composer update`.*

```
{
  "require": {
  "php": ">=5.6",
  "cybersource/rest-client-php": "0.0.25"
  }
}
```

Registration &amp; Configuration
--------------------------------

[](#registration--configuration)

Use of this SDK and the CyberSource APIs requires having an account on our system. You can find details of getting a test account and creating your keys [here](https://developer.cybersource.com/api/developer-guides/dita-gettingstarted/registration.html)

Once you have your keys, simply load them into the appropriate variables in your code, as per the below sample code dealing with the authentication part of the API request.

Remember this SDK is for use in server-side PHP applications that access the CyberSource REST API and credentials should always be securely stored and accessed appropriately.

SDK Usage Examples and Sample Code
----------------------------------

[](#sdk-usage-examples-and-sample-code)

To get started using this SDK, it's highly recommended to download our sample code repository:

- [Cybersource PHP Sample Code Repository (on GitHub)](https://github.com/CyberSource/cybersource-rest-samples-php)

In that respository, we have comprehensive sample code for all common uses of our API:

Additionally, you can find details and examples of how our API is structured in our API Reference Guide:

- [Developer Center API Reference](https://developer.cybersource.com/api/reference/api-reference.html)

The API Reference Guide provides examples of what information is needed for a particular request and how that information would be formatted. Using those examples, you can easily determine what methods would be necessary to include that information in a request using this SDK.

MetaKey Support
---------------

[](#metakey-support)

A Meta Key is a single key that can be used by one, some, or all merchants (or accounts, if created by a Portfolio user) in the portfolio.

The Portfolio or Parent Account owns the key and is considered the transaction submitter when a Meta Key is used, while the merchant owns the transaction.

MIDs continue to be able to create keys for themselves, even if a Meta Key is generated.

Further information on MetaKey can be found in [New Business Center User Guide](https://developer.cybersource.com/library/documentation/dev_guides/Business_Center/New_Business_Center_User_Guide.pdf).

To set your API credentials for an API request, configure the following information in ExternalConfiguration.php file:
----------------------------------------------------------------------------------------------------------------------

[](#to-set-your-api-credentials-for-an-api-request-configure-the-following-information-in-externalconfigurationphp-file)

Create a file in your application `ExternalConfiguration.php` inside a `Resources` folder and configure the following information as per requirement similar to [**this one**](https://github.com/CyberSource/cybersource-rest-samples-php/blob/master/Resources/ExternalConfiguration.php).

#### For Http Signature Authentication

[](#for-http-signature-authentication)

Configure the following information in `ExternalConfiguration.php` file

- Authentication Type: Merchant should enter "HTTP\_SIGNATURE" for HTTP authentication mechanism.
- Merchant ID: Merchant will provide the merchant ID, which has taken from EBC portal.
- MerchantSecretKey: Merchant will provide the secret Key value, which has taken from EBC portal.
- MerchantKeyId: Merchant will provide the Key ID value, which has taken from EBC portal.
- Enable Log: To start the log entry provide *true* else enter *false*.
- LogDirectory: Merchant will provide directory path where logs will be created.
- LogMaximumSize: Merchant will provide size value for log file.
- LogFilename: Merchant will provide log file name.

```
   $this->authType          = "HTTP_SIGNATURE";
   $this->runEnv            = "apitest.cybersource.com";
   $this->merchantID        = ;
   $this->apiKeyID          = ;
   $this->secretKey         = ;

   $this->enableLog         = true;
   $this->logSize           = ;
   $this->logFile           = ;
   $this->logFilename       = ;

   $this->proxyUrl          = ;
   $this->proxyHost         = ;

   $this->useMetaKey        = false;

```

#### For Jwt Signature Authentication

[](#for-jwt-signature-authentication)

Configure the following information in the `ExternalConfiguration.php` file

- Authentication Type: Merchant should enter "JWT" for JWT authentication mechanism.
- Merchant ID: Merchant will provide the merchant ID, which has taken from EBC portal.
- keyAlias: Alias of the Merchant ID, to be used while generating the JWT token.
- keyPassword: Alias of the Merchant password, to be used while generating the JWT token.
- keyFileName: Filename of the key generated from the EBC portal, without the extension part .P12
- keysDirectory: Path of the directory, where key is placed.
- Enable Log: To start the log entry provide *true* else enter *false*.
- LogDirectory: Merchant will provide directory path where logs will be created.
- LogMaximumSize: Merchant will provide size value for log file.
- LogFilename: Merchant will provide log file name.

```
   $this->authType            = "JWT";
   $this->runEnv              = "apitest.cybersource.com";
   $this->merchantID          = ;

   $this->keyAlias            = ;
   $this->keyPass             = ;
   $this->keyFilename         = ";
   $this->keyDirectory        = ;

   $this->enableLog           = true;
   $this->logSize             = ;
   $this->logFile             = ;
   $this->logFilename         = ;

   $this->proxyUrl            = ;
   $this->proxyHost           = ;

   $this->useMetaKey          = false;

```

#### For using MetaKey

[](#for-using-metakey)

MetaKey can be used for HTTP Signature and JWT authentication

For HTTP Signature Authentication

```
   $this->authType            = "HTTP_SIGNATURE";
   $this->merchantID          = ;
   $this->apiKeyID            = ;
   $this->secretKey           = ;
   $this->useMetaKey          = true;
   $this->portfolioID         = ;

```

For JWT Authentication

```
   $this->authenticationType  = "JWT";
   $this->merchantID          = ;
   $this->keyAlias            = ;
   $this->keyPass             = ;
   $this->keyFileName         = ;
   $this->keyDirectory        = ;
   $this->useMetaKey          = true;

```

### Switching between the sandbox environment and the production environment

[](#switching-between-the-sandbox-environment-and-the-production-environment)

CyberSource maintains a complete sandbox environment for testing and development purposes. This sandbox environment is an exact duplicate of our production environment with the transaction authorization and settlement process simulated. By default, this SDK is configured to communicate with the sandbox environment. To switch to the production environment, set the appropriate property in Resources\\ExternalConfiguration.php.

For example:

```
   // For TESTING use
   // $this->runEnv = "apitest.cybersource.com";
   // For PRODUCTION use
   $this->runEnv = "api.cybersource.com";
```

The [API Reference Guide](https://developer.cybersource.com/api/reference/api-reference.html) provides examples of what information is needed for a particular request and how that information would be formatted. Using those examples, you can easily determine what methods would be necessary to include that information in a request using this SDK.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Recently: every ~1 days

Total

30

Last Release

1702d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c757024af57798c8b5857ade5fa9aaa51f4d8bdef93a971bdf9f4c737e6de27e?d=identicon)[vkopytich13](/maintainers/vkopytich13)

---

Top Contributors

[![gnongsie](https://avatars.githubusercontent.com/u/14273863?v=4)](https://github.com/gnongsie "gnongsie (104 commits)")[![snavinch](https://avatars.githubusercontent.com/u/49395625?v=4)](https://github.com/snavinch "snavinch (36 commits)")[![ashtru](https://avatars.githubusercontent.com/u/14973353?v=4)](https://github.com/ashtru "ashtru (18 commits)")[![vkopytich13](https://avatars.githubusercontent.com/u/42588308?v=4)](https://github.com/vkopytich13 "vkopytich13 (15 commits)")[![kikmak42](https://avatars.githubusercontent.com/u/645401?v=4)](https://github.com/kikmak42 "kikmak42 (8 commits)")[![brianmc](https://avatars.githubusercontent.com/u/1022976?v=4)](https://github.com/brianmc "brianmc (4 commits)")[![SantoshShanmugam](https://avatars.githubusercontent.com/u/36918753?v=4)](https://github.com/SantoshShanmugam "SantoshShanmugam (3 commits)")[![khaaldrogo](https://avatars.githubusercontent.com/u/35258595?v=4)](https://github.com/khaaldrogo "khaaldrogo (1 commits)")[![KasperFranz](https://avatars.githubusercontent.com/u/191405?v=4)](https://github.com/KasperFranz "KasperFranz (1 commits)")[![chsriniv9](https://avatars.githubusercontent.com/u/35677727?v=4)](https://github.com/chsriniv9 "chsriniv9 (1 commits)")[![ssethumavisa](https://avatars.githubusercontent.com/u/45388836?v=4)](https://github.com/ssethumavisa "ssethumavisa (1 commits)")[![SYip](https://avatars.githubusercontent.com/u/6204506?v=4)](https://github.com/SYip "SYip (1 commits)")[![KatteriSharath](https://avatars.githubusercontent.com/u/147804309?v=4)](https://github.com/KatteriSharath "KatteriSharath (1 commits)")

---

Tags

payment processingpaymentpaymentsecommercemerchantpayment gatewayauthorizemerchantscybersourcevisapayment-integrationpayment-modulepayment-servicepayment-methods

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vkopytich13-cybersource-rest-client-php/health.svg)

```
[![Health](https://phpackages.com/badges/vkopytich13-cybersource-rest-client-php/health.svg)](https://phpackages.com/packages/vkopytich13-cybersource-rest-client-php)
```

###  Alternatives

[cybersource/rest-client-php

Client SDK for CyberSource REST APIs

39881.3k6](/packages/cybersource-rest-client-php)[omnipay/authorizenet

Authorize.Net gateway for the Omnipay payment processing library

602.5M7](/packages/omnipay-authorizenet)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
