Example #1
0
function generateMessage($first_name, $cart, $transid)
{
    $message = 'Hallo ' . $first_name . ",\n\nWe received your Payment with the Transaction ID: " . $transid . "\n\n";
    $message .= "You purchased:\n\n";
    foreach ($cart as $productid => $product) {
        $message .= "- " . $product->name . " (" . $product->description . ")" . "\n";
    }
    $message .= "\nTo download the Products you have purchased, please visit the 'Payment History' section when logged in\n\n";
    $message .= "- Your " . Settings::i()->title . " Team";
    return $message;
}
Example #2
0
 function __construct($testing = false)
 {
     $this->testing = $testing;
     if (!$testing) {
         $this->api_url = str_replace("sandbox.", "", $this->api_url);
     }
     $this->api_user = Settings::i()->paypal_email;
     $this->api_password = Settings::i()->paypal_api_pass;
     $this->api_signature = Settings::i()->paypal_api_signature;
     if (is_null($this->api_user) || is_null($this->api_password) || is_null($this->api_signature)) {
         throw new Exception("PayPal API Credentials missing");
     }
 }
Example #3
0
require_once ROOT_DIR . '/class.sessionmanager.php';
require_once ROOT_DIR . '/recaptchalib.php';
if (!SessionManager::i()->validateToken("LoginToken", "token")) {
    Logger::i()->writeLog("Token to login is missing", 'dev');
    die(Submission::createResult("Please refresh the page and try again"));
}
if (isset($_POST['login'])) {
    $login = (array) json_decode(base64_decode($_POST['login']));
    if ($field = Submission::checkFields(array("username", "password"), $login)) {
        die(Submission::createResult(ucfirst($field) . " is missing or invalid"));
    }
    if (Settings::i()->captcha_private) {
        if (!isset($login['captcha_response'])) {
            die(Submission::createResult("Please validate the captcha"));
        }
        $reCaptcha = new ReCaptcha(Settings::i()->captcha_private);
        $resp = $reCaptcha->verifyResponse($_SERVER["REMOTE_ADDR"], $login['captcha_response']);
        if (!$resp->success) {
            die(Submission::createResult("Please validate the Captcha"));
        }
    }
    $key = Crypto::GenerateKey($login['username']);
    $find = DbManager::i()->select("sf_members", array("iv", "userid"), array("key" => base64_encode(base64_encode($key))));
    if ($find !== false) {
        if (!is_array($find)) {
            $iv = base64_decode(base64_decode($find->iv));
            $password = base64_encode(base64_encode(Crypto::EncryptString($key, $iv, $login['password'])));
            $find = DbManager::i()->select("sf_members", array("userid"), array("password" => $password));
            if ($find !== false && !is_array($find)) {
                echo Submission::createResult("login successful", true);
                $_SESSION['login'] = 1;
Example #4
0
');" class="center-block" src="https://www.paypalobjects.com/webstatic/en_US/developer/docs/ec/EC-button.gif" alt="Paypal"/></a>
									</div>
									<?php 
}
if (strlen(Settings::i()->btc_api_key) > 0) {
    ?>
									<div class="col-md-6">
										<h3 class="text-center">Checkout with Bitcoin</h3>
										<a><img ng-click="checkoutWithBTC('<?php 
    echo $_SESSION['CheckoutToken'];
    ?>
');" class="center-block" src="images/bitcoin.png" alt="BTC"/></a>
									</div>
									<?php 
}
if (strlen(Settings::i()->paypal_email) <= 0 && strlen(Settings::i()->btc_api_key) <= 0) {
    ?>
										<p class="text-center">Checkout not possible at the moment. Please contact an administrator</p>
									<?php 
}
?>
			  					</div>
							</div>
							<div id="btcResult" ng-show="btcaddress.length">
								<div class="panel panel-default">
									<div class="panel-body">
										<h3 class="text-center"><span class="glyphicon glyphicon-btc" aria-hidden="true"></span> Please send {{btcamount | currency:'':8}} Bitcoins to: {{btcaddress}}</h3>
										<p class="text-center">After paying please visit 'Payment History' to check for the status. Thanks :)</p>
									</div>
								</div>
							</div>
Example #5
0
<head>
	<title><?php 
echo Settings::i()->title;
?>
</title>
	<meta charset="UTF-8">
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="description" content="ShopFix is a simple but useful shop CMS" />
	<meta name="keywords" content="shopping, shopfix, cms, purchases" />
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	<meta name='expires' content='0'>
	<meta content='no-cache'>

	<link rel="stylesheet" href="./css/bootstrap.min.css">
</head>
<body>
	<div class="container">
		<div class="jumbotron">
		  <h1>Hi there!</h1>
		  <p>It seems you do not have JavaScript enabled for this Website, however <?php 
echo Settings::i()->title;
?>
 requires you to have JavaScript enabled.</p>
		  <p>Please enable JavaScript and then you can get back to <a href="index.php">the actual <?php 
echo Settings::i()->title;
?>
 website</a></p>
		</div>
	</div>
</body>
</html>
Example #6
0
		<!-- Angular JS -->
		<script type="text/javascript" src= "../js/angular.min.js"></script>
		<script type="text/javascript" src= "./js/shopfix.js"></script>

		<!-- Bootstrap -->
		<script type="text/javascript" src="../js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="../css/bootstrap.min.css">

		<script type="text/javascript">
			var loginResponse = null;
			var loginContainer = null;
		    var loadCaptcha = function() {
		      loginContainer = grecaptcha.render('login_container', {
		        'sitekey' : '<?php 
if (!is_null(Settings::i()->captcha_public)) {
    echo Settings::i()->captcha_public;
}
?>
',
		        'callback' : function(response) {
		          loginResponse = response;
		        }
		      });
		    };
		</script>

	</head>
	<body>
		<div class="container">
			<div class="row">
				<div class="panel panel-default">
Example #7
0
 function __construct()
 {
     $this->api_key = Settings::i()->btc_api_key;
     $this->api_pin = Settings::i()->btc_api_pin;
     if (!is_null($this->api_key) && !is_null($this->api_pin)) {
         try {
             $this->block_io = new BlockIo($this->api_key, $this->api_pin, BTC_API_VERSION);
         } catch (Exception $e) {
             throw new Exception($e->getMessage());
         }
     } else {
         throw new Exception("API Key and API Pin are missing in settings");
     }
     $this->token = SessionManager::GenerateToken();
 }