Skip to content

Commit 57d5baf

Browse files
committed
Create Paclage
1 parent 5986237 commit 57d5baf

25 files changed

+1198
-0
lines changed

.coveralls.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
service_name: travis-ci
2+
src_dir: src
3+
coverage_clover: build/logs/clover.xml

.scrutinizer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tools:
2+
external_code_coverage: true

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: php
2+
3+
php:
4+
- 5.3
5+
- 5.4
6+
- 5.5
7+
8+
before_install:
9+
- composer self-update
10+
11+
install:
12+
- composer install --no-interaction --dev --prefer-source
13+
- wget https://scrutinizer-ci.com/ocular.phar
14+
15+
script:
16+
- php vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
17+
- php vendor/bin/phpcs --standard=PSR2 src
18+
19+
after_script:
20+
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
21+
- php vendor/bin/coveralls -v

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Contributing Guidelines
2+
3+
* Fork the project.
4+
* Make your feature addition or bug fix.
5+
* Add tests for it. This is important so I don't break it in a future version unintentionally.
6+
* Commit just the modifications, do not mess with the composer.json or CHANGELOG.md files.
7+
* Ensure your code is nicely formatted in the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
8+
style and that all tests pass.
9+
* Send the pull request.
10+
* Check that the Travis CI build passed. If not, rinse and repeat.

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Cherry Ltd.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

composer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "dercoder/omnipay-ukash",
3+
"type": "library",
4+
"description": "Ukash driver for the Omnipay payment processing library",
5+
"keywords": [
6+
"gateway",
7+
"merchant",
8+
"ukash",
9+
"omnipay",
10+
"pay",
11+
"payment"
12+
],
13+
"homepage": "https://github.com/dercoder/omnipay-ukash",
14+
"license": "MIT",
15+
"authors": [
16+
{
17+
"name": "Alexander Fedra",
18+
"email": "[email protected]"
19+
}
20+
],
21+
"autoload": {
22+
"psr-0": {
23+
"Omnipay\\Ukash\\": "src/"
24+
}
25+
},
26+
"require": {
27+
"omnipay/common": "~2.0"
28+
},
29+
"require-dev": {
30+
"omnipay/tests": "~2.0",
31+
"satooshi/php-coveralls": "dev-master"
32+
},
33+
"extra": {
34+
"branch-alias": {
35+
"dev-master": "1.0.x-dev"
36+
}
37+
}
38+
}

phpunit.xml.dist

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="tests/bootstrap.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false">
12+
<testsuites>
13+
<testsuite name="Omnipay Test Suite">
14+
<directory>./tests/</directory>
15+
</testsuite>
16+
</testsuites>
17+
<listeners>
18+
<listener class="Mockery\Adapter\Phpunit\TestListener" file="vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php" />
19+
</listeners>
20+
<filter>
21+
<whitelist>
22+
<directory>./src</directory>
23+
</whitelist>
24+
</filter>
25+
<logging>
26+
<log type="coverage-clover" target="build/logs/clover.xml" />
27+
</logging>
28+
</phpunit>

src/Omnipay/Ukash/Gateway.php

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<?php
2+
namespace Omnipay\Ukash;
3+
4+
use Omnipay\Common\AbstractGateway;
5+
6+
/**
7+
* Ukash Gateway
8+
*
9+
* @author Alexander Fedra <[email protected]>
10+
* @copyright 2014 DerCoder
11+
* @license http://opensource.org/licenses/mit-license.php MIT
12+
* @version 1.0.0
13+
*/
14+
class Gateway extends AbstractGateway
15+
{
16+
17+
/**
18+
* {@inheritdoc}
19+
*/
20+
public function getName()
21+
{
22+
return 'Ukash';
23+
}
24+
25+
/**
26+
* {@inheritdoc}
27+
*/
28+
public function getDefaultParameters()
29+
{
30+
return array(
31+
'brandId' => 0,
32+
'languageCode' => 'EN',
33+
'requestSecurityToken' => '',
34+
'responseSecurityToken' => '',
35+
'testMode' => false,
36+
);
37+
}
38+
39+
/**
40+
* Get the Brand ID
41+
*
42+
* Ukash will supply a brand id to the merchant for each of the brands they wish to differentiate between.
43+
* The appropriate brand id must then be sent through on each transaction request.
44+
*
45+
* @return string brand id
46+
*/
47+
public function getBrandId()
48+
{
49+
return $this->getParameter('brandId');
50+
}
51+
52+
/**
53+
* Set the Brand ID
54+
*
55+
* Ukash will supply a brand id to the merchant for each of the brands they wish to differentiate between.
56+
* The appropriate brand id must then be sent through on each transaction request.
57+
*
58+
* @param string $value brand id
59+
* @return self
60+
*/
61+
public function setBrandId($value)
62+
{
63+
return $this->setParameter('brandId', $value);
64+
}
65+
66+
/**
67+
* Get the Request Security Token
68+
*
69+
* 20-Character alphanumeric unique Request-Token provided by Ukash.
70+
* The token is used to validate the merchant account.
71+
*
72+
* @return string merchant key
73+
*/
74+
public function getRequestSecurityToken()
75+
{
76+
return $this->getParameter('requestSecurityToken');
77+
}
78+
79+
/**
80+
* Set the Request Security Token were assigned when your Ukash merchant account was
81+
* created.
82+
*
83+
* 20-Character alphanumeric unique Request-Token provided by Ukash.
84+
* The token is used to validate the merchant account.
85+
*
86+
* @param string $value merchant key
87+
* @return self
88+
*/
89+
public function setRequestSecurityToken($value)
90+
{
91+
return $this->setParameter('requestSecurityToken', $value);
92+
}
93+
94+
/**
95+
* Get the Request Security Token
96+
*
97+
* 20-Character alphanumeric unique Response-Token provided by Ukash.
98+
* The token is used to validate the merchant account.
99+
*
100+
* @return string merchant key
101+
*/
102+
public function getResponseSecurityToken()
103+
{
104+
return $this->getParameter('responseSecurityToken');
105+
}
106+
107+
/**
108+
* Set the Request Security Token were assigned when your Ukash merchant account was
109+
* created.
110+
*
111+
* 20-Character alphanumeric unique Response-Token provided by Ukash.
112+
* The token is used to validate the merchant account.
113+
*
114+
* @param string $value merchant key
115+
* @return self
116+
*/
117+
public function setResponseSecurityToken($value)
118+
{
119+
return $this->setParameter('responseSecurityToken', $value);
120+
}
121+
122+
public function purchase(array $parameters = array())
123+
{
124+
return $this->createRequest('\Omnipay\Ukash\Message\PurchaseRequest', $parameters);
125+
}
126+
127+
public function completePurchase(array $parameters = array())
128+
{
129+
return $this->createRequest('\Omnipay\Ukash\Message\CompletePurchaseRequest', $parameters);
130+
}
131+
132+
public function fetchTransaction(array $parameters = array())
133+
{
134+
return $this->createRequest('\Omnipay\Ukash\Message\FetchTransactionRequest', $parameters);
135+
}
136+
137+
}

0 commit comments

Comments
 (0)