uskur / omnipay-pelecard
Pelecard support for Omnipay payment processing library
Requires
- php: ^8.1
- omnipay/common: ^3.0
- php-http/guzzle7-adapter: ^1.1
Requires (Dev)
- omnipay/tests: ^4.2
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-01 14:12:31 UTC
README
Pelecard gateway for the Omnipay PHP payment processing library
Omnipay is a framework-agnostic, multi-gateway payment processing library. This package provides Pelecard's hosted iframe payment flow for Omnipay 3 on PHP 8.1 and later.
Version compatibility
| Package | PHP | Omnipay |
|---|---|---|
2.x |
^8.1 |
^3.0 |
1.x |
>=5.3 |
~2.0 |
Reference documentation
This driver is implemented against Pelecard's Iframe/Redirect 2.0 Programmer Manual, Version 2.0, dated June 2018 (English edition). The third-party manual is not redistributed with this repository. Pelecard's maintained IFrame/Redirect 2.0 Quickstart is the current online reference; review it and confirm provider changes before altering the integration contract.
Install
Via Composer
composer require uskur/omnipay-pelecard
Usage
The package provides the Pelecard_Iframe gateway. Pelecard's iframe flow
authorizes and captures in one operation, so both purchase() and
authorize() create the same hosted payment request.
use Omnipay\Omnipay; $gateway = Omnipay::create('Pelecard_Iframe'); $gateway->setUser(getenv('PELECARD_USER')); $gateway->setPassword(getenv('PELECARD_PASSWORD')); $gateway->setTerminal(getenv('PELECARD_TERMINAL')); $response = $gateway->purchase([ 'transactionId' => 'order-123', 'amount' => '100.00', 'currency' => 'ILS', 'card' => $card, 'returnUrl' => 'https://merchant.example/payments/return', 'errorUrl' => 'https://merchant.example/payments/error', 'cancelUrl' => 'https://merchant.example/payments/cancel', 'notifyUrl' => 'https://merchant.example/payments/notify', ])->send(); if ($response->isRedirect()) { $response->redirect(); }
Supported currencies are ILS (1), USD (2), EUR (978), and GBP
(826). The legacy NIS alias is accepted and normalized to ILS.
Test mode
Pelecard uses the production API endpoints with credentials assigned for testing. Supply those credentials explicitly; the package does not contain shared or hard-coded test credentials.
$gateway->setTestMode(true); $gateway->setTestUser(getenv('PELECARD_TEST_USER')); $gateway->setTestPassword(getenv('PELECARD_TEST_PASSWORD')); $gateway->setTestTerminal(getenv('PELECARD_TEST_TERMINAL'));
Keep credentials in environment variables or a secret manager. Do not commit them to the repository.
For Pelecard QA accounts, QAResultStatus can be passed on an individual
payment request when a specific simulated outcome is needed. Status requests
report Pelecard's actual result and do not override it.
Status and callbacks
Use the transaction reference returned by the initialization response when requesting status:
$status = $gateway->status([ 'transactionReference' => $transactionReference, ])->send();
Transaction references are recognized in Pelecard result data, callback
parameters (PelecardTransactionId or TransactionId), hosted-payment URLs,
and the originating request as a final fallback.
Pelecard uses different field names for the two response surfaces. Browser
landing parameters include PelecardStatusCode and PelecardTransactionId,
whereas GetTransaction returns StatusCode with transaction fields nested in
ResultData. A successful lookup is still verified using
ValidateByUniqueKey before isSuccessful() returns true.
The optional notifyUrl is sent to Pelecard as both
ServerSideGoodFeedbackURL and ServerSideErrorFeedbackURL, so the same
application endpoint receives successful and failed terminal feedback. The
endpoint should use the returned transaction reference to fetch and validate
the provider state before changing an order.
Cancellation
Pelecard reports a customer cancellation by redirecting the browser to the
configured cancelUrl (CancelURL in Pelecard's request). Handle that URL as a
distinct return path and protect it against forged requests.
Refused payments are redirected to errorUrl (ErrorURL). If errorUrl is
not supplied, the driver uses returnUrl to preserve existing integrations.
Status responses do not contain a reliable customer-cancelled state. Therefore,
Response::isCancelled() does not treat a decline or another non-success
status as cancellation. This distinction lets an application offer another
payment attempt after a decline instead of destructively cancelling its order.
For general usage instructions, see the main Omnipay repository.
Support
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 announcements, 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.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email burak@uskur.com.tr instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.