@@ -2,41 +2,41 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 . '×tamp=' . $timestampNew; |
| 87 | 87 | |
| 88 | - $this->redirect($redirect_complete); |
|
| 88 | + $this->redirect($redirect_complete); |
|
| 89 | 89 | |
| 90 | 90 | } |
| 91 | 91 | |
@@ -241,14 +241,14 @@ |
||
| 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 | { |
@@ -101,14 +101,14 @@ |
||
| 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 |