Skip to content

Commit 2aa03aa

Browse files
committed
First commit
0 parents  commit 2aa03aa

17 files changed

+813
-0
lines changed

.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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: php
2+
3+
php:
4+
- 5.3
5+
- 5.4
6+
- 5.5
7+
- 5.6
8+
- hhvm
9+
10+
before_script:
11+
- composer install -n --dev --prefer-source
12+
13+
script: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+
* 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)
7+
style and that all tests pass.

LICENSE

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

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Omnipay: Globalcloudpay
2+
3+
**Globalcloudpay driver for the Omnipay PHP payment processing library**
4+
5+
[![Build Status](https://travis-ci.org/dercoder/omnipay-globalcloudpay.png?branch=master)](https://travis-ci.org/dercoder/omnipay-globalcloudpay)
6+
[![Dependency Status](https://www.versioneye.com/user/projects/54366b4be993e89c45000137/badge.png)](https://www.versioneye.com/user/projects/54366b4be993e89c45000137)
7+
8+
[![Latest Stable Version](https://poser.pugx.org/dercoder/omnipay-globalcloudpay/v/stable.png)](https://packagist.org/packages/dercoder/omnipay-globalcloudpay)
9+
[![Total Downloads](https://poser.pugx.org/dercoder/omnipay-globalcloudpay/downloads.png)](https://packagist.org/packages/dercoder/omnipay-globalcloudpay)
10+
[![Latest Unstable Version](https://poser.pugx.org/dercoder/omnipay-globalcloudpay/v/unstable.png)](https://packagist.org/packages/dercoder/omnipay-globalcloudpay)
11+
[![License](https://poser.pugx.org/dercoder/omnipay-globalcloudpay/license.png)](https://packagist.org/packages/dercoder/omnipay-globalcloudpay)
12+
13+
[Omnipay](https://github.com/omnipay/omnipay) is a framework agnostic, multi-gateway payment
14+
processing library for PHP 5.3+. This package implements [Globalcloudpay](http://www.globalcloudpay.com) support for Omnipay.
15+
16+
## Installation
17+
18+
Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it
19+
to your `composer.json` file:
20+
21+
```json
22+
{
23+
"require": {
24+
"dercoder/omnipay-globalcloudpay": "~1.0"
25+
}
26+
}
27+
```
28+
29+
And run composer to update your dependencies:
30+
31+
$ curl -s http://getcomposer.org/installer | php
32+
$ php composer.phar update
33+
34+
## Basic Usage
35+
36+
The following gateways are provided by this package:
37+
38+
* Globalcloudpay
39+
40+
For general usage instructions, please see the main [Omnipay](https://github.com/omnipay/omnipay)
41+
repository.
42+
43+
## Support
44+
45+
If you are having general issues with Omnipay, we suggest posting on
46+
[Stack Overflow](http://stackoverflow.com/). Be sure to add the
47+
[omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.
48+
49+
If you want to keep up to date with release anouncements, discuss ideas for the project,
50+
or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which
51+
you can subscribe to.
52+
53+
If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/dercoder/omnipay-globalcloudpay/issues),
54+
or better yet, fork the library and submit a pull request.

composer.json

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

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="Globalcloudpay 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="./clover.xml" />
27+
</logging>
28+
</phpunit>
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?php
2+
namespace Omnipay\Globalcloudpay;
3+
4+
use Omnipay\Common\AbstractGateway;
5+
6+
/**
7+
* Globalcloudpay Gateway
8+
*
9+
* @author Alexander Fedra <contact@dercoder.at>
10+
* @copyright 2015 DerCoder
11+
* @license http://opensource.org/licenses/mit-license.php MIT
12+
*/
13+
class Gateway extends AbstractGateway
14+
{
15+
/**
16+
* {@inheritdoc}
17+
*/
18+
public function getName()
19+
{
20+
return 'Globalcloudpay';
21+
}
22+
23+
/**
24+
* {@inheritdoc}
25+
*/
26+
public function getDefaultParameters()
27+
{
28+
return array(
29+
'merNo' => '',
30+
'gatewayNo' => '',
31+
'signKey' => '',
32+
'testMode' => false
33+
);
34+
}
35+
36+
/**
37+
* Get the Merchant No
38+
*
39+
* This value is provided by Globalcloudpay is used to authenticate a merchant.
40+
*
41+
* @return string merchant no
42+
*/
43+
public function getMerNo()
44+
{
45+
return $this->getParameter('merNo');
46+
}
47+
48+
/**
49+
* Set the Merchant No
50+
*
51+
* This value is provided by Globalcloudpay is used to authenticate a merchant.
52+
*
53+
* @param string $value merchant no
54+
* @return self
55+
*/
56+
public function setMerNo($value)
57+
{
58+
return $this->setParameter('merNo', $value);
59+
}
60+
61+
/**
62+
* Get the Gateway No
63+
*
64+
* This value is provided by Globalcloudpay is used to authenticate a merchant.
65+
*
66+
* @return string gateway no
67+
*/
68+
public function getGatewayNo()
69+
{
70+
return $this->getParameter('gatewayNo');
71+
}
72+
73+
/**
74+
* Set the Gateway No
75+
*
76+
* This value is provided by Globalcloudpay is used to authenticate a merchant.
77+
*
78+
* @param string $value gateway no
79+
* @return self
80+
*/
81+
public function setGatewayNo($value)
82+
{
83+
return $this->setParameter('gatewayNo', $value);
84+
}
85+
86+
/**
87+
* Get the Sign Key
88+
*
89+
* This value is provided by Globalcloudpay is used to sign communication.
90+
*
91+
* @return string sign key
92+
*/
93+
public function getSignKey()
94+
{
95+
return $this->getParameter('signKey');
96+
}
97+
98+
/**
99+
* Set the Sign Key
100+
*
101+
* This value is provided by Globalcloudpay is used to sign communication.
102+
*
103+
* @param string $value sign key
104+
* @return self
105+
*/
106+
public function setSignKey($value)
107+
{
108+
return $this->setParameter('signKey', $value);
109+
}
110+
111+
/**
112+
* @param array $parameters
113+
* @return \Omnipay\Globalcloudpay\Message\PurchaseRequest
114+
*/
115+
public function purchase(array $parameters = array())
116+
{
117+
return $this->createRequest('\Omnipay\Globalcloudpay\Message\PurchaseRequest', $parameters);
118+
}
119+
}

0 commit comments

Comments
 (0)