Download the PHP package avto-dev/cloud-payments-laravel without Composer
On this page you can find all versions of the php package avto-dev/cloud-payments-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download avto-dev/cloud-payments-laravel
More information about avto-dev/cloud-payments-laravel
Files in avto-dev/cloud-payments-laravel
Package cloud-payments-laravel
Short Description Cloud Payments PHP-client
License MIT
Informations about the package cloud-payments-laravel
Cloud Payments PHP-client
The package provides easy way to use Cloud Payments API.
Install
Require this package with composer using the following command:
Installed
composer
is required (how to install composer).
Configuration
You can find laravel framework integration here
For client configuration use Config
instance. Client constructor requires Public ID and API Secret that you can find in ClodPayments personal area.
Usage
Select one of requset builders:
Set all necessary parameters through the setters:
Get PSR7 request:
Set up client, and send the request:
Api client
Constructing
Constructor requires any GuzzleHttp\ClientInterface
instance and Config
instance
Sending
This method allows to send any Psr\Http\Message\RequestInterface
and returns only Psr\Http\Message\ResponseInterface
,
that allow you to build own requests as you want or use one of provided requests builders.
This client does only one thing: authorizes requests for CloudPayments and sends them.
Request builders
Supported builders:
Builder | Description | Documentation link |
---|---|---|
TestRequestBuilder |
The method to test the interaction with the API | Link |
CardsAuthRequestBuilder |
The method to make a payment by a cryptogram | Link |
CardsChargeRequestBuilder |
The method to make a payment by a cryptogram. Charge only | Link |
CardsPost3DsRequestBuilder |
3-D Secure Processing | Link |
TokensAuthRequestBuilder |
The method to make a payment by a token | Link |
TokensChargeRequestBuilder |
The method to make a payment by a token. Charge only | Link |
PaymentsConfirmRequestBuilder |
Payment Confirmation | Link |
PaymentsVoidRequestBuilder |
Payment Cancellation | Link |
SubscriptionsCreateRequestBuilder |
Creation of Subscriptions on Recurrent Payments | Link |
SubscriptionsGetRequestBuilder |
Subscription Details | Link |
SubscriptionsFindRequestBuilder |
Subscriptions Search | Link |
SubscriptionsUpdateRequestBuilder |
Recurrent Payments Subscription Change | Link |
SubscriptionsCancelRequestBuilder |
Subscription on Recurrent Payments Cancellation | Link |
How to get card cryptogram packet?
Idempotency
Idempotency is an ability of API to produce the same result as the first one without re-processing in case of repeated requests. That means you can send several requests to the system with the same identifier, and only one request will be processed. All the responses will be identical. Thus the protection against network errors is implemented which can lead to creation of duplicate records and actions.
To enable idempotency, it is necessary to call setRequestId('request_id')
method with a unique identifier in API request. Generation of request identifier remains on your side - it can be a guid, a combination of an order number, date and amount, or other values of your choice. Each new request that needs to be processed must include new request_id
value. The processed result is stored in the system for 1 hour.
Frameworks integration
Laravel
Laravel 5.5 and above uses Package Auto-Discovery, so doesn't require you to manually register the service-provider. Otherwise you must add the service provider to the providers
array in ./config/app.php
:
Laravel configuration
Service provider pick configuration from services.cloud_payments
config. So you need to put it into config/services.php
file. For example:
Testing
For package testing we use phpunit
framework. Just write into your terminal:
Changes log
Changes log can be found here.
Support
If you will find any package errors, please, make an issue in current repository.
License
This is open-sourced software licensed under the MIT License.
All versions of cloud-payments-laravel with dependencies
ext-json Version *
guzzlehttp/guzzle Version ~7.5
guzzlehttp/psr7 Version ^2.6.2
psr/http-client Version ~1.0