This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 21a27cf
Showing
11 changed files
with
356 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
// ========================================================================= | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.