Git Product home page Git Product logo

tpay-php's Introduction

Tpay

Library for all payment methods available in Tpay

Requirements

  • PHP > 5.6.0

Installation

Install via composer:

composer require tpay-com/tpay-php

Install via git over ssh:

git clone [email protected]:tpay-com/tpay-php.git

Install via git over https:

git clone https://github.com/tpay-com/tpay-php.git

manual download: https://github.com/tpay-com/tpay-php/archive/master.zip

Configuration

The only thing you need to do is to set your API access data via $this-> (see examples) You can generate access keys in tpay merchant panel (https://secure.tpay.com/panel)

The loader.php file handles all required class loading, so you can include this file to any file you are editing (remember to configure your current working path correctly).

All methods described in tpay documentation can be easily executed by extending required class in main src folder (see examples)

###Example configuration data should look like this:

merchantId - merchant id ex. 1010

merchantSecret - merchant secret ex. demo

Basic Payments and bank selection forms:

Example of usages: Basic, Bank selection html form, Bank selection API form, Blik form

Transaction API / create, get, refund, report

Example of usages: Create transaction, Refund Transaction, Refund Transaction Status

Card Basic / Card On-Site

Example of usages: Card basic form, Card On-site Gateway, Card payment links builder, Card On-site Gateway with saved cards

Logs

Library has own logging system to save all confirmations and notifications sent by Tpay.com server, outgoing requests and exceptions. Be sure that file src/Logs directory is writable and add rule to Apache htaccess or NGINX to deny access to this area from browser. The log files are created for each day separately under 'Logs' directory.

The logging is enabled by default but you can switch this feature by command:

Util::$loggingEnabled = false;

You can also set your own logging path by this command:

Util::$customLogPatch = '/my/own/path/Logs/';

The logs file names will be assigned automatically.

Custom templates path

You can set your own templates path so you can copy and modify the phtml template files from this library.

Util::$customTemplateDirectory = '/my/own/templates/path/';

Language

For this moment library supports two languages (EN, PL). Default language is english. Change language example:

//All Tpay class constructors load Lang class
$tpay = new BankSelectionExample();

//After this line all static messages (input labels, buttons titles) will be displayed in Polish
(new Util())->setLanguage('pl');

If you want to access translations manually, use:
$language = new Lang()
$language->setLang('pl'); for setting language
$language->l('pay'); to echo translated key

License

This library is released under the MIT License but uses third party libraries that are distributed under their own terms (see LICENSE-3RD-PARTY.md)

tpay-php's People

Contributors

piotrjozwiak avatar szczepaniakg avatar banczerowskim avatar kdoroszewicz avatar karpol avatar digital87 avatar pstasicki avatar thomas2411 avatar erizodelbosque avatar

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.