From 549295aba2571a8bf1218a2a0c05adcb1169d075 Mon Sep 17 00:00:00 2001 From: Jason Irish Date: Tue, 23 Oct 2018 14:31:38 -0500 Subject: [PATCH] bugfix - update SSO redirect link to accommodate custom SSL (#346) fixes #343 --- src/Controller/FoxyStripeController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Controller/FoxyStripeController.php b/src/Controller/FoxyStripeController.php index 57c552b..defd9b6 100644 --- a/src/Controller/FoxyStripeController.php +++ b/src/Controller/FoxyStripeController.php @@ -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; @@ -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.'×tamp='.$timestampNew; $this->redirect($redirect_complete);