Giter Club home page Giter Club logo

lib-webtopay's Introduction

lib-webtopay

The Checkout API (Payment Gateway API) allows for the collection of online payments with many payment methods. The Checkout API is easy to integrate โ€“ simply use one of our methods and the checkout processes will be performed automatically. The library can be used to check all the necessary security parameters of transferred and received data. More information can be found in the documentation.

Installation

Easiest way to use library is to include merged all-in-one file. It is located in base libwebtopay directory, "WebToPay.php". In this case you only need this one file. Example:

<?php

require_once('WebToPay.php');

Alternatively, you can use files in the "src" folder. Either set-up autoloader or include file "includes.php" in "src" directory. Example:

<?php

require_once('libwebtopay/src/includes.php');
// Your code goes here

Another way to install library is using composer:

// to install the latest version
"composer require webtopay/libwebtopay

// to install the oldest supported version (in some projects)
"composer require webtopay/libwebtopay "^1.6"

// to install version with new interface
"composer require webtopay/libwebtopay "^2.0"

And then:

<?php

use WebToPay;

Pay attention that the ^3.0 version has the same interface as the ^2.0 but newest one is brought up to PHP 7.4 standards and code style like strict_types, type hints etc

Testing

$ bash runt_tests.sh

lib-webtopay's People

Contributors

alexanderzaiets-paysera avatar gsalnis avatar kostasnoreika avatar morlo1 avatar oleksandr-gribiennikov-paysera avatar pelanis avatar poltoruhin avatar reekenx avatar sirex avatar vbartusevicius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lib-webtopay's Issues

When searching by payment amount = null, no payment methods returned

Newest library version, when trying to search for payment methods with amount = null:
WebToPay::getPaymentMethodList(6028, null, 'EUR')
returns no payment methods at all, because it wrongly searches by amount=0. I expect that it would not use amount for filtering at all, if its value is null.

There is a problem in library internals. When searching for amount = null, it uses URL https://www.paysera.com/new/api/paymentMethods/6028/currency:EUR/amount: (mind ":" at the end of URL) which returns nothing, same as https://www.paysera.com/new/api/paymentMethods/6028/currency:EUR/amount:0 But one would expect if we are not filtering by amount, such URL should be used instead: https://www.paysera.com/new/api/paymentMethods/6028/currency:EUR , which returns all enabled payment methods ignoring amount.

Proposed pull request is here: #29

Call to undefined function get_magic_quotes_gpc()

Error Message :
Call to undefined function get_magic_quotes_gpc() {"exception":"[object] (Error(code: 0): Call to undefined function get_magic_quotes_gpc() at .../vendor/webtopay/libwebtopay/src/WebToPay/Util.php:42)
PHP VERSION: 8.1

PHP version incompatibility with openssl_decrypt

The openssl_decrypt tag parameter was added in PHP 7.1.
Because of that PHP 7.0 gives error saying it accepts 5 parameters.
I think composer.json PHP versions need to be updated.

$decryptedText = openssl_decrypt(
$ciphertext,
self::GCM_CIPHER,
$key,
OPENSSL_RAW_DATA,
$iv,
$tag
);

Documentation: https://www.php.net/manual/en/function.openssl-decrypt.php#refsect1-function.openssl-decrypt-parameters

PHPUnit setup?

What version of PHPUnit should we use with these? Seems quite old because of that PHPUnit_Framework_TestCase class. I am trying to check if this library is fine with PHP8, but I can't get the tests to run without exceptions for now.

Maybe you could include that as a dev dependency and suggest running the local vendor/bin/phpunit instead of the global one?

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.