public function sso()
    {
        // GET variables from FoxyCart Request
        $fcsid = $this->request->getVar('fcsid');
        $timestampNew = strtotime('+30 days');

        // get current member if logged in. If not, create a 'fake' user with Customer_ID = 0
        // fake user will redirect to FC checkout, ask customer to log in
        // to do: consider a login/registration form here if not logged in
        if (!$Member = Security::getCurrentUser()) {
            $Member = new Member();
            $Member->Customer_ID = 0;
        }

        $auth_token = sha1($Member->Customer_ID . '|' . $timestampNew . '|' . FoxyCart::getStoreKey());

        $config = FoxyStripeSetting::current_foxystripe_setting();
        if ($config->CustomSSL) {
            $link = FoxyCart::getFoxyCartStoreName();
        } else {
            $link = FoxyCart::getFoxyCartStoreName() . '.foxycart.com';
        }

        $params = [
            'fc_auth_token' => $auth_token,
            'fcsid' => $fcsid,
            'fc_customer_id' => $Member->Customer_ID,
            'timestamp' => $timestampNew,
        ];

        $httpQuery = http_build_query($params);

        $this->redirect("https://{$link}/checkout?$httpQuery");
    }
public function sso()
    {
        // GET variables from FoxyCart Request
        $fcsid = $this->request->getVar('fcsid');
        $timestampNew = strtotime('+30 days');

        // get current member if logged in. If not, create a 'fake' user with Customer_ID = 0
        // fake user will redirect to FC checkout, ask customer to log in
        // to do: consider a login/registration form here if not logged in
        if (!$Member = Security::getCurrentUser()) {
            $Member = new Member();
            $Member->Customer_ID = 0;
        }

        $auth_token = sha1($Member->Customer_ID . '|' . $timestampNew . '|' . FoxyCart::getStoreKey());

        $config = FoxyStripeSetting::current_foxystripe_setting();
        if ($config->CustomSSL) {
            $link = FoxyCart::getFoxyCartStoreName();
        } else {
            $link = FoxyCart::getFoxyCartStoreName() . '.foxycart.com';
        }

        $params = [
            'fc_auth_token' => $auth_token,
            'fcsid' => $fcsid,
            'fc_customer_id' => $Member->Customer_ID,
            'timestamp' => $timestampNew,
        ];

        $httpQuery = http_build_query($params);

        $this->redirect("https://{$link}/checkout?$httpQuery");
    }
public function sso ( ) { // GET variables from FoxyCart Request $ fcsid = $ this -> request -> getVar ( 'fcsid' ) ; $ timestampNew = strtotime ( '+30 days' ) ; // get current member if logged in. If not, create a 'fake' user with Customer_ID = 0 // fake user will redirect to FC checkout, ask customer to log in // to do: consider a login/registration form here if not logged in if ( ! $ Member = Security :: getCurrentUser ( ) ) { $ Member = new Member ( ) ; $ Member -> Customer_ID = 0 ; } $ auth_token = sha1 ( $ Member -> Customer_ID . '|' . $ timestampNew . '|' . FoxyCart :: getStoreKey ( ) ) ; $ config = FoxyStripeSetting :: current_foxystripe_setting ( ) ; if ( $ config -> CustomSSL ) { $ link = FoxyCart :: getFoxyCartStoreName ( ) ; } else { $ link = FoxyCart :: getFoxyCartStoreName ( ) . '.foxycart.com' ; } $ params = [ 'fc_auth_token' => $ auth_token , 'fcsid' => $ fcsid , 'fc_customer_id' => $ Member -> Customer_ID , 'timestamp' => $ timestampNew , ] ; $ httpQuery = http_build_query ( $ params ) ; $ this -> redirect ( "https://{$link}/checkout?$httpQuery" ) ; }
Single Sign on integration with FoxyCart.
Single Sign on integration with FoxyCart .