@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | $rules = Director::config()->get('rules'); |
| 37 | 37 | $rule = array_search(FoxyStripeController::class, $rules); |
| 38 | - $myURL = Director::absoluteBaseURL() . explode('//', $rule)[0]; |
|
| 38 | + $myURL = Director::absoluteBaseURL().explode('//', $rule)[0]; |
|
| 39 | 39 | $myKey = FoxyCart::getStoreKey(); |
| 40 | 40 | |
| 41 | 41 | $this->updateConfig(); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $email = $emails[count($emails) - 1]; |
| 123 | 123 | return preg_replace_callback( |
| 124 | 124 | "|(\d+)|", |
| 125 | - function ($mathces) { |
|
| 125 | + function($mathces) { |
|
| 126 | 126 | return ++$mathces[1]; |
| 127 | 127 | }, |
| 128 | 128 | |
@@ -117,12 +117,10 @@ discard block |
||
| 117 | 117 | $this->setSiteConfig($siteConfig); |
| 118 | 118 | |
| 119 | 119 | $fields = ($fields != null && $fields->exists()) ? |
| 120 | - $this->getProductFields($fields) : |
|
| 121 | - $this->getProductFields(FieldList::create()); |
|
| 120 | + $this->getProductFields($fields) : $this->getProductFields(FieldList::create()); |
|
| 122 | 121 | |
| 123 | 122 | $actions = ($actions != null && $actions->exists()) ? |
| 124 | - $this->getProductActions($actions) : |
|
| 125 | - $this->getProductActions(FieldList::create()); |
|
| 123 | + $this->getProductActions($actions) : $this->getProductActions(FieldList::create()); |
|
| 126 | 124 | $validator = (!empty($validator) || $validator != null) ? $validator : RequiredFields::create(); |
| 127 | 125 | |
| 128 | 126 | parent::__construct($controller, $name, $fields, $actions, $validator); |
@@ -131,7 +129,7 @@ discard block |
||
| 131 | 129 | $this->setAttribute('action', FoxyCart::FormActionURL()); |
| 132 | 130 | $this->disableSecurityToken(); |
| 133 | 131 | |
| 134 | - $this->setHTMLID($this->getTemplateHelper()->generateFormID($this) . "_{$product->ID}"); |
|
| 132 | + $this->setHTMLID($this->getTemplateHelper()->generateFormID($this)."_{$product->ID}"); |
|
| 135 | 133 | } |
| 136 | 134 | |
| 137 | 135 | /** |
@@ -143,8 +141,7 @@ discard block |
||
| 143 | 141 | { |
| 144 | 142 | //Requirements::javascript('dynamic/foxystripe: client/dist/javascript/scripts.min.js'); |
| 145 | 143 | $hiddenTitle = ($this->product->ReceiptTitle) ? |
| 146 | - htmlspecialchars($this->product->ReceiptTitle) : |
|
| 147 | - htmlspecialchars($this->product->Title); |
|
| 144 | + htmlspecialchars($this->product->ReceiptTitle) : htmlspecialchars($this->product->Title); |
|
| 148 | 145 | $code = $this->product->Code; |
| 149 | 146 | |
| 150 | 147 | if ($this->product->Available) { |
@@ -172,7 +169,7 @@ discard block |
||
| 172 | 169 | $code, |
| 173 | 170 | 'price', |
| 174 | 171 | $this->product->Price |
| 175 | - ))->setValue($this->product->Price));//can't override id |
|
| 172 | + ))->setValue($this->product->Price)); //can't override id |
|
| 176 | 173 | if ($this->product->Weight > 0) { |
| 177 | 174 | $fields->push(HiddenField::create(ProductPage::getGeneratedValue( |
| 178 | 175 | $code, |
@@ -214,7 +211,7 @@ discard block |
||
| 214 | 211 | ); |
| 215 | 212 | |
| 216 | 213 | $fields->push( |
| 217 | - HeaderField::create('submitPrice', '$' . $this->product->Price, 4) |
|
| 214 | + HeaderField::create('submitPrice', '$'.$this->product->Price, 4) |
|
| 218 | 215 | ->addExtraClass('submit-price') |
| 219 | 216 | ); |
| 220 | 217 | $fields->push( |
@@ -223,7 +220,7 @@ discard block |
||
| 223 | 220 | ); |
| 224 | 221 | |
| 225 | 222 | $this->extend('updatePurchaseFormFields', $fields); |
| 226 | - } else { |
|
| 223 | + }else { |
|
| 227 | 224 | $fields->push(HeaderField::create('submitPrice', 'Currently Out of Stock', 4)); |
| 228 | 225 | } |
| 229 | 226 | |
@@ -269,7 +266,7 @@ discard block |
||
| 269 | 266 | */ |
| 270 | 267 | protected function getProductOptionSet() |
| 271 | 268 | { |
| 272 | - $assignAvailable = function ($self) { |
|
| 269 | + $assignAvailable = function($self) { |
|
| 273 | 270 | /** @var OptionItem $self */ |
| 274 | 271 | $this->extend('updateFoxyStripePurchaseForm', $form); |
| 275 | 272 | $self->Available = ($self->getAvailability()) ? true : false; |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | |
| 100 | 100 | if (!$this->getCustomer()->Customer_ID) { |
| 101 | 101 | $response = $client->post($this->getNewCustomerAPIURI(), $this->getSendData()); |
| 102 | - } else { |
|
| 102 | + }else { |
|
| 103 | 103 | $response = $client->patch($this->getAPIURI(true), $this->getSendData()); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | { |
| 176 | 176 | $obj = DBHTMLVarchar::create(); |
| 177 | 177 | $obj->setValue( |
| 178 | - '<a href="' . $this->ReceiptURL . '" target="_blank" class="cms-panel-link action external-link">view</a>' |
|
| 178 | + '<a href="'.$this->ReceiptURL.'" target="_blank" class="cms-panel-link action external-link">view</a>' |
|
| 179 | 179 | ); |
| 180 | 180 | |
| 181 | 181 | return $obj; |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | { |
| 211 | 211 | if ($this->Response) { |
| 212 | 212 | $this->transaction = Transaction::create($this->Order_ID, $this->Response); |
| 213 | - } else { |
|
| 213 | + }else { |
|
| 214 | 214 | $this->transaction = false; |
| 215 | 215 | } |
| 216 | 216 | |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | if ($OrderProduct) { |
| 330 | 330 | $OrderDetail->ProductID = $OrderProduct->ID; |
| 331 | 331 | } |
| 332 | - } else { |
|
| 332 | + }else { |
|
| 333 | 333 | $OrderOption = OrderOption::create(); |
| 334 | 334 | $OrderOption->Name = (string)$option->product_option_name; |
| 335 | 335 | $OrderOption->Value = (string)$option->product_option_value; |
@@ -138,13 +138,13 @@ |
||
| 138 | 138 | $Member->Customer_ID = 0; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - $auth_token = sha1($Member->Customer_ID . '|' . $timestampNew . '|' . FoxyCart::getStoreKey()); |
|
| 141 | + $auth_token = sha1($Member->Customer_ID.'|'.$timestampNew.'|'.FoxyCart::getStoreKey()); |
|
| 142 | 142 | |
| 143 | 143 | $config = FoxyStripeSetting::current_foxystripe_setting(); |
| 144 | 144 | if ($config->CustomSSL) { |
| 145 | 145 | $link = FoxyCart::getFoxyCartStoreName(); |
| 146 | - } else { |
|
| 147 | - $link = FoxyCart::getFoxyCartStoreName() . '.foxycart.com'; |
|
| 146 | + }else { |
|
| 147 | + $link = FoxyCart::getFoxyCartStoreName().'.foxycart.com'; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $this |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | if (count($errors)) { |
| 154 | 154 | Injector::inst() |
| 155 | - ->get(LoggerInterface::class)->error('setCurrentStore errors - ' . json_encode($errors)); |
|
| 155 | + ->get(LoggerInterface::class)->error('setCurrentStore errors - '.json_encode($errors)); |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $errors = array_merge($errors, $client->getErrors($result)); |
| 191 | 191 | if (count($errors)) { |
| 192 | - Injector::inst()->get(LoggerInterface::class)->error('updateStore errors - ' . json_encode($errors)); |
|
| 192 | + Injector::inst()->get(LoggerInterface::class)->error('updateStore errors - '.json_encode($errors)); |
|
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | $errors = array_merge($errors, $client->getErrors($result)); |
| 220 | 220 | if (count($errors)) { |
| 221 | 221 | Injector::inst() |
| 222 | - ->get(LoggerInterface::class)->error('setItemCategoriesURL errors - ' . json_encode($errors)); |
|
| 222 | + ->get(LoggerInterface::class)->error('setItemCategoriesURL errors - '.json_encode($errors)); |
|
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | } |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | $errors = array_merge($errors, $client->getErrors($result)); |
| 249 | 249 | if (count($errors)) { |
| 250 | 250 | Injector::inst() |
| 251 | - ->get(LoggerInterface::class)->error('setItemCategories errors - ' . json_encode($errors)); |
|
| 251 | + ->get(LoggerInterface::class)->error('setItemCategories errors - '.json_encode($errors)); |
|
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | 254 | } |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $errors = array_merge($errors, $client->getErrors($result)); |
| 278 | 278 | if (count($errors)) { |
| 279 | 279 | Injector::inst() |
| 280 | - ->get(LoggerInterface::class)->error('getCategory errors - ' . json_encode($errors)); |
|
| 280 | + ->get(LoggerInterface::class)->error('getCategory errors - '.json_encode($errors)); |
|
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | 283 | } |
@@ -298,12 +298,12 @@ discard block |
||
| 298 | 298 | if ($client) { |
| 299 | 299 | if ($category = $this->getCategory($data['code'])) { |
| 300 | 300 | $result = $client->patch($category, $data); |
| 301 | - } else { |
|
| 301 | + }else { |
|
| 302 | 302 | $result = $client->post($this->getItemCategoriesURL(), $data); |
| 303 | 303 | } |
| 304 | 304 | $errors = array_merge($errors, $client->getErrors($result)); |
| 305 | 305 | if (count($errors)) { |
| 306 | - Injector::inst()->get(LoggerInterface::class)->error('putCategory errors - ' . json_encode($errors)); |
|
| 306 | + Injector::inst()->get(LoggerInterface::class)->error('putCategory errors - '.json_encode($errors)); |
|
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | |
| 324 | 324 | $errors = array_merge($errors, $client->getErrors($result)); |
| 325 | 325 | if (count($errors)) { |
| 326 | - Injector::inst()->get(LoggerInterface::class)->error('deleteCategory errors - ' . json_encode($errors)); |
|
| 326 | + Injector::inst()->get(LoggerInterface::class)->error('deleteCategory errors - '.json_encode($errors)); |
|
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | } |