Download the PHP package soberanes/cybersource-rest-client-php without Composer
On this page you can find all versions of the php package soberanes/cybersource-rest-client-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download soberanes/cybersource-rest-client-php
More information about soberanes/cybersource-rest-client-php
Files in soberanes/cybersource-rest-client-php
Package cybersource-rest-client-php
Short Description Client SDK for CyberSource REST APIs - Custom
License proprietary
Homepage https://github.com/soberanes
Informations about the package cybersource-rest-client-php
PHP Client SDK for CyberSource REST APIs
The CyberSource PHP client provides convenient access to the CyberSource REST API from your PHP application.
Requirements
- PHP 7.1.3+
- Enable cURL PHP Extension
- Enable JSON PHP Extension
- Enable MBString PHP Extension
- CyberSource Account
-
Dependencies
- PHP-JWT : JWT token Genearation
- CURL : Http communication with the payment gateway
- phpunit-5.7.25 : unit testing
- phpunit-5.7.25 code coverage : Sonar coverage
Installation
Composer
We recommend using Composer
. (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
.
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
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
To get started using this SDK, it's highly recommended to download our sample code repository:
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:
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.
To set your API credentials for an API request,Configure the following information in ExternalConfiguration.php 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.
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.
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.
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:
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.
All versions of cybersource-rest-client-php with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
firebase/php-jwt Version 5.0.0