Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mosnar committed Apr 15, 2019
0 parents commit 21a27cf
Show file tree
Hide file tree
Showing 11 changed files with 356 additions and 0 deletions.
1 change: 1 addition & 0 deletions .craftplugin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"pluginName":"OAuth Infusionsoft","pluginDescription":"Infusionsoft provider for Venveo OAuth Client","pluginVersion":"1.0.0","pluginAuthorName":"Venveo","pluginVendorName":"venveo","pluginAuthorUrl":"https://www.venveo.com","pluginAuthorGithub":"venveo","codeComments":"","pluginComponents":"","consolecommandName":"","controllerName":"","cpsectionName":"","elementName":"","fieldName":"","modelName":"","purchasableName":"","recordName":"","serviceName":"","taskName":"","utilityName":"","widgetName":"","apiVersion":"api_version_3_0"}
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# CRAFT ENVIRONMENT
.env.php
.env.sh
.env

# COMPOSER
/vendor

# BUILD FILES
/bower_components/*
/node_modules/*
/build/*
/yarn-error.log

# MISC FILES
.cache
.DS_Store
.idea
.project
.settings
*.esproj
*.sublime-workspace
*.sublime-project
*.tmproj
*.tmproject
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
config.codekit3
prepros-6.config
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# OAuth Infusionsoft Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.0.0 - 2019-04-15
### Added
- Initial release
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2019 Venveo

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.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# OAuth Infusionsoft plugin for Craft CMS 3.x

Infusionsoft provider for Venveo OAuth Client

![Screenshot](resources/img/plugin-logo.png)

## Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

## Installation

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

cd /path/to/project

2. Then tell Composer to load the plugin:

composer require venveo/oauth-infusionsoft

3. In the Control Panel, go to Settings → Plugins and click the “Install” button for OAuth Infusionsoft.

## OAuth Infusionsoft Overview

-Insert text here-

## Configuring OAuth Infusionsoft

-Insert text here-

## Using OAuth Infusionsoft

-Insert text here-

## OAuth Infusionsoft Roadmap

Some things to do, and ideas for potential features:

* Release it

Brought to you by [Venveo](https://www.venveo.com)
41 changes: 41 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "venveo/oauth-infusionsoft",
"description": "Infusionsoft provider for Venveo OAuth Client",
"type": "craft-plugin",
"version": "1.0.0",
"keywords": [
"craft",
"cms",
"craftcms",
"craft-plugin",
"oauth infusionsoft"
],
"support": {
"docs": "https://github.com/venveo/oauth-infusionsoft/blob/master/README.md",
"issues": "https://github.com/venveo/oauth-infusionsoft/issues"
},
"license": "MIT",
"authors": [
{
"name": "Venveo",
"homepage": "https://www.venveo.com"
}
],
"require": {
"craftcms/cms": "^3.0.0-RC1",
"adespresso/oauth2-infusionsoft": "^0.1.1"
},
"autoload": {
"psr-4": {
"venveo\\oauthinfusionsoft\\": "src/"
}
},
"extra": {
"name": "OAuth Infusionsoft",
"handle": "oauth-infusionsoft",
"hasCpSettings": false,
"hasCpSection": false,
"changelogUrl": "https://raw.githubusercontent.com/venveo/oauth-infusionsoft/master/CHANGELOG.md",
"class": "venveo\\oauthinfusionsoft\\Plugin"
}
}
Binary file added resources/img/plugin-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
/**
* OAuth Infusionsoft plugin for Craft CMS 3.x
*
* Infusionsoft provider for Venveo OAuth Client
*
* @link https://www.venveo.com
* @copyright Copyright (c) 2019 Venveo
*/

namespace venveo\oauthinfusionsoft;


use Craft;
use craft\base\Plugin as BasePlugin;
use craft\events\RegisterComponentTypesEvent;
use craft\services\Plugins;
use craft\events\PluginEvent;

use yii\base\Event;

/**
* Class OauthInfusionsoft
*
* @author Venveo
* @package OauthInfusionsoft
* @since 1.0.0
*
*/
class Plugin extends BasePlugin
{
// Static Properties
// =========================================================================

/**
* @var Plugin
*/
public static $plugin;

// Public Properties
// =========================================================================

/**
* @var string
*/
public $schemaVersion = '1.0.0';

// Public Methods
// =========================================================================

/**
* @inheritdoc
*/
public function init()
{
parent::init();
self::$plugin = $this;

Event::on(
\venveo\oauthclient\services\Providers::class,
\venveo\oauthclient\services\Providers::EVENT_REGISTER_PROVIDER_TYPES,
function (RegisterComponentTypesEvent $event) {
$event->types[] = Provider::class;
}
);
}

// Protected Methods
// =========================================================================

}
46 changes: 46 additions & 0 deletions src/Provider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
namespace venveo\oauthinfusionsoft;

use League\OAuth2\Client\Provider\AbstractProvider;
use venveo\oauthclient\base\Provider as BaseProvider;
use AdEspresso\OAuth2\Client\Provider\Infusionsoft as InfusionsoftProvider;
/**
* @package venveo\oauthinfusionsoft
*/
class Provider extends BaseProvider
{
public static function displayName(): string
{

return 'Infusionsoft';
}

public function getConfiguredProvider(): InfusionsoftProvider
{
if ($this->configuredProvider instanceof AbstractProvider) {
return $this->configuredProvider;
}

$this->configuredProvider = new InfusionsoftProvider([
'clientId' => $this->getApp()->getClientId(),
'clientSecret' => $this->getApp()->getClientSecret(),
'redirectUri' => $this->getApp()->getRedirectUrl(),
'accessType' => 'offline',
]);
return $this->configuredProvider;
}

/**
* @param array $options
* @return String
*/
public function getAuthorizeURL($options = []): String {
return $this->getConfiguredProvider()->getAuthorizationUrl(
array_merge([
'scope' => $this->getApp()->getScopes(),
'approval_prompt' => 'force'
],
$options)
);
}
}
52 changes: 52 additions & 0 deletions src/icon-mask.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions src/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 21a27cf

Please sign in to comment.