Skip to content

Commit 9553d20

Browse files
committed
first commit
0 parents  commit 9553d20

28 files changed

+1818
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/docs export-ignore

.github/workflows/tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: tests
2+
3+
on: [ push ]
4+
5+
jobs:
6+
build-test:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: true
11+
matrix:
12+
php: [ '5.6', '7.0', '7.1','7.2', '7.3', '7.4' ]
13+
stability: [ prefer-stable ]
14+
15+
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php }}
25+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, memcached
26+
tools: composer:v2
27+
coverage: none
28+
29+
- name: Install dependencies
30+
uses: nick-invision/retry@v1
31+
with:
32+
timeout_minutes: 5
33+
max_attempts: 5
34+
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress ${{ matrix.flags }}
35+
36+
- name: Execute tests
37+
continue-on-error: ${{ matrix.php > 8 }}
38+
run: vendor/bin/phpunit --verbose

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/vendor
2+
composer.lock
3+
composer.phar
4+
phpunit.xml
5+
.directory
6+
.idea/
7+
dirlist.app
8+
dirlist.cache
9+
dirlist.vendor
10+
11+
.php-cs-fixer.cache

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: php
2+
3+
php:
4+
- 5.6
5+
- 7.0
6+
- 7.1
7+
- 7.2
8+
9+
before_script:
10+
- composer install -n --dev --prefer-source
11+
12+
script: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text

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+
Copyright (c) 2012-2013 Adrian Macneil
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: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Omnipay: Payware
2+
3+
**Skeleton gateway for the Omnipay PHP payment processing library**
4+
5+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/omnipay-taiwan/omnipay-payware.svg?style=flat-square)](https://packagist.org/packages/omnipay-taiwan/omnipay-payware)
6+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
7+
[![Build Status](https://img.shields.io/travis/omnipay-taiwan/omnipay-payware/master.svg?style=flat-square)](https://travis-ci.org/omnipay-taiwan/omnipay-payware)
8+
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/omnipay-taiwan/omnipay-payware.svg?style=flat-square)](https://scrutinizer-ci.com/g/omnipay-taiwan/omnipay-payware/code-structure)
9+
[![Quality Score](https://img.shields.io/scrutinizer/g/omnipay-taiwan/omnipay-payware.svg?style=flat-square)](https://scrutinizer-ci.com/g/omnipay-taiwan/omnipay-payware)
10+
[![Total Downloads](https://img.shields.io/packagist/dt/omnipay-taiwan/omnipay-payware.svg?style=flat-square)](https://packagist.org/packages/omnipay-taiwan/omnipay-payware)
11+
12+
[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for
13+
PHP 5.3+. This package implements payware support for Omnipay.
14+
15+
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what
16+
PSRs you support to avoid any confusion with users and contributors.
17+
18+
## Install
19+
20+
Instal the gateway using require. Require the `league/omnipay` base package and this gateway.
21+
22+
```bash
23+
$ composer require league/omnipay omnipay-taiwan/omnipay-payware
24+
```
25+
26+
## Usage
27+
28+
The following gateways are provided by this package:
29+
30+
- payware
31+
32+
For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay) repository.
33+
34+
## Support
35+
36+
If you are having general issues with Omnipay, we suggest posting on
37+
[Stack Overflow](http://stackoverflow.com/). Be sure to add the
38+
[omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.
39+
40+
If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed
41+
questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.
42+
43+
If you believe you have found a bug, please report it using
44+
the [GitHub issue tracker](https://github.com/omnipay-taiwan/omnipay-payware/issues), or better yet, fork the library
45+
and submit a pull request.
46+
47+
## Change log
48+
49+
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
50+
51+
## Testing
52+
53+
```bash
54+
$ composer test
55+
```
56+
57+
## Contributing
58+
59+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
60+
61+
## Security
62+
63+
If you discover any security related issues, please email recca0120@gmail.com instead of using the issue tracker.
64+
65+
## Credits
66+
67+
- [recca0120](https://github.com/recca0120)
68+
- [All Contributors](../../contributors)
69+
70+
## License
71+
72+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "omnipay-taiwan/omnipay-payware",
3+
"type": "library",
4+
"description": "Payware driver for the Omnipay payment processing library",
5+
"keywords": [
6+
"payware",
7+
"gateway",
8+
"merchant",
9+
"omnipay",
10+
"pay",
11+
"payment"
12+
],
13+
"homepage": "https://github.com/omnipay-taiwan/omnipay-payware",
14+
"license": "MIT",
15+
"authors": [
16+
{
17+
"name": "Adrian Macneil",
18+
"email": "adrian@adrianmacneil.com"
19+
},
20+
{
21+
"name": "Omnipay Contributors",
22+
"homepage": "https://github.com/thephpleague/omnipay-dummy/contributors"
23+
},
24+
{
25+
"name": "recca0120",
26+
"email": "recca0120@gmail.com"
27+
}
28+
],
29+
"autoload": {
30+
"psr-4": {
31+
"Omnipay\\Payware\\": "src/"
32+
}
33+
},
34+
"autoload-dev": {
35+
"psr-4": {
36+
"Omnipay\\Payware\\Tests\\": "tests/"
37+
}
38+
},
39+
"require": {
40+
"omnipay/common": "~3.0"
41+
},
42+
"require-dev": {
43+
"omnipay/tests": "~3.0",
44+
"squizlabs/php_codesniffer": "~3.0"
45+
},
46+
"extra": {
47+
"branch-alias": {
48+
"dev-master": "3.0.x-dev"
49+
}
50+
},
51+
"prefer-stable": true
52+
}

makedoc.sh

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
#!/bin/sh
2+
3+
#
4+
# Smart little documentation generator.
5+
# GPL/LGPL
6+
# (c) Del 2015 http://www.babel.com.au/
7+
#
8+
9+
APPNAME='Omnipay Dummy Gateway Documentation'
10+
CMDFILE=apigen.cmd.$$
11+
DESTDIR=./documents
12+
SRCDIRS="src"
13+
VENDORDIRS="vendor/guzzle vendor/omnipay"
14+
15+
#
16+
# Ensure that dependencies are installed (including codeception and phpunit)
17+
#
18+
if [ -f composer.lock ]; then
19+
/usr/local/bin/composer install
20+
else
21+
/usr/local/bin/composer update
22+
fi
23+
24+
#
25+
# Find apigen, either in the path or as a local phar file
26+
#
27+
if [ -f apigen.phar ]; then
28+
APIGEN="php apigen.phar"
29+
30+
else
31+
APIGEN=`which apigen`
32+
if [ ! -f "$APIGEN" ]; then
33+
34+
# Search for phpdoc if apigen is not found.
35+
if [ -f phpDocumentor.phar ]; then
36+
PHPDOC="php phpDocumentor.phar"
37+
38+
else
39+
PHPDOC=`which phpdoc`
40+
if [ ! -f "$PHPDOC" ]; then
41+
echo "Neither apigen nor phpdoc is installed in the path or locally, please install one of them"
42+
echo "see http://www.apigen.org/ or http://www.phpdoc.org/"
43+
exit 1
44+
fi
45+
fi
46+
fi
47+
fi
48+
49+
#
50+
# As of version 4 of apigen need to use the generate subcommand
51+
#
52+
if [ ! -z "$APIGEN" ]; then
53+
APIGEN="$APIGEN generate"
54+
fi
55+
56+
#
57+
# Without any arguments this builds the entire system documentation,
58+
# making the cache file first if required.
59+
#
60+
if [ -z "$1" ]; then
61+
#
62+
# Check to see that the cache has been made.
63+
#
64+
if [ ! -f dirlist.cache ]; then
65+
echo "Making dirlist.cache file"
66+
$0 makecache
67+
fi
68+
69+
#
70+
# Build the apigen/phpdoc command in a file.
71+
#
72+
if [ ! -z "$APIGEN" ]; then
73+
echo "$APIGEN --php --tree --title '$APPNAME API Documentation' --destination $DESTDIR/main \\" > $CMDFILE
74+
cat dirlist.cache | while read dir; do
75+
echo "--source $dir \\" >> $CMDFILE
76+
done
77+
echo "" >> $CMDFILE
78+
79+
elif [ ! -z "$PHPDOC" ]; then
80+
echo "$PHPDOC --sourcecode --title '$APPNAME API Documentation' --target $DESTDIR/main --directory \\" > $CMDFILE
81+
cat dirlist.cache | while read dir; do
82+
echo "${dir},\\" >> $CMDFILE
83+
done
84+
echo "" >> $CMDFILE
85+
86+
else
87+
"Neither apigen nor phpdoc are found, how did I get here?"
88+
exit 1
89+
fi
90+
91+
#
92+
# Run the apigen command
93+
#
94+
rm -rf $DESTDIR/main
95+
mkdir -p $DESTDIR/main
96+
. ./$CMDFILE
97+
98+
/bin/rm -f ./$CMDFILE
99+
100+
#
101+
# The "makecache" argument causes the script to just make the cache file
102+
#
103+
elif [ "$1" = "makecache" ]; then
104+
echo "Find application source directories"
105+
find $SRCDIRS -name \*.php -print | \
106+
(
107+
while read file; do
108+
grep -q 'class' $file && dirname $file
109+
done
110+
) | sort -u | \
111+
grep -v -E 'config|docs|migrations|test|Test|views|web' > dirlist.app
112+
113+
echo "Find vendor source directories"
114+
find $VENDORDIRS -name \*.php -print | \
115+
(
116+
while read file; do
117+
grep -q 'class' $file && dirname $file
118+
done
119+
) | sort -u | \
120+
grep -v -E 'config|docs|migrations|test|Test|views|codesniffer|phpmd|pdepend|php-parser|codeception|phpunit' > dirlist.vendor
121+
122+
#
123+
# Filter out any directories for which apigen fails
124+
#
125+
echo "Filter source directories"
126+
mkdir -p $DESTDIR/tmp
127+
cat dirlist.app dirlist.vendor | while read dir; do
128+
if [ ! -z "$APIGEN" ]; then
129+
$APIGEN --quiet --title "Test please ignore" \
130+
--source $dir \
131+
--destination $DESTDIR/tmp && (
132+
echo "Including $dir"
133+
echo $dir >> dirlist.cache
134+
) || (
135+
echo "Excluding $dir"
136+
)
137+
138+
elif [ ! -z "$PHPDOC" ]; then
139+
$PHPDOC --quiet --title "Test please ignore" \
140+
--directory $dir \
141+
--target $DESTDIR/tmp && (
142+
echo "Including $dir"
143+
echo $dir >> dirlist.cache
144+
) || (
145+
echo "Excluding $dir"
146+
)
147+
148+
fi
149+
done
150+
echo "Documentation cache dirlist.cache built OK"
151+
152+
#
153+
# Clean up
154+
#
155+
/bin/rm -rf $DESTDIR/tmp
156+
157+
fi

0 commit comments

Comments
 (0)