-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-> Adding Stripe -> Updated readme with new dash list -> Moved install location to view since it is a view
- Loading branch information
Showing
17 changed files
with
306 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE `mythicaldash_settings` ADD `stripe_publishable_key` TEXT NOT NULL DEFAULT 'none' AFTER `discord_webhook`, ADD `stripe_secret_key` TEXT NOT NULL DEFAULT 'none' AFTER `stripe_publishable_key`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE `mythicaldash_settings` CHANGE `version` `version` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '3.0.2'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE `mythicaldash_settings` ADD `enable_stripe` ENUM('false','true') NOT NULL DEFAULT 'false' AFTER `discord_webhook`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE `mythicaldash_settings` ADD `stripe_coin_per_balance` TEXT NOT NULL DEFAULT '0.25' AFTER `stripe_secret_key`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE `mythicaldash_settings` ADD `stripe_currency` TEXT NOT NULL DEFAULT 'eur' AFTER `stripe_coin_per_balance`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
$router->add("/store/buy/stripe/coins", function () { | ||
require("../include/main.php"); | ||
require("../view/stripe/buy_coins.php"); | ||
}); | ||
|
||
$router->add("/store/get/stripe/coins", function () { | ||
require("../include/main.php"); | ||
require("../view/stripe/get_coins.php"); | ||
}); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
use MythicalDash\ErrorHandler; | ||
include (__DIR__ . '/../../requirements/page.php'); | ||
include (__DIR__ . '/../../requirements/admin.php'); | ||
|
||
try { | ||
if (isset($_GET['update_settings'])) { | ||
$enable_stripe = mysqli_real_escape_string($conn, $_GET['stripe:enabled']); | ||
$stripe_publishable_key = mysqli_real_escape_string($conn, $_GET['stripe:public_key']); | ||
$stripe_secret_key = mysqli_real_escape_string($conn, $_GET['stripe:private_key']); | ||
$stripe_coin_per_balance = mysqli_real_escape_string($conn, $_GET['stripe:coin_per_balance']); | ||
$stripe_currency = mysqli_real_escape_string($conn, $_GET['stripe:stripe_currency']); | ||
mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `enable_stripe` = '" . $enable_stripe . "' WHERE `mythicaldash_settings`.`id` = 1;"); | ||
mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `stripe_publishable_key` = '" . $stripe_publishable_key . "' WHERE `mythicaldash_settings`.`id` = 1;"); | ||
mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `stripe_secret_key` = '" . $stripe_secret_key . "' WHERE `mythicaldash_settings`.`id` = 1;"); | ||
mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `stripe_coin_per_balance` = '" . $stripe_coin_per_balance . "' WHERE `mythicaldash_settings`.`id` = 1;"); | ||
mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `stripe_currency` = '" . $stripe_currency . "' WHERE `mythicaldash_settings`.`id` = 1;"); | ||
header('location: /admin/settings?s=We updated the settings inside the database'); | ||
$conn->close(); | ||
die (); | ||
} else { | ||
header('location: /admin/settings'); | ||
die (); | ||
} | ||
} catch (Exception $ex) { | ||
ErrorHandler::Critical("Failed to update settings ",$e); | ||
header('location: /admin/settings?e=Failed to update the settings inside the database'); | ||
die (); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.