Completed
Push — pull/SSOcorrection ( 58ab9b...3b9b8a )
by Nic
10:41
created
src/Controller/FoxyStripeController.php 1 patch
Spacing   +11 added lines, -12 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@  discard block
 block discarded – undo
43 43
         // handle POST from FoxyCart API transaction
44 44
         if ((isset($_POST['FoxyData']) or isset($_POST['FoxySubscriptionData']))) {
45 45
             $FoxyData_encrypted = (isset($_POST['FoxyData'])) ?
46
-                urldecode($_POST['FoxyData']) :
47
-                urldecode($_POST['FoxySubscriptionData']);
46
+                urldecode($_POST['FoxyData']) : urldecode($_POST['FoxySubscriptionData']);
48 47
             $FoxyData_decrypted = \rc4crypt::decrypt(FoxyCart::getStoreKey(), $FoxyData_encrypted);
49 48
 
50 49
             // parse the response and save the order
@@ -54,7 +53,7 @@  discard block
 block discarded – undo
54 53
             $this->extend('addIntegrations', $FoxyData_encrypted);
55 54
 
56 55
             return 'foxy';
57
-        } else {
56
+        }else {
58 57
             return 'No FoxyData or FoxySubscriptionData received.';
59 58
         }
60 59
     }
@@ -137,7 +136,7 @@  discard block
 block discarded – undo
137 136
                 /* todo: make sure local password is updated if changed on FoxyCart
138 137
                 $this->updatePasswordFromData($customer, $order);
139 138
                 */
140
-            } else {
139
+            }else {
141 140
                 // create new Member, set password info from FoxyCart
142 141
                 $customer = Member::create();
143 142
                 $customer->Customer_ID = (int)$order->customer_id;
@@ -164,11 +163,11 @@  discard block
 block discarded – undo
164 163
         Security::config()->update('password_encryption_algorithm', 'none');
165 164
 
166 165
         $customer->PasswordEncryption = 'none';
167
-        $customer->Password = (string) $order->customer_password;
166
+        $customer->Password = (string)$order->customer_password;
168 167
         $customer->write();
169 168
 
170
-        $customer->PasswordEncryption = $this->getEncryption((string) $order->customer_password_hash_type);
171
-        $customer->Salt = (string) $order->customer_password_salt;
169
+        $customer->PasswordEncryption = $this->getEncryption((string)$order->customer_password_hash_type);
170
+        $customer->Salt = (string)$order->customer_password_salt;
172 171
         $customer->write();
173 172
 
174 173
         Security::config()->update('password_encryption_algorithm', $password_encryption_algorithm);
@@ -260,7 +259,7 @@  discard block
 block discarded – undo
260 259
             }
261 260
 
262 261
             return ProductPage::get()
263
-                ->filter('ID', (int) $productOptions->product_option_value)
262
+                ->filter('ID', (int)$productOptions->product_option_value)
264 263
                 ->First();
265 264
         }
266 265
     }
@@ -310,18 +309,18 @@  discard block
 block discarded – undo
310 309
         // to do: consider a login/registration form here if not logged in
311 310
         if ($Member = Security::getCurrentUser()) {
312 311
             $Member = Security::getCurrentUser();
313
-        } else {
312
+        }else {
314 313
             $Member = new Member();
315 314
             $Member->Customer_ID = 0;
316 315
         }
317 316
 
318
-        $auth_token = sha1($Member->Customer_ID . '|' . $timestampNew . '|' . FoxyCart::getStoreKey());
317
+        $auth_token = sha1($Member->Customer_ID.'|'.$timestampNew.'|'.FoxyCart::getStoreKey());
319 318
 
320 319
         $config = FoxyStripeSetting::current_foxystripe_setting();
321 320
         if ($config->CustomSSL) {
322 321
             $link = FoxyCart::getFoxyCartStoreName();
323
-        } else {
324
-            $link = FoxyCart::getFoxyCartStoreName() . '.foxycart.com';
322
+        }else {
323
+            $link = FoxyCart::getFoxyCartStoreName().'.foxycart.com';
325 324
         }
326 325
 
327 326
         $redirect_complete = 'https://'.$link.'/checkout?fc_auth_token='.$auth_token.'&fcsid='.$fcsid.
Please login to merge, or discard this patch.