Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
initial commit
  • Loading branch information
Robert committed Aug 28, 2015
0 parents commit 8a2d85e
Show file tree
Hide file tree
Showing 59 changed files with 11,691 additions and 0 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,31 @@
## 1.0.2 (2015-08-27)

Fixed bugs:

- clear code


## 1.0.1 (2015-08-25)

Implemented enhancements:

- add more code comments


## 1.0.0 (2015-08-12)

Implemented enhancements:

- check the compatibility with the installed version of PHP
- add CHANGELOG.md file
- add more information about the error in TException class
- add option small bank list instead of big bank icons for payment with bank selection in merchant shop
- add requirements section to readme file
- add options disable and enable validation of IP address of notification server
- add option of display checkbox with regulations acceptance on bank selection form

Fixed bugs:

- remove methods which required PHP version > 5.3
- fix spelling in the comments contents
- set 'common/_tpl/' path as class variable instead of multiple repeat in code
160 changes: 160 additions & 0 deletions LICENSE-3RD-PARTY.md
@@ -0,0 +1,160 @@
jquery

Copyright jQuery Foundation and other contributors, https://jquery.org/

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----------------------------------------------------------------------------
jquery.formance

Copyright (c) 2013 Omar Shammas (omar@shammaslabs.com)
and Stripe (alex@stripe.com)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----------------------------------------------------------------------------
jsencrypt

File: src/LICENSE.txt
The MIT License (MIT)
Copyright (c) 2013 AllPlayers.com

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


File: lib/jsrsasign/LICENSE.txt


CONTAINS CODE FROM YUI LIBRARY SEE LICENSE @ http://yuilibrary.com/license/

The 'jsrsasign'(RSA-Sign JavaScript Library) License

Copyright (c) 2010-2013 Kenji Urushima

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


File: lib/jsbn/LICENSE.txt

This software is covered under the following copyright:

Copyright (c) 2003-2005 Tom Wu
All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

In addition, the following condition applies:
All redistributions must retain an intact copy of this copyright notice
and disclaimer.


Address all questions regarding this license to:

Tom Wu
tjw@cs.Stanford.EDU


File: lib/asn1js/LICENSE.txt


ASN.1 JavaScript decoder
Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 changes: 21 additions & 0 deletions LICENSE.md
@@ -0,0 +1,21 @@
@todo fill this
Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
48 changes: 48 additions & 0 deletions README.md
@@ -0,0 +1,48 @@
# Transferuj.pl
----------

Library for all payment methods available in Transferuj.pl

## Installation

Replace all occurrences of the following codes on real data from the Merchant panel (https://secure.transferuj.pl/panel):

* [MERCHANT_ID] - merchant id ex. 14868
* [MERCHANT_SECRET] - merchant secret ex. nd6u7duYeso4hrtc
* [TRANSACTION_API_KEY] - transaction API key ex. c4fb9c5482e16a848e68dbb1488ed42ddcb82311
* [TRANSACTION_API_PASS] - transaction API secret ex. bd6u7drYesa43rtw
* [CARD_API_KEY] - card API key ex. 455ue12b1c26a9570vb852b31680ce6k3f706p9
* [CARD_API_PASSWORD] - card API key ex. od0ufdrYap343r0
* [CARD_API_CODE] - card API code ex. i2128h0e6b17a78fn3c1adaod262o120
* [CARD_RSA_KEY] - card RSA key ex. S10tLS1CURdJTiBQVUJMSUMgS0VZLS0tLS0NCk1JR2ZNQTBHQ1NxR1NJYjNEUUXCQVFVQUE0R05ERBNCaVFLQmdRQ2NLRTVZNU1Wemd5a1Z5ODNMS1NTTFlEMEVrU2xadTRVZm1STS8NCmM5L0NtMENuVDM2ekU0L2dMRzBSYzQwODRHNmIzU3l5NVpvZ1kwQXFOVU5vUEptUUZGVyswdXJacU8yNFRCQkxCcU10TTVYSllDaVQNCmVpNkx3RUIyNnpPOFZocW9SK0tiRS92K1l1GlDXNGQ0cWtHU0IzeHBhSUJncllrT2o0aFJDOXk0WXdJ11FRQUINCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ==
* [CARD_HASH_ALG] - card hash algorithm ex. sha1
* [SZKWAL_LOGIN] - szkwal API login ex. supershop
* [SZKWAL_API_PASSWORD] - szkwal API password ex. igtht7i7m08tdsg4wsztrrgRDSHA
* [SZKWAL_API_HASH] - szkwal API hash ex. fjk8IGjnh92TEcvfpo3usdZ
* [SZKWAL_PARTNER_ADDRESS] - szkwal unique partner address ex. c_supershop
* [SZKWAL_TITLE_FORMAT] - pattern of unique client title ex. KIR[0-9]{9}

Library has own logging system to save all confirmations and notifications sent by Transferuj.pl server
Be sure that file src/log is writable and add rule to htaccess to deny access to this file from browser

## Requirements

* PHP > 5.3.0

## Language

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

:::php
//All Transferuj class constructors load Lang class
$transferuj = new Transferuj\PaymentSzkwal();

//After this line all static messages (input labels, buttons titles) will be displayed in Polish
Transferuj\Lang::setLang('pl');


## License

This library is released under the [MIT License](http://www.opensource.org/licenses/MIT)
but uses third party libraries that are distributed under their own terms (see LICENSE-3RD-PARTY.md)
54 changes: 54 additions & 0 deletions examples/basic.php
@@ -0,0 +1,54 @@
<?php

require_once dirname(dirname(__FILE__)).'/src/_class_transferuj/payment_basic.php';

/*
* Handle payment confirmation sent by Transferuj.pl server
*/
if (isset($_GET['transaction_confirmation'])) {
$transferuj = new Transferuj\PaymentBasic();
$paymentDetails = $transferuj->checkPayment();

/*
* Example $paymentDetails response
Array
(
[id] => 12345
[tr_id] => TR-B7K-79FR0X
[tr_date] => 2015-07-22 08:45:23
[tr_crc] => order_200
[tr_amount] => 40.96
[tr_paid] => 40.96
[tr_desc] => Sklep transferuj.pl
[tr_status] => TRUE
[tr_error] => none
[tr_email] => kowalsky@example.com
[test_mode] => 1
[md5sum] => 0d1cf3083e2fe3b49d046c28e28d120c
)
*/
die;
}

$config = array(
'kwota' => 999.99,
'opis' => 'Transaction description',
'crc' => '100020003000',
'wyn_url' => 'http://example.pl/examples/payment_basic.php?transaction_confirmation',
'wyn_email' => 'shop@example.com',
'pow_url' => 'http://example.pl/examples/payment_basic.php',
'email' => 'customer@example.com',
'imie' => 'Jan',
'nazwisko' => 'Kowalski',
);

$transferuj = new Transferuj\PaymentBasic();

/*
* This method return HTML form
*/
$paymentForm = $transferuj->getTransactionForm($config);

echo $paymentForm;

?>
37 changes: 37 additions & 0 deletions examples/basic_bank_selection.php
@@ -0,0 +1,37 @@
<?php

require_once dirname(dirname(__FILE__)).'/src/_class_transferuj/payment_basic.php';

/*
* Handle payment confirmation sent by Transferuj.pl server
*/
if (isset($_GET['transaction_confirmation'])) {
$transferuj = new Transferuj\PaymentBasic();
$data = $transferuj->checkPayment();
die;
}

$config = array(
'kwota' => 999.99,
'opis' => 'Transaction description',
'crc' => '100020003000',
'wyn_url' => 'http://example.pl/examples/payment_basic_bank_selection.php?transaction_confirmation',
'wyn_email' => 'shop@example.com',
'pow_url' => 'http://example.pl/examples/payment_basic_bank_selection.php',
'email' => 'customer@example.com',
'imie' => 'Jan',
'nazwisko' => 'Kowalski',
);

$transferuj = new Transferuj\PaymentBasic();
echo $transferuj->getBankSelectionForm($config, true, true);
?>

<button id="go-to-payment" type="button">Pay</button>

<script>
var button = document.getElementById('go-to-payment');
button.onclick = function () {
document.getElementById('transferuj-payment-submit').click();
}
</script>

0 comments on commit 8a2d85e

Please sign in to comment.