-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Get v3 up to date with latest PRs on v2
- Loading branch information
Showing
15 changed files
with
336 additions
and
22 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
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 |
---|---|---|
|
@@ -7,8 +7,8 @@ | |
// Fill in with your BTCPay Server data. | ||
$apiKey = ''; | ||
$host = ''; // e.g. https://your.btcpay-server.tld | ||
$storeId = ''; | ||
$invoiceId = ''; | ||
$email = ''; // e.g. [email protected] | ||
$password = ''; | ||
|
||
// Get information about store on BTCPay Server. | ||
try { | ||
|
@@ -17,3 +17,33 @@ | |
} catch (\Throwable $e) { | ||
echo "Error: " . $e->getMessage(); | ||
} | ||
|
||
/* | ||
print("\nCreate a new api key (needs server modify permission of used api).\n"); | ||
try { | ||
$client = new Apikey($host, $apiKey); | ||
var_dump($client->createApiKey('api generated', ['btcpay.store.canmodifystoresettings'])); | ||
} catch (\Throwable $e) { | ||
echo "Error: " . $e->getMessage(); | ||
} | ||
*/ | ||
print("\nCreate a new api key for different user. Needs unrestricted access\n"); | ||
|
||
try { | ||
$client = new Apikey($host, $apiKey); | ||
$uKey = $client->createApiKeyForUser($userEmail, 'api generated to be deleted', ['btcpay.store.canmodifystoresettings']); | ||
var_dump($uKey); | ||
} catch (\Throwable $e) { | ||
echo "Error: " . $e->getMessage(); | ||
} | ||
|
||
|
||
print("\nRevoke api key for different user.\n"); | ||
|
||
try { | ||
$client = new Apikey($host, $apiKey); | ||
$uKey = $client->revokeApiKeyForUser($userEmail, $uKey->getData()['apiKey']); | ||
var_dump($uKey); | ||
} catch (\Throwable $e) { | ||
echo "Error: " . $e->getMessage(); | ||
} |
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
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.