Skip to content

Commit

Permalink
bugfix - update SSO redirect link to accommodate custom SSL (#346)
Browse files Browse the repository at this point in the history
fixes #343
  • Loading branch information
jsirish authored Oct 23, 2018
1 parent 55c29ce commit 549295a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Controller/FoxyStripeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Dynamic\FoxyStripe\Controller;

use Dynamic\FoxyStripe\Model\FoxyCart;
use Dynamic\FoxyStripe\Model\FoxyStripeSetting;
use Dynamic\FoxyStripe\Model\Order;
use SilverStripe\Security\Member;
use SilverStripe\Security\Security;
Expand Down Expand Up @@ -104,7 +105,14 @@ public function sso()

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

$redirect_complete = 'https://'.FoxyCart::getFoxyCartStoreName().'.foxycart.com/checkout?fc_auth_token='.
$config = FoxyStripeSetting::current_foxystripe_setting();
if ($config->CustomSSL) {
$link = FoxyCart::getFoxyCartStoreName();
} else {
$link = FoxyCart::getFoxyCartStoreName() . '.foxycart.com';
}

$redirect_complete = 'https://'.$link.'.foxycart.com/checkout?fc_auth_token='.
$auth_token.'&fcsid='.$fcsid.'&fc_customer_id='.$Member->Customer_ID.'&timestamp='.$timestampNew;

$this->redirect($redirect_complete);
Expand Down

0 comments on commit 549295a

Please sign in to comment.