OneID - Version 1.0.10

Version Notes

Refactor the changes made to Onepage checkout to mostly one block.

Download this release

Release Info

Developer OneID
Extension OneID
Version 1.0.10
Comparing to
See all releases


Code changes from version 1.0.9 to 1.0.10

app/code/community/OneID/README.txt CHANGED
@@ -16,24 +16,27 @@ This will likely include you modifying your
16
 
17
  app/design/frontend/base/default/template/customer/form/login.phtml
18
 
19
- to render the block.
 
20
 
21
  ## Getting the OneID Quick Fill buttons to show up ##
22
 
23
- We built our templates based off of the 1.7 community edition. If you use this version
24
- and use the Magento Onepage Checkout, you should be good to go. If you've made customizations
25
- to your checkout, you can copy/paste the OneID blocks into your theme. The important files for Quickfill are:
26
 
27
- app/design/frontend/base/default/template/oneid/checkout/onepage.pthml
28
 
29
- OneID signin button on guest checkout
30
- app/design/frontend/base/default/template/oneid/checkout/onepage/login.phtml
31
 
32
- OneID Quickfill button on billing section
33
- app/design/frontend/base/default/template/oneid/checkout/onepage/billing.phtml
 
 
 
 
 
 
 
 
34
 
35
- OneID Quickfill button on shipping section
36
- app/design/frontend/base/default/template/oneid/checkout/onepage/shipping.phtml
37
 
38
- OneId Quickfill button on payment section
39
- app/design/frontend/base/default/template/oneid/checkout/onepage/payment.phtml
16
 
17
  app/design/frontend/base/default/template/customer/form/login.phtml
18
 
19
+ to render the block as follows :
20
+ <?php echo $this->getChildHtml("oneid_signin_button"); ?>
21
 
22
  ## Getting the OneID Quick Fill buttons to show up ##
23
 
24
+ Similar to the OneID sign in button, we have written a block that will insert OneID QuickFill buttons onto the Magento OnePage checkout.
25
+ The block is defined as follows :
26
+ <block type="core/template" name="oneid_onepage" template="oneid/checkout/oneid_onepage.phtml"></block>
27
 
28
+ We include this into the checkout_onepage_index handle in OneID.xml. If your buttons are not showing up, you may need to include this on your own.
29
 
 
 
30
 
31
+ ## Getting a Create OneID button to show on order success ##
32
+ We've defined a block to show a Create OneID button, so that you can offer your customers a OneID after an order is placed.
33
+ In OneID.xml:
34
+
35
+ <reference name="checkout.success">
36
+ <block type="core/template" name="oneid_provision" template="oneid/checkout/success/oneid_create.phtml"></block>
37
+ </reference>
38
+
39
+ You can print this block out in your theme's success.phtml with the line
40
+ <?php echo $this->getChildHtml("oneid_provision"); ?>
41
 
 
 
42
 
 
 
app/design/frontend/base/default/layout/OneID.xml CHANGED
@@ -31,7 +31,9 @@
31
  </reference>
32
 
33
  <reference name="content">
 
34
  <reference name="customer_form_login">
 
35
  <reference name="form.additional.info">
36
  <block type="OneID/signin" name="oneid_signin_button" template="oneid/oneid/signin.phtml"></block>
37
  </reference>
@@ -78,7 +80,7 @@
78
  </reference>
79
  </customer_account_edit>
80
 
81
- <customer_account_forgotpassword>
82
  <reference name="head">
83
  <action method="addCss"><name>css/oneid.css</name></action>
84
  </reference>
@@ -87,32 +89,14 @@
87
  <action method="setTemplate"><template>oneid/customer/form/forgotpassword.phtml</template></action>
88
  </reference>
89
  </reference>
90
- </customer_account_forgotpassword>
91
 
92
  <checkout_onepage_index translate="label">
93
  <reference name="head">
94
  <action method="addCss"><name>css/oneid.css</name></action>
95
  </reference>
96
  <reference name="content">
97
- <reference name="checkout.onepage">
98
- <action method="setTemplate"><template>oneid/checkout/onepage.phtml</template></action>
99
- </reference>
100
- <reference name="checkout.onepage.login">
101
- <action method="setTemplate"><template>oneid/checkout/onepage/login.phtml</template></action>
102
- </reference>
103
-
104
- <reference name="checkout.onepage.billing">
105
- <action method="setTemplate"><template>oneid/checkout/onepage/billing.phtml</template></action>
106
- </reference>
107
- <reference name="checkout.onepage.shipping">
108
- <action method="setTemplate"><template>oneid/checkout/onepage/shipping.phtml</template></action>
109
- </reference>
110
- <reference name="checkout.onepage.payment">
111
- <action method="setTemplate"><template>oneid/checkout/onepage/payment.phtml</template></action>
112
- </reference>
113
- <!-- <reference name="checkout.onepage.review">
114
- <action method="setTemplate"><template>oneid/checkout/onepage/review.phtml</template></action>
115
- </reference>-->
116
  </reference>
117
  </checkout_onepage_index>
118
 
@@ -130,7 +114,7 @@
130
  </reference>
131
  <reference name="content">
132
  <reference name="checkout.success">
133
- <action method="setTemplate"><template>oneid/checkout/success.phtml</template></action>
134
  </reference>
135
  </reference>
136
  </checkout_onepage_success>
31
  </reference>
32
 
33
  <reference name="content">
34
+
35
  <reference name="customer_form_login">
36
+ <block type="OneID/signin" name="oneid_signin_button" template="oneid/oneid/signin.phtml"></block>
37
  <reference name="form.additional.info">
38
  <block type="OneID/signin" name="oneid_signin_button" template="oneid/oneid/signin.phtml"></block>
39
  </reference>
80
  </reference>
81
  </customer_account_edit>
82
 
83
+ <!-- <customer_account_forgotpassword>
84
  <reference name="head">
85
  <action method="addCss"><name>css/oneid.css</name></action>
86
  </reference>
89
  <action method="setTemplate"><template>oneid/customer/form/forgotpassword.phtml</template></action>
90
  </reference>
91
  </reference>
92
+ </customer_account_forgotpassword>-->
93
 
94
  <checkout_onepage_index translate="label">
95
  <reference name="head">
96
  <action method="addCss"><name>css/oneid.css</name></action>
97
  </reference>
98
  <reference name="content">
99
+ <block type="core/template" name="oneid_onepage" template="oneid/checkout/oneid_onepage.phtml"></block>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  </reference>
101
  </checkout_onepage_index>
102
 
114
  </reference>
115
  <reference name="content">
116
  <reference name="checkout.success">
117
+ <block type="core/template" name="oneid_provision" template="oneid/checkout/success/oneid_create.phtml"></block>
118
  </reference>
119
  </reference>
120
  </checkout_onepage_success>
app/design/frontend/base/default/template/oneid/checkout/oneid_onepage.phtml ADDED
@@ -0,0 +1,482 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $args = Mage::app()->getRequest()->getParams();
3
+ $_quote = Mage::getModel('checkout/cart')->getQuote();
4
+ ?>
5
+
6
+ <script type="text/javascript">
7
+ var automateFormFill = <?php
8
+ if (array_key_exists("autoFill", $args)){
9
+ echo 1;
10
+ }
11
+ else {
12
+ echo 0;
13
+ }
14
+ ?>;
15
+
16
+ var recoverFromFailedOneidCheckout = function(){
17
+ OneId.$("#opc-login").show();
18
+ OneId.$("#opc-billing").show();
19
+ OneId.$("#opc-shipping").show();
20
+ OneId.$("#opc-payment").show();
21
+ OneId.$("#oneid-checkout-please-wait").hide();
22
+
23
+
24
+ OneId.$("#login\\:guest").click();
25
+ OneId.$("#p_method_ccsave").click();
26
+
27
+ OneId.$("#register-xcustomer-password").show();
28
+ OneId.$("#billing\\:customer_password").removeClass("required-entry");
29
+ OneId.$("#billing\\:confirm_password").removeClass("required-entry");
30
+ OneId.$("#checkout-step-review").hide();
31
+ }
32
+
33
+ // page level variables.
34
+ var oneIDSaveAttributes = function() {
35
+ var data = {};
36
+ // Elements that were missing from oneID will have this CSS class attached.
37
+ var missing_fields = $$(".oneid-attr-missing");
38
+
39
+
40
+ if (missing_fields.length) {
41
+ for (var i=0; i < missing_fields.length; i++) {
42
+ var missing_field = missing_fields[i];
43
+ var oneidAttr = null;
44
+ var missing_field_id = missing_field.id;
45
+ // Need to go through the JSON blobs defining the forms to get
46
+ // the form_id -> oneid_attribute mapping.
47
+ if (billingAddressPostData["formData"][missing_field_id]) {
48
+ oneidAttr = billingAddressPostData["formData"][missing_field_id]["oneid_attribute"];
49
+ }
50
+ else if (shippingAddressPostData["formData"][missing_field_id]){
51
+ oneidAttr = shippingAddressPostData["formData"][missing_field_id]["oneid_attribute"];
52
+ }
53
+ else if (paymentPostData["formData"][missing_field_id]) {
54
+ oneidAttr = paymentPostData["formData"][missing_field_id]["oneid_attribute"];
55
+ }
56
+
57
+ if (oneidAttr) {
58
+ data[oneidAttr] = missing_field.value;
59
+ }
60
+
61
+ }
62
+
63
+ // Call the external setuserattributes, which proxies to server.
64
+ OneId.setUserAttributes(data, function(status){
65
+ oneidAuthorizePurchase();
66
+ });
67
+ }
68
+ else {
69
+ oneidAuthorizePurchase();
70
+ }
71
+ };
72
+ var oneidAuthorizePurchase = function() {
73
+ OneId.isUserLoggedIn(function(isLoggedIn){
74
+ if (isLoggedIn){
75
+ OneId.authSecuredTransaction({'auth_message' : '<?php echo Mage::helper("OneID")->getAuthPurchaseMessage($_quote) ?>',
76
+ 'amount' : '<?php echo $_quote->getGrandTotal() ?>',
77
+ 'challenge' : <?php echo Mage::helper("OneID")->getChalj('secureTransaction', $_quote) ?>
78
+ },
79
+ function(data) {
80
+ if (!data) {
81
+ return;
82
+ }
83
+ if (!OneId.$("#oneIdPurchaseAuthData").length){
84
+ OneId.$('<input id="oneIDPurchaseAuthData" type="hidden" name="oneIDPurchaseAuthData" />').appendTo("#co-payment-form");
85
+ }
86
+
87
+
88
+ $("oneIDPurchaseAuthData").value = OneIdJSON.stringify(data);
89
+ review.save();
90
+ });
91
+ }
92
+
93
+ else{
94
+ review.save();
95
+ }
96
+ });
97
+ };
98
+
99
+
100
+
101
+ OneIdExtern.registerApiReadyFunction(function(){
102
+ // insert buttons
103
+ var loginCtr = '<div class="oneid-only"><div id="oneid-checkout-login-form" class="oneid-only oneid-login-container" style="" ></div></div>';
104
+ OneId.$(loginCtr).insertAfter("#checkout-step-login .col-2 .buttons-set .button");
105
+
106
+ // billing
107
+ var billingCtr = '<div name="AutoFill with OneID" class="oneid-only oneid-formfill-billing" style="float:right; margin-top:-7px; margin-right:5px;"></div>';
108
+ OneId.$(billingCtr).insertAfter("#co-billing-form .button");
109
+
110
+ // billing
111
+ var billingCtr = '<div name="AutoFill with OneID" class="oneid-only oneid-formfill-shipping" style="float:right; margin-top:-7px; margin-right:5px;"></div>';
112
+ OneId.$(billingCtr).insertAfter("#co-shipping-form .button");
113
+
114
+ //payment
115
+ var paymentCtr = '<div name="AutoFill with OneID" class="oneid-only oneid-formfill-payment" style="float:right; margin-top:-7px; margin-right:5px;"></div>'
116
+ OneId.$(paymentCtr).insertAfter("#checkout-step-payment .button");
117
+
118
+
119
+
120
+ // attach the OneId login button
121
+ OneId.loginButton(OneId.$("#oneid-checkout-login-form"), { "challenge" : <?php echo $this->helper("OneID")->getCheckoutLoginCHALJ() ?> });
122
+
123
+
124
+ var postPaymentFillFunction = function() {
125
+ payment.resetLoadWaiting();
126
+
127
+ if (automateFormFill) {
128
+ // If we're auto form filling, need to show all the other accordian pieces.
129
+ payment.onSave = function(t){
130
+ payment.nextStep(t);
131
+ OneId.$("#oneid-checkout-please-wait").hide();
132
+ OneId.$("#opc-login").addClass("allow").show();
133
+ OneId.$("#opc-billing").addClass("allow").show();
134
+ OneId.$("#opc-shipping").addClass("allow").show();
135
+ OneId.$("#opc-payment").addClass("allow").show();
136
+ }
137
+ }
138
+
139
+ if (OneId.$("#ccsave_cc_cid,#authorizenet_cc_cid").length){
140
+ OneId.$("#oneid-checkout-please-wait").hide();
141
+ OneId.$("#opc-login").addClass("allow").show();
142
+ OneId.$("#opc-billing").addClass("allow").show();
143
+ OneId.$("#opc-shipping").addClass("allow").show();
144
+ OneId.$("#opc-payment").addClass("allow").show();
145
+ // We don't autofill the CVV, so lets focus on it
146
+ OneId.$("#ccsave_cc_cid").focus();
147
+ }
148
+ else{
149
+ payment.save();
150
+ }
151
+
152
+ };
153
+
154
+ var startPaymentsFormFill = function(){
155
+ var attr = "<?php echo $this->helper('OneID')->getCheckoutAttr() ?>";
156
+ paymentPostData.additional_attrs = attr;
157
+ OneIdForm.fill(paymentPostData);
158
+ }
159
+
160
+ var paymentMissingFields = function(missing_fields) {
161
+ $("opc-payment").show();
162
+ $("checkout-step-payment").show();
163
+ }
164
+
165
+ var paymentPostData = {
166
+ "formData" : {
167
+ "ccsave_cc_owner" : {
168
+ "oneid_attribute" : "payment[cc_name_on_card]",
169
+ "oneid_class" : "",
170
+ "scope" : "oneID",
171
+ "format" : ""
172
+ },
173
+ "ccsave_cc_type" : {
174
+ "oneid_attribute" : "payment[cc_type]",
175
+ "oneid_class" : "",
176
+ "scope" : "oneID",
177
+ "format" : ""
178
+ },
179
+ "ccsave_cc_number" : {
180
+ "oneid_attribute" : "payment[cc_number]",
181
+ "oneid_class" : "",
182
+ "scope" : "oneID",
183
+ "format" : ""
184
+ },
185
+ "ccsave_expiration" : {
186
+ "oneid_attribute" : "payment[cc_exp_mo]",
187
+ "oneid_class" : "",
188
+ "scope" : "oneID",
189
+ "format" : ""
190
+ },
191
+ "ccsave_expiration_yr" : {
192
+ "oneid_attribute" : "payment[cc_exp_yr]",
193
+ "oneid_class" : "",
194
+ "scope" : "oneID",
195
+ "selector_type" : "base",
196
+ "format" : ""
197
+ }
198
+ }
199
+ };
200
+
201
+ OneId.accuFillButton(OneId.$(".oneid-formfill-payment"), paymentPostData, "", function(completed){
202
+ if (!completed && automateFormFill){
203
+ recoverFromFailedOneidCheckout();
204
+ }
205
+ if (completed){
206
+ postPaymentFillFunction();
207
+ }
208
+ });
209
+
210
+ var billingAddressFillSuccess = function() {
211
+ OneId.$("#p_method_ccsave").click();
212
+ OneId.$("#payment_form_ccsave").show();
213
+ billing.save();
214
+
215
+ if (OneId.$("#opc-shipping_methods").length){
216
+ recoverFromFailedOneidCheckout();
217
+ }
218
+
219
+ };
220
+
221
+ function escapeSelector(str){
222
+ if( str){
223
+ return str.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g,'\\$1')
224
+ }
225
+ else {
226
+ return str;
227
+ }
228
+ }
229
+
230
+ var isFormFilledOut = function(formData){
231
+ for(key in formData){
232
+ var selector = OneId.$("#"+escapeSelector(key));
233
+ if (selector.length && !selector.val() && formData[key].required){
234
+ return false;
235
+ }
236
+ }
237
+
238
+ return true;
239
+ };
240
+
241
+ // Need this function for auto-filling.
242
+ var startBillingAddressFormFill = function() {
243
+ var attr = "<?php echo $this->helper('OneID')->getCheckoutAttr() ?>";
244
+
245
+ billingAddressPostData.additional_attrs = attr;
246
+
247
+ OneIdForm.fill(billingAddressPostData, "", false, function(completed){
248
+
249
+ var filledOut = isFormFilledOut(billingAddressPostData.formData);
250
+
251
+ if (automateFormFill && (!completed || !filledOut)){
252
+ recoverFromFailedOneidCheckout();
253
+ checkout.gotoSection("billing");
254
+ }
255
+ else {
256
+ if (completed){
257
+ billingAddressFillSuccess();
258
+ }
259
+ }
260
+ });
261
+ }
262
+
263
+
264
+
265
+ var billingAddressMissingFields = function(missing_fields) {
266
+ if (automateFormFill){
267
+ recoverFromFailedOneidCheckout();
268
+ }
269
+ checkout.gotoSection("billing");
270
+ $("opc-billing").show();
271
+
272
+ };
273
+
274
+ var billingAddressPostData = {
275
+ "formData" : {
276
+ "billing:firstname" : {
277
+ "oneid_attribute" : ["personal_info[first_name]"]
278
+ },
279
+ "billing:lastname" : {
280
+ "oneid_attribute" : ["personal_info[last_name]"]
281
+
282
+ },
283
+ "billing:email" :{
284
+ "oneid_attribute" : ["personal_info[email]"]
285
+ },
286
+ "billing:street1" :{
287
+ "oneid_attribute" : "address[billing][street]"
288
+ },
289
+ "billing:street2" :{
290
+ "oneid_attribute" : "address[billing][street2]",
291
+ "required" : false
292
+ },
293
+ "billing:telephone" :{
294
+ "oneid_attribute" : "address[billing][phone]"
295
+ },
296
+ "billing:region_id" :{
297
+ "oneid_attribute" : "address[billing][state]"
298
+ },
299
+ "billing:city" : {
300
+ "oneid_attribute" : "address[billing][city]"
301
+ },
302
+ "billing:postcode" : {
303
+ "oneid_attribute" : "address[billing][zip]"
304
+ }
305
+ }
306
+ };
307
+
308
+ var oneidBillingNextStep = function() {
309
+ OneId.isUserEnabled( function (isEnabled) {
310
+ if (isEnabled) {
311
+ billingAddressFillSuccess();
312
+ $("opc-payment").show();
313
+ }
314
+ else {
315
+ billing.save();
316
+ }
317
+ });
318
+ };
319
+
320
+ OneId.accuFillButton(OneId.$(".oneid-formfill-billing"), billingAddressPostData, "", function(completed){
321
+ if (!completed && automateFormFill){
322
+ recoverFromFailedOneidCheckout();
323
+ }
324
+ if (completed){
325
+ billingAddressFillSuccess();
326
+ }
327
+ });
328
+
329
+
330
+
331
+ //<!-- shipping.phtml -->
332
+
333
+ var postShippingAddressFunction = function() {
334
+ shipping.save();
335
+
336
+ if (automateFormFill) {
337
+
338
+ OneId.$("#opc-shipping_methods").show();
339
+
340
+
341
+ }
342
+ };
343
+
344
+ var shippingAddressMissingFields = function(missing_fields) {
345
+ if (automateFormFill){
346
+ recoverFromFailedOneidCheckout();
347
+ }
348
+ checkout.gotoSection("shipping");
349
+ $("opc-shipping").show();
350
+ }
351
+
352
+ var shippingAddressPostData = {
353
+ "formData" : {
354
+ "shipping:firstname" : {
355
+ "oneid_attribute" : "personal_info[first_name]"
356
+ },
357
+ "shipping:lastname" : {
358
+ "oneid_attribute" : "personal_info[last_name]"
359
+ },
360
+ "shipping:street1" :{
361
+ "oneid_attribute" : "address[shipping][street]"
362
+ },
363
+ "shipping:street2" :{
364
+ "oneid_attribute" : "address[shipping][street2]",
365
+ "required": false
366
+ },
367
+ "shipping:telephone" :{
368
+ "oneid_attribute" : "address[shipping][phone]"
369
+ },
370
+ "shipping:region_id" :{
371
+ "oneid_attribute" : "address[shipping][state]"
372
+ },
373
+ "shipping:city" : {
374
+ "oneid_attribute" : "address[shipping][city]"
375
+ },
376
+ "shipping:postcode" : {
377
+ "oneid_attribute" : "address[shipping][zip]"
378
+ }
379
+ }
380
+ };
381
+
382
+ var startShippingAddressFormFill = function() {
383
+ var attr = "<?php echo $this->helper('OneID')->getCheckoutAttr() ?>";
384
+ OneIdForm.fill(shippingAddressPostData);
385
+ };
386
+
387
+
388
+ OneId.accuFillButton(OneId.$(".oneid-formfill-shipping"), shippingAddressPostData, "", function(completed){
389
+ if (!completed && automateFormFill){
390
+ recoverFromFailedOneidCheckout();
391
+ }
392
+ if (completed){
393
+ postShippingAddressFunction();
394
+ }
395
+ });
396
+
397
+ OneId.isUserEnabled(function(isEnabled){
398
+ if (isEnabled){
399
+ OneId.$(".oneid-only").show();
400
+
401
+ if (automateFormFill){
402
+ OneId.$("#opc-login").hide();
403
+ OneId.$("#opc-billing").hide();
404
+ OneId.$("#opc-shipping").hide();
405
+ OneId.$("#opc-payment").hide();
406
+ OneId.$("#oneid-checkout-please-wait").show();
407
+
408
+
409
+ OneId.$("#login\\:guest").click();
410
+ OneId.$("#p_method_ccsave").click();
411
+
412
+ OneId.$("#register-xcustomer-password").hide();
413
+ OneId.$("#billing\\:customer_password").removeClass("required-entry");
414
+ OneId.$("#billing\\:confirm_password").removeClass("required-entry");
415
+ OneId.$("#checkout-step-review").show();
416
+
417
+
418
+ shippingMethod.onSave = function(transport){
419
+ if (transport && transport.responseText){
420
+ try{
421
+ response = eval('(' + transport.responseText + ')');
422
+ }
423
+ catch (e) {
424
+ response = {};
425
+ }
426
+ }
427
+
428
+ if (response.error) {
429
+ alert(response.message);
430
+ return false;
431
+ }
432
+
433
+ if (response.update_section) {
434
+ $('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
435
+ }
436
+
437
+ payment.initWhatIsCvvListeners();
438
+
439
+
440
+ OneIdForm.fill(paymentPostData, "", function(completed){
441
+ });
442
+
443
+ if (response.goto_section) {
444
+ checkout.gotoSection(response.goto_section);
445
+ checkout.reloadProgressBlock();
446
+ return;
447
+ }
448
+
449
+ if (response.payment_methods_html) {
450
+ $('checkout-payment-method-load').update(response.payment_methods_html);
451
+ }
452
+
453
+ checkout.setShippingMethod();
454
+ }
455
+
456
+ var autoFillFormData = OneId.$.extend({}, billingAddressPostData.formData, paymentPostData.formData);
457
+ var autoFillMap = {
458
+ "formData" : autoFillFormData
459
+ };
460
+
461
+ OneIdForm.fill(autoFillMap, "", false, function(completed){
462
+
463
+ recoverFromFailedOneidCheckout();
464
+
465
+ var filledOut = isFormFilledOut(billingAddressPostData.formData);
466
+ if (automateFormFill && (!completed || !filledOut)){
467
+ checkout.gotoSection("billing");
468
+ }
469
+ else {
470
+ if (completed){
471
+ billingAddressFillSuccess();
472
+ }
473
+ }
474
+ });
475
+
476
+ }
477
+ }
478
+ });
479
+
480
+
481
+ });
482
+ </script>
app/design/frontend/base/default/template/oneid/checkout/onepage.phtml DELETED
@@ -1,136 +0,0 @@
1
- <div class="opc-wrapper">
2
- <div class="page-title">
3
- <?php echo $this->getChildHtml('checkoutCallout') ?>
4
- <h1><?php echo $this->__('Checkout') ?></h1>
5
- </div>
6
- <script type="text/javascript" src="<?php echo $this->getJsUrl('varien/accordion.js') ?>"></script>
7
- <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/opcheckout.js') ?>"></script>
8
- <script type="text/javascript">countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>
9
- <div class="opc-progress-container" id="col-right-opcheckout">
10
- <?php echo $this->getChildHtml('checkoutProgress') ?>
11
- </div>
12
- <ol class="opc" id="checkoutSteps">
13
- <?php $i=0; foreach($this->getSteps() as $_stepId => $_stepInfo): ?>
14
- <?php if (!$this->getChild($_stepId) || !$this->getChild($_stepId)->isShow()): continue; endif; $i++ ?>
15
- <li id="opc-<?php echo $_stepId ?>" class="section<?php echo !empty($_stepInfo['allow'])?' allow':'' ?><?php echo !empty($_stepInfo['complete'])?' saved':'' ?>">
16
- <div class="step-title">
17
- <span class="number"><?php echo $i ?></span>
18
- <h2><?php echo $_stepInfo['label'] ?></h2>
19
- <!--<a href="#"><?php echo $this->__('Edit') ?></a>-->
20
- </div>
21
- <div id="checkout-step-<?php echo $_stepId ?>" class="step a-item" style="display:none;">
22
- <?php echo $this->getChildHtml($_stepId) ?>
23
- </div>
24
- </li>
25
- <?php endforeach ?>
26
- </ol>
27
- <script type="text/javascript">
28
- //<![CDATA[
29
- var accordion = new Accordion('checkoutSteps', '.step-title', true);
30
- <?php if($this->getActiveStep()): ?>
31
- accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
32
- <?php endif ?>
33
- var checkout = new Checkout(accordion,{
34
- progress: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
35
- review: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
36
- saveMethod: '<?php echo $this->getUrl('checkout/onepage/saveMethod') ?>',
37
- failure: '<?php echo $this->getUrl('checkout/cart') ?>'}
38
- );
39
- //]]>
40
- </script>
41
-
42
-
43
- <script type="text/javascript">
44
-
45
- <?php
46
- $args = Mage::app()->getRequest()->getParams();
47
- $_quote = Mage::getModel('checkout/cart')->getQuote();
48
- ?>
49
- OneIdExtern.registerApiReadyFunction(function(){
50
- OneId.automateFormFill = "<?php echo $args["autoFill"] ? true : false ?>"
51
- OneId.isUserEnabled(function(isEnabled){
52
- if (OneId.automateFormFill && isEnabled){
53
- OneId.$("#opc-login").hide();
54
- OneId.$("#opc-billing").hide();
55
- OneId.$("#opc-shipping").hide();
56
- OneId.$("#opc-payment").hide();
57
- OneId.$("#oneid-checkout-please-wait").show();
58
-
59
-
60
- OneId.$("#login\\:guest").click();
61
- OneId.$("#p_method_ccsave").click();
62
-
63
- OneId.$("#register-xcustomer-password").hide();
64
- OneId.$("#billing\\:customer_password").removeClass("required-entry");
65
- OneId.$("#billing\\:confirm_password").removeClass("required-entry");
66
- OneId.$("#checkout-step-review").show();
67
-
68
- startBillingAddressFormFill();
69
- }
70
- });
71
- });
72
-
73
- var oneIDSaveAttributes = function() {
74
- var data = {};
75
- // Elements that were missing from oneID will have this CSS class attached.
76
- var missing_fields = $$(".oneid-attr-missing");
77
-
78
-
79
- if (missing_fields.length) {
80
- for (var i=0; i < missing_fields.length; i++) {
81
- var missing_field = missing_fields[i];
82
- var oneidAttr = null;
83
- var missing_field_id = missing_field.id;
84
- // Need to go through the JSON blobs defining the forms to get
85
- // the form_id -> oneid_attribute mapping.
86
- if (billingAddressPostData["formData"][missing_field_id]) {
87
- oneidAttr = billingAddressPostData["formData"][missing_field_id]["oneid_attribute"];
88
- }
89
- else if (shippingAddressPostData["formData"][missing_field_id]){
90
- oneidAttr = shippingAddressPostData["formData"][missing_field_id]["oneid_attribute"];
91
- }
92
- else if (paymentPostData["formData"][missing_field_id]) {
93
- oneidAttr = paymentPostData["formData"][missing_field_id]["oneid_attribute"];
94
- }
95
-
96
- if (oneidAttr) {
97
- data[oneidAttr] = missing_field.value;
98
- }
99
-
100
- }
101
-
102
- // Call the external setuserattributes, which proxies to server.
103
- OneId.setUserAttributes(data, function(status){
104
- oneidAuthorizePurchase();
105
- });
106
- }
107
- else {
108
- oneidAuthorizePurchase();
109
- }
110
- };
111
- var oneidAuthorizePurchase = function() {
112
- OneId.isUserLoggedIn(function(isLoggedIn){
113
- if (isLoggedIn){
114
- OneId.authSecuredTransaction({'auth_message' : '<?php echo Mage::helper("OneID")->getAuthPurchaseMessage($_quote) ?>',
115
- 'amount' : '<?php echo $_quote->getGrandTotal() ?>',
116
- 'challenge' : <?php echo Mage::helper("OneID")->getChalj('secureTransaction', $_quote) ?>
117
- },
118
- function(data) {
119
- if (!data) {
120
- return;
121
- }
122
- $("oneIDPurchaseAuthData").value = JSON.stringify(data);
123
- review.save();
124
- });
125
- }
126
-
127
- else{
128
- review.save();
129
- }
130
- });
131
- };
132
- </script>
133
-
134
-
135
-
136
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/oneid/checkout/onepage/billing.phtml DELETED
@@ -1,332 +0,0 @@
1
- <form id="co-billing-form" action="">
2
- <fieldset>
3
- <ul class="form-list">
4
- <?php if ($this->customerHasAddresses()): ?>
5
- <li class="form-alt">
6
- <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
7
- <div class="input-box">
8
- <?php echo $this->getAddressesHtmlSelect('billing') ?>
9
- </div>
10
- </li>
11
- <?php endif; ?>
12
- <li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
13
- <div class="fieldset">
14
- <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
15
- <ul>
16
- <li class="fields">
17
- <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
18
- </li>
19
- <li>
20
- <label for="billing:company"><?php echo $this->__('Company') ?></label>
21
- <div class="input-box">
22
- <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" />
23
- </div>
24
- </li>
25
- <?php if(!$this->isCustomerLoggedIn()): ?>
26
- <li>
27
- <label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
28
- <div class="input-box">
29
- <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" />
30
- </div>
31
- </li>
32
- <?php endif ?>
33
- <li>
34
- <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
35
- <div class="input-box">
36
- <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" />
37
- </div>
38
- </li>
39
- <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
40
- <li class="add-field">
41
- <div class="input-box">
42
- <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" />
43
- </div>
44
- </li>
45
- <?php endfor ?>
46
- <li class="fields">
47
- <div class="field">
48
- <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
49
- <div class="input-box">
50
- <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" />
51
- </div>
52
- </div>
53
- <div class="field">
54
- <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
55
- <div class="input-box">
56
- <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
57
- <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
58
- </select>
59
- <script type="text/javascript">
60
- $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
61
- </script>
62
- <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;" />
63
- </div>
64
- </div>
65
- </li>
66
- <li class="fields">
67
- <div class="field">
68
- <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
69
- <div class="input-box">
70
- <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" />
71
- </div>
72
- </div>
73
- <div class="field">
74
- <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
75
- <div class="input-box">
76
- <?php echo $this->getCountryHtmlSelect('billing') ?>
77
- </div>
78
- </div>
79
- </li>
80
- <li class="fields">
81
- <div class="field">
82
- <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
83
- <div class="input-box">
84
- <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" />
85
- </div>
86
- </div>
87
- <div class="field">
88
- <label for="billing:fax"><?php echo $this->__('Fax') ?></label>
89
- <div class="input-box">
90
- <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" />
91
- </div>
92
- </div>
93
- </li>
94
-
95
- <?php $addressAttributes = $this->getChild('customer_form_billing_address_user_defined_attributes');?>
96
- <?php if ($addressAttributes): ?>
97
- <?php $addressAttributes->setEntity($this->getAddress())->setEntityType('customer_address');?>
98
- <?php $addressAttributes->setFieldIdFormat('billing:%1$s')->setFieldNameFormat('billing[%1$s]');?>
99
- <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
100
- <?php endif;?>
101
-
102
- <?php if(!$this->isCustomerLoggedIn()): ?>
103
- <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
104
- <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
105
- <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
106
- <?php if ($_dob->isEnabled() || $_taxvat->isEnabled() || $_gender->isEnabled() ): ?>
107
- <li class="fields">
108
- <?php if ($_dob->isEnabled()): ?>
109
- <div class="field">
110
- <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())
111
- ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
112
- </div>
113
- <?php endif; ?>
114
- <?php if ($_taxvat->isEnabled()): ?>
115
- <div class="field">
116
- <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())
117
- ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
118
- </div>
119
- <?php endif ?>
120
- <?php if ($_gender->isEnabled()): ?>
121
- <div class="field">
122
- <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())
123
- ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
124
- </div>
125
- <?php endif ?>
126
- </li>
127
- <?php endif; ?>
128
- <?php $customerAttributes = $this->getChild('customer_form_customer_user_defined_attributes');?>
129
- <?php if ($customerAttributes): ?>
130
- <?php $customerAttributes->setEntityModelClass('customer/customer')->setFieldIdFormat('billing:%1$s');?>
131
- <?php $customerAttributes->setFieldNameFormat('billing[%1$s]')->setShowContainer(false);?>
132
- <?php echo $customerAttributes->setExcludeFileAttributes(true)->toHtml()?>
133
- <?php endif;?>
134
- <li class="fields" id="register-customer-password">
135
- <div class="field">
136
- <label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
137
- <div class="input-box">
138
- <input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
139
- </div>
140
- </div>
141
- <div class="field">
142
- <label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
143
- <div class="input-box">
144
- <input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
145
- </div>
146
- </div>
147
- </li>
148
- <?php endif; ?>
149
- <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
150
- <li class="control">
151
- <div class="input-box">
152
- <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" />
153
- </div>
154
- <label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
155
- </li>
156
- <?php else:?>
157
- <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
158
- <?php endif; ?>
159
- </ul>
160
- </div>
161
- </li>
162
- <?php if ($this->canShip()): ?>
163
- <li class="control">
164
- <div class="input-box">
165
- <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" />
166
- </div>
167
- <label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label>
168
- </li>
169
- <li class="control">
170
- <div class="input-box">
171
- <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" />
172
- </div>
173
- <label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
174
- </li>
175
- <?php endif; ?>
176
- </ul>
177
- <?php if (!$this->canShip()): ?>
178
- <input type="hidden" name="billing[use_for_shipping]" value="1" />
179
- <?php endif; ?>
180
- </fieldset>
181
-
182
-
183
- <script type="text/javascript">
184
-
185
- OneIdExtern.registerApiReadyFunction(function(){
186
- OneId.accuFillButton(OneId.$(".oneid-formfill-billing"), billingAddressPostData, "", function(completed){
187
- if (!completed && OneId.automateFormFill){
188
- recoverFromFailedOneidCheckout();
189
- }
190
- if (completed){
191
- billingAddressFillSuccess();
192
- }
193
- });
194
- });
195
-
196
- var billingAddressFillSuccess = function() {
197
- OneId.$("#p_method_ccsave").click();
198
- OneId.$("#payment_form_ccsave").show();
199
- billing.save();
200
-
201
- if (OneId.automateFormFill) {
202
- OneIdForm.fill(paymentPostData, "", false, function(completed){
203
- if (!completed && OneId.automateFormFill){
204
- recoverFromFailedOneidCheckout();
205
- }
206
- if (completed){
207
- postPaymentFillFunction();
208
- }
209
- });
210
- payment.resetLoadWaiting();
211
- }
212
- };
213
-
214
- // Need this function for auto-filling.
215
- var startBillingAddressFormFill = function() {
216
- var attr = "<?php echo $this->helper('OneID')->getCheckoutAttr() ?>";
217
-
218
- billingAddressPostData.additional_attrs = attr;
219
-
220
- OneIdForm.fill(billingAddressPostData, "", false, function(completed){
221
- if (!completed && OneId.automateFormFill){
222
- recoverFromFailedOneidCheckout();
223
- }
224
- else {
225
- if (completed){
226
- billingAddressFillSuccess();
227
- }
228
- }
229
- });
230
- }
231
-
232
- var recoverFromFailedOneidCheckout = function(){
233
- OneId.$("#opc-login").show();
234
- OneId.$("#opc-billing").show();
235
- OneId.$("#opc-shipping").show();
236
- OneId.$("#opc-payment").show();
237
- OneId.$("#oneid-checkout-please-wait").hide();
238
-
239
-
240
- OneId.$("#login\\:guest").click();
241
- OneId.$("#p_method_ccsave").click();
242
-
243
- OneId.$("#register-xcustomer-password").show();
244
- OneId.$("#billing\\:customer_password").removeClass("required-entry");
245
- OneId.$("#billing\\:confirm_password").removeClass("required-entry");
246
- OneId.$("#checkout-step-review").hide();
247
- }
248
-
249
- var billingAddressMissingFields = function(missing_fields) {
250
- if (OneId.automateFormFill){
251
- recoverFromFailedOneidCheckout();
252
- }
253
- checkout.gotoSection("billing");
254
- $("opc-billing").show();
255
-
256
- };
257
-
258
- var billingAddressPostData = {
259
- "profile" : "checkout",
260
- "templateId" : "",
261
- "missingFieldsFunction" : "billingAddressMissingFields",
262
- "postFillFunction" : "billingAddressFillSuccess",
263
- "formData" : {
264
- "billing:firstname" : {
265
- "oneid_attribute" : ["personal_info[first_name]"]
266
- },
267
- "billing:lastname" : {
268
- "oneid_attribute" : ["personal_info[last_name]"]
269
-
270
- },
271
- "billing:email" :{
272
- "oneid_attribute" : ["personal_info[email]"]
273
- },
274
- "billing:street1" :{
275
- "oneid_attribute" : "address[billing][street]"
276
- },
277
- "billing:street2" :{
278
- "oneid_attribute" : "address[billing][street2]",
279
- "required" : false
280
- },
281
- "billing:telephone" :{
282
- "oneid_attribute" : "address[billing][phone]"
283
- },
284
- "billing:region_id" :{
285
- "oneid_attribute" : "address[billing][state]"
286
- },
287
- "billing:city" : {
288
- "oneid_attribute" : "address[billing][city]"
289
- },
290
- "billing:postcode" : {
291
- "oneid_attribute" : "address[billing][zip]"
292
- }
293
- }
294
- };
295
-
296
- </script>
297
- <div id="one-id-form-billing-address" class="one-id-form"></div>
298
-
299
-
300
- <div class="buttons-set form-buttons btn-only" id="billing-buttons-container">
301
- <button type="button" class="button" onclick="oneidBillingNextStep()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
302
- <div name="AutoFill with OneID" class="oneid-only oneid-formfill-billing" style="float:right; margin-top:-7px; margin-right:5px;"></div>
303
- <span id="billing-please-wait" class="please-wait" style="display:none;">
304
- <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
305
- </span>
306
- </div>
307
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
308
- </form>
309
- <script type="text/javascript">
310
- //<![CDATA[
311
-
312
- var oneidBillingNextStep = function() {
313
- OneId.isUserEnabled( function (isEnabled) {
314
- if (isEnabled) {
315
- billingAddressFillSuccess();
316
- $("opc-payment").show();
317
- }
318
- else {
319
- billing.save();
320
- }
321
- });
322
- };
323
-
324
- var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
325
- var billingForm = new VarienForm('co-billing-form');
326
-
327
- //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
328
- $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
329
-
330
- var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions, undefined, 'billing:postcode');
331
- //]]>
332
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/oneid/checkout/onepage/login.phtml DELETED
@@ -1,98 +0,0 @@
1
- <?php echo $this->getChildHtml('login_before')?>
2
- <div class="col2-set<?php if (!$this->helper('customer')->isRegistrationAllowed() && !$this->getQuote()->isAllowedGuestCheckout()) echo ' login-only' ?>">
3
- <div class="col-1">
4
- <h4><?php echo $this->__('Login') ?></h4>
5
- <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
6
- <form id="login-form" action="<?php echo $this->getPostAction() ?>" method="post">
7
- <fieldset>
8
- <p><?php echo $this->__('Already registered?') ?> <?php echo $this->__('Please log in below:') ?></p>
9
- <ul class="form-list">
10
- <li>
11
- <label for="login-email"><?php echo $this->__('Email Address') ?></label>
12
- <div class="input-box">
13
- <input type="text" class="input-text required-entry validate-email" id="login-email" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" />
14
- </div>
15
- </li>
16
- <li>
17
- <label for="login-password"><?php echo $this->__('Password') ?></label>
18
- <div class="input-box">
19
- <input type="password" class="input-text validate-password required-entry" id="login-password" name="login[password]" />
20
- </div>
21
- </li>
22
- </ul>
23
- </fieldset>
24
- <div class="buttons-set form-buttons btn-only">
25
- <button type="button" class="button" onclick="loginForm.submit()"><span><span><?php echo $this->__('Login') ?></span></span></button>
26
- <div class="oneid-only">
27
-
28
- <div id="oneid-checkout-login-form" class="oneid-only oneid-login-container" style="" ></div>
29
- <script type="text/javascript">
30
- OneIdExtern.registerApiReadyFunction(function(){
31
- OneId.loginButton(OneId.$("#oneid-checkout-login-form"), { "challenge" : <?php echo $this->helper("OneID")->getCheckoutLoginCHALJ() ?> });
32
- });
33
- </script>
34
- </div>
35
-
36
-
37
- <a href="<?php echo $this->getUrl('customer/account/forgotpassword') ?>"><?php echo $this->__('Forgot your password?') ?></a>
38
- </div>
39
- </form>
40
- </div>
41
- <?php if ( $this->getQuote()->isAllowedGuestCheckout() || $this->helper('customer')->isRegistrationAllowed() ): ?>
42
- <div class="col-2">
43
- <h4>
44
- <?php if( $this->getQuote()->isAllowedGuestCheckout() && $this->helper('customer')->isRegistrationAllowed() ): ?>
45
- <?php echo $this->__('Checkout as a Guest or Register') ?>
46
- <?php elseif ( $this->getQuote()->isAllowedGuestCheckout() && !$this->helper('customer')->isRegistrationAllowed() ): ?>
47
- <?php echo $this->__('Checkout as a Guest') ?>
48
- <?php else: ?>
49
- <?php echo $this->__('Register to Create an Account') ?>
50
- <?php endif; ?>
51
- </h4>
52
- <?php if( !$this->getQuote()->isAllowedGuestCheckout() && $this->helper('customer')->isRegistrationAllowed() ): ?>
53
- <p><strong><?php echo $this->__('Register and save time!') ?></strong><br />
54
- <?php echo $this->__('Register with us for future convenience:') ?></p>
55
- <ul>
56
- <li><?php echo $this->__('Fast and easy check out') ?></li>
57
- <li><?php echo $this->__('Easy access to your order history and status') ?></li>
58
- </ul>
59
- <?php elseif( $this->getQuote()->isAllowedGuestCheckout() && $this->helper('customer')->isRegistrationAllowed() ): ?>
60
- <p><?php echo $this->__('Register with us for future convenience:') ?></p>
61
- <?php endif ?>
62
-
63
- <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
64
- <ul class="form-list form-alt">
65
- <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
66
- <li>
67
- <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" />
68
- <label for="login:guest"><?php echo $this->__('Checkout as Guest') ?></label>
69
- </li>
70
- <?php endif; ?>
71
- <?php if( $this->helper('customer')->isRegistrationAllowed() ): ?>
72
- <li>
73
- <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" />
74
- <label for="login:register"><?php echo $this->__('Register') ?></label>
75
- </li>
76
- <?php endif; ?>
77
- </ul>
78
- <?php else: ?>
79
- <input type="hidden" name="checkout_method" id="login:register" value="register" checked="checked" />
80
- <?php endif; ?>
81
- <div class="buttons-set">
82
- <button type="button" class="button" onclick="checkout.setMethod();"><span><span><?php echo ($this->getQuote()->isAllowedGuestCheckout() ? $this->__('Continue') : $this->__('Register')) ?></span></span></button>
83
- </div>
84
- </div>
85
- <?php endif; ?>
86
- <script type="text/javascript">
87
- //<![CDATA[
88
- var loginForm = new VarienForm('login-form', true);
89
- $('login-email').observe('keypress', bindLoginPost);
90
- $('login-password').observe('keypress', bindLoginPost);
91
- function bindLoginPost(evt){
92
- if (evt.keyCode == Event.KEY_RETURN) {
93
- loginForm.submit();
94
- }
95
- }
96
- //]]>
97
- </script>
98
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/oneid/checkout/onepage/payment.phtml DELETED
@@ -1,152 +0,0 @@
1
- <script type="text/javascript">
2
- //<![CDATA[
3
- var quoteBaseGrandTotal = <?php echo (float)$this->getQuoteBaseGrandTotal(); ?>;
4
- var payment = new Payment('co-payment-form', '<?php echo $this->getUrl('checkout/onepage/savePayment') ?>');
5
- //]]>
6
- </script>
7
- <form action="" id="co-payment-form">
8
- <fieldset>
9
- <?php echo $this->getChildChildHtml('methods_additional', '', true, true) ?>
10
- <?php echo $this->getChildHtml('methods') ?>
11
- <input id='oneIDPurchaseAuthData' type="hidden" name="oneIDPurchaseAuthData" />
12
- </fieldset>
13
- <script>
14
- OneIdExtern.registerApiReadyFunction(function(){
15
- OneId.accuFillButton(OneId.$(".oneid-formfill-payment"), paymentPostData, "", function(completed){
16
- if (!completed && OneId.automateFormFill){
17
- recoverFromFailedOneidCheckout();
18
- }
19
- if (completed){
20
- postPaymentFillFunction();
21
- }
22
- });
23
- });
24
-
25
-
26
- var postPaymentFillFunction = function() {
27
- payment.resetLoadWaiting();
28
-
29
- if (OneId.automateFormFill) {
30
- // If we're auto form filling, need to show all the other accordian pieces.
31
- payment.onSave = function(t){
32
- payment.nextStep(t);
33
- OneId.$("#oneid-checkout-please-wait").hide();
34
- OneId.$("#opc-login").addClass("allow").show();
35
- OneId.$("#opc-billing").addClass("allow").show();
36
- OneId.$("#opc-shipping").addClass("allow").show();
37
- OneId.$("#opc-payment").addClass("allow").show();
38
- }
39
- }
40
-
41
- if (OneId.$("#ccsave_cc_cid,#authorizenet_cc_cid").length){
42
- OneId.$("#oneid-checkout-please-wait").hide();
43
- OneId.$("#opc-login").addClass("allow").show();
44
- OneId.$("#opc-billing").addClass("allow").show();
45
- OneId.$("#opc-shipping").addClass("allow").show();
46
- OneId.$("#opc-payment").addClass("allow").show();
47
- // We don't autofill the CVV, so lets focus on it
48
- OneId.$("#ccsave_cc_cid").focus();
49
- }
50
- else{
51
- payment.save();
52
- }
53
-
54
- };
55
-
56
- var startPaymentsFormFill = function(){
57
- var attr = "<?php echo $this->helper('OneID')->getCheckoutAttr() ?>";
58
- paymentPostData.additional_attrs = attr;
59
- OneIdForm.fill(paymentPostData);
60
- }
61
-
62
- var paymentMissingFields = function(missing_fields) {
63
- $("opc-payment").show();
64
- $("checkout-step-payment").show();
65
- }
66
-
67
- var paymentPostData = {
68
- "profile" : "checkout",
69
- "templateId" : "",
70
- "missingFieldsFunction" : "paymentMissingFields",
71
- "formData" : {
72
- "ccsave_cc_owner" : {
73
- "oneid_attribute" : "payment[cc_name_on_card]",
74
- "oneid_class" : "",
75
- "scope" : "oneID",
76
- "format" : ""
77
- },
78
- "ccsave_cc_type" : {
79
- "oneid_attribute" : "payment[cc_type]",
80
- "oneid_class" : "",
81
- "scope" : "oneID",
82
- "format" : ""
83
- },
84
- "ccsave_cc_number" : {
85
- "oneid_attribute" : "payment[cc_number]",
86
- "oneid_class" : "",
87
- "scope" : "oneID",
88
- "format" : ""
89
- },
90
- "ccsave_expiration" : {
91
- "oneid_attribute" : "payment[cc_exp_mo]",
92
- "oneid_class" : "",
93
- "scope" : "oneID",
94
- "format" : ""
95
- },
96
- "ccsave_expiration_yr" : {
97
- "oneid_attribute" : "payment[cc_exp_yr]",
98
- "oneid_class" : "",
99
- "scope" : "oneID",
100
- "selector_type" : "base",
101
- "format" : ""
102
- }
103
- }
104
- };
105
-
106
-
107
- </script>
108
-
109
- <div id="one-id-form-payment" class="one-id-form"></div>
110
- </form>
111
- <div class="tool-tip" id="payment-tool-tip" style="display:none;">
112
- <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>
113
- <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>
114
- </div>
115
- <?php echo $this->getChildChildHtml('additional') ?>
116
- <div class="buttons-set" id="payment-buttons-container">
117
- <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
118
- <button type="button" class="button" onclick="payment.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
119
- <div name="AutoFill with OneID" class="oneid-only oneid-formfill-payment" style="float:right; margin-top:-7px; margin-right:5px;">
120
-
121
- </div>
122
- <!-- <div name="AutoFill with OneID" class="oneid-only" type="button" style="float:right;">
123
- <img class="oneid-button" src="<?php echo $this->helper('OneID')->getAccuFillButtonSrc() ?>" onClick="startPaymentsFormFill()" />
124
- </div>-->
125
-
126
- <span id="payment-please-wait" class="please-wait" style="display:none">
127
- <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
128
- </span>
129
- </div>
130
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
131
- <script type="text/javascript">
132
- //<![CDATA[
133
- function toggleToolTip(event){
134
- if($('payment-tool-tip')){
135
- $('payment-tool-tip').setStyle({
136
- top: (Event.pointerY(event)-515)+'px'//,
137
- //left: (Event.pointerX(event)+100)+'px'
138
- })
139
- $('payment-tool-tip').toggle();
140
- }
141
- Event.stop(event);
142
- }
143
- if($('payment-tool-tip-close')){
144
- Event.observe($('payment-tool-tip-close'), 'click', toggleToolTip);
145
- }
146
- //]]>
147
- </script>
148
- <script type="text/javascript">
149
- //<![CDATA[
150
- payment.currentMethod = "<?php echo $this->getChild('methods')->getSelectedMethodCode() ?>";
151
- //]]>
152
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/oneid/checkout/onepage/shipping.phtml DELETED
@@ -1,203 +0,0 @@
1
- <form action="" id="co-shipping-form">
2
- <fieldset>
3
- <ul class="form-list">
4
- <?php if ($this->customerHasAddresses()): ?>
5
- <li class="form-alt">
6
- <label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
7
- <div class="input-box"><?php echo $this->getAddressesHtmlSelect('shipping') ?></div>
8
- </li>
9
- <?php endif ?>
10
- <li id="shipping-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif ?>>
11
- <div class="fieldset">
12
- <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
13
- <ul>
14
- <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())
15
- ->setFieldIdFormat('shipping:%s')->setFieldNameFormat('shipping[%s]')->setFieldParams('onchange="shipping.setSameAsBilling(false)"')->toHtml() ?>
16
- </li>
17
- <li>
18
- <label for="shipping:company"><?php echo $this->__('Company') ?></label>
19
- <div class="input-box">
20
- <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);" />
21
- </div>
22
- </li>
23
- <?php if(false): ?>
24
- <li>
25
- <label for="shipping:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
26
- <div class="input-box">
27
- <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" />
28
- </div>
29
- </li>
30
- <?php endif ?>
31
- <li>
32
- <label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
33
- <div class="input-box">
34
- <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);" />
35
- </div>
36
- </li>
37
- <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
38
- <li class="add-field">
39
- <div class="input-box">
40
- <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);" />
41
- </div>
42
- </li>
43
- <?php endfor ?>
44
- <li class="fields">
45
- <div class="field">
46
- <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
47
- <div class="input-box">
48
- <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);" />
49
- </div>
50
- </div>
51
- <div class="field">
52
- <label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
53
- <div class="input-box">
54
- <select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
55
- <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
56
- </select>
57
- <script type="text/javascript">
58
- $('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
59
- </script>
60
- <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;" />
61
- </div>
62
- </div>
63
- </li>
64
- <li class="fields">
65
- <div class="field">
66
- <label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
67
- <div class="input-box">
68
- <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);" />
69
- </div>
70
- </div>
71
- <div class="field">
72
- <label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
73
- <div class="input-box">
74
- <?php echo $this->getCountryHtmlSelect('shipping') ?>
75
- </div>
76
- </div>
77
- </li>
78
- <li class="fields">
79
- <div class="field">
80
- <label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
81
- <div class="input-box">
82
- <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);" />
83
- </div>
84
- </div>
85
- <div class="field">
86
- <label for="shipping:fax"><?php echo $this->__('Fax') ?></label>
87
- <div class="input-box">
88
- <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);" />
89
- </div>
90
- </div>
91
- </li>
92
- <?php $addressAttributes = $this->getChild('customer_form_shipping_address_user_defined_attributes');?>
93
- <?php if ($addressAttributes): ?>
94
- <?php $addressAttributes->setEntity($this->getAddress())->setEntityType('customer_address');?>
95
- <?php $addressAttributes->setFieldIdFormat('shipping:%1$s')->setFieldNameFormat('shipping[%1$s]');?>
96
- <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
97
- <?php endif;?>
98
- <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
99
- <li class="control">
100
- <div class="input-box">
101
- <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" />
102
- </div>
103
- <label for="shipping:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
104
- </li>
105
- <?php else:?>
106
- <li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
107
- <?php endif;?>
108
- <li class="control">
109
- <div class="input-box">
110
- <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" />
111
- </div>
112
- <label for="shipping:same_as_billing"><?php echo $this->__('Use Billing Address') ?></label>
113
- </li>
114
- </ul>
115
- </div>
116
- </li>
117
- </ul>
118
- </fieldset>
119
- <script type="text/javascript">
120
- var postShippingAddressFunction = function() { shipping.save(); };
121
-
122
- var shippingAddressMissingFields = function(missing_fields) {
123
- if (OneId.automateFormFill){
124
- recoverFromFailedOneidCheckout();
125
- }
126
- checkout.gotoSection("shipping");
127
- $("opc-shipping").show();
128
- }
129
-
130
- var shippingAddressPostData = {
131
- "profile" : "checkout",
132
- "templateId" : "",
133
- "postFillFunction" : "postShippingAddressFunction",
134
- "missingFieldsFunction" : "shippingAddressMissingFields",
135
- "formData" : {
136
- "shipping:firstname" : {
137
- "oneid_attribute" : "personal_info[first_name]"
138
- },
139
- "shipping:lastname" : {
140
- "oneid_attribute" : "personal_info[last_name]"
141
- },
142
- "shipping:street1" :{
143
- "oneid_attribute" : "address[shipping][street]"
144
- },
145
- "shipping:street2" :{
146
- "oneid_attribute" : "address[shipping][street2]",
147
- "required": false
148
- },
149
- "shipping:telephone" :{
150
- "oneid_attribute" : "address[shipping][phone]"
151
- },
152
- "shipping:region_id" :{
153
- "oneid_attribute" : "address[shipping][state]"
154
- },
155
- "shipping:city" : {
156
- "oneid_attribute" : "address[shipping][city]"
157
- },
158
- "shipping:postcode" : {
159
- "oneid_attribute" : "address[shipping][zip]"
160
- }
161
- }
162
- };
163
- var startShippingAddressFormFill = function() {
164
- var attr = "<?php echo $this->helper('OneID')->getCheckoutAttr() ?>";
165
- OneIdForm.fill(shippingAddressPostData);
166
- };
167
-
168
- OneIdExtern.registerApiReadyFunction(function(){
169
- OneId.accuFillButton(OneId.$(".oneid-formfill-shipping"), shippingAddressPostData, "", function(completed){
170
- if (!completed && OneId.automateFormFill){
171
- recoverFromFailedOneidCheckout();
172
- }
173
- if (completed){
174
- postShippingAddressFunction();
175
- }
176
- });
177
- });
178
-
179
-
180
- </script>
181
- <div id="one-id-form-shipping-address" class="one-id-form" ></div>
182
-
183
- <div class="buttons-set form-buttons" id="shipping-buttons-container">
184
- <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
185
- <button type="button" class="button" onclick="shipping.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
186
- <div name="AutoFill with OneID" class="oneid-only oneid-formfill-shipping" style="float:right; margin-top:-7px; margin-right:5px;"></div>
187
-
188
- <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>
189
- </div>
190
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
191
- </form>
192
- <script type="text/javascript">
193
- //<![CDATA[
194
- var shipping = new Shipping('co-shipping-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveShipping') ?>',
195
- '<?php echo $this->getUrl('checkout/onepage/shippingMethod') ?>');
196
- var shippingForm = new VarienForm('co-shipping-form');
197
- shippingForm.extraChildParams = ' onchange="shipping.setSameAsBilling(false);"';
198
- //shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
199
- $('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
200
-
201
- var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', countryRegions, undefined, 'shipping:postcode');
202
- //]]>
203
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/oneid/checkout/success.phtml DELETED
@@ -1,63 +0,0 @@
1
- <div class="page-title">
2
- <h1><?php echo $this->__('Your order has been received') ?></h1>
3
- </div>
4
- <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
5
- <h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>
6
-
7
- <?php if ($this->getOrderId()):?>
8
- <?php if ($this->getCanViewOrder()) :?>
9
- <p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
10
- <?php else :?>
11
- <p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?>.</p>
12
- <?php endif;?>
13
- <p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
14
- <?php if ($this->getViewOrder() && $this->getCanPrintOrder()) :?>
15
- <p>
16
- <?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
17
- <?php echo $this->getChildHtml() ?>
18
- </p>
19
- <?php endif;?>
20
- <?php endif;?>
21
-
22
- <?php if ($this->getAgreementRefId()): ?>
23
- <p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?></p>
24
- <?php endif;?>
25
-
26
- <?php if ($profiles = $this->getRecurringProfiles()):?>
27
- <p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
28
- <ul class="disc">
29
- <?php foreach($profiles as $profile):?>
30
- <?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')));?>
31
- <li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description')))?></li>
32
- <?php endforeach;?>
33
- </ul>
34
- <?php endif;?>
35
- <div class="buttons-set">
36
- <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>
37
- </div>
38
-
39
-
40
- <?php $_order = $this->getOrder(); ?>
41
- <div id="getAOneId" style="display: none" class="oneid-successpage-block">
42
- <p>Make ordering here again easy! Click to sign up for OneID</p>
43
- <p>
44
- <div class="create_oneid_ctr"></div>
45
- </p>
46
- </div>
47
- <script type="text/javascript">
48
- OneIdExtern.registerApiReadyFunction(function(){
49
- OneId.isUserLoggedIn(function(loggedIn){
50
- if (!loggedIn){
51
- var data = OneIdUtil.parseJSON('<?php echo $this->helper('OneID')->getCreateOneIdAttrsFromOrder($_order) ?>');
52
- var challenge = <?php echo $this->helper("OneID")->getLoginCHALJ() ?>;
53
- OneId.createOneIdButton(".create_oneid_ctr", data, challenge, function(success){
54
- if (success){
55
- // Hide the mssage, now that the user has created a OneID.
56
- OneId.$("#getAOneId").hide();
57
- }
58
- });
59
- OneId.$("#getAOneId").show();
60
- }
61
- });
62
- });
63
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/oneid/checkout/success/oneid_create.phtml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_order = $this->getParentBlock()->getOrder(); ?>
2
+ <div id="getAOneId" style="display: none" class="oneid-successpage-block">
3
+ <p>Make ordering here again easy! Click to sign up for OneID</p>
4
+ <p>
5
+ <div class="create_oneid_ctr"></div>
6
+ </p>
7
+ </div>
8
+ <script type="text/javascript">
9
+ OneIdExtern.registerApiReadyFunction(function(){
10
+ OneId.isUserLoggedIn(function(loggedIn){
11
+ if (!loggedIn){
12
+ var data = OneIdUtil.parseJSON('<?php echo $this->helper('OneID')->getCreateOneIdAttrsFromOrder($_order) ?>');
13
+ var challenge = <?php echo $this->helper("OneID")->getLoginCHALJ() ?>;
14
+ OneId.createOneIdButton(".create_oneid_ctr", data, challenge, function(success){
15
+ if (success){
16
+ // Hide the mssage, now that the user has created a OneID.
17
+ OneId.$("#getAOneId").hide();
18
+ }
19
+ });
20
+ OneId.$("#getAOneId").show();
21
+ }
22
+ });
23
+ });
24
+ </script>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>OneID</name>
4
- <version>1.0.9</version>
5
  <stability>stable</stability>
6
  <license>Apache Software License (ASL)</license>
7
  <channel>community</channel>
@@ -21,11 +21,11 @@ Privacy: OneID does not track any user behavior &#x2013; and certainly won&#x201
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>Add in a README.txt, open up to Magento 1.6</notes>
25
  <authors><author><name>OneID</name><user>bpk_oneid</user><email>bpk@oneid.com</email></author></authors>
26
- <date>2013-01-28</date>
27
- <time>20:34:38</time>
28
- <contents><target name="magecommunity"><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="Signin.php" hash="454d819e284f02ef5e2ae8e57d714918"/></dir><dir name="Helper"><file name="Data.php" hash="6d702e8fcf10c58de1ce6aa457dca427"/></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="8c3246ec55c0f60669fe484abbc1a04b"/><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><file name="README.txt" hash="4cb8d14cc59c9e6060e09946203a5cda"/></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="4b02b99a1bbc8ad14a4452775df49ef2"/><dir name="onepage"><file name="billing.phtml" hash="db33088fbf7c82e54359f6b47f9782bd"/><file name="link.phtml" hash="c38a01ac21b86b2cd2b923f99b0d32f9"/><file name="login.phtml" hash="14a18316708340b2cb9d40d8c00a1050"/><file name="payment.phtml" hash="9b984eb3b27d9d522a5233a8be59f28f"/><dir name="review"><file name="button.phtml" hash="7646991c5b937654771fa78627e49c95"/></dir><file name="shipping.phtml" hash="ecc2387a24237e4b7021779578a2d942"/></dir><file name="onepage.phtml" hash="26399371e208ecb11bf0cda67621bcee"/><file name="success.phtml" hash="1bd4d74a04b4166aa8ce08b581d01fa0"/></dir><dir name="customer"><dir name="account"><file name="dashboard.phtml" hash="55b1ec9a6860486943e2e4fb8d81aede"/></dir><dir name="form"><file name="edit.phtml" hash="23eea7e7e29cb36c3c5885d7775de528"/><file name="forgotpassword.phtml" hash="cd02367e8214930140d80a7834e0f4a4"/></dir></dir><dir name="form"><file name="traditional_login.phtml" hash="597e5d7b99eb7dcfb8f5a63185ce5e38"/></dir><dir name="oneid"><file name="signin.phtml" hash="1aeb1ac58db061d9649b92ee25b2ed20"/></dir></dir></dir><dir name="layout"><file name="OneID.xml" hash="153030f3e008e6c671cb0f9f5341a638"/></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="1f42a132067a01e1056d5c514d96507a"/></dir></target></contents>
29
  <compatible/>
30
  <dependencies><required><php><min>5.0.0</min><max>5.4.10</max></php></required></dependencies>
31
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>OneID</name>
4
+ <version>1.0.10</version>
5
  <stability>stable</stability>
6
  <license>Apache Software License (ASL)</license>
7
  <channel>community</channel>
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>Refactor the changes made to Onepage checkout to mostly one block. </notes>
25
  <authors><author><name>OneID</name><user>bpk_oneid</user><email>bpk@oneid.com</email></author></authors>
26
+ <date>2013-02-05</date>
27
+ <time>19:13:47</time>
28
+ <contents><target name="magecommunity"><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="Signin.php" hash="454d819e284f02ef5e2ae8e57d714918"/></dir><dir name="Helper"><file name="Data.php" hash="6d702e8fcf10c58de1ce6aa457dca427"/></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="8c3246ec55c0f60669fe484abbc1a04b"/><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><file name="README.txt" hash="fc7ce5e9b6b09f43a8776ef1c05d3f11"/></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="4b02b99a1bbc8ad14a4452775df49ef2"/><file name="oneid_onepage.phtml" hash="5683ee65f0d7125e5f15f1cb3d14b8fb"/><dir name="onepage"><file name="link.phtml" hash="c38a01ac21b86b2cd2b923f99b0d32f9"/><dir name="review"><file name="button.phtml" hash="7646991c5b937654771fa78627e49c95"/></dir></dir><dir name="success"><file name="oneid_create.phtml" hash="653fee23d3059609ae5330f0d6c84d34"/></dir></dir><dir name="customer"><dir name="account"><file name="dashboard.phtml" hash="55b1ec9a6860486943e2e4fb8d81aede"/></dir><dir name="form"><file name="edit.phtml" hash="23eea7e7e29cb36c3c5885d7775de528"/><file name="forgotpassword.phtml" hash="cd02367e8214930140d80a7834e0f4a4"/></dir></dir><dir name="form"><file name="traditional_login.phtml" hash="597e5d7b99eb7dcfb8f5a63185ce5e38"/></dir><dir name="oneid"><file name="signin.phtml" hash="1aeb1ac58db061d9649b92ee25b2ed20"/></dir></dir></dir><dir name="layout"><file name="OneID.xml" hash="a394b3f62e225364b5053160c845d38c"/></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="5e44748f801c63012a57995a0c1fca80"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Oneid_Connector.xml" hash="1f42a132067a01e1056d5c514d96507a"/></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 CHANGED
@@ -18,10 +18,10 @@
18
  .oneid-api-ready {
19
  display:none;
20
  }
21
-
22
  .oneid-only {
23
  display:none;
24
- }
25
 
26
  .oneid-forgotpassword-block {
27
  margin: 0;
@@ -37,7 +37,7 @@
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{
18
  .oneid-api-ready {
19
  display:none;
20
  }
21
+ /*
22
  .oneid-only {
23
  display:none;
24
+ }*/
25
 
26
  .oneid-forgotpassword-block {
27
  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{