dofinity / pelecard Goto Github PK
View Code? Open in Web Editor NEWA lightweight PHP Helper Library for integrating Pelecard Iframe V2 payments.
License: MIT License
A lightweight PHP Helper Library for integrating Pelecard Iframe V2 payments.
License: MIT License
I guess that t()
function is from Drupal.
It would be nice to remove Drupal dependency for people who use this package with other CMS or plain PHP.
Script:
$terminal = 'XXXXXXXXX';
$user = 'XXXXXXXXX';
$password = 'XXXXXXXXX';
$PelecardTransactionId = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX';
$PelecardStatusCode = '000';
$ConfirmationKey = 'XXXXXXXXXXXXXXXXXXXXXXXXXX';
$Total = 100;
$PaymentResponse = new \Pelecard\PaymentResponse(
$PelecardStatusCode, $PelecardTransactionId, '', '', $ConfirmationKey, $Total
);
$payment = new \Pelecard\PelecardPayment();
$payment->setPaymentResponse($PaymentResponse);
$transaction = new \Pelecard\PelecardTransaction(
$terminal, $user, $password, $PelecardTransactionId
);
$clearerName = $transaction->getClearerName();
Output
Fatal error: Uncaught Error: Call to undefined function Pelecard\t()
in \vendor\dofinity\pelecard\src\Pelecard\PelecardTransaction.php:178
From offical documentation:
QAResultStatus
Allows us to simulate good/error response for transaction.
Example:
To get a success response we will send 000
To get false response we will send the status code we want to simulate
There is no way to set this parameter in \Pelecard\PaymentRequest
class.
i see there is no documentation for how to use this library, so can you please make documentation on this?
I'm sorry i have to create an issue because there is no option like comments here.
Official manual contains Appendix B – Error Code List section. It seems to me that Pelecard API returns only english error messages even when payment page has been configured with hebrew locale.
Hardcode hebrew error messages from official manual into external PHP class. I can submit PR, it's almost ready if nobody have other ideas.
My implementation looks like:
use Pelecard\PelecardPaymentStatus;
$status = new PelecardPaymentStatus('010', 'he');
$status->getMessage();
// output:
// תוכנית הופסקה עפ"י הוראת המפעיל (ESC) או COM PORT לא ניתן לפתיחה (WINDOWS).
Option to change timeouts would be great.
pelecard/src/Pelecard/PelecardHttpRequest.php
Lines 19 to 20 in 52432e0
pelecard/src/Pelecard/PelecardHttpRequest.php
Lines 33 to 40 in 52432e0
5 and 10 seconds isn't optimal for all servers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.