Download the PHP package restoore/systempay-webservice without Composer
On this page you can find all versions of the php package restoore/systempay-webservice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download restoore/systempay-webservice
More information about restoore/systempay-webservice
Files in restoore/systempay-webservice
Package systempay-webservice
Short Description The library provides an easy and fast systempay webservice package. Web services are used to include one or several payment functions into an integrated CMS.
License MIT
Informations about the package systempay-webservice
Use Systempay payment webservice for Laravel 5.x
What is the point ?
The library provides an easy and fast systempay webservice package. Web services are used to include one or several payment functions into an integrated CMS.
Common transaction operations :
- Creating payments (without 3D Secure authentication).
- Automating transaction actions (refund, cancel, etc.).
To enable this option, the merchant must subscribe to the option of payment by web services.
Web services are developed according to the version 1.2 of the SOAP protocol (Simple Object Access Protocol) and are described by the following wsdl file: https://paiement.systempay.fr/vads-ws/v5?wsdl
Don't forget to read : Systempay Webservice v5 documentation
Installation
First you need to add the component to your composer.json
Update your packages with composer update or install with composer install.
After updating composer, add the ServiceProvider to the providers array in config/app.php
For Laravel >= 5.1
For Laravel 5.0
Facades
Configuration
You can execute this command from your laravel project root directory to copy config file in your config directory :
By default, the package comes with an example configuration file : config/systempay_webservice.php
In this file, you have to put your key and shopid. This parameters are given by Systempay.
Test environment
If you are running your app in a test environment, you can override key, shopid and env parameters using .env file
Use this following constants names : SYSTEMPAYWEBSERVICE_SHOPID, SYSTEMPAYWEBSERVICE_CERTIFICATE and SYSTEMPAYWEBSERVICE_MODE
Unit tests
You can execute this command from your laravel project root directory to copy test file in your tests directory :
After that, simply execute phpunit command to launch unit tests. Please make sure to have the last phpunit version installed. At this moment, the last version is 5.7.14.
Test will create a transaction, get uuid, return all the transaction details, update and cancel the transaction.
Create a payment request
Now we are finally ready to use the package! Here is a little example of code to explain how does it work
What you have to know about this code
- CreatePayment can takes a lot of parameters so i use arrays for this function
- This function return a boolean
- If true you can have the complete result otherwise you can see error message
List of availables functions
Important thing to know
For each functions you can call Systempay::getResult() or Systempay::getLastError(). So you have access to the complete return object from systempay webservice. Please refer to the documentation to have the complete structure.
getPaymentUuid
Get an uuid (Universally Unique IDentifier) for a transaction from transactionId, creationDate and sequenceNumber
Parameters
- string transactionId
- string creationDate
- int sequenceNumber, defaut value : 1
Return
- uuid string
Exemple
findPayments
The findPayments operation allows to search for payments. findPayments allows to obtain a list of payments according to the search criteria. At the moment, the paymentToken, subscriptionId and uuid attributes are not taken into account for this operation.
Parameter
- string orderId
Return
- boolean - true if action successfully completed, false otherwise
Exemple
getPaymentDetails
The getPaymentDetails operation allows to request the results for the payment outcome to see its attributes.
Parameter
- string uuid
Return
- boolean - true if action successfully completed, false otherwise
Exemple
updatePayment
updatePayment allows to:
- edit the transaction amount (downward),
- edit the desired capture date,
- To be updated, transactions must have one of the following statuses:
- To be validated
- To be validated and authorized
Waiting for authorization :
- Waiting for capture.
Note: if no detail is edited, an error code will appear and the query will be rejected.
Parameters
- string uuid
- string amount
- string
expectedCaptureDate - int currency
- int
manualValidation - 0|1 - string
comment - int
paymentOptionCode
Return
- boolean - true if action successfully completed, false otherwise
Exemple
validatePayment
The validatePayment operation allows to authorize transaction capture in the bank on the date specified in the original payment. To be validated, transactions must have one of the following statuses:
- To be validated
- To be validated and authorized
Parameters
- string uuid
- string
comment
Return
- boolean - true if action successfully completed, false otherwise
Exemple
createPayment
The call to the createPayment operation allows to initialize a payment transaction.
Depending on the attribute values in the query, it is possible to make:
- immediate payments,
- deferred payments,
- payments without 3D Secure authentication,
- payments using an existing token
Note : 3DS is not implemented yet in this package
Parameters
- array commonRequestParams
- array
threeDSRequestParams - array paymentRequestParams
- array orderRequestParams
- array cardRequestParams
- array
customerRequestParams - array
techRequestParams - array
shoppingCartRequestParams
For all parameters details you can refer to manual : Systempay Webservice v5 documentation
Return
- boolean - true if action successfully completed, false otherwise
refundPayment
The refundPayment operation allows to refund a buyer. The transactions subject to refund have the Captured status.
Parameters
- string uuid
- string amount
- string
expectedCaptureDate - int currency
- int
manualValidation - 0|1 - string
comment
Return
- boolean - true if action successfully completed, false otherwise
Exemple
cancelPayment
The cancelPayment operation allows to cancel a payment transaction. cancelPayment allows to definitively cancel a not-yet-captured transaction with one of the following statuses:
- To be validated
- To be validated and authorized
- Waiting for authorization.
- Waiting for capture.
Parameters
- string uuid
- string
comment
Return
- boolean - true if action successfully completed, false otherwise
Exemple
All versions of systempay-webservice with dependencies
ext-soap Version *
wsdltophp/packagebase Version ~1.0
phpunit/phpunit Version ~5.0
laravel/framework Version ~5.0