Download the PHP package sauladam/omnipay-paysafecard-rest without Composer
On this page you can find all versions of the php package sauladam/omnipay-paysafecard-rest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sauladam/omnipay-paysafecard-rest
More information about sauladam/omnipay-paysafecard-rest
Files in sauladam/omnipay-paysafecard-rest
Package omnipay-paysafecard-rest
Short Description Paysafecard (with REST API) gateway for Omnipay payment processing library
License MIT
Homepage https://github.com/sauladam/omnipay-paysafecard-rest
Informations about the package omnipay-paysafecard-rest
Omnipay: Paysafecard (REST API)
Paysafecard driver for the Omnipay PHP payment processing library
This is non-official Omnipay-driver for the payment gateway provider Paysafecard. In order to use it the Omnipay-Framework is required.
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Paysafecard REST API support for Omnipay.
Installation
This package is installed via Composer. To install, simply add it
to your composer.json
file:
And run composer to update your dependencies:
Basic Usage
The following gateway is provided by this package:
- Paysafecard_Rest
For general usage instructions, please see the main Omnipay repository.
Setting up the gateway
This is quite simple because the API only needs an API key.
Initializing / authorizing a payment
The auth URL points to a (secure) page where the customer can enter their Paysafecard PIN number. You can redirect the customer to that URL or embed it as an iframe and display it to them - either is fine.
After the customer has filled out and submitted the form, Paysafecard will redirect them to what you've specified as your success_url in the authorize request. Ideally that URL should contain some kind of payment identifier or some reference to your previously stored $paymentId
(Paysafecard will replace the placeholder {payment_id} in the URL with the actual payment id), because you now need it to check the status of this transaction:
Check the status
The status now should be AUTHORIZED, so check for that:
Capture the transaction
Refunds
In order to use the Refund API, you have to ask paysafecard explicitly to enable this endpoint for your merchant account, otherwise you will get a "401 Unauthorized" response.
If you want to execute the refund immediately, just use the refund()
-funtion directly with all the required data:
However, it is recommended to validate the refund first in order to "precheck the likeliness of the upcoming refund to be successful" because "there are certain conditions why a refund might be refused".
So instead of refund()
you should rather use validateRefund()
first with the same data and only request the refund if the validation passed:
Support
For more usage examples please have a look at the tests of this package. Also have a look at the Paysafecard API Documentation for further details.
If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.
If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.