From 6e646c0a570cf57a8867350d0559ececb5263429 Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Wed, 9 Jul 2014 12:03:12 -0400 Subject: [PATCH 1/7] Updated license and added to all files --- LICENSE | 21 ++++++++++ README.md | 40 +++++++++++-------- bitpay/.htaccess | 22 +++++++++- bitpay/bp_lib.php | 23 +++++++++++ bitpay/bp_options.php | 25 +++++++++++- bitpay/index.php | 23 +++++++++++ bitpay_callback.php | 21 ++++++---- .../english/modules/payment/bitpay.php | 21 ++++++---- includes/modules/payment/bitpay.php | 21 ++++++---- 9 files changed, 175 insertions(+), 42 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5dd2731 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2011-2014 BitPay + +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. diff --git a/README.md b/README.md index 2f26749..e2737d0 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,3 @@ -©2012,2013,2014 BITPAY, INC. - -Permission is hereby granted to any person obtaining a copy of this software -and associated documentation for use and/or modification in association with -the bitpay.com service. - -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. - -Bitcoin payment module for ZenCart using the bitpay.com service. - Installation ------------ Copy these files into your Zen Cart directory. @@ -51,3 +35,27 @@ Version 3 Version 4 - Fix to use server error handling + +# License + +The MIT License (MIT) + +Copyright (c) 2011-2014 BitPay + +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. diff --git a/bitpay/.htaccess b/bitpay/.htaccess index 2c1b49f..2fd0e10 100644 --- a/bitpay/.htaccess +++ b/bitpay/.htaccess @@ -1,3 +1,23 @@ +# The MIT License (MIT) +# +# Copyright (c) 2011-2014 BitPay +# +# 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. Order deny,allow Deny from all - diff --git a/bitpay/bp_lib.php b/bitpay/bp_lib.php index e39e884..ba07e51 100755 --- a/bitpay/bp_lib.php +++ b/bitpay/bp_lib.php @@ -1,4 +1,27 @@ \ No newline at end of file +?> diff --git a/bitpay/index.php b/bitpay/index.php index 34a6d15..bccc057 100644 --- a/bitpay/index.php +++ b/bitpay/index.php @@ -1,3 +1,26 @@ Date: Tue, 15 Jul 2014 14:04:02 -0400 Subject: [PATCH 2/7] Added build scripts --- .gitattributes | 31 ++++++ .gitignore | 28 ++++++ .travis.yml | 33 +++++++ build.xml | 200 +++++++++++++++++++++++++++++++++++++++ build/build.properties | 145 ++++++++++++++++++++++++++++ build/phpunit.xml.dist | 50 ++++++++++ build/rulesets/phpmd.xml | 43 +++++++++ composer.json | 28 ++++++ 8 files changed, 558 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 build.xml create mode 100644 build/build.properties create mode 100644 build/phpunit.xml.dist create mode 100644 build/rulesets/phpmd.xml create mode 100644 composer.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..52d5d56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,31 @@ +# The MIT License (MIT) +# +# Copyright (c) 2011-2014 BitPay +# +# 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. + +# These files/directories are not included when making +# an archive of this repository. +/build export-ignore +/tests export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.travis.yml export-ignore +build.xml export-ignore +composer.json export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c25b78b --- /dev/null +++ b/.gitignore @@ -0,0 +1,28 @@ +# The MIT License (MIT) +# +# Copyright (c) 2011-2014 BitPay +# +# 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. +/bin/ +/build/cache/ +/build/docs/ +/build/logs/ +/vendor/ +composer.lock +composer.phar diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..e714753 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,33 @@ +# The MIT License (MIT) +# +# Copyright (c) 2011-2014 BitPay +# +# 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. +language: php +php: + - 5.5 + - 5.4 + - 5.3 +install: + - composer install +script: ./bin/phing -propertyfile build/travis.properties build-travis +cache: + directories: + - build/cache/ + - vendor/ diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..319d3dc --- /dev/null +++ b/build.xml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/build.properties b/build/build.properties new file mode 100644 index 0000000..d33720a --- /dev/null +++ b/build/build.properties @@ -0,0 +1,145 @@ +# The MIT License (MIT) +# +# Copyright (c) 2011-2014 BitPay +# +# 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. + +#### +# +# This properties file is used to configure the entire build. The purpose of +# this file is so that it is easy to drop it into a project and change a few +# of these settings and have a build run successfully. +# +# NOTE: You may still need to take a look at and edit `phpunit.xml.dist`. +# + +#### +# +# Directory Configuration +# + +# The main location of all the projects source code, this should be the only +# property that you need to change. Code can live in the root directory or it +# can live inside of it's own directory. +project.source=${project.basedir} +#project.source=${project.basedir}/src + +# --- You shouldn't need to edit any of the below value --- + +# Location of all executables, this is the location on the `bin-dir` that you +# have configured in `composer.json`. If you have not configured this in +# 1composer.json` the default is to put it in the `vendor` directory. +project.bindir=${project.basedir}/bin +#project.bindir=${project.basedir}/vendor/bin + +# Where to put the build artifacts, cache, logs, docs, etc. +project.builddir=${project.basedir}/build + +# Location of vendor directory created by composer. +project.vendordir=${project.basedir}/vendor + +# build artifacts for code analysis +project.logsdir=${project.builddir}/logs + +# Build artifacts that can be reused or updated, they do not need to be deleted +# every build. These would include charts and images. +project.cachedir=${project.builddir}/cache + +# Location of generated documentation such as API and code coverage +project.docsdir=${project.builddir}/docs +#### directory #### + +#### +# +# phpunit configuration +# + +# Directory that contains phpunit.xml or the phpunit.xml file itself +phpunit.configuration=${project.builddir}/phpunit.xml.dist +#### phpunit #### + +#### +# +# phpmd configuration +# + +# php source code filename or directory. Can be a comma-separated string +phpmd.source=${project.source} + +# report format, text, xml, or html +phpmd.report.format=xml + +# ruleset filename or a comma-separated string of rulesetfilenames +phpmd.ruleset=${project.builddir}/rulesets/phpmd.xml + +# send report output to this file +phpmd.report.file=${project.logsdir}/phpmd.xml + +# comma-separated string of patterns that are used to ignore directories +phpmd.exclude=${project.bindir},${project.builddir},${project.vendordir},${project.basedir}/tests +#### phpmd #### + +#### +# +# phploc Configuration +# + +# Source directory of project +phploc.source=${project.source}/ + +# Where to put the csv log +phploc.log.csv=${project.logsdir}/phploc.csv + +# Location of xml log +phploc.log.xml=${project.logsdir}/phploc.xml + +# Small hack to exclude multiple directories +phploc.exclude=vendor --exclude=build --exclude=bin --exclude=tests +#### phploc #### + +#### +# +# pdepend configuration +# +pdepend.source=${project.source} +pdepend.jdepend.chart=${project.cachedir}/jdepend_chart.svg +pdepend.jdepend.xml=${project.logsdir}/jdepend.xml +pdepend.overview.pyramid=${project.cachedir}/pyramid.svg +pdepend.summary.xml=${project.logsdir}/jdepend_summary.xml +pdepend.ignore=bin,build,vendor,tests +#### pdepend #### + +#### +# +# phpcs configuration +# +phpcs.source=${project.source} +phpcs.report.xml=${project.logsdir}/phpcs.xml +phpcs.standard=PSR1 --standard=PSR2 +phpcs.ignore=vendor --ignore=bin --ignore=build --ignore=tests +#### phpcs #### + +#### +# +# phpdoc configuration +# +phpdoc.directory=${project.source}/ +phpdoc.target=${project.docsdir}/api +phpdoc.ignore=vendor/,bin/,tests/ +#### phpdoc #### diff --git a/build/phpunit.xml.dist b/build/phpunit.xml.dist new file mode 100644 index 0000000..321d196 --- /dev/null +++ b/build/phpunit.xml.dist @@ -0,0 +1,50 @@ + + + + + + + ../tests/*Test.php + + + + + + ../build + + + + + + + + diff --git a/build/rulesets/phpmd.xml b/build/rulesets/phpmd.xml new file mode 100644 index 0000000..50bc36d --- /dev/null +++ b/build/rulesets/phpmd.xml @@ -0,0 +1,43 @@ + + + + + Custom phpmd ruleset to be used with BitPay projects. + + + + + + + + + + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..0a9fb87 --- /dev/null +++ b/composer.json @@ -0,0 +1,28 @@ +{ + "name": "bitpay/zencart-plugin", + "description": "", + "type": "zencart-plugin", + "keywords": [], + "homepage": "https://github.com/bitpay/zencart-plugin", + "license": "MIT", + "support": { + "email": "support@bitpay.com", + "issues": "https://github.com/bitpay/zencart-plugin/issues", + "source": "https://github.com/bitpay/zencart-plugin" + }, + "minimum-stability": "stable", + "require": {}, + "require-dev": { + "phpmd/phpmd": "*", + "phpdocumentor/phpdocumentor": "*", + "phing/phing": "*", + "pdepend/pdepend" : "1.1.0", + "squizlabs/php_codesniffer": "*", + "phpunit/phpunit": "*", + "phploc/phploc": "*", + "phpunit/phpunit-skeleton-generator": "*" + }, + "config": { + "bin-dir": "bin" + } +} From 2f04df5dbb9a8dddfb8df8b6a76c84652227f42f Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Tue, 15 Jul 2014 14:33:42 -0400 Subject: [PATCH 3/7] Added properties file for travis ci --- build/travis.properties | 145 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 build/travis.properties diff --git a/build/travis.properties b/build/travis.properties new file mode 100644 index 0000000..d33720a --- /dev/null +++ b/build/travis.properties @@ -0,0 +1,145 @@ +# The MIT License (MIT) +# +# Copyright (c) 2011-2014 BitPay +# +# 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. + +#### +# +# This properties file is used to configure the entire build. The purpose of +# this file is so that it is easy to drop it into a project and change a few +# of these settings and have a build run successfully. +# +# NOTE: You may still need to take a look at and edit `phpunit.xml.dist`. +# + +#### +# +# Directory Configuration +# + +# The main location of all the projects source code, this should be the only +# property that you need to change. Code can live in the root directory or it +# can live inside of it's own directory. +project.source=${project.basedir} +#project.source=${project.basedir}/src + +# --- You shouldn't need to edit any of the below value --- + +# Location of all executables, this is the location on the `bin-dir` that you +# have configured in `composer.json`. If you have not configured this in +# 1composer.json` the default is to put it in the `vendor` directory. +project.bindir=${project.basedir}/bin +#project.bindir=${project.basedir}/vendor/bin + +# Where to put the build artifacts, cache, logs, docs, etc. +project.builddir=${project.basedir}/build + +# Location of vendor directory created by composer. +project.vendordir=${project.basedir}/vendor + +# build artifacts for code analysis +project.logsdir=${project.builddir}/logs + +# Build artifacts that can be reused or updated, they do not need to be deleted +# every build. These would include charts and images. +project.cachedir=${project.builddir}/cache + +# Location of generated documentation such as API and code coverage +project.docsdir=${project.builddir}/docs +#### directory #### + +#### +# +# phpunit configuration +# + +# Directory that contains phpunit.xml or the phpunit.xml file itself +phpunit.configuration=${project.builddir}/phpunit.xml.dist +#### phpunit #### + +#### +# +# phpmd configuration +# + +# php source code filename or directory. Can be a comma-separated string +phpmd.source=${project.source} + +# report format, text, xml, or html +phpmd.report.format=xml + +# ruleset filename or a comma-separated string of rulesetfilenames +phpmd.ruleset=${project.builddir}/rulesets/phpmd.xml + +# send report output to this file +phpmd.report.file=${project.logsdir}/phpmd.xml + +# comma-separated string of patterns that are used to ignore directories +phpmd.exclude=${project.bindir},${project.builddir},${project.vendordir},${project.basedir}/tests +#### phpmd #### + +#### +# +# phploc Configuration +# + +# Source directory of project +phploc.source=${project.source}/ + +# Where to put the csv log +phploc.log.csv=${project.logsdir}/phploc.csv + +# Location of xml log +phploc.log.xml=${project.logsdir}/phploc.xml + +# Small hack to exclude multiple directories +phploc.exclude=vendor --exclude=build --exclude=bin --exclude=tests +#### phploc #### + +#### +# +# pdepend configuration +# +pdepend.source=${project.source} +pdepend.jdepend.chart=${project.cachedir}/jdepend_chart.svg +pdepend.jdepend.xml=${project.logsdir}/jdepend.xml +pdepend.overview.pyramid=${project.cachedir}/pyramid.svg +pdepend.summary.xml=${project.logsdir}/jdepend_summary.xml +pdepend.ignore=bin,build,vendor,tests +#### pdepend #### + +#### +# +# phpcs configuration +# +phpcs.source=${project.source} +phpcs.report.xml=${project.logsdir}/phpcs.xml +phpcs.standard=PSR1 --standard=PSR2 +phpcs.ignore=vendor --ignore=bin --ignore=build --ignore=tests +#### phpcs #### + +#### +# +# phpdoc configuration +# +phpdoc.directory=${project.source}/ +phpdoc.target=${project.docsdir}/api +phpdoc.ignore=vendor/,bin/,tests/ +#### phpdoc #### From f9bbefac0f9981b0bf28813cff29d34b8ae9fbea Mon Sep 17 00:00:00 2001 From: Charles Stevens Date: Wed, 16 Jul 2014 16:35:59 -0400 Subject: [PATCH 4/7] Added CHANGELOG, updated README --- CHANGELOG | 11 +++++++++++ README.md | 41 ++++++++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 CHANGELOG diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..3b4b36e --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,11 @@ +Version 4 + * Fix to use server error handling + +Version 3 + * Added new HTTP header for version tracking + +Version 2 + * Updated to support API key instead of SSL files. Tested against Zen Cart 1.5.1. + +Version 1 + * Initial version, tested against Zen Cart 1.3.9h \ No newline at end of file diff --git a/README.md b/README.md index e2737d0..c6f9468 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ -Installation ------------- +bitpay/zencart-plugin + +# Installation + Copy these files into your Zen Cart directory. -Configuration -------------- +# Configuration + 1. Create an API key at bitpay.com under your My Account section. 2. In Admin panel under "Modules > Payment > Bitcoins" click Install. 3. Fill out all configuration information:
@@ -14,27 +16,32 @@ d. Choose a status for unpaid and paid orders (or leave the default values as de e. Verify that the currencies displayed correspond to what you want and to those accepted by bitpay.com (the defaults are what bitpay accepts as of this writing).
f. Choose a sort order for displaying this payment option to visitors. Lowest is displayed first.
-Usage ------ -When a shopping chooses the Bitcoin payment method, they will be presented with an order summary as the next step (prices are shown in whatever currency they've selected for shopping). Upon receiving their order, the system takes the shopper to a bitpay.com invoice where the user is presented with bitcoin payment instructions. Once payment is received, a link is presented to the shopper that will take them back to your website. +# Usage + +When a shopping chooses the Bitcoin payment method, they will be presented with an order summary as the next step (prices are shown in whatever currency they've selected for shopping). Upon receiving their order, the system takes the shopper to a bitpay.com invoice where the user is presented with bitcoin payment instructions. Once payment is received, a link is presented to the shopper that will take them back to your website. In your Admin control panel, you can see the orders made with Bitcoins just as you would any other order. The status you selected in the configuration steps above will indicate whether the order has been paid for. Note: This extension does not provide a means of automatically pulling a current BTC exchange rate for presenting BTC prices to shoppers. -Change Log ----------- -Version 1 -- Initial version, tested against Zen Cart 1.3.9h +# Support + +## BitPay Support + +* [GitHub Issues](https://github.com/bitpay/zencart-plugin/issues) + * Open an issue if you are having issues with this plugin. +* [Support](https://support.bitpay.com) + * BitPay merchant support documentation + +## ZenCart Support -Version 2 -- Updated to support API key instead of SSL files. Tested against Zen Cart 1.5.1. +* [Homepage](http://www.zen-cart.com) +* [Documentation](http://www.zen-cart.com/wiki/index.php/Developers_API) +* [Support Forums](http://www.zen-cart.com/forum.php) -Version 3 -- Added new HTTP header for version tracking +# Contribute -Version 4 -- Fix to use server error handling +To contribute to this project, please fork and submit a pull request. # License From ed0759894e224f607c971d717cae8160abaafd2b Mon Sep 17 00:00:00 2001 From: Charles Stevens Date: Wed, 16 Jul 2014 18:24:09 -0400 Subject: [PATCH 5/7] Added CHANGELOG, updated README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c6f9468..be1872e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ bitpay/zencart-plugin +===================== # Installation From 92fdf13e20eb6ef3c36cd11b03cd8989ae407593 Mon Sep 17 00:00:00 2001 From: Sam Bohler Date: Fri, 10 Oct 2014 17:10:53 -0400 Subject: [PATCH 6/7] Security Patch --- bitpay/bp_lib.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bitpay/bp_lib.php b/bitpay/bp_lib.php index ba07e51..38bec40 100755 --- a/bitpay/bp_lib.php +++ b/bitpay/bp_lib.php @@ -130,7 +130,12 @@ function bpVerifyNotification($apiKey = false) { return 'authentication failed (bad hash)'; $json['posData'] = $posData['posData']; - return $json; + if (!array_key_exists('id', $json)) + { + return 'Cannot find invoice ID'; + } + + return bpGetInvoice($json['id'], $apiKey); } // $options can include ('apiKey') @@ -143,6 +148,10 @@ function bpGetInvoice($invoiceId, $apiKey=false) { if (is_string($response)) return $response; // error $response['posData'] = json_decode($response['posData'], true); + if($bpOptions['verifyPos']) + { + $response['posData'] = $response['posData']['posData']; + } return $response; } From 7e283072a7bcc53f56dc50c3e960680e9ba5b985 Mon Sep 17 00:00:00 2001 From: Rich Morgan Date: Tue, 10 Feb 2015 00:11:20 -0500 Subject: [PATCH 7/7] Updated copyright notice year, typos & formatting --- README.md | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index be1872e..7dc14df 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ bitpay/zencart-plugin # Installation -Copy these files into your Zen Cart directory. +Copy these files into the ZenCart directory on your webserver. # Configuration @@ -23,7 +23,7 @@ When a shopping chooses the Bitcoin payment method, they will be presented with In your Admin control panel, you can see the orders made with Bitcoins just as you would any other order. The status you selected in the configuration steps above will indicate whether the order has been paid for. -Note: This extension does not provide a means of automatically pulling a current BTC exchange rate for presenting BTC prices to shoppers. +**Note:** This extension does not provide a means of automatically pulling a current BTC exchange rate for presenting BTC prices to shoppers. # Support @@ -48,22 +48,10 @@ To contribute to this project, please fork and submit a pull request. The MIT License (MIT) -Copyright (c) 2011-2014 BitPay - -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. +Copyright (c) 2011-2015 BitPay + +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.