Completed
Push — master ( aa83e2...f8f77e )
by Jason
22:25 queued 07:26
created
code/controllers/FoxyStripe_Controller.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -38,6 +38,9 @@
 block discarded – undo
38 38
 		}
39 39
 	}
40 40
 
41
+    /**
42
+     * @param string $encrypted
43
+     */
41 44
     public function handleDataFeed($encrypted, $decrypted){
42 45
 
43 46
         $orders = new SimpleXMLElement($decrypted);
Please login to merge, or discard this patch.
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -2,41 +2,41 @@  discard block
 block discarded – undo
2 2
 
3 3
 class FoxyStripe_Controller extends Page_Controller {
4 4
 	
5
-	const URLSegment = 'foxystripe';
5
+    const URLSegment = 'foxystripe';
6 6
 
7
-	public function getURLSegment() {
8
-		return self::URLSegment;
9
-	}
7
+    public function getURLSegment() {
8
+        return self::URLSegment;
9
+    }
10 10
 	
11
-	static $allowed_actions = array(
12
-		'index',
11
+    static $allowed_actions = array(
12
+        'index',
13 13
         'sso'
14
-	);
14
+    );
15 15
 	
16
-	public function index() {
16
+    public function index() {
17 17
 
18
-	    // handle POST from FoxyCart API transaction
19
-		if ((isset($_POST["FoxyData"]) OR isset($_POST['FoxySubscriptionData']))) {
18
+        // handle POST from FoxyCart API transaction
19
+        if ((isset($_POST["FoxyData"]) OR isset($_POST['FoxySubscriptionData']))) {
20 20
 
21
-			$FoxyData_encrypted = (isset($_POST["FoxyData"])) ?
21
+            $FoxyData_encrypted = (isset($_POST["FoxyData"])) ?
22 22
                 urldecode($_POST["FoxyData"]) :
23 23
                 urldecode($_POST["FoxySubscriptionData"]);
24
-			$FoxyData_decrypted = rc4crypt::decrypt(FoxyCart::getStoreKey(),$FoxyData_encrypted);
24
+            $FoxyData_decrypted = rc4crypt::decrypt(FoxyCart::getStoreKey(),$FoxyData_encrypted);
25 25
 
26 26
             // parse the response and save the order
27
-			self::handleDataFeed($FoxyData_encrypted, $FoxyData_decrypted);
27
+            self::handleDataFeed($FoxyData_encrypted, $FoxyData_decrypted);
28 28
 			
29
-			// extend to allow for additional integrations with Datafeed
30
-			$this->extend('addIntegrations', $FoxyData_encrypted);
29
+            // extend to allow for additional integrations with Datafeed
30
+            $this->extend('addIntegrations', $FoxyData_encrypted);
31 31
 			
32
-			return 'foxy';
32
+            return 'foxy';
33 33
 			
34
-		} else {
34
+        } else {
35 35
 			
36
-			return "No FoxyData or FoxySubscriptionData received.";
36
+            return "No FoxyData or FoxySubscriptionData received.";
37 37
 			
38
-		}
39
-	}
38
+        }
39
+    }
40 40
 
41 41
     public function handleDataFeed($encrypted, $decrypted){
42 42
 
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
     }
64 64
 
65 65
 
66
-	// Single Sign on integration with FoxyCart
66
+    // Single Sign on integration with FoxyCart
67 67
     public function sso() {
68 68
 
69
-	    // GET variables from FoxyCart Request
69
+        // GET variables from FoxyCart Request
70 70
         $fcsid = $this->request->getVar('fcsid');
71 71
         $timestampNew = strtotime('+30 days');
72 72
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $redirect_complete = 'https://' . FoxyCart::getFoxyCartStoreName() . '.foxycart.com/checkout?fc_auth_token=' . $auth_token .
86 86
             '&fcsid=' . $fcsid . '&fc_customer_id=' . $Member->Customer_ID . '&timestamp=' . $timestampNew;
87 87
 	
88
-	    $this->redirect($redirect_complete);
88
+        $this->redirect($redirect_complete);
89 89
 
90 90
     }
91 91
 	
Please login to merge, or discard this patch.
code/objects/Order.php 2 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -90,6 +90,9 @@  discard block
 block discarded – undo
90 90
         return $obj;
91 91
     }
92 92
 
93
+    /**
94
+     * @return string
95
+     */
93 96
     public function getDecryptedResponse() {
94 97
         $decrypted = urldecode($this->Response);
95 98
         return rc4crypt::decrypt(FoxyCart::getStoreKey(), $decrypted);
@@ -120,6 +123,9 @@  discard block
 block discarded – undo
120 123
         }
121 124
     }
122 125
 
126
+    /**
127
+     * @param SimpleXMLElement $response
128
+     */
123 129
     public function parseOrderInfo($response) {
124 130
 
125 131
         foreach ($response->transactions->transaction as $transaction) {
@@ -138,6 +144,9 @@  discard block
 block discarded – undo
138 144
         }
139 145
     }
140 146
 
147
+    /**
148
+     * @param SimpleXMLElement $response
149
+     */
141 150
     public function parseOrderCustomer($response) {
142 151
 
143 152
         foreach ($response->transactions->transaction as $transaction) {
@@ -179,6 +188,9 @@  discard block
 block discarded – undo
179 188
         }
180 189
     }
181 190
 
191
+    /**
192
+     * @param SimpleXMLElement $response
193
+     */
182 194
     public function parseOrderDetails($response) {
183 195
 
184 196
         // remove previous OrderDetails and OrderOptions so we don't end up with duplicates
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -241,14 +241,14 @@
 block discarded – undo
241 241
     }
242 242
 
243 243
 
244
-	public function canView($member = false) {
245
-		return Permission::check('Product_ORDERS');
246
-	}
244
+    public function canView($member = false) {
245
+        return Permission::check('Product_ORDERS');
246
+    }
247 247
 
248
-	public function canEdit($member = null) {
248
+    public function canEdit($member = null) {
249 249
         return false;
250 250
         //return Permission::check('Product_ORDERS');
251
-	}
251
+    }
252 252
 
253 253
     public function canDelete($member = null)
254 254
     {
Please login to merge, or discard this patch.
code/objects/OrderDetail.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -101,14 +101,14 @@
 block discarded – undo
101 101
     {
102 102
         return false;
103 103
         //return Permission::check('Product_ORDERS');
104
-	}
104
+    }
105 105
 
106
-	public function canDelete($member = null) {
107
-		return Permission::check('Product_ORDERS');
108
-	}
106
+    public function canDelete($member = null) {
107
+        return Permission::check('Product_ORDERS');
108
+    }
109 109
 
110
-	public function canCreate($member = null) {
111
-		return false;
112
-	}
110
+    public function canCreate($member = null) {
111
+        return false;
112
+    }
113 113
 
114 114
 }
115 115
\ No newline at end of file
Please login to merge, or discard this patch.