Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
detain committed Jul 10, 2017
0 parents commit cc29c0f
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

33 changes: 33 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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/"}
}
}
48 changes: 48 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Detain\MyAdminAuthorizeNet;

use Symfony\Component\EventDispatcher\GenericEvent;

class Plugin {

public static $name = 'AuthorizeNet Plugin';
public static $description = 'Allows handling of AuthorizeNet emails and honeypots';
public static $help = '';
public static $type = 'plugin';


public function __construct() {
}

public static function getHooks() {
return [
'system.settings' => [__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);
}

}
2 changes: 2 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
require_once(__DIR__.'/../vendor/autoload.php');

0 comments on commit cc29c0f

Please sign in to comment.