TroopID_Connect - Version 1.4.0

Version Notes

Remove sandbox settings and update styling as per new style guide.

Download this release

Release Info

Developer ID.me
Extension TroopID_Connect
Version 1.4.0
Comparing to
See all releases


Code changes from version 1.3.0 to 1.4.0

app/code/community/TroopID/Connect/Block/Adminhtml/System/Config/Instructions.php CHANGED
@@ -5,7 +5,7 @@ class TroopID_Connect_Block_Adminhtml_System_Config_Instructions extends TroopID
5
  protected function _getContentHtml($element) {
6
  $config = $element->getData("field_config")->asArray();
7
 
8
- $html = '<span class="title">In order to test the integration in sandbox mode, follow the steps below on <a href="' . $config["sandbox_url"] . '" target="_blank">' . $config["sandbox_url"] . '</a></span>';
9
  $html .= '<ul class="steps">';
10
  $html .= '<li>' . $this->__("Create a developer account at") . ' <a href="' . $config["developer_url"] . '" target="_blank">' . $config["developer_url"] . '</a></li>';
11
  $html .= '<li>' . $this->__("Register an application at") . ' <a href="' . $config["apps_url"] . '" target="_blank">' . $config["apps_url"] . '</a></li>';
@@ -14,7 +14,7 @@ class TroopID_Connect_Block_Adminhtml_System_Config_Instructions extends TroopID
14
  $html .= '<li>' . $this->__("Copy and paste your <strong>Client ID</strong> and <strong>Client Secret</strong> values from your application settings on ID.me") . '</li>';
15
  $html .= '<li>' . $this->__("That's it! You are ready to go.") . '</li>';
16
  $html .= '<li>' . $this->__("You can customize the buttons by overriding or extending the cart template.") . '</li>';
17
- $html .= '<li>' . $this->__("Custom buttons need to have a <strong>troopid-connect-trigger</strong> class and a <strong>data-scope</strong> attribute that determines the affinity group you want to verify.") . '</li>';
18
  $html .= '</ul>';
19
  $html .= '<div class="heading"><span class="heading-intro"><a href="' . $config["learn_more_url"] . '" target="_blank">' . $this->__("Learn more about ID.me") . '</a></span></div>';
20
  $html .= '<div class="heading"><span class="heading-intro"><a href="' . $config["docs_url"] . '" target="_blank">' . $this->__("Read developer documentation") . '</a></span></div>';
5
  protected function _getContentHtml($element) {
6
  $config = $element->getData("field_config")->asArray();
7
 
8
+ $html = '<span class="title">In order to test the integration, follow the steps below:</span>';
9
  $html .= '<ul class="steps">';
10
  $html .= '<li>' . $this->__("Create a developer account at") . ' <a href="' . $config["developer_url"] . '" target="_blank">' . $config["developer_url"] . '</a></li>';
11
  $html .= '<li>' . $this->__("Register an application at") . ' <a href="' . $config["apps_url"] . '" target="_blank">' . $config["apps_url"] . '</a></li>';
14
  $html .= '<li>' . $this->__("Copy and paste your <strong>Client ID</strong> and <strong>Client Secret</strong> values from your application settings on ID.me") . '</li>';
15
  $html .= '<li>' . $this->__("That's it! You are ready to go.") . '</li>';
16
  $html .= '<li>' . $this->__("You can customize the buttons by overriding or extending the cart template.") . '</li>';
17
+ $html .= '<li>' . $this->__("Custom buttons need to have a <strong>idme-connect-trigger</strong> class and a <strong>data-scope</strong> attribute that determines the affinity group you want to verify.") . '</li>';
18
  $html .= '</ul>';
19
  $html .= '<div class="heading"><span class="heading-intro"><a href="' . $config["learn_more_url"] . '" target="_blank">' . $this->__("Learn more about ID.me") . '</a></span></div>';
20
  $html .= '<div class="heading"><span class="heading-intro"><a href="' . $config["docs_url"] . '" target="_blank">' . $this->__("Read developer documentation") . '</a></span></div>';
app/code/community/TroopID/Connect/Block/Cart.php CHANGED
@@ -10,11 +10,11 @@ class TroopID_Connect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract {
10
  }
11
 
12
  public function getEndpoint() {
13
- return Mage::getUrl("troopid/authorize/authorize");
14
  }
15
 
16
  public function getRemoveUrl() {
17
- return Mage::getUrl("troopid/authorize/remove");
18
  }
19
 
20
  public function hasAffiliation() {
10
  }
11
 
12
  public function getEndpoint() {
13
+ return Mage::getUrl("troopid/authorize/authorize", array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure()));
14
  }
15
 
16
  public function getRemoveUrl() {
17
+ return Mage::getUrl("troopid/authorize/remove", array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure()));
18
  }
19
 
20
  public function hasAffiliation() {
app/code/community/TroopID/Connect/Helper/Data.php CHANGED
@@ -13,10 +13,6 @@ class TroopID_Connect_Helper_Data extends Mage_Core_Helper_Abstract {
13
  return $this->getKey("enabled_" . $scope) === "1";
14
  }
15
 
16
- public function isSandbox() {
17
- return $this->getKey("sandbox_mode") == "1";
18
- }
19
-
20
  public function isOperational() {
21
  return $this->getKey("enabled") == "1" && $this->getKey("client_id") && $this->getKey("client_secret");
22
  }
13
  return $this->getKey("enabled_" . $scope) === "1";
14
  }
15
 
 
 
 
 
16
  public function isOperational() {
17
  return $this->getKey("enabled") == "1" && $this->getKey("client_id") && $this->getKey("client_secret");
18
  }
app/code/community/TroopID/Connect/Helper/Oauth.php CHANGED
@@ -2,12 +2,11 @@
2
 
3
  class TroopID_Connect_Helper_Oauth extends Mage_Core_Helper_Abstract {
4
 
5
- const ENDPOINT_SANDBOX = "https://api.sandbox.id.me";
6
- const ENDPOINT_PRODUCTION = "https://api.id.me";
7
 
8
  const AUTHORIZE_PATH = "/oauth/authorize";
9
  const TOKEN_PATH = "/oauth/token";
10
- const AFFILIATIONS_PATH = "/v2/affiliations.json";
11
 
12
  const API_ORIGIN = "MAGENTO-IDME";
13
 
@@ -74,10 +73,10 @@ class TroopID_Connect_Helper_Oauth extends Mage_Core_Helper_Abstract {
74
  $scope = "military";
75
 
76
  $endpoints = array(
77
- "military" => "/v2/military.json",
78
- "student" => "/v2/student.json",
79
- "responder" => "/v2/responder.json",
80
- "teacher" => "/v2/teacher.json"
81
  );
82
 
83
  $client = new Zend_Http_Client();
@@ -125,11 +124,7 @@ class TroopID_Connect_Helper_Oauth extends Mage_Core_Helper_Abstract {
125
  }
126
 
127
  private function getDomain() {
128
- if ($this->getConfig()->isSandbox()) {
129
- return self::ENDPOINT_SANDBOX;
130
- } else {
131
- return self::ENDPOINT_PRODUCTION;
132
- }
133
  }
134
 
135
  private function toQuery($params) {
2
 
3
  class TroopID_Connect_Helper_Oauth extends Mage_Core_Helper_Abstract {
4
 
5
+ const ENDPOINT_PRODUCTION = "https://api.id.me";
 
6
 
7
  const AUTHORIZE_PATH = "/oauth/authorize";
8
  const TOKEN_PATH = "/oauth/token";
9
+ const AFFILIATIONS_PATH = "/api/public/v2/affiliations.json";
10
 
11
  const API_ORIGIN = "MAGENTO-IDME";
12
 
73
  $scope = "military";
74
 
75
  $endpoints = array(
76
+ "military" => "/api/public/v2/military.json",
77
+ "student" => "/api/public/v2/student.json",
78
+ "responder" => "/api/public/v2/responder.json",
79
+ "teacher" => "/api/public/v2/teacher.json"
80
  );
81
 
82
  $client = new Zend_Http_Client();
124
  }
125
 
126
  private function getDomain() {
127
+ return self::ENDPOINT_PRODUCTION;
 
 
 
 
128
  }
129
 
130
  private function toQuery($params) {
app/code/community/TroopID/Connect/controllers/AuthorizeController.php CHANGED
@@ -55,7 +55,7 @@ class TroopID_Connect_AuthorizeController extends Mage_Core_Controller_Front_Act
55
 
56
  /* code was not found, invalid callback request */
57
  if (empty($code)) {
58
- $session->addError($config->__("ID.me verification failed, please contact the store owner"));
59
  } else {
60
 
61
  /* request access token with the given code */
@@ -65,7 +65,7 @@ class TroopID_Connect_AuthorizeController extends Mage_Core_Controller_Front_Act
65
  $data = $oauth->getProfileData($token, $scope);
66
 
67
  if (empty($data)) {
68
- $session->addError($config->__("ID.me verification failed, please contact the store owner"));
69
  } else {
70
  $cart = $this->getCart();
71
  $quote = $cart->getQuote();
55
 
56
  /* code was not found, invalid callback request */
57
  if (empty($code)) {
58
+ $session->addError($config->__("ID.me verification failed, please contact the store owner (code 101)."));
59
  } else {
60
 
61
  /* request access token with the given code */
65
  $data = $oauth->getProfileData($token, $scope);
66
 
67
  if (empty($data)) {
68
+ $session->addError($config->__("ID.me verification failed, please contact the store owner (code 102)."));
69
  } else {
70
  $cart = $this->getCart();
71
  $quote = $cart->getQuote();
app/code/community/TroopID/Connect/etc/config.xml CHANGED
@@ -120,16 +120,19 @@
120
  <troopid_connect>
121
  <settings>
122
  <enabled>1</enabled>
123
- <sandbox_mode>1</sandbox_mode>
124
  <enable_military>1</enable_military>
125
  <enable_student>1</enable_student>
126
  <enable_responder>1</enable_responder>
127
  <enable_teachers>1</enable_teachers>
128
  <about><![CDATA[
129
- <p><strong>Who is eligible for ID.me membership?</strong><br/>
130
- Students, First Responders, Veterans, Service Members, Retirees, Military Spouses and their Immediate Family Members i.e. parents and children of Veterans, Service Members, Retirees and Military Spouses are eligible to sign up for ID.me</p>
131
- <p><strong>Does signing up for ID.me mean I'll start receiving newsletters and promotions from ID.me?</strong><br/>
132
- No, you may receive a message inviting you to opt in to relevant communications, but you are not required or automatically signed up for these newsletters.</p>
 
 
 
 
133
  ]]>
134
  </about>
135
  </settings>
120
  <troopid_connect>
121
  <settings>
122
  <enabled>1</enabled>
 
123
  <enable_military>1</enable_military>
124
  <enable_student>1</enable_student>
125
  <enable_responder>1</enable_responder>
126
  <enable_teachers>1</enable_teachers>
127
  <about><![CDATA[
128
+ <p>You can receive discounts, cashback and many more exclusive offers while shopping online by verifying your eligibility with ID.me. Different retailers offer different opportunities &ndash; just for being you. You can find this offer and everything else at ID.me</p>
129
+ <p><strong>Who Is Eligible?</strong><br>ID.me offers discounts and special offers for the military, first responders, students and many more communities. Sign up now to discover exclusive and unique offers.</p>
130
+ <p><strong>How Do I Verify?</strong><br>You can verify by clicking on the appropriate ID.me button on the Checkout page. Simply follow the prompts and the steps provided in order to verify. You can also sign up by visiting ID.me.</p>
131
+ <p><strong>What Happens When I Verify My Status? </strong><br>Once your credential is verified, you will immediately receive your offer. You are also now able to visit the <a target="_blank" href="https://www.id.me/"><strong>ID.me Marketplace</strong></a> where you can login to find discounts and offers specially curated for you.</p>
132
+ <p><strong>Can I Provide My Discount To Non-Eligible Friends?</strong><br>No, this program is only for eligible members. ID.me employs technology that can detect fraudulent use across accounts and reserves the right to revoke access/membership from anyone abusing the terms of usage.</p>
133
+ <p><strong>Does Signing Up For ID.me Mean I'll Start Receiving Newsletters And Promotions From ID.me? </strong><br> No, you may receive a message inviting you to opt in to relevant communications, but you are not required or automatically signed up for these newsletters. You will receive a single confirmation email that requires action to confirm your account set-up, but that is only to complete the account set-up process. For more information on ID.me's Privacy Policy, <a target="_blank" href="https://www.id.me/privacy-policy"><strong>click here</strong></a>.</p>
134
+ <p><strong>Where Can I Learn More About ID.me?</strong><br>To learn more about the offers and benefits of ID.me, or for company information, please visit <a target="_blank" href="https://www.id.me/"><strong>ID.me</strong></a>, our <a target="_blank" href="https://www.id.me/faq"><strong>FAQ page</strong></a>, or our <a target="_blank" href="https://www.id.me/about-us"><strong>About page</strong></a>.</p>
135
+ <p><strong>Having Trouble?</strong><br>ID.me is standing by to assist you with account verification 24 hours a day. For assistance call 1-866-775-IDME or email help@id.me.</p>
136
  ]]>
137
  </about>
138
  </settings>
app/code/community/TroopID/Connect/etc/system.xml CHANGED
@@ -28,7 +28,7 @@
28
  <frontend_class>troopid-connect first</frontend_class>
29
  <frontend_model>troopid_connect/adminhtml_system_config_custom</frontend_model>
30
  <comment>
31
- <![CDATA[Create discounts on special offers exclusively for verified military members, students or first responders via ID.me]]>
32
  </comment>
33
  <sort_order>0</sort_order>
34
  <show_in_default>1</show_in_default>
@@ -47,7 +47,6 @@
47
  <apps_url><![CDATA[https://developer.id.me/applications]]></apps_url>
48
  <docs_url><![CDATA[https://developer.id.me/documentation]]></docs_url>
49
  <learn_more_url><![CDATA[https://www.id.me/partner-with-us]]></learn_more_url>
50
- <sandbox_url><![CDATA[https://developer.sandbox.id.me]]></sandbox_url>
51
  </instructions>
52
  <enabled>
53
  <label>Enabled?</label>
@@ -77,16 +76,6 @@
77
  <show_in_store>1</show_in_store>
78
  <comment/>
79
  </client_secret>
80
- <sandbox_mode>
81
- <label>Sandbox Mode?</label>
82
- <frontend_type>select</frontend_type>
83
- <source_model>adminhtml/system_config_source_yesno</source_model>
84
- <sort_order>5</sort_order>
85
- <show_in_default>1</show_in_default>
86
- <show_in_website>1</show_in_website>
87
- <show_in_store>1</show_in_store>
88
- <comment/>
89
- </sandbox_mode>
90
  <enabled_military>
91
  <label>Military verification</label>
92
  <frontend_type>select</frontend_type>
@@ -135,7 +124,7 @@
135
  <show_in_website>1</show_in_website>
136
  <show_in_store>1</show_in_store>
137
  <comment>
138
- <![CDATA[This text will be displayed as "What is this?" in your shopping cart next to ID.me Connect button]]>
139
  </comment>
140
  </about>
141
  </fields>
28
  <frontend_class>troopid-connect first</frontend_class>
29
  <frontend_model>troopid_connect/adminhtml_system_config_custom</frontend_model>
30
  <comment>
31
+ <![CDATA[Create discounts on special offers exclusively for verified military members, students, teachers or first responders via ID.me]]>
32
  </comment>
33
  <sort_order>0</sort_order>
34
  <show_in_default>1</show_in_default>
47
  <apps_url><![CDATA[https://developer.id.me/applications]]></apps_url>
48
  <docs_url><![CDATA[https://developer.id.me/documentation]]></docs_url>
49
  <learn_more_url><![CDATA[https://www.id.me/partner-with-us]]></learn_more_url>
 
50
  </instructions>
51
  <enabled>
52
  <label>Enabled?</label>
76
  <show_in_store>1</show_in_store>
77
  <comment/>
78
  </client_secret>
 
 
 
 
 
 
 
 
 
 
79
  <enabled_military>
80
  <label>Military verification</label>
81
  <frontend_type>select</frontend_type>
124
  <show_in_website>1</show_in_website>
125
  <show_in_store>1</show_in_store>
126
  <comment>
127
+ <![CDATA[This text will be displayed as "What is ID.me?" in your shopping cart next to ID.me buttons]]>
128
  </comment>
129
  </about>
130
  </fields>
app/design/adminhtml/default/default/layout/troopid_connect.xml CHANGED
@@ -3,7 +3,7 @@
3
  <default>
4
  <reference name="head">
5
  <action method="addCss">
6
- <stylesheet>troopid/troopid.css</stylesheet>
7
  </action>
8
  </reference>
9
  </default>
3
  <default>
4
  <reference name="head">
5
  <action method="addCss">
6
+ <stylesheet>troopid/idme.css</stylesheet>
7
  </action>
8
  </reference>
9
  </default>
app/design/frontend/base/default/layout/troopid_connect.xml CHANGED
@@ -3,7 +3,7 @@
3
  <checkout_cart_index>
4
  <reference name="head">
5
  <action method="addCss">
6
- <stylesheet>troopid/troopid.css</stylesheet>
7
  </action>
8
  </reference>
9
  <reference name="before_body_end">
3
  <checkout_cart_index>
4
  <reference name="head">
5
  <action method="addCss">
6
+ <stylesheet>troopid/idme.css</stylesheet>
7
  </action>
8
  </reference>
9
  <reference name="before_body_end">
app/design/frontend/base/default/template/troopid/connect/cart.phtml CHANGED
@@ -1,5 +1,5 @@
1
  <?php if ($this->isOperational()) : ?>
2
- <div class="discount troopid-connect">
3
  <h2><?php echo $this->__("Get verified with ID.me") ?></h2>
4
  <?php if ($this->hasAffiliation()): ?>
5
  <div class="affiliation">
@@ -10,9 +10,10 @@
10
 
11
  <?php if ($this->isEnabled("military")) : ?>
12
 
13
- <div class="button">
14
- <a href="javascript:void(0);" class="troopid-connect-trigger" data-scope="military" title="<?php echo $this->__("Verify your military affiliation with ID.me") ?>">
15
- <img alt="<?php echo $this->__("Verify your military affiliation with ID.me") ?>" src="https://s3.amazonaws.com/idme/buttons/troop_red_rnd_32.png" />
 
16
  </a>
17
  </div>
18
 
@@ -20,29 +21,29 @@
20
 
21
  <?php if ($this->isEnabled("student")) : ?>
22
 
23
- <div class="button">
24
- <a href="javascript:void(0);" class="troopid-connect-trigger" data-scope="student" title="<?php echo $this->__("Verify your student affiliation with ID.me") ?>">
25
- <img alt="<?php echo $this->__("Verify your student affiliation with ID.me") ?>" src="https://s3.amazonaws.com/idme/buttons/student_gray2_rnd_32.png" />
26
  </a>
27
  </div>
28
 
29
  <?php endif ?>
30
 
31
- <?php if ($this->isEnabled("responder")) : ?>
32
 
33
- <div class="button">
34
- <a href="javascript:void(0);" class="troopid-connect-trigger" data-scope="responder" title="<?php echo $this->__("Verify your first responder affiliation with ID.me") ?>">
35
- <img alt="<?php echo $this->__("Verify your first responder affiliation with ID.me") ?>" src="https://s3.amazonaws.com/idme/buttons/responder_gray2_rnd_32.png" />
36
  </a>
37
  </div>
38
 
39
  <?php endif ?>
40
 
41
- <?php if ($this->isEnabled("teacher")) : ?>
42
 
43
- <div class="button">
44
- <a href="javascript:void(0);" class="troopid-connect-trigger" data-scope="teacher" title="<?php echo $this->__("Verify your teacher affiliation with ID.me") ?>">
45
- <img alt="<?php echo $this->__("Verify your teacher affiliation with ID.me") ?>" src="https://s3.amazonaws.com/idme/buttons/teacher_gray1_rnd_32.png" />
46
  </a>
47
  </div>
48
 
@@ -50,19 +51,25 @@
50
 
51
  <?php endif ?>
52
  <div class="about">
53
- <a href="javascript:void(0);" class="troopid-modal-trigger"><?php echo $this->__("What is this?") ?></a>
54
- <?php if ($this->hasAffiliation()): ?>
55
- | <a href="<?php echo $this->getRemoveUrl() ?>" title="<?php echo $this->__("Remove your verified affiliation") ?>">
56
- <?php echo $this->__("Remove") ?>
57
- </a>
58
- <?php endif ?>
 
 
 
 
59
  </div>
60
 
61
- <div id="troopid-modal" style="display: none;"></div>
62
- <div id="troopid-modal-content" style="display: none;">
63
  <h3><?php echo $this->__("What is ID.me?") ?></h3>
64
- <a href="javascript:void(0);" class="close" id="troopid-modal-closer">[x]</a>
65
- <?php echo $this->getAbout() ?>
 
 
66
  </div>
67
  </div>
68
  <?php endif ?>
1
  <?php if ($this->isOperational()) : ?>
2
+ <div class="discount idme-connect">
3
  <h2><?php echo $this->__("Get verified with ID.me") ?></h2>
4
  <?php if ($this->hasAffiliation()): ?>
5
  <div class="affiliation">
10
 
11
  <?php if ($this->isEnabled("military")) : ?>
12
 
13
+ <div class="idme-button">
14
+ <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="military" title="<?php echo $this->__("Verify your military affiliation with ID.me") ?>">
15
+ <img alt="Troop ID" src="https://s3.amazonaws.com/idme/assets/troop-id.png">
16
+ TROOP ID
17
  </a>
18
  </div>
19
 
21
 
22
  <?php if ($this->isEnabled("student")) : ?>
23
 
24
+ <div class="idme-button">
25
+ <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="student" title="<?php echo $this->__("Verify your student affiliation with ID.me") ?>">
26
+ STUDENT ID
27
  </a>
28
  </div>
29
 
30
  <?php endif ?>
31
 
32
+ <?php if ($this->isEnabled("teacher")) : ?>
33
 
34
+ <div class="idme-button">
35
+ <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="teacher" title="<?php echo $this->__("Verify your teacher affiliation with ID.me") ?>">
36
+ TEACHER ID
37
  </a>
38
  </div>
39
 
40
  <?php endif ?>
41
 
42
+ <?php if ($this->isEnabled("responder")) : ?>
43
 
44
+ <div class="idme-button">
45
+ <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="responder" title="<?php echo $this->__("Verify your first responder affiliation with ID.me") ?>">
46
+ FIRST RESPONDER ID
47
  </a>
48
  </div>
49
 
51
 
52
  <?php endif ?>
53
  <div class="about">
54
+ <div class="container">
55
+ <img alt="ID.me" src="https://s3.amazonaws.com/idme/assets/lock.png" style="vertical-align:middle; margin:0 3px 5px 0;" width="8">
56
+ Verification by ID.me &bull;
57
+ <a href="javascript:void(0);" class="idme-modal-trigger"><?php echo $this->__("What is ID.me?") ?></a>
58
+ <?php if ($this->hasAffiliation()): ?>
59
+ | <a href="<?php echo $this->getRemoveUrl() ?>" title="<?php echo $this->__("Remove your verified affiliation") ?>">
60
+ <?php echo $this->__("Remove") ?>
61
+ </a>
62
+ <?php endif ?>
63
+ </div>
64
  </div>
65
 
66
+ <div id="idme-modal" style="display: none;"></div>
67
+ <div id="idme-modal-content" style="display: none;">
68
  <h3><?php echo $this->__("What is ID.me?") ?></h3>
69
+ <a href="javascript:void(0);" class="close" id="idme-modal-closer"></a>
70
+ <div class="content">
71
+ <?php echo $this->getAbout() ?>
72
+ </div>
73
  </div>
74
  </div>
75
  <?php endif ?>
app/design/frontend/base/default/template/troopid/connect/script.phtml CHANGED
@@ -1,8 +1,8 @@
1
  <script type="text/javascript">
2
- if (typeof(TroopID) == "undefined")
3
- TroopID = {};
4
 
5
- TroopID.Connect = Class.create({
6
 
7
  initialize: function(selector) {
8
  this.selector = selector;
@@ -24,15 +24,15 @@
24
 
25
  });
26
 
27
- TroopID.Modal = Class.create({
28
 
29
  initialize: function(selector) {
30
  this.selector = $(selector);
31
  this.selector.observe("click", this.open.bind(this));
32
 
33
- this.overlay = $("troopid-modal");
34
- this.content = $("troopid-modal-content");
35
- this.closer = $("troopid-modal-closer");
36
 
37
  this.overlay.observe("click", this.close.bind(this));
38
  this.closer.observe("click", this.close.bind(this));
@@ -44,10 +44,6 @@
44
  },
45
 
46
  open: function() {
47
- this.content.setStyle({
48
- width: this.getWidth() + "px",
49
- left: ((document.viewport.getWidth() - this.getWidth()) / 2) + "px"
50
- });
51
  this.overlay.show();
52
  this.content.show();
53
  },
@@ -55,25 +51,22 @@
55
  close: function() {
56
  this.content.hide();
57
  this.overlay.hide();
58
- },
59
-
60
- getWidth: function() {
61
- return (document.viewport.getWidth() / 4);
62
- },
63
-
64
- getHeight: function() {
65
- return (document.viewport.getHeight() / 2);
66
  }
67
 
68
  });
69
 
70
  document.observe("dom:loaded", function() {
 
 
 
 
 
71
  $$(".troopid-connect-trigger").each(function(item) {
72
- new TroopID.Connect(item);
73
  });
74
 
75
- $$(".troopid-modal-trigger").each(function(item) {
76
- new TroopID.Modal(item);
77
  });
78
  });
79
  </script>
1
  <script type="text/javascript">
2
+ if (typeof(IDme) == "undefined")
3
+ IDme = {};
4
 
5
+ IDme.Connect = Class.create({
6
 
7
  initialize: function(selector) {
8
  this.selector = selector;
24
 
25
  });
26
 
27
+ IDme.Modal = Class.create({
28
 
29
  initialize: function(selector) {
30
  this.selector = $(selector);
31
  this.selector.observe("click", this.open.bind(this));
32
 
33
+ this.overlay = $("idme-modal");
34
+ this.content = $("idme-modal-content");
35
+ this.closer = $("idme-modal-closer");
36
 
37
  this.overlay.observe("click", this.close.bind(this));
38
  this.closer.observe("click", this.close.bind(this));
44
  },
45
 
46
  open: function() {
 
 
 
 
47
  this.overlay.show();
48
  this.content.show();
49
  },
51
  close: function() {
52
  this.content.hide();
53
  this.overlay.hide();
 
 
 
 
 
 
 
 
54
  }
55
 
56
  });
57
 
58
  document.observe("dom:loaded", function() {
59
+ $$(".idme-connect-trigger").each(function(item) {
60
+ new IDme.Connect(item);
61
+ });
62
+
63
+ // backwards compatibility support
64
  $$(".troopid-connect-trigger").each(function(item) {
65
+ new IDme.Connect(item);
66
  });
67
 
68
+ $$(".idme-modal-trigger").each(function(item) {
69
+ new IDme.Modal(item);
70
  });
71
  });
72
  </script>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>TroopID_Connect</name>
4
- <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>TroopID Connect integration.</summary>
10
  <description>N/A</description>
11
- <notes>Add support for teacher verification</notes>
12
  <authors><author><name>ID.me</name><user>idme</user><email>support@id.me</email></author></authors>
13
- <date>2014-07-02</date>
14
- <time>15:14:50</time>
15
- <contents><target name="magecommunity"><dir name="TroopID"><dir name="Connect"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Affiliation.php" hash="d2f7b9f00585fc7d2b558096c31f5de1"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="Custom.php" hash="0f7f75b4b55edb638d241852a0220b3f"/><file name="Instructions.php" hash="8672b12ef38027e844bcccf5835d6a30"/></dir></dir></dir><file name="Cart.php" hash="749846d467e503c705818897f57ed7f9"/></dir><dir name="Helper"><file name="Data.php" hash="437452520a2f77e9633873df5a0d1948"/><file name="Oauth.php" hash="0a9b3cb1a3935e3018e6ff11580c3412"/></dir><dir name="Model"><dir name="Cart"><file name="Observer.php" hash="c837fb0c02ac02416200002d5e3b233c"/></dir><dir name="Rule"><file name="Condition.php" hash="345e7992da8bd7d543e9d25ed92e1d66"/><file name="Observer.php" hash="ff3a6cc43e4d46401a4bbb37262f4f56"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Enabled.php" hash="103e4776ee228d313fcb63c0eefcb0db"/></dir></dir></dir></dir><dir name="controllers"><file name="AuthorizeController.php" hash="1e27d7e0f7f6f10e0fc8ac69a5b35f3d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2bba51d29a0e9c444ff401a460a44142"/><file name="config.xml" hash="9afbb55596777705acd7fde962e879e7"/><file name="system.xml" hash="ffe152cba7141c917b7beb8a97c5940d"/></dir><dir name="sql"><dir name="troopid_connect_setup"><file name="mysql4-install-0.1.0.php" hash="2ed9e5f82407c756477d7fc2d3cd20ff"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="6160551e6951f91ab7ef18e887ea73a9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="b5c1ab02bb09e99d59465add1182e5e0"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="affiliation.phtml" hash="69c74c5b4d78f1f6822be88d1a3bd928"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="2252d9dd57d061eeaca3577190fb67c2"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="callback.phtml" hash="71b10af7408d6f50999529c08aa75dfb"/><file name="cart.phtml" hash="3f31cfde6b4bac8618677694b7f2b5c2"/><file name="script.phtml" hash="3bf90c1e66e5382336ffe2fca136503d"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TroopID_Connect.xml" hash="daae0990b13ba4071764efd4f9f674ec"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="troopid"><dir name="images"><file name="logo.png" hash="65421456771898d7cbced7b99d4b56ea"/></dir><file name="troopid.css" hash="57964a12675c76bca426475515160dcc"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="troopid"><file name="troopid.css" hash="05c691747e19934f56d4f9f9f777d440"/></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="troopid"><file name="troopid.css" hash="4bba21e6846610c2acc9f50207292a1c"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>TroopID_Connect</name>
4
+ <version>1.4.0</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>ID.me Integration</summary>
10
  <description>N/A</description>
11
+ <notes>Remove sandbox settings and update styling as per new style guide.</notes>
12
  <authors><author><name>ID.me</name><user>idme</user><email>support@id.me</email></author></authors>
13
+ <date>2014-11-14</date>
14
+ <time>21:29:31</time>
15
+ <contents><target name="magecommunity"><dir name="TroopID"><dir name="Connect"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Affiliation.php" hash="d2f7b9f00585fc7d2b558096c31f5de1"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="Custom.php" hash="0f7f75b4b55edb638d241852a0220b3f"/><file name="Instructions.php" hash="f28988ab9fe72951229b58321f980f96"/></dir></dir></dir><file name="Cart.php" hash="b772c8cba699f4fd433157e1c3fa8d8d"/></dir><dir name="Helper"><file name="Data.php" hash="72586f83d6d5b3b4208f242e410208db"/><file name="Oauth.php" hash="ab6572b3e7683e45a26b2f939b1e4ffa"/></dir><dir name="Model"><dir name="Cart"><file name="Observer.php" hash="c837fb0c02ac02416200002d5e3b233c"/></dir><dir name="Rule"><file name="Condition.php" hash="345e7992da8bd7d543e9d25ed92e1d66"/><file name="Observer.php" hash="ff3a6cc43e4d46401a4bbb37262f4f56"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Enabled.php" hash="103e4776ee228d313fcb63c0eefcb0db"/></dir></dir></dir></dir><dir name="controllers"><file name="AuthorizeController.php" hash="fa9f2560b2d04995091835935037cc2a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2bba51d29a0e9c444ff401a460a44142"/><file name="config.xml" hash="25effbb6c1487f4db22443f8a47f0af2"/><file name="system.xml" hash="22c0372a79c65417cf1239591fc37d64"/></dir><dir name="sql"><dir name="troopid_connect_setup"><file name="mysql4-install-0.1.0.php" hash="2ed9e5f82407c756477d7fc2d3cd20ff"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="6160551e6951f91ab7ef18e887ea73a9"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="troopid"><file name="idme.css" hash="950827f2031330fed931930c12b5fa88"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="troopid"><file name="idme.css" hash="57964a12675c76bca426475515160dcc"/><dir name="images"><file name="logo.png" hash="65421456771898d7cbced7b99d4b56ea"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TroopID_Connect.xml" hash="daae0990b13ba4071764efd4f9f674ec"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="760c7d73dcab51068a0db524699b354e"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="affiliation.phtml" hash="69c74c5b4d78f1f6822be88d1a3bd928"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="f83172a0eaea9b8c185f49f0864bf8cb"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="callback.phtml" hash="71b10af7408d6f50999529c08aa75dfb"/><file name="cart.phtml" hash="2df306654373065c7b0d5299b248379c"/><file name="script.phtml" hash="5e281cd246f5d02fae91ff9742ee9088"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
skin/adminhtml/default/default/troopid/{troopid.css → idme.css} RENAMED
File without changes
skin/frontend/base/default/troopid/idme.css ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'Open Sans';
3
+ font-style: normal;
4
+ font-weight: 400;
5
+ src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v10/cJZKeOuBrn4kERxqtaUH3bO3LdcAZYWl9Si6vvxL-qU.woff) format('woff');
6
+ }
7
+ @font-face {
8
+ font-family: 'Open Sans';
9
+ font-style: normal;
10
+ font-weight: 600;
11
+ src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://fonts.gstatic.com/s/opensans/v10/MTP_ySUJH_bn48VBG8sNSqRDOzjiPcYnFooOUGCOsRk.woff) format('woff');
12
+ }
13
+ @font-face {
14
+ font-family: 'Open Sans';
15
+ font-style: normal;
16
+ font-weight: 700;
17
+ src: local('Open Sans Bold'), local('OpenSans-Bold'), url(https://fonts.gstatic.com/s/opensans/v10/k3k702ZOKiLJc3WVjuplzKRDOzjiPcYnFooOUGCOsRk.woff) format('woff');
18
+ }
19
+
20
+ .idme-connect {
21
+ text-align: center;
22
+ }
23
+
24
+ .idme-connect h2 {
25
+ margin-bottom: 10px;
26
+ }
27
+
28
+ .idme-connect .idme-button {
29
+ margin: 10px 0 0 0;
30
+ display: inline-block;
31
+ }
32
+
33
+ .idme-connect .idme-button a {
34
+ display: inline-block;
35
+ background: none repeat scroll 0% 0% rgb(255, 255, 255);
36
+ font-family: Open Sans, Arial, sans-serif;
37
+ font-size: 13px;
38
+ font-weight: 600;
39
+ color: rgb(39, 160, 227);
40
+ border: 2px solid rgb(237, 240, 242);
41
+ border-radius: 10px;
42
+ padding: 8px 16px;
43
+ text-decoration: none;
44
+ }
45
+
46
+ .idme-connect .idme-button a img {
47
+ display: inline;
48
+ vertical-align: middle;
49
+ margin: 0 3px 2px 0;
50
+ }
51
+
52
+ .idme-connect .about {
53
+ display: block;
54
+ clear: both;
55
+ margin-top: 15px;
56
+ text-align: center;
57
+ }
58
+
59
+ .idme-connect .about .container {
60
+ display: inline-block;
61
+ color: rgb(0, 0, 0);
62
+ font-family: Open Sans, Arial, sans-serif;
63
+ font-size: 11px;
64
+ font-weight: 600;
65
+ }
66
+
67
+ .idme-connect .about .container img {
68
+ vertical-align: middle;
69
+ margin: 0 3px 5px 0;
70
+ display: inline;
71
+ }
72
+
73
+ .idme-connect .about .container a {
74
+ color: rgb(39, 160, 227);
75
+ }
76
+
77
+ .idme-connect .affiliation strong {
78
+ display: block;
79
+ }
80
+
81
+ #idme-modal {
82
+ background: none repeat scroll 0 0 #000;
83
+ position: fixed;
84
+ opacity: 0.5;
85
+ top: 0;
86
+ left: 0;
87
+ height: 100%;
88
+ width: 100%;
89
+ }
90
+
91
+ #idme-modal-content {
92
+ background: url("https://s3.amazonaws.com/idme/assets/faq-model-footer.png") no-repeat scroll center bottom #fff;
93
+ border-radius: 20px;
94
+ box-shadow: 0 0 17px 0 rgba(0, 0, 0, 0.5);
95
+ margin: 0 auto;
96
+ padding: 40px 10px 90px;
97
+ position: absolute;
98
+ left: 25%;
99
+ top: 15%;
100
+ width: 480px;
101
+ z-index: 9999;
102
+ }
103
+
104
+ #idme-modal-content .content {
105
+ text-align: left;
106
+ font-family: Open Sans, Arial, sans-serif;
107
+ font-size: 12px;
108
+ height: 400px;
109
+ overflow-x: hidden;
110
+ overflow-y: scroll;
111
+ padding: 0 30px 0 40px;
112
+ }
113
+
114
+ #idme-modal-content h3 {
115
+ font-family: Open Sans, Arial, sans-serif;
116
+ font-size: 32px;
117
+ font-weight: 300;
118
+ margin: 0 0 20px;
119
+ text-align: center;
120
+ text-transform: none;
121
+ }
122
+
123
+
124
+ #idme-modal-content .content p {
125
+ color: rgb(45, 62, 81);
126
+ font-size: 12px;
127
+ margin: 12px 0
128
+ }
129
+
130
+ #idme-modal-content h3 {
131
+ margin: 0 0 20px;
132
+ font-size: 32px;
133
+ font-weight: 300;
134
+ text-align: center;
135
+ }
136
+
137
+ #idme-modal-content .close {
138
+ background: url("https://s3.amazonaws.com/idme/assets/faq-model-close.png") no-repeat scroll center bottom rgba(0, 0, 0, 0);
139
+ position: absolute;
140
+ float: right;
141
+ top: 15px;
142
+ right: 15px;
143
+ height: 26px;
144
+ width: 26px;
145
+ }
skin/frontend/base/default/troopid/troopid.css DELETED
@@ -1,53 +0,0 @@
1
- .troopid-connect {
2
- text-align: center;
3
- }
4
- .troopid-connect h2 {
5
- padding: 0 !important;
6
- background: none !important;
7
- }
8
- .troopid-connect .button {
9
- margin: 10px 0 0 0;
10
- }
11
-
12
- .troopid-connect .about {
13
- margin: 10px 0 0 0;
14
- }
15
-
16
- .troopid-connect .affiliation strong {
17
- display: block;
18
- }
19
-
20
- #troopid-modal {
21
- position: fixed;
22
- top: 0;
23
- left: 0;
24
- width: 100%;
25
- height: 100%;
26
- background: #000000;
27
- opacity: 0.75;
28
- z-index: 100;
29
- }
30
-
31
- #troopid-modal-content {
32
- position: fixed;
33
- left: 25%;
34
- top: 25%;
35
- background: #ffffff;
36
- opacity: 1;
37
- z-index: 200;
38
- text-align: left;
39
- padding: 20px;
40
- max-width: 900px;
41
- }
42
-
43
- #troopid-modal-content h3 {
44
- font-weight: bold;
45
- display: inline-block;
46
- }
47
-
48
- #troopid-modal-content .close {
49
- float: right;
50
- font-weight: bold;
51
- margin: -5px 0 0 0;
52
- text-decoration: none;
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/frontend/enterprise/default/troopid/troopid.css DELETED
@@ -1,50 +0,0 @@
1
- .troopid-connect h2 {
2
- padding: 0 !important;
3
- background: none !important;
4
- }
5
- .troopid-connect .button {
6
- margin: 10px 0 0 0;
7
- }
8
-
9
- .troopid-connect .about {
10
- margin: 10px 0 0 0;
11
- }
12
-
13
- .troopid-connect .affiliation strong {
14
- display: block;
15
- }
16
-
17
- #troopid-modal {
18
- position: fixed;
19
- top: 0;
20
- left: 0;
21
- width: 100%;
22
- height: 100%;
23
- background: #000000;
24
- opacity: 0.75;
25
- z-index: 100;
26
- }
27
-
28
- #troopid-modal-content {
29
- position: fixed;
30
- left: 25%;
31
- top: 25%;
32
- background: #ffffff;
33
- opacity: 1;
34
- z-index: 200;
35
- text-align: left;
36
- padding: 20px;
37
- max-width: 900px;
38
- }
39
-
40
- #troopid-modal-content h3 {
41
- font-weight: bold;
42
- display: inline-block;
43
- }
44
-
45
- #troopid-modal-content .close {
46
- float: right;
47
- font-weight: bold;
48
- margin: -5px 0 0 0;
49
- text-decoration: none;
50
- }