Skip to content

Commit 65054cd

Browse files
committed
Added additional environment variable for the bitpay token label and added it to the config file, then replaced the app napp name out with this variable. The createkeypair command fails when the app name has spaces in it. Made a note in the readme also
1 parent 1d5fff2 commit 65054cd

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ php artisan vendor:publish --provider="Vrajroham\LaravelBitpay\LaravelBitpayServ
4343
#### Add configuration values
4444
Add following keys to `.env` file and updated the details ([view more about configuration](https://support.bitpay.com/hc/en-us/articles/115003001063-How-do-I-configure-the-PHP-BitPay-Client-Library-)):
4545

46+
note: BITPAY_TOKEN_LABEL can be any name, but can not have spaces
47+
4648
```dotenv
4749
BITPAY_PRIVATE_KEY_PATH=/tmp/bitpay.pri
4850
BITPAY_PUBLIC_KEY_PATH=/tmp/bitpay.pub
4951
BITPAY_NETWORK=testnet
5052
BITPAY_KEY_STORAGE_PASSWORD=SomeRandomePasswordForKeypairEncryption
5153
BITPAY_TOKEN=
54+
BITPAY_TOKEN_LABEL=projectname
5255
```
5356

5457
#### Add webhook event listener

config/laravel-bitpay.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@
3737
* BitPay Token
3838
*/
3939
'token' => env('BITPAY_TOKEN', ''),
40+
41+
/*
42+
* BitPay Token label
43+
*/
44+
'label' => env('BITPAY_TOKEN_LABEL', 'projectlabel'),
4045
];

src/Commands/CreateKeypair.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function pairWithServerAndCreateToken()
144144
$this->info(' - Connecting Bitpay server 🖥️ and generating token & pairing code.');
145145

146146
try {
147-
$this->pairingCodeLabel = config('app.name').'_BitPay_Client';
147+
$this->pairingCodeLabel = config('laravel-bitpay.label').'_BitPay_Client';
148148
$postData = [
149149
'id' => (string) $this->sin,
150150
'label' => $this->pairingCodeLabel,

0 commit comments

Comments
 (0)