diff --git a/README.md b/README.md new file mode 100644 index 0000000..e13ffad --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# AuthorizeNet handling plugin for MyAdmin + +AuthorizeNet handling plugin for MyAdmin + +## Build Status and Code Analysis + +Site | Status +--------------|--------------------------- +Travis-CI | [![Build Status](https://travis-ci.org/detain/myadmin-authorizenet-payments.svg?branch=master)](https://travis-ci.org/detain/myadmin-authorizenet-payments) +Code Climate | [![Code Climate](https://codeclimate.com/github/detain/myadmin-authorizenet-payments/badges/gpa.svg)](https://codeclimate.com/github/detain/myadmin-authorizenet-payments) [![Test Coverage](https://codeclimate.com/github/detain/myadmin-authorizenet-payments/badges/coverage.svg)](https://codeclimate.com/github/detain/myadmin-authorizenet-payments/coverage) [![Issue Count](https://codeclimate.com/github/detain/myadmin-authorizenet-payments/badges/issue_count.svg)](https://codeclimate.com/github/detain/myadmin-authorizenet-payments) +Scrutinizer | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/detain/myadmin-authorizenet-payments/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/detain/myadmin-authorizenet-payments/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/detain/myadmin-authorizenet-payments/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/detain/myadmin-authorizenet-payments/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/detain/myadmin-authorizenet-payments/badges/build.png?b=master)](https://scrutinizer-ci.com/g/detain/myadmin-authorizenet-payments/build-status/master) +Codacy | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/226251fc068f4fd5b4b4ef9a40011d06)](https://www.codacy.com/app/detain/myadmin-authorizenet-payments) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/25fa74eb74c947bf969602fcfe87e349)](https://www.codacy.com/app/detain/myadmin-authorizenet-payments?utm_source=github.com&utm_medium=referral&utm_content=detain/myadmin-authorizenet-payments&utm_campaign=Badge_Coverage) +VersionEye | [![Reference Status](https://www.versioneye.com/php/detain:myadmin-authorizenet-payments/reference_badge.svg?style=flat)](https://www.versioneye.com/php/detain:myadmin-authorizenet-payments/references) [![Dependency Status](https://www.versioneye.com/user/projects/592f7318bafc5500414dfd2a/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/592f7318bafc5500414dfd2a) +Packagist | [![Latest Stable Version](https://poser.pugx.org/detain/myadmin-authorizenet-payments/version)](https://packagist.org/packages/detain/myadmin-authorizenet-payments) [![Total Downloads](https://poser.pugx.org/detain/myadmin-authorizenet-payments/downloads)](https://packagist.org/packages/detain/myadmin-authorizenet-payments) [![Latest Unstable Version](https://poser.pugx.org/detain/myadmin-authorizenet-payments/v/unstable)](//packagist.org/packages/detain/myadmin-authorizenet-payments) [![Monthly Downloads](https://poser.pugx.org/detain/myadmin-authorizenet-payments/d/monthly)](https://packagist.org/packages/detain/myadmin-authorizenet-payments) [![Daily Downloads](https://poser.pugx.org/detain/myadmin-authorizenet-payments/d/daily)](https://packagist.org/packages/detain/myadmin-authorizenet-payments) [![License](https://poser.pugx.org/detain/myadmin-authorizenet-payments/license)](https://packagist.org/packages/detain/myadmin-authorizenet-payments) + + +## Installation + +Install with composer like + +```sh +composer require detain/myadmin-authorizenet-payments +``` + +## License + +The AuthorizeNet handling plugin for MyAdmin class is licensed under the LGPL-v2 license. + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..0c92a8b --- /dev/null +++ b/composer.json @@ -0,0 +1,33 @@ +{ + "name": "detain/myadmin-authorizenet-payments", + "type": "myadmin-plugin", + "description": "AuthorizeNet handling plugin for MyAdmin", + "keywords": ["abuse","administration","spam"], + "license": "LGPL-2.1", + "authors": [ + { + "name": "Joe Huss", + "homepage": "https://my.interserver.net/" + } + ], + "config": { + "bin-dir": "vendor/bin", + "minimum-stability": "dev" + }, + "require": { + "php": ">=5.0.0", + "ext-soap": "*", + "symfony/event-dispatcher": "*", + "detain/myadmin-plugin-installer": "dev-master" + }, + "require-dev": { + "phpunit/phpunit": "*", + "vlucas/phpdotenv": "*", + "codeclimate/php-test-reporter": "dev-master", + "satooshi/php-coveralls": "*", + "codacy/coverage": "dev-master" + }, + "autoload": { + "psr-4": {"Detain\\MyAdminAuthorizeNet\\": "src/"} + } +} diff --git a/src/Plugin.php b/src/Plugin.php new file mode 100644 index 0000000..4994856 --- /dev/null +++ b/src/Plugin.php @@ -0,0 +1,48 @@ + [__CLASS__, 'getSettings'], + 'ui.menu' => [__CLASS__, 'getMenu'], + ]; + } + + public static function getMenu(GenericEvent $event) { + $menu = $event->getSubject(); + if ($GLOBALS['tf']->ima == 'admin') { + function_requirements('has_acl'); + if (has_acl('client_billing')) + $menu->add_link('admin', 'choice=none.abuse_admin', '//my.interserver.net/bower_components/webhostinghub-glyphs-icons/icons/development-16/Black/icon-spam.png', 'AuthorizeNet'); + } + } + + public static function getRequirements(GenericEvent $event) { + $loader = $event->getSubject(); + $loader->add_requirement('class.AuthorizeNet', '/../vendor/detain/myadmin-authorizenet-payments/src/AuthorizeNet.php'); + $loader->add_requirement('deactivate_kcare', '/../vendor/detain/myadmin-authorizenet-payments/src/abuse.inc.php'); + $loader->add_requirement('deactivate_abuse', '/../vendor/detain/myadmin-authorizenet-payments/src/abuse.inc.php'); + $loader->add_requirement('get_abuse_licenses', '/../vendor/detain/myadmin-authorizenet-payments/src/abuse.inc.php'); + } + + public static function getSettings(GenericEvent $event) { + $settings = $event->getSubject(); + $settings->add_text_setting('General', 'AuthorizeNet', 'abuse_imap_user', 'AuthorizeNet IMAP User:', 'AuthorizeNet IMAP Username', ABUSE_IMAP_USER); + $settings->add_text_setting('General', 'AuthorizeNet', 'abuse_imap_pass', 'AuthorizeNet IMAP Pass:', 'AuthorizeNet IMAP Password', ABUSE_IMAP_PASS); + } + +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..c0b280e --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,2 @@ +