OneID - Version 1.0.0

Version Notes

First release including : OneID sign in, OneID checkout, OneID quickfill (for onepage checkout)

Download this release

Release Info

Developer OneID
Extension OneID
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (30) hide show
  1. app/code/local/OneID/Connector/Block/Checkout/Onepage/Success.php +40 -0
  2. app/code/local/OneID/Connector/Block/Login.php +5 -0
  3. app/code/local/OneID/Connector/Helper/Data.php +401 -0
  4. app/code/local/OneID/Connector/controllers/AccountController.php +29 -0
  5. app/code/local/OneID/Connector/controllers/ConnectorController.php +224 -0
  6. app/code/local/OneID/Connector/controllers/OnepageController.php +83 -0
  7. app/code/local/OneID/Connector/etc/config.xml +110 -0
  8. app/code/local/OneID/Connector/etc/system.xml +110 -0
  9. app/code/local/OneID/Connector/sql/oneid_connector_setup/mysql4-install-0.1.0.php +31 -0
  10. app/design/frontend/base/default/template/oneid/block/login.phtml +6 -0
  11. app/design/frontend/base/default/template/oneid/block/page/html/footer.phtml +104 -0
  12. app/design/frontend/base/default/template/oneid/block/page/html/head.phtml +8 -0
  13. app/design/frontend/base/default/template/oneid/block/page/html/newjavascript.js +2 -0
  14. app/design/frontend/base/default/template/oneid/checkout/cart.phtml +138 -0
  15. app/design/frontend/base/default/template/oneid/checkout/onepage.phtml +162 -0
  16. app/design/frontend/base/default/template/oneid/checkout/onepage/billing.phtml +358 -0
  17. app/design/frontend/base/default/template/oneid/checkout/onepage/link.phtml +31 -0
  18. app/design/frontend/base/default/template/oneid/checkout/onepage/login.phtml +124 -0
  19. app/design/frontend/base/default/template/oneid/checkout/onepage/payment.phtml +178 -0
  20. app/design/frontend/base/default/template/oneid/checkout/onepage/review/button.phtml +1 -0
  21. app/design/frontend/base/default/template/oneid/checkout/onepage/shipping.phtml +229 -0
  22. app/design/frontend/base/default/template/oneid/checkout/success.phtml +89 -0
  23. app/design/frontend/base/default/template/oneid/customer/account/dashboard.phtml +83 -0
  24. app/design/frontend/base/default/template/oneid/customer/form/edit.phtml +129 -0
  25. app/design/frontend/base/default/template/oneid/customer/form/forgotpassword.phtml +65 -0
  26. app/design/frontend/base/default/template/oneid/form/login.phtml +94 -0
  27. app/design/frontend/base/default/template/oneid/form/traditional_login.phtml +77 -0
  28. app/etc/modules/Oneid_Connector.xml +10 -0
  29. package.xml +31 -0
  30. skin/frontend/base/default/css/oneid.css +55 -0
app/code/local/OneID/Connector/Block/Checkout/Onepage/Success.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Checkout
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+
27
+ /**
28
+ * One page checkout success page
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Checkout
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class OneID_Connector_Block_Checkout_Onepage_Success extends Mage_Checkout_Block_Onepage_Success
35
+ {
36
+ public function getOrder(){
37
+ $order_id = $this->getOrderId();
38
+ return Mage::getModel("sales/order")->loadByIncrementId($order_id);
39
+ }
40
+ }
app/code/local/OneID/Connector/Block/Login.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class OneID_Connector_Block_Login extends Mage_Core_Block_Template {
4
+
5
+ }
app/code/local/OneID/Connector/Helper/Data.php ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class OneID_Connector_Helper_Data extends Mage_Core_Helper_Abstract {
4
+
5
+ const ONEID_UID_ATTR_KEY = "oneid_uid";
6
+
7
+ const API_ENDPOINT_PATH = 'OneID/endpoint/host';
8
+ const KEYCHAIN_ENDPOINT_PATH = 'OneID/endpoint/helper_host';
9
+
10
+ const VERIFIED_EMAIL_REQUIRED_PATH = 'OneID/oneid_authentication/verified_email_required';
11
+
12
+ const API_ID_PATH = 'OneID/endpoint/api_id';
13
+ const API_KEY_PATH = 'OneID/endpoint/api_key';
14
+ const AUTH_PURCHASE_AMOUNT_PATH = 'OneID/auth_purchase/auth_amount';
15
+ const AUTH_PURCHASE_ENABLED='OneID/auth_purchase/enabled';
16
+
17
+ const REFERRAL_CODE = "magerefcode"; // prob need to toss this into magento admin
18
+
19
+ public function getButton($container_class="") {
20
+ $button = '<div class="'.$container_class.' oneid-api-ready"><img class="oneidlogin" style="margin-left:6px; margin-top:-4px"
21
+ return_to="'. $this->_getUrl("/") .'"
22
+ ref="' . self::REFERRAL_CODE . '"
23
+ id="oneidlogin"
24
+ CHALJ=\'{"NONCE":"' . $this->getNonce() . '","ATTR":"'.$this->getLoginATTR().'", "CALLBACK":"'. $this->_getUrl("oneid/connector/authenticate",array('_secure'=>true)) . '" }\'
25
+ src="' . $this->getEndPoint() . '/images/oneid_signin.png"
26
+ onclick="OneId.login()" /></div>';
27
+ return $button;
28
+ }
29
+
30
+ public function getLoginCHALJ(){
31
+ return '{"attr":"'.$this->getLoginATTR().'", "callback":"'. $this->_getUrl("oneid/connector/authenticate",array('_secure'=>true)) . '" }' ;
32
+ }
33
+
34
+ public function getLinkCHALJ(){
35
+ return '{"callback":"'. $this->_getUrl("oneid/connector/authenticate",array('_secure'=>true)) . '" }' ;
36
+ }
37
+
38
+ public function getCheckoutLoginCHALJ(){
39
+ return '{"nonce":"' . $this->getNonce() . '","attr":"'.$this->getLoginATTR().'", "callback":"'. $this->_getUrl("oneid/connector/authenticate",array('_secure'=>true)) . '" }';
40
+ }
41
+
42
+ public function getAOneIdButton($email){
43
+ $button = '<div><img class="oneidlogin" style="margin-left:6px; margin-top:-4px"
44
+ return_to="'. $this->_getUrl("/") .'" ref="' . self::REFERRAL_CODE . '"
45
+ id="getAOneIdButton" CHALJ=\'{"NONCE":"' . $this->getNonce() . '","ATTR":"'.$this->getLoginATTR().'", "CALLBACK":"'. $this->_getUrl("oneid/connector/authenticate").'" }\'
46
+ src="' . $this->getEndPoint() . '/images/oneid_signin.png"
47
+ onclick="OneId.createOneId(\''.$email.'\', \''.$this->getReferralCode().'\')" /></div>';
48
+ return $button;
49
+ }
50
+
51
+ public function getCreateOneIdAttrs() {
52
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
53
+ $data = array(
54
+ "personal_info" => array(
55
+ "first_name" => $this->_escapeQuote($customer->getFirstname()),
56
+ "last_name" => $this->_escapeQuote($customer->getLastname()),
57
+ "email" => $this->_escapeQuote($customer->getEmail())
58
+ )
59
+ );
60
+
61
+
62
+ $customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
63
+ if ($customerAddressId){
64
+ $address = Mage::getModel('customer/address')->load($customerAddressId);
65
+ $street = $address->getStreet();
66
+ $data["address"] = array("billing" => array());
67
+ $data["address"]["billing"]["street"] = $this->_escapeQuote( $street[0]);
68
+ $data["address"]["billing"]["street2"] = count($street) == 2 ? $this->_escapeQuote($street[1]) : "";
69
+ $data["address"]["billing"]["state"] = $address->getRegionId();
70
+ $data["address"]["billing"]["city"] = $this->_escapeQuote($address->getCity());
71
+ $data["address"]["billing"]["zip"] = $address->getPostcode();
72
+ $data["address"]["billing"]["phone"] = $address->getTelephone();
73
+ }
74
+
75
+ $customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping();
76
+ if ($customerAddressId){
77
+ $address = Mage::getModel('customer/address')->load($customerAddressId);
78
+
79
+ if (!$data["address"]) {
80
+ $data["address"] = array();
81
+ }
82
+
83
+ $street = $address->getStreet();
84
+ $data["address"]["shipping"] = array();
85
+ $data["address"]["shipping"]["street"] = $this->_escapeQuote( $street[0]);
86
+ $data["address"]["shipping"]["street2"] = count($street) == 2 ? $this->_escapeQuote($street[1]) : "";
87
+ $data["address"]["shipping"]["state"] = $address->getRegionId();
88
+ $data["address"]["shipping"]["city"] = $this->_escapeQuote($address->getCity());
89
+ $data["address"]["shipping"]["zip"] = $address->getPostcode();
90
+ $data["address"]["shipping"]["phone"] = $address->getTelephone();
91
+ }
92
+
93
+ $orders = Mage::getResourceModel('sales/order_collection')
94
+ ->addAttributeToSelect('*')
95
+ ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
96
+ ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
97
+ ->addAttributeToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())
98
+ ->addAttributeToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
99
+ ->addAttributeToSort('created_at', 'desc')
100
+ ->setPageSize('1')
101
+ ->load();
102
+
103
+ if (count($orders)){
104
+ foreach($orders as $order){
105
+ // Payment info
106
+ $payment = $order->getPayment();
107
+ $payment_info = $payment->getMethodInstance()->getInfoInstance();
108
+ $data["payment"] = array();
109
+ $data["payment"]["cc_type"] = $payment_info->getCcType();
110
+ $data["payment"]["cc_number"] = $payment_info->getCcNumber();
111
+ $data["payment"]["cc_exp_mo"] = $payment_info->getCcExpMonth();
112
+ $data["payment"]["cc_exp_yr"] = $payment_info->getCcExpYear();
113
+ $data["payment"]["cc_name_on_card"] = $this->_escapeQuote($payment_info->getCcOwner());
114
+ }
115
+ }
116
+
117
+
118
+
119
+ return json_encode($data);
120
+ }
121
+
122
+
123
+ public function getBasicCreatOneIdInfoFromCustomer() {
124
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
125
+ $data = array(
126
+ "personal_info" => array(
127
+ "first_name" => $this->_escapeQuote($customer->getFirstname()),
128
+ "last_name" => $this->_escapeQuote($customer->getLastname()),
129
+ "email" => $this->_escapeQuote($customer->getEmail())
130
+ )
131
+ );
132
+
133
+ return json_encode($data);
134
+ }
135
+
136
+ public function getCreateOndIdAttrsFromOrder($order) {
137
+ $data = array(
138
+ "personal_info" => array(
139
+ "first_name" => $this->_escapeQuote($order->getCustomerFirstname()),
140
+ "last_name" => $this->_escapeQuote($order->getCustomerLastname()),
141
+ "email" => $this->_escapeQuote($order->getCustomerEmail())
142
+ )
143
+ );
144
+
145
+ $address = $order->getBillingAddress();
146
+
147
+ $data["address"] = array("billing" => array());
148
+
149
+ $street = $address->getStreet();
150
+ $data["address"]["billing"]["street"] = $this->_escapeQuote( $street[0]);
151
+ $data["address"]["billing"]["street2"] = count($street) == 2 ? $this->_escapeQuote($street[1]) : "";
152
+ $data["address"]["billing"]["state"] = $address->getRegionId();
153
+ $data["address"]["billing"]["city"] = $this->_escapeQuote($address->getCity());
154
+ $data["address"]["billing"]["zip"] = $address->getPostcode();
155
+ $data["address"]["billing"]["phone"] = $address->getTelephone();
156
+ $data["personal_info"]["primary_phone"] = $address->getTelephone();
157
+
158
+ $address = $order->getShippingAddress();
159
+ if ($address) {
160
+ if (!$data["address"]){
161
+ $data["address"] = array();
162
+ }
163
+ $data["address"]["shipping"] = array();
164
+
165
+
166
+ $street = $address->getStreet();
167
+ $data["address"]["shipping"]["street"] = $this->_escapeQuote( $street[0]);
168
+ $data["address"]["shipping"]["street2"] = count($street) == 2 ? $this->_escapeQuote($street[1]) : "";
169
+ $data["address"]["shipping"]["state"] = $address->getRegionId();
170
+ $data["address"]["shipping"]["city"] = $this->_escapeQuote($address->getCity());
171
+ $data["address"]["shipping"]["zip"] = $address->getPostcode();
172
+ $data["address"]["shipping"]["phone"] = $address->getTelephone();
173
+ }
174
+
175
+
176
+ // Payment info
177
+ $data["payment"] = array();
178
+ $payment = $order->getPayment();
179
+ $payment_info = $payment->getMethodInstance()->getInfoInstance();
180
+ $data["payment"]["cc_type"] = $payment_info->getCcType();
181
+ $data["payment"]["cc_number"] = $payment_info->getCcNumber();
182
+ $data["payment"]["cc_exp_mo"] = $payment_info->getCcExpMonth();
183
+ $data["payment"]["cc_exp_yr"] = $payment_info->getCcExpYear();
184
+ $data["payment"]["cc_name_on_card"] = $this->_escapeQuote($payment_info->getCcOwner());
185
+
186
+
187
+ return json_encode($data);
188
+
189
+ }
190
+
191
+ private function _escapeQuote($str){
192
+ return htmlspecialchars( $str, ENT_QUOTES );
193
+ }
194
+
195
+ public function getCustomerByOneIDUID($uid) {
196
+ $customer = Mage::getModel('customer/customer')
197
+ ->setWebsiteId(Mage::app()->getStore()->getWebsiteId());
198
+ $collection = $customer->getCollection()
199
+ ->addFieldToFilter('oneid_uid',$uid);
200
+
201
+ foreach ($collection as $customer){
202
+ return $customer;
203
+ }
204
+
205
+ return null;
206
+ }
207
+
208
+ public function assignOrdersToCustomer($customer) {
209
+ $orders_collection = Mage::getModel('sales/order')
210
+ ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
211
+ ->getCollection()
212
+ ->addFieldToFilter('customer_email',$customer->getEmail() )
213
+ ->addFieldToFilter('customer_id', array('null' => true));
214
+
215
+ foreach ($orders_collection as $order) {
216
+ $order->setCustomer($customer);
217
+ $order->save();
218
+ }
219
+ return;
220
+ }
221
+
222
+ public function getLoginATTR(){
223
+ return "personal_info[email] personal_info[first_name] personal_info[last_name]";
224
+ }
225
+
226
+ private function getReferralCode(){
227
+ return self::REFERRAL_CODE;
228
+ }
229
+
230
+ public function getLoginSelect() {
231
+ $loginSelect = '<div><select class="oneidlogin_select" style="float:right" ></select></div>';
232
+ $loginSelect .= '<script type="text/javascript"> oneIdExtern.registerApiReadyFunction ( function() {OneId.fillLoginDropDown();}); </script>';
233
+ return $loginSelect;
234
+ }
235
+
236
+ public function getCheckoutLoginButton() {
237
+ $button = '<div><img class="oneidlogin" style="margin-left:6px; margin-top:-4px"
238
+ return_to="'. $this->_getUrl("/checkout/onepage/") .'"
239
+ ref="' . self::REFERRAL_CODE . '"
240
+ id="oneidlogin"
241
+ CHALJ=\'{"NONCE":"' . $this->getNonce() . '","ATTR":"'.$this->getLoginATTR().'", "CALLBACK":"'. $this->_getUrl("oneid/connector/authenticate", array('_secure'=>true)) . '" }\'
242
+ src="' . $this->getEndPoint() . '/images/oneid_signin.png"
243
+ onclick="OneId.login()"></div>';
244
+ return $button;
245
+ }
246
+
247
+ public function getCheckoutCombo() {
248
+ return "";
249
+ if (Mage::isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn()) {
250
+ return "";
251
+ } else {
252
+ return '<img class="oneidlogin" style="margin-left:6px; margin-top:-4px" id="oneidlogin" CHALJ=\'{"NONCE":"' . $this->getNonce() . '","ATTR":"'.$this->getLoginATTR().'"}\' callback="'. $this->_getUrl("oneid/connector/authenticate",array('_secure'=>true)) . '" src="' . $this->getEndPoint() . '/images/1id_SignIn_flat-190.png" onclick="OneId.login()">';
253
+ }
254
+ }
255
+ public function getPromo() {
256
+ return "";
257
+ // return '<img class="oneidlogin" style="margin-left:6px; margin-top:-4px" id="oneidlogin" src="' . $this->getEndPoint() . '/images/1id_Register-180.png" onclick="OneId.login()">';
258
+
259
+ }
260
+ public function getAccuFillButtonSrc() {
261
+ return $this->getEndPoint() . '/images/oneid_accufill.png';
262
+ }
263
+
264
+ public function getCheckoutAttr(){
265
+ return "personal_info[email] personal_info[first_name] personal_info[last_name] address.billing[street] address.billing[street2] address.billing[city] address.billing[state] address.billing[zip] address.billing[phone] payment[cc_type] payment[cc_number] payment[cc_exp_mo] payment[cc_exp_yr] payment[cc_verify] payment[cc_name_on_card]";
266
+ }
267
+
268
+ public function getChalj($method=null, $quote=null) {
269
+ if (!$method) {
270
+ $method=$this->getLoginATTR();
271
+ }
272
+ else if ($method == "secureTransaction"){
273
+ if ($quote && $this->getAuthRequired() && $this->getAuthAmount() < $quote->getGrandTotal()) {
274
+ return '{"nonce":"' . $this->getNonce() . '", "auth_level" : "OOBPIN"}';
275
+ } else {
276
+ return '{"nonce":"' . $this->getNonce() . '", "auth_level" : "ON"}';
277
+ }
278
+ }
279
+
280
+ return '{"nonce":"' . $this->getNonce() . '"}';
281
+ }
282
+
283
+ public function getCheckoutChalj(){
284
+ return '{"NONCE":"' . $this->getNonce() . '"}';
285
+ }
286
+
287
+ public function getEndPoint() {
288
+ return (string)Mage::getStoreConfig(self::API_ENDPOINT_PATH);
289
+ }
290
+
291
+ public function getKeychainHost(){
292
+ return (string)Mage::getStoreConfig(self::KEYCHAIN_ENDPOINT_PATH);
293
+ }
294
+
295
+ public function getVerifiedEmailRequired(){
296
+ return (string)Mage::getStoreConfig(self::VERIFIED_EMAIL_REQUIRED_PATH);
297
+ }
298
+
299
+ public function getApiId() {
300
+ return (string)Mage::getStoreConfig(self::API_ID_PATH);
301
+ }
302
+
303
+ public function getApiKey() {
304
+ return (string)Mage::getStoreConfig(self::API_KEY_PATH);
305
+ }
306
+
307
+ public function getAuthAmount() {
308
+ return Mage::getStoreConfig(self::AUTH_PURCHASE_AMOUNT_PATH);
309
+ }
310
+
311
+ public function getAuthRequired() {
312
+ return Mage::getStoreConfig(self::AUTH_PURCHASE_ENABLED);
313
+ }
314
+
315
+ public function getPromptUserOnDashboard() {
316
+ return Mage::getStoreConfig(self::PROMPT_CREATE_ONEID_ON_DASHBOARD);
317
+ }
318
+
319
+ public function getAuthPurchaseMessage($quote) {
320
+ return sprintf("Approve the purchase of %s ?", Mage::helper("core")->formatCurrency($quote->getGrandTotal(), false));
321
+ }
322
+
323
+ public function validateAuthPurchaseResponse($data, $quote) {
324
+ return true; // isset($data) && $data->auth_msg_md5 == md5($this->getAuthPurchaseMessage($quote));
325
+ }
326
+
327
+ public function isQuoteAuthRequired($quote) {
328
+ $enabled = $this->getAuthRequired();
329
+ if (!$enabled) {
330
+ return false;
331
+ }
332
+
333
+ $quote_amount = $quote->getGrandTotal();
334
+ $min_auth = $this->getAuthAmount();
335
+
336
+ return $quote_amount >= $min_auth;
337
+ }
338
+
339
+ public function getNonce() {
340
+ $data = $this->_callOneIdKeychain("make_nonce");
341
+ return $data["nonce"];
342
+ }
343
+
344
+ public function validateOneIDResponse($responseData) {
345
+ $validateData = array();
346
+ $validateData["uid"] = $responseData['uid'];
347
+
348
+ if ( $this->getVerifiedEmailRequired() ) {
349
+ $validateData["attr_claim_tokens"] = $responseData['attr_claim_tokens'] ? $responseData['attr_claim_tokens'] : array();
350
+ }
351
+
352
+ if ($responseData['nonces']) {
353
+ $validateData["nonces"] = $responseData['nonces'];
354
+ }
355
+
356
+ $response = $this->_callOneIdKeychain("validate", $validateData);
357
+
358
+ if (is_null($response)) {
359
+ return array("isValid" => 0,
360
+ "errorcode" => 500,
361
+ "error" => "OneID Validate service is down.");
362
+ }
363
+
364
+ $isValid = $response['errorcode'] == 0;
365
+
366
+ foreach ($response['attr_claims'] as $attr => $claimValid) {
367
+ $isValid = $isValid && $claimValid;
368
+
369
+ if (!$claimValid) {
370
+ $response["error"].= " ";
371
+ $response["error"].= "Claim for attribute " . $attr ." didn't verify";
372
+ }
373
+ }
374
+ $response["isValid"] = $isValid;
375
+
376
+ return $response;
377
+
378
+ }
379
+
380
+ private function _callOneIdKeychain($method, $data=null){
381
+ $oneid_server = $this->getKeychainHost();
382
+ $oneid_api_id = $this->getApiId();
383
+ $oneid_api_key = $this->getApiKey();
384
+
385
+ $scope = "/keychain";
386
+ //$scope = "";
387
+ $ch = curl_init($oneid_server . $scope. "/" . $method);
388
+
389
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
390
+ curl_setopt($ch, CURLOPT_USERPWD, $oneid_api_id . ":" . $oneid_api_key);
391
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
392
+
393
+ if ($data !== null) {
394
+ curl_setopt($ch, CURLOPT_POST, 1);
395
+ curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
396
+ }
397
+ $json = curl_exec($ch);
398
+ curl_close($ch);
399
+ return json_decode($json, true);
400
+ }
401
+ }
app/code/local/OneID/Connector/controllers/AccountController.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once 'Mage/Customer/controllers/AccountController.php';
4
+
5
+ class OneID_Connector_AccountController extends Mage_Customer_AccountController {
6
+
7
+ public function loginAction() {
8
+ parent::loginAction();
9
+ }
10
+
11
+ public function loginPostAction(){
12
+ parent::loginPostAction();
13
+ $session = Mage::getSingleton('customer/session');
14
+
15
+ if ($session->getCustomer()->getId()){
16
+ if ($session->getData("oneid_uid")){
17
+ $customer = $session->getCustomer();
18
+ $customer->setData("oneid_uid", $session->getData("oneid_uid"));
19
+ $session->unsetData("oneid_uid");
20
+ $customer->save();
21
+ }
22
+ }
23
+ else{
24
+ // Login failed, redirect
25
+ $this->_redirect("oneid/account/login",array('_secure'=>true));
26
+ }
27
+
28
+ }
29
+ }
app/code/local/OneID/Connector/controllers/ConnectorController.php ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class OneID_Connector_ConnectorController extends Mage_Core_Controller_Front_Action {
4
+
5
+ public function removeOneidAction(){
6
+ $session = Mage::getSingleton('customer/session');
7
+ $customer = $session->getCustomer();
8
+ $customer->setData("oneid_uid", null);
9
+ $customer->save();
10
+
11
+ Mage::getSingleton('core/session')->addSuccess("Your accounts are no longer linked and we have removed this website’s information from your OneID.");
12
+
13
+ $redirectUrl = Mage::getUrl("customer/account");
14
+ $this->_redirectUrl($redirectUrl);
15
+
16
+ }
17
+
18
+ public function authenticateFromSuccessAction($jsonInput=null) {
19
+ self::authenticateAction($jsonInput);
20
+
21
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
22
+ if ($customer->getId()){
23
+ Mage::helper("OneID")->assignOrdersToCustomer($customer);
24
+ }
25
+
26
+ }
27
+
28
+
29
+
30
+ public function authenticateAction($jsonInput = null) {
31
+
32
+ // Read in our JSON post
33
+ if ($jsonInput == null){
34
+ // Check to see if data was POSTED.
35
+ $postData = Mage::app()->getRequest()->getPost();
36
+ if (count($postData) && isset($postData['json_data'])){
37
+ $jsonInput = $postData['json_data'];
38
+ }
39
+ else {
40
+ // Read from php input.
41
+ $handle = fopen('php://input', 'r');
42
+ $jsonInput = fgets($handle);
43
+ }
44
+ }
45
+ Mage::log($jsonInput);
46
+ $decoded = json_decode($jsonInput, true);
47
+
48
+
49
+ $validateResponse = Mage::helper("OneID")->validateOneIDResponse($decoded);
50
+ if (!$validateResponse['isValid']) {
51
+ Mage::log("Validating OneID Response returned this error :". $validateResponse['error']);
52
+ Mage::app()->getResponse()->setBody(json_encode($validateResponse));
53
+ return;
54
+ }
55
+
56
+ $session = Mage::getSingleton('customer/session');
57
+ $uid = $decoded['uid'];
58
+
59
+ try {
60
+ // Is user logged into Magento?
61
+ $customer = $session->getCustomer();
62
+ if ($customer->getId()){ // If they're logged in
63
+ if ($customer->getOneidUid()) { // And they have a OneID linked here
64
+ if($customer->getOneidUid() != $uid){ // And it's not the UID that we're generating.
65
+ // Return an exception because that's not good.
66
+ $error_return = array("error" => "A different OneID is already linked to this account");
67
+ Mage::app()->getResponse()->setBody(json_encode($error_return));
68
+ return;
69
+ }
70
+ }
71
+ else{ // There is no OneId link, set one up.
72
+ $customer->setData("oneid_uid", $uid);
73
+ $customer->save();
74
+ Mage::getSingleton('core/session')->addSuccess("OneID is successfully linked!");
75
+ }
76
+ }
77
+ else {
78
+
79
+ // This is same as email for now
80
+
81
+ $infoCard = $decoded["attr"]["personal_info"];
82
+
83
+ //TODO: don't assume default card here.
84
+ $email = $infoCard['email'];
85
+
86
+ if (!$email){
87
+ $url = $this->_getLoginPostRedirect();
88
+ $msg = "Sorry, a verified email address supplied by OneID is required to login!";
89
+ $response = array("error" => $msg, "errorcode" => "-999");
90
+ Mage::app()->getResponse()->setBody(json_encode($response));
91
+ return;
92
+ }
93
+
94
+
95
+
96
+ // Has the user used OneID to login here before?
97
+ $customer = Mage::helper("OneID")->getCustomerByOneIDUID($uid);
98
+
99
+ if ($customer && $customer->getId()) { // User exists and is linked by OneID.
100
+
101
+ if (!$customer->getId()) { // If customer does not exist, create one
102
+ $customer->setData('firstname', $infoCard['first_name']);
103
+ $customer->setData('lastname', $infoCard['last_name']);
104
+ $customer->setData('email', $email);
105
+ $customer->setData("oneid_uid", $uid);
106
+ $customer->save();
107
+ }
108
+ $saveAcct=false;
109
+ if (!$customer->getFirstname()) {
110
+ $customer->setData('firstname', $infoCard['first_name']);
111
+ $saveAcct=true;
112
+ }
113
+ if (!$customer->getLastname()){
114
+ $customer->setData('lastname', $infoCard['last_name']);
115
+ $saveAcct=true;
116
+ }
117
+ if (!$customer->getOneidUid()){
118
+ $customer->setData("oneid_uid", $uid);
119
+ $saveAcct=true;
120
+ }
121
+ if ($saveAcct){
122
+ $customer->save();
123
+ }
124
+ }
125
+ else {
126
+ // Try and load Magento customer by email provided by OneID.
127
+ $customer = Mage::getModel('customer/customer')->setWebsiteId(Mage::app()->getStore()->getWebsiteId());
128
+ $customer->loadByEmail($email);
129
+
130
+ if ($customer && $customer->getId()){
131
+ // Now check if this customer exists in Magento.
132
+ // If customer exists, we need to verify that this OneID user is the customer
133
+ // by making them login to Magento the traditional way.
134
+ $session->setData("oneid_uid", $uid);
135
+
136
+ $url = Mage::getUrl("oneid/account/login",array('_secure'=>true));
137
+ $response = array("error" => 'success', "url" => $url);
138
+ Mage::app()->getResponse()->setBody(json_encode($response));
139
+ return;
140
+ }
141
+ else{
142
+ // Create new account, with data provided by OneID.
143
+
144
+ $customer->setData('firstname', $infoCard['first_name']);
145
+ $customer->setData('lastname', $infoCard['last_name']);
146
+ $customer->setData('email', $email);
147
+ $customer->setData("oneid_uid", $uid);
148
+ $customer->save();
149
+ Mage::getSingleton('core/session')->addSuccess("Your new account has been linked to your OneID!");
150
+ }
151
+ }
152
+
153
+ }
154
+ } catch (Mage_Core_Exception $e) {
155
+ Mage::log("exception " . $e);
156
+ $url = $this->_getLoginPostRedirect();
157
+ $response = array("error" => $e->getMessage(), "errorcode" => "-999");
158
+ Mage::app()->getResponse()->setBody(json_encode($response));
159
+ return;
160
+ }
161
+
162
+ // Log the customer in at Magento.
163
+ if ($customer->getId()) {
164
+ $session->setCustomerAsLoggedIn($customer);
165
+ }
166
+
167
+ // Redirect user to success page.
168
+ $url = $this->_getLoginPostRedirect();
169
+ $response = array("error" => 'success', "url" => $url);
170
+ Mage::app()->getResponse()->setBody(json_encode($response));
171
+ }
172
+ /**
173
+ * Retrieve customer session model object
174
+ *
175
+ * @return Mage_Customer_Model_Session
176
+ */
177
+ protected function _getSession() {
178
+ return Mage::getSingleton('customer/session');
179
+ }
180
+
181
+
182
+ /*
183
+ * Borrowed from AccountController.php
184
+ */
185
+ protected function _getLoginPostRedirect()
186
+ {
187
+ $session = $this->_getSession();
188
+
189
+ if (!$session->getBeforeAuthUrl() || $session->getBeforeAuthUrl() == Mage::getBaseUrl()) {
190
+
191
+ // Set default URL to redirect customer to
192
+ $session->setBeforeAuthUrl(Mage::getUrl("/"));
193
+ // Redirect customer to the last page visited after logging in
194
+ if ($session->isLoggedIn()) {
195
+ if (!Mage::getStoreConfigFlag('customer/startup/redirect_dashboard')) {
196
+ $referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME);
197
+ if ($referer) {
198
+ $referer = Mage::helper('core')->urlDecode($referer);
199
+ if ($this->_isUrlInternal($referer)) {
200
+ $session->setBeforeAuthUrl($referer);
201
+ }
202
+ }
203
+ } else if ($session->getAfterAuthUrl()) {
204
+ $session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
205
+ }
206
+ } else {
207
+ $session->setBeforeAuthUrl(Mage::helper('customer')->getLoginUrl());
208
+ }
209
+ } else if ($session->getBeforeAuthUrl() == Mage::helper('customer')->getLogoutUrl()) {
210
+ $session->setBeforeAuthUrl(Mage::helper('customer')->getDashboardUrl());
211
+ } else {
212
+ if (!$session->getAfterAuthUrl()) {
213
+ $session->setAfterAuthUrl($session->getBeforeAuthUrl());
214
+ }
215
+ if ($session->isLoggedIn()) {
216
+ $session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
217
+ }
218
+ }
219
+ $url = $session->getBeforeAuthUrl(true);
220
+
221
+ return $url;
222
+ }
223
+ }
224
+
app/code/local/OneID/Connector/controllers/OnepageController.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once("Mage/Checkout/controllers/OnepageController.php");
3
+
4
+ class OneID_Connector_OnepageController extends Mage_Checkout_OnepageController
5
+ {
6
+ /**
7
+ * save checkout billing address
8
+ */
9
+ public function saveBillingAction()
10
+ {
11
+ if ($this->_expireAjax()) {
12
+ return;
13
+ }
14
+ if ($this->getRequest()->isPost()) {
15
+ // $postData = $this->getRequest()->getPost('billing', array());
16
+ // $data = $this->_filterPostData($postData);
17
+ $data = $this->getRequest()->getPost('billing', array());
18
+ $customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
19
+
20
+ if (isset($data['email'])) {
21
+ $data['email'] = trim($data['email']);
22
+ }
23
+ $result = $this->getOnepage()->saveBilling($data, $customerAddressId);
24
+
25
+ if (!isset($result['error'])) {
26
+ /* check quote for virtual */
27
+ if ($this->getOnepage()->getQuote()->isVirtual()) {
28
+ $result['goto_section'] = 'payment';
29
+ //ONEID change
30
+ // Don't return updated payment section
31
+
32
+ } elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) {
33
+ $result['goto_section'] = 'shipping_method';
34
+ $result['update_section'] = array(
35
+ 'name' => 'shipping-method',
36
+ 'html' => $this->_getShippingMethodsHtml()
37
+ );
38
+
39
+ $result['allow_sections'] = array('shipping');
40
+ $result['duplicateBillingInfo'] = 'true';
41
+ } else {
42
+ $result['goto_section'] = 'shipping';
43
+ }
44
+ }
45
+
46
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Create order action
52
+ */
53
+ public function saveOrderAction()
54
+ {
55
+ if ($this->_expireAjax()) {
56
+ return;
57
+ }
58
+
59
+ if (Mage::helper("OneID")->isQuoteAuthRequired($this->getOnepage()->getQuote())) {
60
+ $data = $this->getRequest()->getPost('oneIDPurchaseAuthData', false);
61
+
62
+ $data = json_decode($data, true);
63
+ $validateResponse = Mage::helper("OneID")->validateOneIDResponse($data);
64
+ if (!$validateResponse['isValid']) {
65
+ Mage::log("Validating OneID Response returned this error :" . $validateResponse['error']);
66
+ $this->getResponse()->setBody( json_encode($validateResponse) );
67
+ return;
68
+ }
69
+
70
+
71
+ if (!Mage::helper("OneID")->validateAuthPurchaseResponse($data, $this->getOnepage()->getQuote()) ) {
72
+ $result['success'] = false;
73
+ $result['error'] = true;
74
+ $result['error_messages'] = "Required authorization from OneID.";
75
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
76
+ return;
77
+ }
78
+
79
+ }
80
+
81
+ return parent::saveOrderAction();
82
+ }
83
+ }
app/code/local/OneID/Connector/etc/config.xml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <OneID_Connector>
6
+ <version>0.1.0</version>
7
+ </OneID_Connector>
8
+ </modules>
9
+ <global>
10
+ <helpers>
11
+ <OneID>
12
+ <class>OneID_Connector_Helper</class>
13
+ </OneID>
14
+ </helpers>
15
+ <blocks>
16
+ <OneID>
17
+ <class>OneID_Connector_Block</class>
18
+ </OneID>
19
+ <checkout>
20
+ <rewrite>
21
+ <onepage_success>OneID_Connector_Block_Checkout_Onepage_Success</onepage_success>
22
+ </rewrite>
23
+ </checkout>
24
+ </blocks>
25
+ <resources>
26
+ <oneid_connector_setup>
27
+ <setup>
28
+ <module>OneID_Connector</module>
29
+ </setup>
30
+ <connection>
31
+ <use>core_setup</use>
32
+ </connection>
33
+ </oneid_connector_setup>
34
+ <oneid_connector_write>
35
+ <connection>
36
+ <use>core_write</use>
37
+ </connection>
38
+ </oneid_connector_write>
39
+ <oneid_connector_read>
40
+ <connection>
41
+ <use>core_read</use>
42
+ </connection>
43
+ </oneid_connector_read>
44
+ </resources>
45
+ </global>
46
+ <frontend>
47
+ <routers>
48
+ <OneID>
49
+ <use>standard</use>
50
+ <args>
51
+ <module>OneID_Connector</module>
52
+ <frontName>oneid</frontName>
53
+ </args>
54
+ </OneID>
55
+ <checkout>
56
+ <args>
57
+ <modules>
58
+ <OneID before="Mage_Checkout">OneID_Connector</OneID>
59
+ </modules>
60
+ </args>
61
+ </checkout>
62
+ </routers>
63
+ <layout>
64
+ <updates>
65
+ <oneidconnector>
66
+ <file>OneID.xml</file>
67
+ </oneidconnector>
68
+ </updates>
69
+ </layout>
70
+ </frontend>
71
+
72
+ <default>
73
+ <OneID>
74
+ <endpoint>
75
+ <helper_host>https://keychain.oneid.com</helper_host>
76
+ <host>https://api.oneid.com</host>
77
+ <api_id><![CDATA[00010001-a6ca-4ece-9d74-0f97f63fac4d]]></api_id>
78
+ <api_key><![CDATA[xxx]]></api_key>
79
+ </endpoint>
80
+ <auth_purchase>
81
+ <enabled>0</enabled>
82
+ <auth_amount>1000</auth_amount>
83
+ </auth_purchase>
84
+ <oneid_authentication>
85
+ <verified_email_required>0</verified_email_required>
86
+ </oneid_authentication>
87
+ </OneID>
88
+ </default>
89
+ <adminhtml>
90
+ <acl>
91
+ <resources>
92
+ <admin>
93
+ <children>
94
+ <system>
95
+ <children>
96
+ <config>
97
+ <children>
98
+ <OneID>
99
+ <title>OneId</title>
100
+ </OneID>
101
+ </children>
102
+ </config>
103
+ </children>
104
+ </system>
105
+ </children>
106
+ </admin>
107
+ </resources>
108
+ </acl>
109
+ </adminhtml>
110
+ </config>
app/code/local/OneID/Connector/etc/system.xml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <OneID translate="label" module="OneID">
5
+ <label>OneID</label>
6
+ <sort_order>300</sort_order>
7
+ </OneID>
8
+ </tabs>
9
+ <sections>
10
+ <OneID translate="label" module="OneID">
11
+ <label>OneID</label>
12
+ <tab>OneID</tab>
13
+ <show_in_default>1</show_in_default>
14
+ <groups>
15
+ <endpoint translate="label">
16
+ <label>API Endpoint Info</label>
17
+ <frontend_type>text</frontend_type>
18
+ <sort_order>0</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>0</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ <fields>
23
+ <host translate="label">
24
+ <label>API Endpoint Host</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>1</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>0</show_in_website>
29
+ <show_in_store>0</show_in_store>
30
+ </host>
31
+ <helper_host translate="label">
32
+ <label>Helper Service Host</label>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>1</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>0</show_in_website>
37
+ <show_in_store>0</show_in_store>
38
+ </helper_host>
39
+ <api_id translate="label">
40
+ <label>API ID</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>2</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>0</show_in_website>
45
+ <show_in_store>0</show_in_store>
46
+ </api_id>
47
+ <api_key translate="label">
48
+ <label>API Key</label>
49
+ <frontend_type>text</frontend_type>
50
+ <sort_order>3</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>0</show_in_website>
53
+ <show_in_store>0</show_in_store>
54
+ </api_key>
55
+ </fields>
56
+ </endpoint>
57
+ <oneid_authentication>
58
+ <label>OneID Authentication</label>
59
+ <frontend_type>text</frontend_type>
60
+ <sort_order>1</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>0</show_in_website>
63
+ <show_in_store>0</show_in_store>
64
+ <fields>
65
+ <verified_email_required translate="label">
66
+ <label>Require a OneID verified email to create Magento account?</label>
67
+ <frontend_type>select</frontend_type>
68
+ <source_model>adminhtml/system_config_source_yesno</source_model>
69
+ <backend_model>adminhtml/system_config_backend_secure</backend_model>
70
+ <sort_order>1</sort_order>
71
+ <show_in_default>1</show_in_default>
72
+ <show_in_website>0</show_in_website>
73
+ <show_in_store>0</show_in_store>
74
+ </verified_email_required>
75
+ </fields>
76
+ </oneid_authentication>
77
+ <auth_purchase>
78
+ <label>Authorize Purchases</label>
79
+ <frontend_type>text</frontend_type>
80
+ <sort_order>2</sort_order>
81
+ <show_in_default>1</show_in_default>
82
+ <show_in_website>0</show_in_website>
83
+ <show_in_store>0</show_in_store>
84
+ <fields>
85
+ <enabled translate="label">
86
+ <label>Require Authorization for purchases?</label>
87
+ <frontend_type>select</frontend_type>
88
+ <source_model>adminhtml/system_config_source_yesno</source_model>
89
+ <backend_model>adminhtml/system_config_backend_secure</backend_model>
90
+ <sort_order>1</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>0</show_in_website>
93
+ <show_in_store>0</show_in_store>
94
+ </enabled>
95
+ <auth_amount translate="label">
96
+ <label>Minimum amount to require purchase authorization</label>
97
+ <frontend_type>text</frontend_type>
98
+ <validate>validate-zero-or-greater</validate>
99
+ <sort_order>1</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>0</show_in_website>
102
+ <show_in_store>0</show_in_store>
103
+ </auth_amount>
104
+ </fields>
105
+ </auth_purchase>
106
+
107
+ </groups>
108
+ </OneID>
109
+ </sections>
110
+ </config>
app/code/local/OneID/Connector/sql/oneid_connector_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
6
+ $setup->addAttribute('customer', OneID_Connector_Helper_Data::ONEID_UID_ATTR_KEY, array(
7
+ 'label' => 'OneID UID',
8
+ 'type' => 'text',
9
+ 'input' => 'text',
10
+ 'visible' => false,
11
+ 'required' => false,
12
+ 'default' => ''
13
+ ));
14
+
15
+ // Go get an API key and ID.
16
+ $ch = curl_init("https://keychain.oneid.com/register/");
17
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
18
+ curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
19
+ if ($post !== null) {
20
+ curl_setopt($ch, CURLOPT_POST, 1);
21
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
22
+ }
23
+ $data = curl_exec($ch);
24
+
25
+ $json = json_decode($data, true);
26
+
27
+ // Set the api key and api id.
28
+ Mage::getConfig()->saveConfig(OneID_Connector_Helper_Data::API_ID_PATH, $json["API_ID"]);
29
+ Mage::getConfig()->saveConfig(OneID_Connector_Helper_Data::API_KEY_PATH, $json["API_KEY"]);
30
+
31
+ $installer->endSetup();
app/design/frontend/base/default/template/oneid/block/login.phtml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <div id="oneid-login-form-button" class="oneid-only oneid-login-container" style="float: right; margin-top: -7px; margin-right: 5px; display: block;" ></div>
2
+ <script type="text/javascript">
3
+ OneIdExtern.registerApiReadyFunction(function(){
4
+ OneId.loginButton(OneId.$("#oneid-login-form-button"), { "CHALJ" : <?php echo $this->helper("OneID")->getLoginCHALJ() ?> });
5
+ });
6
+ </script>
app/design/frontend/base/default/template/oneid/block/page/html/footer.phtml ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <script type="text/javascript">
3
+ OneIdExtern.registerApiReadyFunction(function(){
4
+ /*
5
+ * Magento -> OneId attribute mapping functions
6
+ */
7
+ var state_map = {
8
+ AL:1,
9
+ AK:2,
10
+ AS:3,
11
+ AZ:4,
12
+ AR:5,
13
+ AA:7,
14
+ AE:9,
15
+ AP:11,
16
+ CA:12,
17
+ CO:13,
18
+ CT:14,
19
+ DE:15,
20
+ DC:16,
21
+ FL:18,
22
+ GA:19,
23
+ GU:20,
24
+ HI:21,
25
+ ID:22,
26
+ IL:23,
27
+ IN:24,
28
+ IA:25,
29
+ KS:26,
30
+ LY:27,
31
+ LA:28,
32
+ ME:29,
33
+ MD:31,
34
+ MA:32,
35
+ MI:33,
36
+ MN:34,
37
+ MS:35,
38
+ MO:36,
39
+ MT:37,
40
+ NE:38,
41
+ NV:39,
42
+ NH:40,
43
+ NJ:41,
44
+ NM:42,
45
+ NY:43,
46
+ NC:44,
47
+ ND:45,
48
+ MP:46,
49
+ OH:47,
50
+ OK:48,
51
+ OR:49,
52
+ PA:51,
53
+ PR:52,
54
+ RI:53,
55
+ SC:54,
56
+ SD:55,
57
+ TN:56,
58
+ TX:57,
59
+ UT:58,
60
+ VT:59,
61
+ VI:60,
62
+ VA:61,
63
+ WA:62,
64
+ WV:63,
65
+ WI:64,
66
+ WY:65
67
+ }
68
+
69
+ OneIdUtil.registerAttributeMappingFunction("address[billing][state]", false, function(state_val){
70
+ return state_map[state_val];
71
+ });
72
+
73
+ OneIdUtil.registerAttributeMappingFunction("address[billing][state]", true, function(state_val){
74
+ for (state in state_map){
75
+ if (state_map[state] == state_val) {
76
+ return state;
77
+ }
78
+ }
79
+ return "";
80
+ });
81
+
82
+ OneIdUtil.registerAttributeMappingFunction("address[shipping][state]", false, function(state_val){
83
+ return state_map[state_val];
84
+ });
85
+
86
+ OneIdUtil.registerAttributeMappingFunction("address[shipping][state]", true, function(state_val){
87
+ for (state in state_map){
88
+ if (state_map[state] == state_val) {
89
+ return state;
90
+ }
91
+ }
92
+ return "";
93
+ });
94
+
95
+ // Show any items that require the API to be ready, but not that oneid be enabled.
96
+ OneId.$(".oneid-api-ready:not(.oneid-only)").show();
97
+
98
+ OneId.isUserEnabled(function(enabled){
99
+ if (enabled){
100
+ OneId.$(".oneid-only").show();
101
+ }
102
+ });
103
+ });
104
+ </script>
app/design/frontend/base/default/template/oneid/block/page/html/head.phtml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <script src="<?php echo $this->helper('OneID')->getEndpoint() ?>/form/form.js"></script>
2
+ <script src="<?php echo $this->helper('OneID')->getEndpoint() ?>/js/includeexternal.js" type="text/javascript"></script>
3
+ <script type="text/javascript">
4
+ // Init oneID
5
+ OneId.init({
6
+ repoHost : "<?php echo $this->helper('OneID')->getEndpoint() ?>"
7
+ });
8
+ </script>
app/design/frontend/base/default/template/oneid/block/page/html/newjavascript.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ ["AL","AK","AS","AZ","AR","CA","CO","CT","DE","DC","FL","GA","GU","HI","ID","IL","IN","IA","KS","LY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OJ","OK","OR","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY"]
2
+ ['US/AL', 'US/AK', 'US/AZ', 'US/AR', 'US/CA', 'US/CO', 'US/CT', 'US/DE', 'US/DC', 'US/FL', 'US/GA', 'US/HI', 'US/ID', 'US/IL', 'US/IN', 'US/IA', 'US/KS', 'US/KY', 'US/LA', 'US/ME', 'US/MD', 'US/MA', 'US/MI', 'US/MN', 'US/MS', 'US/MO', 'US/MT', 'US/NE', 'US/NV', 'US/NH', 'US/NJ', 'US/NM', 'US/NY', 'US/NC', 'US/ND', 'US/OH', 'US/OK', 'US/OR', 'US/PA', 'US/RI', 'US/SC', 'US/SD', 'US/TN', 'US/TX', 'US/UT', 'US/VT', 'US/VA', 'US/WA', 'US/WV', 'US/WI', 'US/WY']
app/design/frontend/base/default/template/oneid/checkout/cart.phtml ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Shopping cart template
30
+ *
31
+ * @see Mage_Checkout_Block_Cart
32
+ */
33
+ ?>
34
+ <div class="cart">
35
+ <p>foo</p>
36
+ <div class="page-title title-buttons">
37
+ <h1><?php echo $this->__('Shopping Cart') ?></h1>
38
+ <?php if(!$this->hasError()): ?>
39
+ <ul class="checkout-types">
40
+ <?php foreach ($this->getMethods('top_methods') as $method): ?>
41
+ <?php if ($methodHtml = $this->getMethodHtml($method)): ?>
42
+ <li><?php echo $methodHtml; ?></li>
43
+ <?php endif; ?>
44
+ <?php endforeach; ?>
45
+ </ul>
46
+ <?php endif; ?>
47
+ </div>
48
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
49
+ <?php echo $this->getChildHtml('form_before') ?>
50
+ <form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
51
+ <fieldset>
52
+ <table id="shopping-cart-table" class="data-table cart-table">
53
+ <col width="1" />
54
+ <col />
55
+ <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
56
+ <col width="1" />
57
+ <?php endif ?>
58
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
59
+ <col width="1" />
60
+ <?php endif; ?>
61
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
62
+ <col width="1" />
63
+ <?php endif; ?>
64
+ <col width="1" />
65
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
66
+ <col width="1" />
67
+ <?php endif; ?>
68
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
69
+ <col width="1" />
70
+ <?php endif; ?>
71
+ <col width="1" />
72
+
73
+ <?php $mergedCells = ($this->helper('tax')->displayCartBothPrices() ? 2 : 1); ?>
74
+ <thead>
75
+ <tr>
76
+ <th rowspan="<?php echo $mergedCells; ?>">&nbsp;</th>
77
+ <th rowspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Product Name') ?></span></th>
78
+ <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
79
+ <th rowspan="<?php echo $mergedCells; ?>" class="a-center"><span class="nobr"><?php echo $this->__('Move to Wishlist') ?></span></th>
80
+ <?php endif ?>
81
+ <th class="a-center" colspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Unit Price') ?></span></th>
82
+ <th rowspan="<?php echo $mergedCells; ?>" class="a-center"><?php echo $this->__('Qty') ?></th>
83
+ <th class="a-center" colspan="<?php echo $mergedCells; ?>"><?php echo $this->__('Subtotal') ?></th>
84
+ <th rowspan="<?php echo $mergedCells; ?>" class="a-center">&nbsp;</th>
85
+ </tr>
86
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
87
+ <tr>
88
+ <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
89
+ <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
90
+ <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
91
+ <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
92
+ </tr>
93
+ <?php endif; ?>
94
+ </thead>
95
+ <tfoot>
96
+ <tr>
97
+ <td colspan="50" class="a-right">
98
+ <?php if($this->getContinueShoppingUrl()): ?>
99
+ <button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
100
+ <?php endif; ?>
101
+ <button type="submit" title="<?php echo $this->__('Update Shopping Cart') ?>" class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart') ?></span></span></button>
102
+ </td>
103
+ </tr>
104
+ </tfoot>
105
+ <tbody>
106
+ <?php foreach($this->getItems() as $_item): ?>
107
+ <?php echo $this->getItemHtml($_item) ?>
108
+ <?php endforeach ?>
109
+ </tbody>
110
+ </table>
111
+ <script type="text/javascript">decorateTable('shopping-cart-table')</script>
112
+ </fieldset>
113
+ </form>
114
+ <div class="cart-collaterals">
115
+ <div class="col2-set">
116
+ <div class="col-1">
117
+ <?php echo $this->getChildHtml('crosssell') ?>
118
+ </div>
119
+ <div class="col-2">
120
+ <?php echo $this->getChildHtml('coupon') ?>
121
+ <?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>
122
+ </div>
123
+ </div>
124
+ <div class="totals">
125
+ <?php echo $this->getChildHtml('totals'); ?>
126
+ <?php if(!$this->hasError()): ?>
127
+ <ul class="checkout-types">
128
+ <?php foreach ($this->getMethods('methods') as $method): ?>
129
+ <?php if ($methodHtml = $this->getMethodHtml($method)): ?>
130
+ <li><?php echo $methodHtml; ?></li>
131
+ <?php endif; ?>
132
+ <?php endforeach; ?>
133
+ <li><?php echo $this->helper('OneID')->getCheckoutCombo() ?></li>
134
+ </ul>
135
+ <?php endif; ?>
136
+ </div>
137
+ </div>
138
+ </div>
app/design/frontend/base/default/template/oneid/checkout/onepage.phtml ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package enterprise_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <div class="opc-wrapper">
28
+ <div class="page-title">
29
+ <?php echo $this->getChildHtml('checkoutCallout') ?>
30
+ <h1><?php echo $this->__('Checkout') ?></h1>
31
+ </div>
32
+ <script type="text/javascript" src="<?php echo $this->getJsUrl('varien/accordion.js') ?>"></script>
33
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/opcheckout.js') ?>"></script>
34
+ <script type="text/javascript">countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>
35
+ <div class="opc-progress-container" id="col-right-opcheckout">
36
+ <?php echo $this->getChildHtml('checkoutProgress') ?>
37
+ </div>
38
+ <ol class="opc" id="checkoutSteps">
39
+ <?php $i=0; foreach($this->getSteps() as $_stepId => $_stepInfo): ?>
40
+ <?php if (!$this->getChild($_stepId) || !$this->getChild($_stepId)->isShow()): continue; endif; $i++ ?>
41
+ <li id="opc-<?php echo $_stepId ?>" class="section<?php echo !empty($_stepInfo['allow'])?' allow':'' ?><?php echo !empty($_stepInfo['complete'])?' saved':'' ?>">
42
+ <div class="step-title">
43
+ <span class="number"><?php echo $i ?></span>
44
+ <h2><?php echo $_stepInfo['label'] ?></h2>
45
+ <!--<a href="#"><?php echo $this->__('Edit') ?></a>-->
46
+ </div>
47
+ <div id="checkout-step-<?php echo $_stepId ?>" class="step a-item" style="display:none;">
48
+ <?php echo $this->getChildHtml($_stepId) ?>
49
+ </div>
50
+ </li>
51
+ <?php endforeach ?>
52
+ </ol>
53
+ <script type="text/javascript">
54
+ //<![CDATA[
55
+ var accordion = new Accordion('checkoutSteps', '.step-title', true);
56
+ <?php if($this->getActiveStep()): ?>
57
+ accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
58
+ <?php endif ?>
59
+ var checkout = new Checkout(accordion,{
60
+ progress: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
61
+ review: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
62
+ saveMethod: '<?php echo $this->getUrl('checkout/onepage/saveMethod') ?>',
63
+ failure: '<?php echo $this->getUrl('checkout/cart') ?>'}
64
+ );
65
+ //]]>
66
+ </script>
67
+
68
+
69
+ <script type="text/javascript">
70
+
71
+ <?php
72
+ $args = Mage::app()->getRequest()->getParams();
73
+ $_quote = Mage::getModel('checkout/cart')->getQuote();
74
+ ?>
75
+ OneIdExtern.registerApiReadyFunction(function(){
76
+ OneId.automateFormFill = "<?php echo $args["autoFill"] ? true : false ?>"
77
+ OneId.isUserEnabled(function(isEnabled){
78
+ if (OneId.automateFormFill && isEnabled){
79
+ OneId.$("#opc-login").hide();
80
+ OneId.$("#opc-billing").hide();
81
+ OneId.$("#opc-shipping").hide();
82
+ OneId.$("#opc-payment").hide();
83
+ OneId.$("#oneid-checkout-please-wait").show();
84
+
85
+
86
+ OneId.$("#login\\:guest").click();
87
+ OneId.$("#p_method_ccsave").click();
88
+
89
+ OneId.$("#register-xcustomer-password").hide();
90
+ OneId.$("#billing\\:customer_password").removeClass("required-entry");
91
+ OneId.$("#billing\\:confirm_password").removeClass("required-entry");
92
+ OneId.$("#checkout-step-review").show();
93
+
94
+ startBillingAddressFormFill();
95
+ }
96
+ });
97
+ });
98
+
99
+ var oneIDSaveAttributes = function() {
100
+ var data = {};
101
+ // Elements that were missing from oneID will have this CSS class attached.
102
+ var missing_fields = $$(".oneid-attr-missing");
103
+
104
+
105
+ if (missing_fields.length) {
106
+ for (var i=0; i < missing_fields.length; i++) {
107
+ var missing_field = missing_fields[i];
108
+ var oneidAttr = null;
109
+ var missing_field_id = missing_field.id;
110
+ // Need to go through the JSON blobs defining the forms to get
111
+ // the form_id -> oneid_attribute mapping.
112
+ if (billingAddressPostData["formData"][missing_field_id]) {
113
+ oneidAttr = billingAddressPostData["formData"][missing_field_id]["oneid_attribute"];
114
+ }
115
+ else if (shippingAddressPostData["formData"][missing_field_id]){
116
+ oneidAttr = shippingAddressPostData["formData"][missing_field_id]["oneid_attribute"];
117
+ }
118
+ else if (paymentPostData["formData"][missing_field_id]) {
119
+ oneidAttr = paymentPostData["formData"][missing_field_id]["oneid_attribute"];
120
+ }
121
+
122
+ if (oneidAttr) {
123
+ data[oneidAttr] = missing_field.value;
124
+ }
125
+
126
+ }
127
+
128
+ // Call the external setuserattributes, which proxies to server.
129
+ OneId.setUserAttributes(data, function(status){
130
+ oneidAuthorizePurchase();
131
+ });
132
+ }
133
+ else {
134
+ oneidAuthorizePurchase();
135
+ }
136
+ };
137
+ var oneidAuthorizePurchase = function() {
138
+ OneId.isUserLoggedIn(function(isLoggedIn){
139
+ if (isLoggedIn){
140
+ OneId.authSecuredTransaction({'auth_message' : '<?php echo Mage::helper("OneID")->getAuthPurchaseMessage($_quote) ?>',
141
+ 'amount' : '<?php echo $_quote->getGrandTotal() ?>',
142
+ 'challenge' : <?php echo Mage::helper("OneID")->getChalj('secureTransaction', $_quote) ?>
143
+ },
144
+ function(data) {
145
+ if (!data) {
146
+ return;
147
+ }
148
+ $("oneIDPurchaseAuthData").value = JSON.stringify(data);
149
+ review.save();
150
+ });
151
+ }
152
+
153
+ else{
154
+ review.save();
155
+ }
156
+ });
157
+ };
158
+ </script>
159
+
160
+
161
+
162
+ </div>
app/design/frontend/base/default/template/oneid/checkout/onepage/billing.phtml ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package enterprise_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <form id="co-billing-form" action="">
28
+ <fieldset>
29
+ <ul class="form-list">
30
+ <?php if ($this->customerHasAddresses()): ?>
31
+ <li class="form-alt">
32
+ <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
33
+ <div class="input-box">
34
+ <?php echo $this->getAddressesHtmlSelect('billing') ?>
35
+ </div>
36
+ </li>
37
+ <?php endif; ?>
38
+ <li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
39
+ <div class="fieldset">
40
+ <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
41
+ <ul>
42
+ <li class="fields">
43
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
44
+ </li>
45
+ <li>
46
+ <label for="billing:company"><?php echo $this->__('Company') ?></label>
47
+ <div class="input-box">
48
+ <input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
49
+ </div>
50
+ </li>
51
+ <?php if(!$this->isCustomerLoggedIn()): ?>
52
+ <li>
53
+ <label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
54
+ <div class="input-box">
55
+ <input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->htmlEscape($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
56
+ </div>
57
+ </li>
58
+ <?php endif ?>
59
+ <li>
60
+ <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
61
+ <div class="input-box">
62
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" class="input-text required-entry" />
63
+ </div>
64
+ </li>
65
+ <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
66
+ <li class="add-field">
67
+ <div class="input-box">
68
+ <input type="text" title="<?php echo $this->__('Street Address '.$_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i?>" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" class="input-text" />
69
+ </div>
70
+ </li>
71
+ <?php endfor ?>
72
+ <li class="fields">
73
+ <div class="field">
74
+ <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
75
+ <div class="input-box">
76
+ <input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" class="input-text required-entry" id="billing:city" />
77
+ </div>
78
+ </div>
79
+ <div class="field">
80
+ <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
81
+ <div class="input-box">
82
+ <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
83
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
84
+ </select>
85
+ <script type="text/javascript">
86
+ $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
87
+ </script>
88
+ <input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
89
+ </div>
90
+ </div>
91
+ </li>
92
+ <li class="fields">
93
+ <div class="field">
94
+ <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
95
+ <div class="input-box">
96
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international required-entry" />
97
+ </div>
98
+ </div>
99
+ <div class="field">
100
+ <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
101
+ <div class="input-box">
102
+ <?php echo $this->getCountryHtmlSelect('billing') ?>
103
+ </div>
104
+ </div>
105
+ </li>
106
+ <li class="fields">
107
+ <div class="field">
108
+ <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
109
+ <div class="input-box">
110
+ <input type="text" name="billing[telephone]" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" id="billing:telephone" />
111
+ </div>
112
+ </div>
113
+ <div class="field">
114
+ <label for="billing:fax"><?php echo $this->__('Fax') ?></label>
115
+ <div class="input-box">
116
+ <input type="text" name="billing[fax]" value="<?php echo $this->htmlEscape($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text" id="billing:fax" />
117
+ </div>
118
+ </div>
119
+ </li>
120
+
121
+ <?php $addressAttributes = $this->getChild('customer_form_billing_address_user_defined_attributes');?>
122
+ <?php if ($addressAttributes): ?>
123
+ <?php $addressAttributes->setEntity($this->getAddress())->setEntityType('customer_address');?>
124
+ <?php $addressAttributes->setFieldIdFormat('billing:%1$s')->setFieldNameFormat('billing[%1$s]');?>
125
+ <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
126
+ <?php endif;?>
127
+
128
+ <?php if(!$this->isCustomerLoggedIn()): ?>
129
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
130
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
131
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
132
+ <?php if ($_dob->isEnabled() || $_taxvat->isEnabled() || $_gender->isEnabled() ): ?>
133
+ <li class="fields">
134
+ <?php if ($_dob->isEnabled()): ?>
135
+ <div class="field">
136
+ <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())
137
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
138
+ </div>
139
+ <?php endif; ?>
140
+ <?php if ($_taxvat->isEnabled()): ?>
141
+ <div class="field">
142
+ <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())
143
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
144
+ </div>
145
+ <?php endif ?>
146
+ <?php if ($_gender->isEnabled()): ?>
147
+ <div class="field">
148
+ <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())
149
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
150
+ </div>
151
+ <?php endif ?>
152
+ </li>
153
+ <?php endif; ?>
154
+ <?php $customerAttributes = $this->getChild('customer_form_customer_user_defined_attributes');?>
155
+ <?php if ($customerAttributes): ?>
156
+ <?php $customerAttributes->setEntityModelClass('customer/customer')->setFieldIdFormat('billing:%1$s');?>
157
+ <?php $customerAttributes->setFieldNameFormat('billing[%1$s]')->setShowContainer(false);?>
158
+ <?php echo $customerAttributes->setExcludeFileAttributes(true)->toHtml()?>
159
+ <?php endif;?>
160
+ <li class="fields" id="register-customer-password">
161
+ <div class="field">
162
+ <label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
163
+ <div class="input-box">
164
+ <input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
165
+ </div>
166
+ </div>
167
+ <div class="field">
168
+ <label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
169
+ <div class="input-box">
170
+ <input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
171
+ </div>
172
+ </div>
173
+ </li>
174
+ <?php endif; ?>
175
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
176
+ <li class="control">
177
+ <div class="input-box">
178
+ <input type="checkbox" name="billing[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="billing:save_in_address_book" onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" />
179
+ </div>
180
+ <label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
181
+ </li>
182
+ <?php else:?>
183
+ <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
184
+ <?php endif; ?>
185
+ </ul>
186
+ </div>
187
+ </li>
188
+ <?php if ($this->canShip()): ?>
189
+ <li class="control">
190
+ <div class="input-box">
191
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> onclick="$('shipping:same_as_billing').checked = true;" class="radio" />
192
+ </div>
193
+ <label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label>
194
+ </li>
195
+ <li class="control">
196
+ <div class="input-box">
197
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> onclick="$('shipping:same_as_billing').checked = false;" class="radio" />
198
+ </div>
199
+ <label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
200
+ </li>
201
+ <?php endif; ?>
202
+ </ul>
203
+ <?php if (!$this->canShip()): ?>
204
+ <input type="hidden" name="billing[use_for_shipping]" value="1" />
205
+ <?php endif; ?>
206
+ </fieldset>
207
+
208
+
209
+ <script type="text/javascript">
210
+
211
+ OneIdExtern.registerApiReadyFunction(function(){
212
+ OneId.accuFillButton(OneId.$(".oneid-formfill-billing"), billingAddressPostData, "", function(completed){
213
+ if (!completed && OneId.automateFormFill){
214
+ recoverFromFailedOneidCheckout();
215
+ }
216
+ if (completed){
217
+ billingAddressFillSuccess();
218
+ }
219
+ });
220
+ });
221
+
222
+ var billingAddressFillSuccess = function() {
223
+ OneId.$("#p_method_ccsave").click();
224
+ OneId.$("#payment_form_ccsave").show();
225
+ billing.save();
226
+
227
+ if (OneId.automateFormFill) {
228
+ OneIdForm.fill(paymentPostData, "", false, function(completed){
229
+ if (!completed && OneId.automateFormFill){
230
+ recoverFromFailedOneidCheckout();
231
+ }
232
+ if (completed){
233
+ postPaymentFillFunction();
234
+ }
235
+ });
236
+ payment.resetLoadWaiting();
237
+ }
238
+ };
239
+
240
+ // Need this function for auto-filling.
241
+ var startBillingAddressFormFill = function() {
242
+ var attr = "<?php echo $this->helper('OneID')->getCheckoutAttr() ?>";
243
+
244
+ billingAddressPostData.additional_attrs = attr;
245
+
246
+ OneIdForm.fill(billingAddressPostData, "", false, function(completed){
247
+ if (!completed && OneId.automateFormFill){
248
+ recoverFromFailedOneidCheckout();
249
+ }
250
+ else {
251
+ if (completed){
252
+ billingAddressFillSuccess();
253
+ }
254
+ }
255
+ });
256
+ }
257
+
258
+ var recoverFromFailedOneidCheckout = function(){
259
+ OneId.$("#opc-login").show();
260
+ OneId.$("#opc-billing").show();
261
+ OneId.$("#opc-shipping").show();
262
+ OneId.$("#opc-payment").show();
263
+ OneId.$("#oneid-checkout-please-wait").hide();
264
+
265
+
266
+ OneId.$("#login\\:guest").click();
267
+ OneId.$("#p_method_ccsave").click();
268
+
269
+ OneId.$("#register-xcustomer-password").show();
270
+ OneId.$("#billing\\:customer_password").removeClass("required-entry");
271
+ OneId.$("#billing\\:confirm_password").removeClass("required-entry");
272
+ OneId.$("#checkout-step-review").hide();
273
+ }
274
+
275
+ var billingAddressMissingFields = function(missing_fields) {
276
+ if (OneId.automateFormFill){
277
+ recoverFromFailedOneidCheckout();
278
+ }
279
+ checkout.gotoSection("billing");
280
+ $("opc-billing").show();
281
+
282
+ };
283
+
284
+ var billingAddressPostData = {
285
+ "profile" : "checkout",
286
+ "templateId" : "",
287
+ "missingFieldsFunction" : "billingAddressMissingFields",
288
+ "postFillFunction" : "billingAddressFillSuccess",
289
+ "formData" : {
290
+ "billing:firstname" : {
291
+ "oneid_attribute" : ["personal_info[first_name]"]
292
+ },
293
+ "billing:lastname" : {
294
+ "oneid_attribute" : ["personal_info[last_name]"]
295
+
296
+ },
297
+ "billing:email" :{
298
+ "oneid_attribute" : ["personal_info[email]"]
299
+ },
300
+ "billing:street1" :{
301
+ "oneid_attribute" : "address[billing][street]"
302
+ },
303
+ "billing:street2" :{
304
+ "oneid_attribute" : "address[billing][street2]",
305
+ "required" : false
306
+ },
307
+ "billing:telephone" :{
308
+ "oneid_attribute" : "address[billing][phone]"
309
+ },
310
+ "billing:region_id" :{
311
+ "oneid_attribute" : "address[billing][state]"
312
+ },
313
+ "billing:city" : {
314
+ "oneid_attribute" : "address[billing][city]"
315
+ },
316
+ "billing:postcode" : {
317
+ "oneid_attribute" : "address[billing][zip]"
318
+ }
319
+ }
320
+ };
321
+
322
+ </script>
323
+ <div id="one-id-form-billing-address" class="one-id-form"></div>
324
+
325
+
326
+ <div class="buttons-set form-buttons btn-only" id="billing-buttons-container">
327
+ <button type="button" class="button" onclick="oneidBillingNextStep()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
328
+ <div name="AutoFill with OneID" class="oneid-only oneid-formfill-billing" style="float:right; margin-top:-7px; margin-right:5px;"></div>
329
+ <span id="billing-please-wait" class="please-wait" style="display:none;">
330
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
331
+ </span>
332
+ </div>
333
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
334
+ </form>
335
+ <script type="text/javascript">
336
+ //<![CDATA[
337
+
338
+ var oneidBillingNextStep = function() {
339
+ OneId.isUserEnabled( function (isEnabled) {
340
+ if (isEnabled) {
341
+ billingAddressFillSuccess();
342
+ $("opc-payment").show();
343
+ }
344
+ else {
345
+ billing.save();
346
+ }
347
+ });
348
+ };
349
+
350
+ var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
351
+ var billingForm = new VarienForm('co-billing-form');
352
+
353
+ //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
354
+ $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
355
+
356
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions, undefined, 'billing:postcode');
357
+ //]]>
358
+ </script>
app/design/frontend/base/default/template/oneid/checkout/onepage/link.phtml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <?php if ($this->isPossibleOnepageCheckout()):?>
28
+ <button type="button" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
29
+ <br/>
30
+ <button type="button" style="margin-top: 5px;" title="<?php echo $this->__('Check out with OneID') ?>" class="oneid-only button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>?autoFill=true';"><img src="<?php echo $this->helper('OneID')->getEndPoint()?>/images/checkout_large.png"></button>
31
+ <?php endif?>
app/design/frontend/base/default/template/oneid/checkout/onepage/login.phtml ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package enterprise_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <?php echo $this->getChildHtml('login_before')?>
28
+ <div class="col2-set<?php if (!$this->helper('customer')->isRegistrationAllowed() && !$this->getQuote()->isAllowedGuestCheckout()) echo ' login-only' ?>">
29
+ <div class="col-1">
30
+ <h4><?php echo $this->__('Login') ?></h4>
31
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
32
+ <form id="login-form" action="<?php echo $this->getPostAction() ?>" method="post">
33
+ <fieldset>
34
+ <p><?php echo $this->__('Already registered?') ?> <?php echo $this->__('Please log in below:') ?></p>
35
+ <ul class="form-list">
36
+ <li>
37
+ <label for="login-email"><?php echo $this->__('Email Address') ?></label>
38
+ <div class="input-box">
39
+ <input type="text" class="input-text required-entry validate-email" id="login-email" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" />
40
+ </div>
41
+ </li>
42
+ <li>
43
+ <label for="login-password"><?php echo $this->__('Password') ?></label>
44
+ <div class="input-box">
45
+ <input type="password" class="input-text validate-password required-entry" id="login-password" name="login[password]" />
46
+ </div>
47
+ </li>
48
+ </ul>
49
+ </fieldset>
50
+ <div class="buttons-set form-buttons btn-only">
51
+ <button type="button" class="button" onclick="loginForm.submit()"><span><span><?php echo $this->__('Login') ?></span></span></button>
52
+ <div class="oneid-only">
53
+
54
+ <div id="oneid-checkout-login-form" class="oneid-only oneid-login-container" style="" ></div>
55
+ <script type="text/javascript">
56
+ OneIdExtern.registerApiReadyFunction(function(){
57
+ OneId.loginButton(OneId.$("#oneid-checkout-login-form"), { "challenge" : <?php echo $this->helper("OneID")->getCheckoutLoginCHALJ() ?> });
58
+ });
59
+ </script>
60
+ </div>
61
+
62
+
63
+ <a href="<?php echo $this->getUrl('customer/account/forgotpassword') ?>"><?php echo $this->__('Forgot your password?') ?></a>
64
+ </div>
65
+ </form>
66
+ </div>
67
+ <?php if ( $this->getQuote()->isAllowedGuestCheckout() || $this->helper('customer')->isRegistrationAllowed() ): ?>
68
+ <div class="col-2">
69
+ <h4>
70
+ <?php if( $this->getQuote()->isAllowedGuestCheckout() && $this->helper('customer')->isRegistrationAllowed() ): ?>
71
+ <?php echo $this->__('Checkout as a Guest or Register') ?>
72
+ <?php elseif ( $this->getQuote()->isAllowedGuestCheckout() && !$this->helper('customer')->isRegistrationAllowed() ): ?>
73
+ <?php echo $this->__('Checkout as a Guest') ?>
74
+ <?php else: ?>
75
+ <?php echo $this->__('Register to Create an Account') ?>
76
+ <?php endif; ?>
77
+ </h4>
78
+ <?php if( !$this->getQuote()->isAllowedGuestCheckout() && $this->helper('customer')->isRegistrationAllowed() ): ?>
79
+ <p><strong><?php echo $this->__('Register and save time!') ?></strong><br />
80
+ <?php echo $this->__('Register with us for future convenience:') ?></p>
81
+ <ul>
82
+ <li><?php echo $this->__('Fast and easy check out') ?></li>
83
+ <li><?php echo $this->__('Easy access to your order history and status') ?></li>
84
+ </ul>
85
+ <?php elseif( $this->getQuote()->isAllowedGuestCheckout() && $this->helper('customer')->isRegistrationAllowed() ): ?>
86
+ <p><?php echo $this->__('Register with us for future convenience:') ?></p>
87
+ <?php endif ?>
88
+
89
+ <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
90
+ <ul class="form-list form-alt">
91
+ <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
92
+ <li>
93
+ <input type="radio" name="checkout_method" id="login:guest" value="guest"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_GUEST): ?> checked="checked"<?php endif; ?> class="radio" />
94
+ <label for="login:guest"><?php echo $this->__('Checkout as Guest') ?></label>
95
+ </li>
96
+ <?php endif; ?>
97
+ <?php if( $this->helper('customer')->isRegistrationAllowed() ): ?>
98
+ <li>
99
+ <input type="radio" name="checkout_method" id="login:register" value="register"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$this->getQuote()->isAllowedGuestCheckout()): ?> checked="checked"<?php endif ?> class="radio" />
100
+ <label for="login:register"><?php echo $this->__('Register') ?></label>
101
+ </li>
102
+ <?php endif; ?>
103
+ </ul>
104
+ <?php else: ?>
105
+ <input type="hidden" name="checkout_method" id="login:register" value="register" checked="checked" />
106
+ <?php endif; ?>
107
+ <div class="buttons-set">
108
+ <button type="button" class="button" onclick="checkout.setMethod();"><span><span><?php echo ($this->getQuote()->isAllowedGuestCheckout() ? $this->__('Continue') : $this->__('Register')) ?></span></span></button>
109
+ </div>
110
+ </div>
111
+ <?php endif; ?>
112
+ <script type="text/javascript">
113
+ //<![CDATA[
114
+ var loginForm = new VarienForm('login-form', true);
115
+ $('login-email').observe('keypress', bindLoginPost);
116
+ $('login-password').observe('keypress', bindLoginPost);
117
+ function bindLoginPost(evt){
118
+ if (evt.keyCode == Event.KEY_RETURN) {
119
+ loginForm.submit();
120
+ }
121
+ }
122
+ //]]>
123
+ </script>
124
+ </div>
app/design/frontend/base/default/template/oneid/checkout/onepage/payment.phtml ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package enterprise_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <script type="text/javascript">
28
+ //<![CDATA[
29
+ var quoteBaseGrandTotal = <?php echo (float)$this->getQuoteBaseGrandTotal(); ?>;
30
+ var payment = new Payment('co-payment-form', '<?php echo $this->getUrl('checkout/onepage/savePayment') ?>');
31
+ //]]>
32
+ </script>
33
+ <form action="" id="co-payment-form">
34
+ <fieldset>
35
+ <?php echo $this->getChildChildHtml('methods_additional', '', true, true) ?>
36
+ <?php echo $this->getChildHtml('methods') ?>
37
+ <input id='oneIDPurchaseAuthData' type="hidden" name="oneIDPurchaseAuthData" />
38
+ </fieldset>
39
+ <script>
40
+ OneIdExtern.registerApiReadyFunction(function(){
41
+ OneId.accuFillButton(OneId.$(".oneid-formfill-payment"), paymentPostData, "", function(completed){
42
+ if (!completed && OneId.automateFormFill){
43
+ recoverFromFailedOneidCheckout();
44
+ }
45
+ if (completed){
46
+ postPaymentFillFunction();
47
+ }
48
+ });
49
+ });
50
+
51
+
52
+ var postPaymentFillFunction = function() {
53
+ payment.resetLoadWaiting();
54
+
55
+ if (OneId.automateFormFill) {
56
+ // If we're auto form filling, need to show all the other accordian pieces.
57
+ payment.onSave = function(t){
58
+ payment.nextStep(t);
59
+ OneId.$("#oneid-checkout-please-wait").hide();
60
+ OneId.$("#opc-login").addClass("allow").show();
61
+ OneId.$("#opc-billing").addClass("allow").show();
62
+ OneId.$("#opc-shipping").addClass("allow").show();
63
+ OneId.$("#opc-payment").addClass("allow").show();
64
+ }
65
+ }
66
+
67
+ if (OneId.$("#ccsave_cc_cid,#authorizenet_cc_cid").length){
68
+ OneId.$("#oneid-checkout-please-wait").hide();
69
+ OneId.$("#opc-login").addClass("allow").show();
70
+ OneId.$("#opc-billing").addClass("allow").show();
71
+ OneId.$("#opc-shipping").addClass("allow").show();
72
+ OneId.$("#opc-payment").addClass("allow").show();
73
+ // We don't autofill the CVV, so lets focus on it
74
+ OneId.$("#ccsave_cc_cid").focus();
75
+ }
76
+ else{
77
+ payment.save();
78
+ }
79
+
80
+ };
81
+
82
+ var startPaymentsFormFill = function(){
83
+ var attr = "<?php echo $this->helper('OneID')->getCheckoutAttr() ?>";
84
+ paymentPostData.additional_attrs = attr;
85
+ OneIdForm.fill(paymentPostData);
86
+ }
87
+
88
+ var paymentMissingFields = function(missing_fields) {
89
+ $("opc-payment").show();
90
+ $("checkout-step-payment").show();
91
+ }
92
+
93
+ var paymentPostData = {
94
+ "profile" : "checkout",
95
+ "templateId" : "",
96
+ "missingFieldsFunction" : "paymentMissingFields",
97
+ "formData" : {
98
+ "ccsave_cc_owner" : {
99
+ "oneid_attribute" : "payment[cc_name_on_card]",
100
+ "oneid_class" : "",
101
+ "scope" : "oneID",
102
+ "format" : ""
103
+ },
104
+ "ccsave_cc_type" : {
105
+ "oneid_attribute" : "payment[cc_type]",
106
+ "oneid_class" : "",
107
+ "scope" : "oneID",
108
+ "format" : ""
109
+ },
110
+ "ccsave_cc_number" : {
111
+ "oneid_attribute" : "payment[cc_number]",
112
+ "oneid_class" : "",
113
+ "scope" : "oneID",
114
+ "format" : ""
115
+ },
116
+ "ccsave_expiration" : {
117
+ "oneid_attribute" : "payment[cc_exp_mo]",
118
+ "oneid_class" : "",
119
+ "scope" : "oneID",
120
+ "format" : ""
121
+ },
122
+ "ccsave_expiration_yr" : {
123
+ "oneid_attribute" : "payment[cc_exp_yr]",
124
+ "oneid_class" : "",
125
+ "scope" : "oneID",
126
+ "selector_type" : "base",
127
+ "format" : ""
128
+ }
129
+ }
130
+ };
131
+
132
+
133
+ </script>
134
+
135
+ <div id="one-id-form-payment" class="one-id-form"></div>
136
+ </form>
137
+ <div class="tool-tip" id="payment-tool-tip" style="display:none;">
138
+ <div class="btn-close"><a href="#" id="payment-tool-tip-close"><img src="<?php echo $this->getSkinUrl('images/btn_window_close.gif') ?>" alt="<?php echo $this->__('Close') ?>" title="<?php echo $this->__('Close') ?>" /></a></div>
139
+ <div class="tool-tip-content"><img src="<?php echo $this->getSkinUrl('images/cvv.gif') ?>" alt="<?php echo $this->__('Card Verification Number Visual Reference') ?>" title="<?php echo $this->__('Card Verification Number Visual Reference') ?>" /></div>
140
+ </div>
141
+ <?php echo $this->getChildChildHtml('additional') ?>
142
+ <div class="buttons-set" id="payment-buttons-container">
143
+ <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
144
+ <button type="button" class="button" onclick="payment.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
145
+ <div name="AutoFill with OneID" class="oneid-only oneid-formfill-payment" style="float:right; margin-top:-7px; margin-right:5px;">
146
+
147
+ </div>
148
+ <!-- <div name="AutoFill with OneID" class="oneid-only" type="button" style="float:right;">
149
+ <img class="oneid-button" src="<?php echo $this->helper('OneID')->getAccuFillButtonSrc() ?>" onClick="startPaymentsFormFill()" />
150
+ </div>-->
151
+
152
+ <span id="payment-please-wait" class="please-wait" style="display:none">
153
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
154
+ </span>
155
+ </div>
156
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
157
+ <script type="text/javascript">
158
+ //<![CDATA[
159
+ function toggleToolTip(event){
160
+ if($('payment-tool-tip')){
161
+ $('payment-tool-tip').setStyle({
162
+ top: (Event.pointerY(event)-515)+'px'//,
163
+ //left: (Event.pointerX(event)+100)+'px'
164
+ })
165
+ $('payment-tool-tip').toggle();
166
+ }
167
+ Event.stop(event);
168
+ }
169
+ if($('payment-tool-tip-close')){
170
+ Event.observe($('payment-tool-tip-close'), 'click', toggleToolTip);
171
+ }
172
+ //]]>
173
+ </script>
174
+ <script type="text/javascript">
175
+ //<![CDATA[
176
+ payment.currentMethod = "<?php echo $this->getChild('methods')->getSelectedMethodCode() ?>";
177
+ //]]>
178
+ </script>
app/design/frontend/base/default/template/oneid/checkout/onepage/review/button.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <button type="submit" title="<?php echo $this->__('Place Order') ?>" class="button btn-checkout" onclick="oneIDSaveAttributes()"><span><span><?php echo $this->__('Place Order') ?></span></span></button>
app/design/frontend/base/default/template/oneid/checkout/onepage/shipping.phtml ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package enterprise_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <form action="" id="co-shipping-form">
28
+ <fieldset>
29
+ <ul class="form-list">
30
+ <?php if ($this->customerHasAddresses()): ?>
31
+ <li class="form-alt">
32
+ <label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
33
+ <div class="input-box"><?php echo $this->getAddressesHtmlSelect('shipping') ?></div>
34
+ </li>
35
+ <?php endif ?>
36
+ <li id="shipping-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif ?>>
37
+ <div class="fieldset">
38
+ <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
39
+ <ul>
40
+ <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())
41
+ ->setFieldIdFormat('shipping:%s')->setFieldNameFormat('shipping[%s]')->setFieldParams('onchange="shipping.setSameAsBilling(false)"')->toHtml() ?>
42
+ </li>
43
+ <li>
44
+ <label for="shipping:company"><?php echo $this->__('Company') ?></label>
45
+ <div class="input-box">
46
+ <input type="text" id="shipping:company" name="shipping[company]" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" onchange="shipping.setSameAsBilling(false);" />
47
+ </div>
48
+ </li>
49
+ <?php if(false): ?>
50
+ <li>
51
+ <label for="shipping:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
52
+ <div class="input-box">
53
+ <input type="text" name="shipping[email]" id="shipping:email" value="<?php echo $this->htmlEscape($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
54
+ </div>
55
+ </li>
56
+ <?php endif ?>
57
+ <li>
58
+ <label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
59
+ <div class="input-box">
60
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="shipping[street][]" id="shipping:street1" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" class="input-text required-entry" onchange="shipping.setSameAsBilling(false);" />
61
+ </div>
62
+ </li>
63
+ <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
64
+ <li class="add-field">
65
+ <div class="input-box">
66
+ <input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="shipping[street][]" id="shipping:street<?php echo $_i?>" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" class="input-text" onchange="shipping.setSameAsBilling(false);" />
67
+ </div>
68
+ </li>
69
+ <?php endfor ?>
70
+ <li class="fields">
71
+ <div class="field">
72
+ <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
73
+ <div class="input-box">
74
+ <input type="text" title="<?php echo $this->__('City') ?>" name="shipping[city]" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" class="input-text required-entry" id="shipping:city" onchange="shipping.setSameAsBilling(false);" />
75
+ </div>
76
+ </div>
77
+ <div class="field">
78
+ <label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
79
+ <div class="input-box">
80
+ <select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
81
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
82
+ </select>
83
+ <script type="text/javascript">
84
+ $('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
85
+ </script>
86
+ <input type="text" id="shipping:region" name="shipping[region]" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
87
+ </div>
88
+ </div>
89
+ </li>
90
+ <li class="fields">
91
+ <div class="field">
92
+ <label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
93
+ <div class="input-box">
94
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international required-entry" onchange="shipping.setSameAsBilling(false);" />
95
+ </div>
96
+ </div>
97
+ <div class="field">
98
+ <label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
99
+ <div class="input-box">
100
+ <?php echo $this->getCountryHtmlSelect('shipping') ?>
101
+ </div>
102
+ </div>
103
+ </li>
104
+ <li class="fields">
105
+ <div class="field">
106
+ <label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
107
+ <div class="input-box">
108
+ <input type="text" name="shipping[telephone]" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" id="shipping:telephone" onchange="shipping.setSameAsBilling(false);" />
109
+ </div>
110
+ </div>
111
+ <div class="field">
112
+ <label for="shipping:fax"><?php echo $this->__('Fax') ?></label>
113
+ <div class="input-box">
114
+ <input type="text" name="shipping[fax]" value="<?php echo $this->htmlEscape($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text" id="shipping:fax" onchange="shipping.setSameAsBilling(false);" />
115
+ </div>
116
+ </div>
117
+ </li>
118
+ <?php $addressAttributes = $this->getChild('customer_form_shipping_address_user_defined_attributes');?>
119
+ <?php if ($addressAttributes): ?>
120
+ <?php $addressAttributes->setEntity($this->getAddress())->setEntityType('customer_address');?>
121
+ <?php $addressAttributes->setFieldIdFormat('shipping:%1$s')->setFieldNameFormat('shipping[%1$s]');?>
122
+ <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
123
+ <?php endif;?>
124
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
125
+ <li class="control">
126
+ <div class="input-box">
127
+ <input type="checkbox" name="shipping[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="shipping:save_in_address_book" onchange="shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" />
128
+ </div>
129
+ <label for="shipping:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
130
+ </li>
131
+ <?php else:?>
132
+ <li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
133
+ <?php endif;?>
134
+ <li class="control">
135
+ <div class="input-box">
136
+ <input type="checkbox" name="shipping[same_as_billing]" id="shipping:same_as_billing" value="1"<?php if($this->getAddress()->getSameAsBilling()): ?> checked="checked"<?php endif; ?> onclick="shipping.setSameAsBilling(this.checked)" class="checkbox" />
137
+ </div>
138
+ <label for="shipping:same_as_billing"><?php echo $this->__('Use Billing Address') ?></label>
139
+ </li>
140
+ </ul>
141
+ </div>
142
+ </li>
143
+ </ul>
144
+ </fieldset>
145
+ <script type="text/javascript">
146
+ var postShippingAddressFunction = function() { shipping.save(); };
147
+
148
+ var shippingAddressMissingFields = function(missing_fields) {
149
+ if (OneId.automateFormFill){
150
+ recoverFromFailedOneidCheckout();
151
+ }
152
+ checkout.gotoSection("shipping");
153
+ $("opc-shipping").show();
154
+ }
155
+
156
+ var shippingAddressPostData = {
157
+ "profile" : "checkout",
158
+ "templateId" : "",
159
+ "postFillFunction" : "postShippingAddressFunction",
160
+ "missingFieldsFunction" : "shippingAddressMissingFields",
161
+ "formData" : {
162
+ "shipping:firstname" : {
163
+ "oneid_attribute" : "personal_info[first_name]"
164
+ },
165
+ "shipping:lastname" : {
166
+ "oneid_attribute" : "personal_info[last_name]"
167
+ },
168
+ "shipping:street1" :{
169
+ "oneid_attribute" : "address[shipping][street]"
170
+ },
171
+ "shipping:street2" :{
172
+ "oneid_attribute" : "address[shipping][street2]",
173
+ "required": false
174
+ },
175
+ "shipping:telephone" :{
176
+ "oneid_attribute" : "address[shipping][phone]"
177
+ },
178
+ "shipping:region_id" :{
179
+ "oneid_attribute" : "address[shipping][state]"
180
+ },
181
+ "shipping:city" : {
182
+ "oneid_attribute" : "address[shipping][city]"
183
+ },
184
+ "shipping:postcode" : {
185
+ "oneid_attribute" : "address[shipping][zip]"
186
+ }
187
+ }
188
+ };
189
+ var startShippingAddressFormFill = function() {
190
+ var attr = "<?php echo $this->helper('OneID')->getCheckoutAttr() ?>";
191
+ OneIdForm.fill(shippingAddressPostData);
192
+ };
193
+
194
+ OneIdExtern.registerApiReadyFunction(function(){
195
+ OneId.accuFillButton(OneId.$(".oneid-formfill-shipping"), shippingAddressPostData, "", function(completed){
196
+ if (!completed && OneId.automateFormFill){
197
+ recoverFromFailedOneidCheckout();
198
+ }
199
+ if (completed){
200
+ postShippingAddressFunction();
201
+ }
202
+ });
203
+ });
204
+
205
+
206
+ </script>
207
+ <div id="one-id-form-shipping-address" class="one-id-form" ></div>
208
+
209
+ <div class="buttons-set form-buttons" id="shipping-buttons-container">
210
+ <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
211
+ <button type="button" class="button" onclick="shipping.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
212
+ <div name="AutoFill with OneID" class="oneid-only oneid-formfill-shipping" style="float:right; margin-top:-7px; margin-right:5px;"></div>
213
+
214
+ <span id="shipping-please-wait" class="please-wait" style="display:none;"><img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="" class="v-middle" /> <?php echo $this->__('Loading next step...') ?></span>
215
+ </div>
216
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
217
+ </form>
218
+ <script type="text/javascript">
219
+ //<![CDATA[
220
+ var shipping = new Shipping('co-shipping-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveShipping') ?>',
221
+ '<?php echo $this->getUrl('checkout/onepage/shippingMethod') ?>');
222
+ var shippingForm = new VarienForm('co-shipping-form');
223
+ shippingForm.extraChildParams = ' onchange="shipping.setSameAsBilling(false);"';
224
+ //shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
225
+ $('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
226
+
227
+ var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', countryRegions, undefined, 'shipping:postcode');
228
+ //]]>
229
+ </script>
app/design/frontend/base/default/template/oneid/checkout/success.phtml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <div class="page-title">
28
+ <h1><?php echo $this->__('Your order has been received') ?></h1>
29
+ </div>
30
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
31
+ <h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>
32
+
33
+ <?php if ($this->getOrderId()):?>
34
+ <?php if ($this->getCanViewOrder()) :?>
35
+ <p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
36
+ <?php else :?>
37
+ <p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?>.</p>
38
+ <?php endif;?>
39
+ <p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
40
+ <?php if ($this->getViewOrder() && $this->getCanPrintOrder()) :?>
41
+ <p>
42
+ <?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
43
+ <?php echo $this->getChildHtml() ?>
44
+ </p>
45
+ <?php endif;?>
46
+ <?php endif;?>
47
+
48
+ <?php if ($this->getAgreementRefId()): ?>
49
+ <p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?></p>
50
+ <?php endif;?>
51
+
52
+ <?php if ($profiles = $this->getRecurringProfiles()):?>
53
+ <p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
54
+ <ul class="disc">
55
+ <?php foreach($profiles as $profile):?>
56
+ <?php $profileIdHtml = ($this->getCanViewProfiles() ? sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id')));?>
57
+ <li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description')))?></li>
58
+ <?php endforeach;?>
59
+ </ul>
60
+ <?php endif;?>
61
+ <div class="buttons-set">
62
+ <button type="button" class="button" title="<?php echo $this->__('Continue Shopping') ?>" onclick="window.location='<?php echo $this->getUrl() ?>'"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
63
+ </div>
64
+
65
+
66
+ <?php $_order = $this->getOrder(); ?>
67
+ <div id="getAOneId" style="display: none" class="oneid-successpage-block">
68
+ <p>Make ordering here again easy! Click to sign up for OneID</p>
69
+ <p>
70
+ <div class="create_oneid_ctr"></div>
71
+ </p>
72
+ </div>
73
+ <script type="text/javascript">
74
+ OneIdExtern.registerApiReadyFunction(function(){
75
+ OneId.isUserLoggedIn(function(loggedIn){
76
+ if (!loggedIn){
77
+ var data = OneIdUtil.parseJSON('<?php echo $this->helper('OneID')->getCreateOndIdAttrsFromOrder($_order) ?>');
78
+ var challenge = <?php echo $this->helper("OneID")->getLoginCHALJ() ?>;
79
+ OneId.createOneIdButton(".create_oneid_ctr", data, challenge, function(success){
80
+ if (success){
81
+ // Hide the mssage, now that the user has created a OneID.
82
+ OneId.$("#getAOneId").hide();
83
+ }
84
+ });
85
+ OneId.$("#getAOneId").show();
86
+ }
87
+ });
88
+ });
89
+ </script>
app/design/frontend/base/default/template/oneid/customer/account/dashboard.phtml ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package enterprise_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <div class="dashboard">
28
+ <div class="page-title">
29
+ <h1><?php echo $this->__('My Dashboard') ?></h1>
30
+ </div>
31
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
32
+ <?php echo $this->getChildHtml('hello') ?>
33
+ <?php echo $this->getChildHtml('top') ?>
34
+ <h2 class="sub-title"><?php echo $this->__('Account Information') ?></h2>
35
+ <?php echo $this->getChildHtml('info') ?>
36
+ <?php $_customer = $this->getCustomer(); ?>
37
+
38
+ <div class="col2-set">
39
+ <div class="info-box">
40
+ <h3 class="box-title"><?php echo $this->__('OneID') ?></h3>
41
+ <div class="box-content">
42
+ <?php if (!$_customer->hasOneidUid() ): ?>
43
+
44
+ <?php
45
+ Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::getUrl("customer/account"));
46
+ ?>
47
+ <div class="oneid-account-edit-block">
48
+ <p><?php echo $this->__('Tired of remembering your username and password? Use OneID to quickly and safely sign into this website next time. It’s free!') ?></p>
49
+ <div id="oneid-link-your-oneid"></div>
50
+ <script type="text/javascript">
51
+ OneIdExtern.registerApiReadyFunction(function(){
52
+ OneId.loginButton(OneId.$("#oneid-link-your-oneid"),
53
+ {
54
+ "oneid_user_link" : true,
55
+ "user_data" : <?php echo $this->helper("OneID")->getCreateOneIdAttrs() ?>,
56
+ "challenge" : <?php echo $this->helper("OneID")->getLinkCHALJ() ?>
57
+ });
58
+ });
59
+ </script>
60
+ </div>
61
+ <?php else: ?>
62
+ <p>
63
+ This account is now protected by OneID
64
+ </p>
65
+ <br/>
66
+ <a href='<?php echo Mage::getUrl("oneid/connector/removeOneid/")?>'>
67
+ <img src="<?php echo $this->helper("OneID")->getEndPoint()?>/images/oneid_unlink.png"/>
68
+ </a>
69
+
70
+ <?php endif; ?>
71
+ </div>
72
+ </div>
73
+ </div>
74
+
75
+ <div class="clear"></div>
76
+
77
+ <?php echo $this->getChildHtml('address') ?>
78
+ <?php echo $this->getChildHtml('info1') ?>
79
+ <?php echo $this->getChildHtml('info2') ?>
80
+ </div>
81
+
82
+
83
+
app/design/frontend/base/default/template/oneid/customer/form/edit.phtml ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package enterprise_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <div class="page-title">
28
+ <h1><?php echo $this->__('Edit Account Information') ?></h1>
29
+ </div>
30
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
31
+ <form action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" id="form-validate" enctype="multipart/form-data">
32
+ <div class="fieldset">
33
+ <?php echo $this->getBlockHtml('formkey')?>
34
+ <h2 class="legend"><?php echo $this->__('Account Information') ?></h2>
35
+ <ul class="form-list">
36
+ <li class="fields">
37
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getCustomer())->toHtml() ?>
38
+ </li>
39
+ <li>
40
+ <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
41
+ <div class="input-box">
42
+ <input type="text" name="email" id="email" value="<?php echo $this->htmlEscape($this->getCustomer()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text required-entry validate-email" />
43
+ </div>
44
+ </li>
45
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
46
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
47
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
48
+ <?php if($_dob->isEnabled() || $_taxvat->isEnabled() || $_gender->isEnabled()): ?>
49
+ <li class="fields">
50
+ <?php if ($_dob->isEnabled()): ?>
51
+ <div class="field"><?php echo $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?></div>
52
+ <?php endif ?>
53
+ <?php if ($_taxvat->isEnabled()): ?>
54
+ <div class="field"><?php echo $_taxvat->setTaxvat($this->getCustomer()->getTaxvat())->toHtml() ?></div>
55
+ <?php endif ?>
56
+ <?php if ($_gender->isEnabled()): ?>
57
+ <div class="field"><?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?></div>
58
+ <?php endif ?>
59
+ </li>
60
+ <?php endif ?>
61
+ <li class="control">
62
+ <div class="input-box">
63
+ <input type="checkbox" name="change_password" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="<?php echo $this->__('Change Password') ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> class="checkbox" />
64
+ </div>
65
+ <label for="change_password"><?php echo $this->__('Change Password') ?></label>
66
+ </li>
67
+ </ul>
68
+ </div>
69
+ <?php $userDefinedAttributes = $this->getLayout()->getBlock('customer_form_user_attributes'); ?>
70
+ <?php if ($userDefinedAttributes):?>
71
+ <?php echo $userDefinedAttributes->setEntity($this->getCustomer())->toHtml(); ?>
72
+ <?php endif;?>
73
+ <div class="fieldset" style="display:none;">
74
+ <h2 class="legend"><?php echo $this->__('Change Password') ?></h2>
75
+ <ul class="form-list">
76
+ <li class="fields">
77
+ <div class="field">
78
+ <label for="current_password"><?php echo $this->__('Current Password') ?></label>
79
+ <div class="input-box">
80
+ <input type="password" class="input-text" name="current_password" id="current_password" />
81
+ </div>
82
+ </div>
83
+ </li>
84
+ <li class="fields">
85
+ <div class="field">
86
+ <label for="password"><?php echo $this->__('New Password') ?></label>
87
+ <div class="input-box">
88
+ <input type="password" class="input-text validate-password" name="password" id="password" />
89
+ </div>
90
+ </div>
91
+ <div class="field">
92
+ <label for="confirmation"><?php echo $this->__('Confirm New Password') ?></label>
93
+ <div class="input-box">
94
+ <input type="password" class="input-text validate-cpassword" name="confirmation" id="confirmation" />
95
+ </div>
96
+ </div>
97
+ </li>
98
+ </ul>
99
+ </div>
100
+
101
+ <div class="buttons-set form-buttons">
102
+ <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>&laquo; </small><?php echo $this->__('Go back') ?></a></p>
103
+ <button type="submit" class="button" title="<?php echo $this->__('Save') ?>"><span><span><?php echo $this->__('Save') ?></span></span></button>
104
+ </div>
105
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
106
+ </form>
107
+
108
+ <script type="text/javascript">
109
+ //<![CDATA[
110
+ var dataForm = new VarienForm('form-validate', true);
111
+ function setPasswordForm(arg){
112
+ if(arg){
113
+ $('current_password').up(4).show();
114
+ $('current_password').addClassName('required-entry');
115
+ $('password').addClassName('required-entry');
116
+ $('confirmation').addClassName('required-entry');
117
+
118
+ }else{
119
+ $('current_password').up(4).hide();
120
+ $('current_password').removeClassName('required-entry');
121
+ $('password').removeClassName('required-entry');
122
+ $('confirmation').removeClassName('required-entry');
123
+ }
124
+ }
125
+ <?php if($this->getCustomer()->getChangePassword()): ?>
126
+ setPasswordForm(true);
127
+ <?php endif; ?>
128
+ //]]>
129
+ </script>
app/design/frontend/base/default/template/oneid/customer/form/forgotpassword.phtml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package enterprise_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <div class="page-title">
28
+ <h1><?php echo $this->__('Forgot Your Password?') ?></h1>
29
+ </div>
30
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
31
+ <form action="<?php echo $this->getUrl('*/*/forgotpasswordpost') ?>" method="post" id="form-validate">
32
+ <div class="fieldset">
33
+ <p><?php echo $this->__('Please enter your email below and we will send you a new password.') ?></p>
34
+ <ul class="form-list">
35
+ <li>
36
+ <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
37
+ <div class="input-box">
38
+ <input type="text" name="email" alt="email" id="email_address" class="input-text required-entry validate-email" value="<?php echo $this->htmlEscape($this->getEmailValue()) ?>" />
39
+ </div>
40
+ </li>
41
+ </ul>
42
+ </div>
43
+ <div class="buttons-set form-buttons">
44
+ <p class="back-link"><a href="<?php echo $this->helper('customer')->getLoginUrl() ?>"><small>&laquo; </small><?php echo $this->__('Go back') ?></a></p>
45
+ <button type="submit" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
46
+ </div>
47
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
48
+ <div class="oneid-forgotpassword-block behind-hollow-box">
49
+ <p>
50
+ <?php echo $this->__('Instead of having to remember a password, log in with OneID. It\'s a safe, secure, and easy way to login without having to remember a password. ') ?>
51
+ <div id="oneid-login-form-button" class="oneid-only oneid-login-container" style="display: block;" ></div>
52
+ </p>
53
+ <script type="text/javascript">
54
+ OneIdExtern.registerApiReadyFunction(function(){
55
+ OneId.loginButton(OneId.$("#oneid-login-form-button"), { "challenge" : <?php echo $this->helper("OneID")->getLoginCHALJ() ?> });
56
+ });
57
+ </script>
58
+ </div>
59
+ </form>
60
+
61
+ <script type="text/javascript">
62
+ //<![CDATA[
63
+ var dataForm = new VarienForm('form-validate', true);
64
+ //]]>
65
+ </script>
app/design/frontend/base/default/template/oneid/form/login.phtml ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package enterprise_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Customer login form template
30
+ *
31
+ * @see Mage_Customer_Block_Form_Login
32
+ */
33
+ ?>
34
+
35
+
36
+ <div class="account-login<?php if (!$this->helper('customer')->isRegistrationAllowed()) echo ' login-only' ?>">
37
+ <div class="page-title">
38
+ <h1><?php if ($this->helper('customer')->isRegistrationAllowed()): ?>
39
+ <?php echo $this->__('Login or Create an Account') ?>
40
+ <?php else: ?>
41
+ <?php echo $this->__('Login'); ?>
42
+ <?php endif; ?></h1>
43
+ </div>
44
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
45
+ <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
46
+ <div class="fieldset">
47
+ <div class="col2-set">
48
+ <div class="col-1 registered-users">
49
+ <h2 class="legend"><?php echo $this->__('Registered Customers') ?></h2>
50
+ <p><?php echo $this->__('If you have an account with us, log in using your email address.') ?></p>
51
+ <ul class="form-list">
52
+ <li>
53
+ <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
54
+ <div class="input-box">
55
+ <input name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" id="email" type="text" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
56
+ </div>
57
+ </li>
58
+ <li>
59
+ <label for="pass" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
60
+ <div class="input-box">
61
+ <input name="login[password]" type="password" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
62
+ </div>
63
+ </li>
64
+ </ul>
65
+ <div class="buttons-set form-buttons btn-only">
66
+ <div id="oneid-login-form-button" class="oneid-only oneid-login-container" style="float: left; margin-top: -7px; margin-right: 5px; display: block;" ></div>
67
+ <script type="text/javascript">
68
+ OneIdExtern.registerApiReadyFunction(function(){
69
+ OneId.loginButton(OneId.$("#oneid-login-form-button"), { "challenge" : <?php echo $this->helper("OneID")->getLoginCHALJ() ?> });
70
+ });
71
+ </script>
72
+ <button type="submit" class="button" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
73
+ <a href="<?php echo $this->getForgotPasswordUrl() ?>"><?php echo $this->__('Forgot Your Password?') ?></a>
74
+ </div>
75
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
76
+ </div>
77
+ <?php if ($this->helper('customer')->isRegistrationAllowed()): ?>
78
+ <div class="col-2 new-users">
79
+ <h2 class="legend"><?php echo $this->__('New Customers') ?></h2>
80
+ <p><?php echo $this->__('By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.') ?></p>
81
+ <div class="buttons-set">
82
+ <button type="button" class="button" onclick="window.location='<?php echo $this->getCreateAccountUrl() ?>';"><span><span><?php echo $this->__('Register') ?></span></span></button>
83
+ </div>
84
+ </div>
85
+ <?php endif; ?>
86
+ </div>
87
+ </div>
88
+ </form>
89
+ <script type="text/javascript">
90
+ //<![CDATA[
91
+ var dataForm = new VarienForm('login-form', true);
92
+ //]]>
93
+ </script>
94
+ </div>
app/design/frontend/base/default/template/oneid/form/traditional_login.phtml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package enterprise_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Customer login form template
30
+ *
31
+ * @see Mage_Customer_Block_Form_Login
32
+ */
33
+ ?>
34
+
35
+
36
+ <div class="account-login login-only">
37
+ <div class="page-title">
38
+ <h1>
39
+ <?php echo $this->__('Login to complete OneID link.') ?>
40
+ </h1>
41
+ </div>
42
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
43
+ <form action="<?php echo $this->getUrl("oneid/account/loginPost") ?>" method="post" id="login-form">
44
+ <div class="fieldset">
45
+ <div class="col2-set">
46
+ <div class="col-1 registered-users">
47
+ <h2 class="legend"><?php echo $this->__('Registered Customers') ?></h2>
48
+ <p><?php echo $this->__('To complete your OneID linking, please login.') ?></p>
49
+ <ul class="form-list">
50
+ <li>
51
+ <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
52
+ <div class="input-box">
53
+ <input name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" id="email" type="text" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
54
+ </div>
55
+ </li>
56
+ <li>
57
+ <label for="pass" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
58
+ <div class="input-box">
59
+ <input name="login[password]" type="password" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
60
+ </div>
61
+ </li>
62
+ </ul>
63
+ <div class="buttons-set form-buttons btn-only">
64
+ <button type="submit" class="button" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
65
+ <a href="<?php echo $this->getForgotPasswordUrl() ?>"><?php echo $this->__('Forgot Your Password?') ?></a>
66
+ </div>
67
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </form>
72
+ <script type="text/javascript">
73
+ //<![CDATA[
74
+ var dataForm = new VarienForm('login-form', true);
75
+ //]]>
76
+ </script>
77
+ </div>
app/etc/modules/Oneid_Connector.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <OneID_Connector>
6
+ <active>true</active>
7
+ <codePool>local</codePool>
8
+ </OneID_Connector>
9
+ </modules>
10
+ </config>
package.xml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>OneID</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>Apache Software License (ASL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Allow your customers to use their OneID account to easily sign in, and check out at your store.</summary>
10
+ <description>&lt;p&gt;OneID is an easy-to-integrate digital identity service that lets makes it one-click easy for users to sign into your site. With OneID, you&#x2019;ll never again have to deal with lost or forgotten password issues, saving you time and money.&lt;/p&gt;&#xD;
11
+ &#xD;
12
+ &lt;h3&gt;Benefits for you&lt;/h3&gt;&#xD;
13
+ &#xD;
14
+ Reduced costs: No more lost password support is needed, saving you time and money.&#xD;
15
+ Secured accounts: Layered security protects customers (and you) against breaches and attacks, like phishing and malware.&#xD;
16
+ Mobile acceleration: One-click sign in makes it easy for users to login while on their mobile devices.&#xD;
17
+ For your users, OneID offers&#xD;
18
+ Easy Checkout: Allow your customers (those with accounts and guest checkouts) to fill out your check out forms with a single click of a OneID checkout button.&#xD;
19
+ &#xD;
20
+ Privacy: OneID does not track any user behavior &#x2013; and certainly won&#x2019;t share it.&#xD;
21
+ Security: OneID secures customer information using three separate cryptographic combinations across multiple devices.&#xD;
22
+ Convenience: OneID removes the hassle of having to remember user names and passwords.&#xD;
23
+ And along with all those great benefits to you and your users, with this plugin you'll also get to use OneID to log into and administer your WordPress site using your OneID.</description>
24
+ <notes>First release including : OneID sign in, OneID checkout, OneID quickfill (for onepage checkout)</notes>
25
+ <authors><author><name>OneID</name><user>bpk_oneid</user><email>bpk@oneid.com</email></author></authors>
26
+ <date>2013-01-16</date>
27
+ <time>17:52:23</time>
28
+ <contents><target name="magelocal"><dir name="OneID"><dir name="Connector"><dir name="Block"><dir name="Checkout"><dir name="Onepage"><file name="Success.php" hash="94f38f858a45304c10138c3a1b265490"/></dir></dir><file name="Login.php" hash="3cb291ca3f4700f279735fdeb544a8b3"/></dir><dir name="Helper"><file name="Data.php" hash="6b6bcce51cc6330beebd788c477b7b25"/></dir><dir name="controllers"><file name="AccountController.php" hash="2401a0a519aac21bebeee77233fd0b03"/><file name="ConnectorController.php" hash="ea726d60099a66c2e63ad27fa1af5b8c"/><file name="OnepageController.php" hash="78d2dbae1606057fb3544296351898d8"/></dir><dir name="etc"><file name="config.xml" hash="cd1e65278f1c6a46103e68ff054ccaaa"/><file name="system.xml" hash="d47ac462cf6efd529aca557fad1b890e"/></dir><dir name="sql"><dir name="oneid_connector_setup"><file name="mysql4-install-0.1.0.php" hash="cad7569ee96103d087bf077661c1cafe"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="OneID.xml" hash=""/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="oneid"><dir name="block"><file name="login.phtml" hash="787f58873550105c3318baa8b0b77ded"/><dir name="page"><dir name="html"><file name="footer.phtml" hash="c4059028bd7db7b0f0d3b157157cea60"/><file name="head.phtml" hash="9dd7e46b5c3ce6eb4e92ef6738d55dc6"/><file name="newjavascript.js" hash="c9e0fa9a4851c0070614f605ebac8257"/></dir></dir></dir><dir name="checkout"><file name="cart.phtml" hash="e5432a7db576f10b3db7f0fbf4a8ad78"/><dir name="onepage"><file name="billing.phtml" hash="d80ce52901d86da87d3c602830d52513"/><file name="link.phtml" hash="504d5a93296a4da2e243261ac7b6793d"/><file name="login.phtml" hash="0a2414f1d6828b55f0a1dc840b81c75f"/><file name="payment.phtml" hash="3b40fd7ef0091e7f7e304aac4b79e950"/><dir name="review"><file name="button.phtml" hash="7646991c5b937654771fa78627e49c95"/></dir><file name="shipping.phtml" hash="73b243968ad4c1abace6a92acf2b1ada"/></dir><file name="onepage.phtml" hash="5629b4c56a420eeb122d321404e8d0c9"/><file name="success.phtml" hash="744a8e75d1c06d7639fdc9281a1ab309"/></dir><dir name="customer"><dir name="account"><file name="dashboard.phtml" hash="bfc5cfa1f832004a10fa46f0dc110116"/></dir><dir name="form"><file name="edit.phtml" hash="5bad31a618e58da3ccad097655c9bdab"/><file name="forgotpassword.phtml" hash="a4bb8bf03b907a0e8cbb2b86a45950ae"/></dir></dir><dir name="form"><file name="login.phtml" hash="9f6d54bc1628d0b58c1b68284d52aac4"/><file name="traditional_login.phtml" hash="cd9a54a89a9408ac40f460df55bc20fc"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="oneid.css" hash="ab21ae320804ed42baaa587d9ad1804d"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Oneid_Connector.xml" hash="436ae58c4d1a855c664ab921b7b0ad44"/></dir></target></contents>
29
+ <compatible/>
30
+ <dependencies><required><php><min>5.0.0</min><max>5.4.10</max></php></required></dependencies>
31
+ </package>
skin/frontend/base/default/css/oneid.css ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .oneid-auto-filled {
2
+
3
+ }
4
+
5
+ /*.oneid-attr-missing {
6
+ background: url("../images/bkg_input-failed.gif") repeat-x scroll 0 0 #FFF7F5 !important;
7
+ border: 1px solid #F47D4E !important;
8
+ }*/
9
+
10
+ .cart .title-buttons .checkout-types {
11
+ text-align: center;
12
+ }
13
+
14
+ .cart .totals .checkout-types {
15
+ text-align:center;
16
+ }
17
+
18
+ .oneid-api-ready {
19
+ display:none;
20
+ }
21
+
22
+ .oneid-only {
23
+ display:none;
24
+ }
25
+
26
+ .oneid-forgotpassword-block {
27
+ margin: 0;
28
+ padding: 5px 0 7px;
29
+ /* text-align: right;*/
30
+ width: 620px;
31
+ font-size: 12px;
32
+ background: #DEDEDE url(../images/bkg_nav.gif) 0 0 no-repeat;
33
+ }
34
+
35
+ .oneid-successpage-block {
36
+ margin: 0;
37
+ padding: 5px 0 7px;
38
+ /* text-align: right;*/
39
+ font-size: 12px;
40
+ background: #DEDEDE url(../images/bkg_nav.gif) 0 0 no-repeat;
41
+ }
42
+
43
+ .oneid-forgotpassword-block p{
44
+ font-weight: bold;
45
+ margin-left : 5px;
46
+ margin-right : 5px;
47
+ }
48
+
49
+ .oneid-forgot-password-login-ctr {
50
+ margin: 0;
51
+ padding: 5px 0 7px;
52
+ text-align: right;
53
+ width: 620px;
54
+ font-size: 12px;
55
+ }