Download the PHP package lunalabs-srl/slimpay-php without Composer
On this page you can find all versions of the php package lunalabs-srl/slimpay-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lunalabs-srl/slimpay-php
More information about lunalabs-srl/slimpay-php
Files in lunalabs-srl/slimpay-php
Package slimpay-php
Short Description A simple PHP package to integrate the SlimPay checkout on your application that supports both iframe and redirect checkout
License GPL-2.0-only
Informations about the package slimpay-php
SlimPay PHP
A simple PHP package to integrate the SlimPay checkout on your application that supports both iframe and redirect checkout.
Installation
You can directly install the package with:
Test the package
Create a simple PHP file with these lines:
Credit card checkout with SlimPay iframe or redirection
To create the SlimPay checkout for Credit Cards you have to init an array like this one below and call the checkout method. Customize the data and the return urls (failureUrl, successUrl and cancelUrl) with yours.
If the response has the user approval link you will be redirected to the SlimPay checkout page. Once you have filled the checkout form with your Credit Card details, a detailed response will be sent to the Server notification URI set in your SlimPay application, containing the get-card-alias link to retrieve the credit card ID and reference ID to be sent to your Payment Gateway to finish the flow. Server Notification Reference
In this response you will find the id, reference and status for the used credit card and now you will able to store these data in the payment gateway.
SEPA checkout with SlimPay iframe or redirection
To create the SlimPay iframe for SEPA direct debit you have to init an array like this one below and call the checkout method. Customize the data and the return urls (failureUrl, successUrl and cancelUrl) with yours.
If the response has the user approval link you will be redirected to the SlimPay checkout page. Once you have filled the checkout form with your IBAN, a detailed response will be sent to the Server notification URI set in your SlimPay application, containing the checkout status and the link (get-mandate) to retrieve the created mandate. Calling this link (like this one: https://api.slimpay.net/mandates/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) you can retrieve the reference ID and the UMR (RUM) number to create the payment method in your payment gateway for this user.
Get a resource through authenticated call
To retrieve a resource, you can use the getResource() method by passing the URL as shown below.
Server notification URL
It is possible to handle the SlimPay server notification. To instantiate the notification handler, write these lines:
If you want to log the notification response, you can inject you custom logger as parameter. Pay attention that your logger must have a "write()" method inside, as shown in this simple example below.
TODO
Authentication
- [x] Authentication flow
Credit card checkout
- [x] Create order
- [x] Checkout redirect
- [x] Embedded Iframe
- [x] Get notification response to retrieve the card and reference IDs
SEPA checkout
- [x] Create order
- [x] Iframe redirect
- [x] Get notification response to retrieve the RUM
Testing
- [x] Unit testing