-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JohnMcCombs
committed
Apr 12, 2022
1 parent
2fb33b1
commit 6399292
Showing
5 changed files
with
195 additions
and
2 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
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,36 @@ | ||
<?php | ||
/** | ||
* Bolt PHP library | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the MIT License (MIT) | ||
* that is bundled with this package in the file LICENSE. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/MIT | ||
* | ||
* @category Bolt | ||
* @copyright Copyright (c) 2018 Bolt Financial, Inc (https://www.bolt.com) | ||
* @license https://opensource.org/licenses/MIT MIT License (MIT) | ||
*/ | ||
|
||
/** Return hardcoded shipping methods. */ | ||
require(dirname(__FILE__) . '/../init_example.php'); | ||
|
||
$hmacHeader = @$_SERVER['HTTP_X_BOLT_HMAC_SHA256']; | ||
|
||
$signatureVerifier = new \BoltPay\SignatureVerifier( | ||
\BoltPay\Bolt::$signingSecret | ||
); | ||
|
||
$requestJson = file_get_contents('php://input'); | ||
|
||
if (!$signatureVerifier->verifySignature($requestJson, $hmacHeader)) { | ||
throw new Exception("Failed HMAC Authentication"); | ||
} | ||
$customerId = 2; | ||
$response = ['id' => $customerId]; | ||
|
||
header('Content-Type: application/json'); | ||
http_response_code(200); | ||
echo json_encode($response); |
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,22 @@ | ||
<?php | ||
/** | ||
* Bolt PHP library | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the MIT License (MIT) | ||
* that is bundled with this package in the file LICENSE. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/MIT | ||
* | ||
* @category Bolt | ||
* @copyright Copyright (c) 2018 Bolt Financial, Inc (https://www.bolt.com) | ||
* @license https://opensource.org/licenses/MIT MIT License (MIT) | ||
*/ | ||
|
||
/** Return hardcoded shipping methods. */ | ||
|
||
require(dirname(__FILE__) . '/../init_example.php'); | ||
session_start(); | ||
$_SESSION['logged_in'] = false; | ||
header("Location:http://boltphp.bolt.devzn.com/example/cart.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* Bolt PHP library | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the MIT License (MIT) | ||
* that is bundled with this package in the file LICENSE. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/MIT | ||
* | ||
* @category Bolt | ||
* @copyright Copyright (c) 2018 Bolt Financial, Inc (https://www.bolt.com) | ||
* @license https://opensource.org/licenses/MIT MIT License (MIT) | ||
*/ | ||
|
||
/** Return hardcoded shipping methods. */ | ||
|
||
require(dirname(__FILE__) . '/../init_example.php'); | ||
session_start(); | ||
$hmacHeader = @$_SERVER['HTTP_X_BOLT_HMAC_SHA256']; | ||
|
||
$signatureVerifier = new \BoltPay\SignatureVerifier( | ||
\BoltPay\Bolt::$signingSecret | ||
); | ||
|
||
$requestJson = file_get_contents('php://input'); | ||
|
||
$_SESSION['logged_in'] = true; | ||
header('Content-Type: application/json'); | ||
http_response_code(200); | ||
header("Location:http://boltphp.bolt.devzn.com/example/cart.php"); |