Skip to content

Commit d4f82ca

Browse files
committed
First commit
1 parent 07c987e commit d4f82ca

20 files changed

+1082
-2
lines changed

.coveralls.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coverage_clover: ./clover.xml
2+
json_path: ./coveralls-upload.json

.gitignore

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

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.

README.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,54 @@
1-
# omnipay-walletone
2-
WalletOne driver for the Omnipay PHP payment processing library
1+
# Omnipay: Wallet One
2+
3+
**Wallet One driver for the Omnipay PHP payment processing library**
4+
5+
[![Build Status](https://travis-ci.org/dercoder/omnipay-walletone.svg?branch=master)](https://travis-ci.org/dercoder/omnipay-walletone)
6+
[![Coverage Status](https://coveralls.io/repos/dercoder/omnipay-walletone/badge.svg?branch=master&service=github)](https://coveralls.io/github/dercoder/omnipay-walletone?branch=master)
7+
8+
[![Latest Stable Version](https://poser.pugx.org/dercoder/omnipay-walletone/v/stable.png)](https://packagist.org/packages/dercoder/omnipay-walletone)
9+
[![Total Downloads](https://poser.pugx.org/dercoder/omnipay-walletone/downloads.png)](https://packagist.org/packages/dercoder/omnipay-walletone)
10+
[![Latest Unstable Version](https://poser.pugx.org/dercoder/omnipay-walletone/v/unstable.png)](https://packagist.org/packages/dercoder/omnipay-walletone)
11+
[![License](https://poser.pugx.org/dercoder/omnipay-walletone/license.png)](https://packagist.org/packages/dercoder/omnipay-walletone)
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 [Wallet One](http://www.walletone.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-walletone": "~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+
* Wallet One
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-walletone/issues),
54+
or better yet, fork the library and submit a pull request.

composer.json

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

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="WalletOne 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>

src/Gateway.php

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<?php
2+
3+
namespace Omnipay\WalletOne;
4+
5+
use Omnipay\Common\AbstractGateway;
6+
use Omnipay\Common\Message\AbstractRequest;
7+
use Omnipay\WalletOne\Message\PurchaseRequest;
8+
use Omnipay\WalletOne\Message\CompletePurchaseRequest;
9+
10+
/**
11+
* Class Gateway
12+
* @package Omnipay\WalletOne
13+
*/
14+
class Gateway extends AbstractGateway
15+
{
16+
/**
17+
* @return string
18+
*/
19+
public function getName()
20+
{
21+
return 'WalletOne';
22+
}
23+
24+
/**
25+
* @return array
26+
*/
27+
public function getDefaultParameters()
28+
{
29+
return array(
30+
'merchantId' => '',
31+
'secretKey' => '',
32+
'algorithm' => 'md5',
33+
'testMode' => false
34+
);
35+
}
36+
37+
/**
38+
* Get Wallet One merchant ID.
39+
*
40+
* @return string merchantId
41+
*/
42+
public function getMerchantId()
43+
{
44+
return $this->getParameter('merchantId');
45+
}
46+
47+
/**
48+
* Set Wallet One merchant ID.
49+
*
50+
* @param string $value merchantId
51+
*
52+
* @return $this
53+
*/
54+
public function setMerchantId($value)
55+
{
56+
return $this->setParameter('merchantId', $value);
57+
}
58+
59+
/**
60+
* Get Wallet One secret key.
61+
*
62+
* @return string secretKey
63+
*/
64+
public function getSecretKey()
65+
{
66+
return $this->getParameter('secretKey');
67+
}
68+
69+
/**
70+
* Set Wallet One secret key.
71+
*
72+
* @param string $value secretKey
73+
*
74+
* @return $this
75+
*/
76+
public function setSecretKey($value)
77+
{
78+
return $this->setParameter('secretKey', $value);
79+
}
80+
81+
/**
82+
* Get Wallet One signature algorithm.
83+
*
84+
* @return string algorithm
85+
*/
86+
public function getAlgorithm()
87+
{
88+
return $this->getParameter('algorithm');
89+
}
90+
91+
/**
92+
* Set Wallet One signature algorithm.
93+
*
94+
* @param string $value algorithm
95+
*
96+
* @return $this
97+
*/
98+
public function setAlgorithm($value)
99+
{
100+
return $this->setParameter('algorithm', $value);
101+
}
102+
103+
/**
104+
* @param array $parameters
105+
*
106+
* @return AbstractRequest|PurchaseRequest
107+
*/
108+
public function purchase(array $parameters = array())
109+
{
110+
return $this->createRequest('\Omnipay\WalletOne\Message\PurchaseRequest', $parameters);
111+
}
112+
113+
/**
114+
* @param array $parameters
115+
*
116+
* @return AbstractRequest|CompletePurchaseRequest
117+
*/
118+
public function completePurchase(array $parameters = array())
119+
{
120+
return $this->createRequest('\Omnipay\WalletOne\Message\CompletePurchaseRequest', $parameters);
121+
}
122+
}

0 commit comments

Comments
 (0)