Giter VIP home page Giter VIP logo

pelecard's People

Contributors

dofinity avatar eyaldofinity avatar reissr avatar ybelenko avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pelecard's Issues

Call to undefined function Pelecard\t()

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

QAResultStatus parameter missing

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.

Unable to retrieve hebrew error messages

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.

Suggested solution

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 for GuzzleHttp client

Option to change timeouts would be great.

const CONNECTION_TIMEOUT = 5;
const REQUEST_TIMEOUT = 10;

$response = $client->post($uri,
[
'headers' => ['Content-Type' => 'application/json'],
'json' => $data,
'connect_timeout' => self::CONNECTION_TIMEOUT,
'timeout' => self::REQUEST_TIMEOUT
]
);

5 and 10 seconds isn't optimal for all servers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.