diff --git a/README.md b/README.md index 02b5696..afcc9a9 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -psyb0t/btcpayserver-php-client +btcpayserver/btcpayserver-php-client ================= -[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/psyb0t/btcpayserver-php-client/master/LICENSE.md) -[![Travis](https://img.shields.io/travis/psyb0t/btcpayserver-php-client.svg?style=flat-square)](https://travis-ci.org/psyb0t/btcpayserver-php-client) -[![Packagist](https://img.shields.io/packagist/v/psyb0t/btcpayserver-php-client.svg?style=flat-square)](https://packagist.org/packages/psyb0t/btcpayserver-php-client) -[![Code Climate](https://img.shields.io/codeclimate/github/psyb0t/btcpayserver-php-client.svg?style=flat-square)](https://codeclimate.com/github/psyb0t/btcpayserver-php-client) -[![Scrutinizer](https://img.shields.io/scrutinizer/g/psyb0t/btcpayserver-php-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/psyb0t/btcpayserver-php-client/) -[![Coveralls](https://img.shields.io/coveralls/psyb0t/btcpayserver-php-client.svg?style=flat-square)](https://coveralls.io/r/psyb0t/btcpayserver-php-client) +[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/btcpayserver/btcpayserver-php-client/master/LICENSE.md) +[![Travis](https://img.shields.io/travis/btcpayserver/btcpayserver-php-client.svg?style=flat-square)](https://travis-ci.org/btcpayserver/btcpayserver-php-client) +[![Packagist](https://img.shields.io/packagist/v/btcpayserver/btcpayserver-php-client.svg?style=flat-square)](https://packagist.org/packages/btcpayserver/btcpayserver-php-client) +[![Code Climate](https://img.shields.io/codeclimate/github/btcpayserver/btcpayserver-php-client.svg?style=flat-square)](https://codeclimate.com/github/btcpayserver/btcpayserver-php-client) +[![Scrutinizer](https://img.shields.io/scrutinizer/g/btcpayserver/btcpayserver-php-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/btcpayserver/btcpayserver-php-client/) +[![Coveralls](https://img.shields.io/coveralls/btcpayserver/btcpayserver-php-client.svg?style=flat-square)](https://coveralls.io/r/btcpayserver/btcpayserver-php-client) -[![Documentation Status](https://readthedocs.org/projects/php-bitpay-client/badge/?version=latest)](https://readthedocs.org/projects/php-bitpay-client/?badge=latest) -[![Total Downloads](https://poser.pugx.org/psyb0t/btcpayserver-php-client/downloads.svg)](https://packagist.org/packages/psyb0t/btcpayserver-php-client) -[![Latest Unstable Version](https://poser.pugx.org/psyb0t/btcpayserver-php-client/v/unstable.svg)](https://packagist.org/packages/psyb0t/btcpayserver-php-client) +[![Documentation Status](https://readthedocs.org/projects/php-btcpay-client/badge/?version=latest)](https://readthedocs.org/projects/php-btcpay-client/?badge=latest) +[![Total Downloads](https://poser.pugx.org/btcpayserver/btcpayserver-php-client/downloads.svg)](https://packagist.org/packages/btcpayserver/btcpayserver-php-client) +[![Latest Unstable Version](https://poser.pugx.org/btcpayserver/btcpayserver-php-client/v/unstable.svg)](https://packagist.org/packages/btcpayserver/btcpayserver-php-client) This is a self-contained PHP implementation of BTCPayServer's cryptographically secure API: https://github.com/btcpayserver/btcpayserver-doc/blob/master/CustomIntegration.md @@ -27,12 +27,12 @@ curl -sS https://getcomposer.org/installer | php ### Install using composer ```bash -php composer.phar require psyb0t/btcpayserver-php-client +php composer.phar require btcpayserver/btcpayserver-php-client ``` # Configuration -See https://github.com/psyb0t/btcpayserver-php-client/tree/master/examples +See https://github.com/btcpayserver/btcpayserver-php-client/tree/master/examples # Usage @@ -61,11 +61,11 @@ and the ``examples`` directory for examples on using this library. You should be able to run all the examples by running ``php examples/File.php``. The ``examples/tutorial`` directory provides four scripts that guide you with creating a BTCPayServer invoice: -https://github.com/psyb0t/btcpayserver-php-client/blob/master/examples/tutorial/ +https://github.com/btcpayserver/btcpayserver-php-client/blob/master/examples/tutorial/ # Support -* https://github.com/psyb0t/btcpayserver-php-client/issues +* https://github.com/btcpayserver/btcpayserver-php-client/issues # License diff --git a/build/phpunit.xml.dist b/build/phpunit.xml.dist index 6983921..8fbca6c 100644 --- a/build/phpunit.xml.dist +++ b/build/phpunit.xml.dist @@ -2,7 +2,7 @@ diff --git a/build/rulesets/phpmd.xml b/build/rulesets/phpmd.xml index 3454a4d..6184e42 100644 --- a/build/rulesets/phpmd.xml +++ b/build/rulesets/phpmd.xml @@ -2,7 +2,7 @@ diff --git a/build/stub.php b/build/stub.php index 7b1f1db..68445ca 100644 --- a/build/stub.php +++ b/build/stub.php @@ -1,7 +1,7 @@ array( + 'btcpay' => array( 'network' => 'testnet', ) ) diff --git a/docs/contributing.md b/docs/contributing.md index b606f7b..a84ccea 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -22,7 +22,7 @@ Add upstream Remote Adding a remote helps keep you up to date with the lastest code updates. ``` {.sourceCode .bash} -git remote add -f upstream git@github.com:psyb0t/btcpayserver-php-client.git +git remote add -f upstream git@github.com:btcpayserver/btcpayserver-php-client.git ``` Creating Branches diff --git a/docs/installation.md b/docs/installation.md index 0543fcd..d324c52 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -6,7 +6,7 @@ Add the following to your composer.json ``` {.sourceCode .json} "require": { - "psyb0t/btcpayserver-php-client": "~0.1.0" + "btcpayserver/btcpayserver-php-client": "~0.1.0" } ``` @@ -21,7 +21,7 @@ Once you have added this to your composer.json file you will need to install the library in your project. ``` {.sourceCode .bash} -php composer.phar update psyb0t/btcpayserver-php-client +php composer.phar update btcpayserver/btcpayserver-php-client ``` Composer Alternative @@ -31,7 +31,7 @@ By running this composer command, you will add the library to composer.json and install the latest version. ``` {.sourceCode .bash} -php composer.phar require "psyb0t/btcpayserver-php-client" +php composer.phar require "btcpayserver/btcpayserver-php-client" ``` Setup diff --git a/docs/invoices/index.md b/docs/invoices/index.md index 3d44ef9..107de7d 100644 --- a/docs/invoices/index.md +++ b/docs/invoices/index.md @@ -51,9 +51,9 @@ Creating an Invoice Create an instance of the BTCPayServer class. ``` {.sourceCode .php} -$bitpay = new \BTCPayServer\BTCPayServer( +$btcpay = new \BTCPayServer\BTCPayServer( array( - 'bitpay' => array( + 'btcpay' => array( 'network' => 'testnet', // testnet or livenet, default is livenet 'public_key' => getenv('HOME').'/.btcpayserver/api.pub', 'private_key' => getenv('HOME').'/.btcpayserver/api.key', @@ -73,7 +73,7 @@ Next you will need to get the client. ``` {.sourceCode .php} // @var \BTCPayServer\Client\Client -$client = $bitpay->get('client'); +$client = $btcpay->get('client'); ``` Inject your `TokenObject` into the client. diff --git a/docs/keypairs/index.md b/docs/keypairs/index.md index 5ce1f62..f84e955 100644 --- a/docs/keypairs/index.md +++ b/docs/keypairs/index.md @@ -72,4 +72,4 @@ $keyManager->persist($privateKey); Cookbook ======== -* [Creating your own storage clas](https://github.com/psyb0t/btcpayserver-php-client/blob/master/docs/keypairs/storage.md) +* [Creating your own storage clas](https://github.com/btcpayserver/btcpayserver-php-client/blob/master/docs/keypairs/storage.md) diff --git a/docs/keypairs/storage.md b/docs/keypairs/storage.md index 1711f72..5e8c631 100644 --- a/docs/keypairs/storage.md +++ b/docs/keypairs/storage.md @@ -4,7 +4,7 @@ along with where your keys are stored. This section of the documentation will go over how to create a new storage service. The first step is to implement the -[StorageInterface](https://github.com/psyb0t/btcpayserver-php-client/blob/master/src/BTCPayServer/Storage/StorageInterface.php). +[StorageInterface](https://github.com/btcpayserver/btcpayserver-php-client/blob/master/src/BTCPayServer/Storage/StorageInterface.php). ``` {.sourceCode .php} use BTCPayServer\Storage\StorageInterface; @@ -26,7 +26,7 @@ class ArrayStorage implements StorageInterface You can use a class like this to store your keys in a database, S3, or any other place you can think of. Now to use your new Storage class, you inject it into the -[KeyManager](https://github.com/psyb0t/btcpayserver-php-client/blob/master/src/BTCPayServer/KeyManager.php) +[KeyManager](https://github.com/btcpayserver/btcpayserver-php-client/blob/master/src/BTCPayServer/KeyManager.php) ``` {.sourceCode .php} $storage = new ArrayStorage(); diff --git a/docs/pairing/index.md b/docs/pairing/index.md index f67df2e..615e64a 100644 --- a/docs/pairing/index.md +++ b/docs/pairing/index.md @@ -10,9 +10,9 @@ Pairing {#pairing-1} Create an instance of the BTCPayServer class. ``` {.sourceCode .php} -$bitpay = new \BTCPayServer\BTCPayServer( +$btcpay = new \BTCPayServer\BTCPayServer( array( - 'bitpay' => array( + 'btcpay' => array( 'network' => 'testnet', // testnet or livenet, default is livenet 'public_key' => getenv('HOME').'/.btcpayserver/api.pub', 'private_key' => getenv('HOME').'/.btcpayserver/api.key', @@ -25,15 +25,15 @@ Next you will need to get the client. ``` {.sourceCode .php} // @var \BTCPayServer\Client\Client -$client = $bitpay->get('client'); +$client = $btcpay->get('client'); ``` You will next need to create a SIN based on your Public Key. ``` {.sourceCode .php} // @var \BTCPayServer\KeyManager -$manager = $bitpay->get('key_manager'); -$publicKey = $manager->load($bitpay->getContainer()->getParameter('btcpayserver.public_key')); +$manager = $btcpay->get('key_manager'); +$publicKey = $manager->load($btcpay->getContainer()->getParameter('btcpayserver.public_key')); $sin = new \BTCPayServer\SinKey(); $sin->setPublicKey($publicKey); $sin->generate(); diff --git a/docs/testing.md b/docs/testing.md index 5a821b3..9196c8f 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -1,7 +1,7 @@ ## Testing Current Build Status: -[![image](https://travis-ci.org/psyb0t/btcpayserver-php-client.svg?branch=master)](https://travis-ci.org/psyb0t/btcpayserver-php-client) +[![image](https://travis-ci.org/btcpayserver/btcpayserver-php-client.svg?branch=master)](https://travis-ci.org/btcpayserver/btcpayserver-php-client) Testing ensures that code is stable and that the code quality is high by holding every person to the same standards. Before you start, please @@ -112,7 +112,7 @@ source ./integration_tests.sh 'https://bobert.bp:8090' bobert@gmail.com 'abc123% You can configure which instance of btcpayserver.com this will test with to by changing the url in the behat.yml file. Make sure you replace username -and password with the credentials used to log into the bitpay site you +and password with the credentials used to log into the btcpay site you are testing with. You can also run specific tests from a command like so: @@ -130,7 +130,7 @@ php bin/behat tests/integrations/invoice_create.feature:20 > **note** > > Tests run individually require you to set environment variables for -> your bitpay credentials or they must be set in the behat.yml file. +> your btcpay credentials or they must be set in the behat.yml file. > > Also keep in mind that rate limiters may hinder some tests and they > need to be reset every so often. diff --git a/docs/usage.md b/docs/usage.md index 1e346c3..a6cfdc2 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -41,14 +41,14 @@ allows you to make requests to our API and receive responses back without having to do too much work. You can see a list of services you have access to by checking out the -[services.xml](https://github.com/psyb0t/btcpayserver-php-client/blob/master/src/BTCPayServer/DependencyInjection/services.xml) +[services.xml](https://github.com/btcpayserver/btcpayserver-php-client/blob/master/src/BTCPayServer/DependencyInjection/services.xml) file. To gain access to any of these services, you first need to instantiate the `BTCPayServer` class with your configuration options. ``` {.sourceCode .php} -$bitpay = \BTCPayServer\BTCPayServer($configuration); +$btcpay = \BTCPayServer\BTCPayServer($configuration); ``` > **note** @@ -64,7 +64,7 @@ work. For all the requests you can make, please see the [API Documentation](https://btcpayserver.com/api) on the website. To get started you need to create your -[Request](https://github.com/psyb0t/btcpayserver-php-client/blob/master/src/BTCPayServer/Client/Request.php) +[Request](https://github.com/btcpayserver/btcpayserver-php-client/blob/master/src/BTCPayServer/Client/Request.php) ``` {.sourceCode .php} $request = new \BTCPayServer\Client\Request(); @@ -77,7 +77,7 @@ $request->setHost('https://btcpayserver.com'); $request->setMethod(Request::METHOD_GET); $request->setPath('/invoices/InvoiceIdHere'); -$client = $bitpay->get('client'); +$client = $btcpay->get('client'); // @var BTCPayServer\Client\ResponseInterface $response = $client->sendRequest($request); @@ -85,5 +85,5 @@ $response = $client->sendRequest($request); That's all there is to it. Just make your Request object and have the Client send it. You'll get a -[Response](https://github.com/psyb0t/btcpayserver-php-client/blob/master/src/BTCPayServer/Client/ResponseInterface.php) +[Response](https://github.com/btcpayserver/btcpayserver-php-client/blob/master/src/BTCPayServer/Client/ResponseInterface.php) object in return which you can use to do whatever it is you need to do. diff --git a/examples/ConfigurationWithYamlFile.php b/examples/ConfigurationWithYamlFile.php index fb4ada8..dd75693 100644 --- a/examples/ConfigurationWithYamlFile.php +++ b/examples/ConfigurationWithYamlFile.php @@ -10,4 +10,4 @@ require __DIR__ . '/../vendor/autoload.php'; * you the ability make some easy to use configuration files. You just need * to pass in the path to the yml file. */ -$bitpay = new \BTCPayServer\BTCPayServer(__DIR__ . '/config.yml'); +$btcpay = new \BTCPayServer\BTCPayServer(__DIR__ . '/config.yml'); diff --git a/examples/CreateInvoice.php b/examples/CreateInvoice.php index aad51ec..98f408e 100644 --- a/examples/CreateInvoice.php +++ b/examples/CreateInvoice.php @@ -77,12 +77,12 @@ $publicKey = $storageEngine->load('/tmp/public.key'); /** * Create a new client. */ -$bitpay = new \BTCPayServer\BTCPayServer(); +$btcpay = new \BTCPayServer\BTCPayServer(); /** * Create the client that will be used to send requests to BTCPayServer's API */ -$client = $bitpay->get('client'); +$client = $btcpay->get('client'); $client->setPrivateKey($privateKey); $client->setPublicKey($publicKey); diff --git a/examples/CreatePayout.php b/examples/CreatePayout.php index 489e772..365e9b1 100644 --- a/examples/CreatePayout.php +++ b/examples/CreatePayout.php @@ -46,7 +46,7 @@ $public->generate($private); $adapter = new \BTCPayServer\Client\Adapter\CurlAdapter(); -$bitpay = new \BTCPayServer\BTCPayServer(); +$btcpay = new \BTCPayServer\BTCPayServer(); $client = new \BTCPayServer\Client\Client(); $client->setPrivateKey($private); diff --git a/examples/Currencies.php b/examples/Currencies.php index 889297b..ca5fa61 100644 --- a/examples/Currencies.php +++ b/examples/Currencies.php @@ -5,8 +5,8 @@ require __DIR__ . '/../vendor/autoload.php'; -$bitpay = new \BTCPayServer\BTCPayServer(__DIR__ . '/config.yml'); -$client = $bitpay->get('client'); +$btcpay = new \BTCPayServer\BTCPayServer(__DIR__ . '/config.yml'); +$client = $btcpay->get('client'); $client->setUri('https://btcpay.server/'); $currencies = $client->getCurrencies(); diff --git a/examples/GetKeys.php b/examples/GetKeys.php index 6006eee..ed35566 100644 --- a/examples/GetKeys.php +++ b/examples/GetKeys.php @@ -23,7 +23,7 @@ printf("PEM keypair: %s\n", $private->pemEncode($keypair)); // -or- if you've got a PEM-encoded text file containing your key pair, we can use this -$keys = file_get_contents(getenv('HOME') . '/.php-bitpay-client/key.pem'); +$keys = file_get_contents(getenv('HOME') . '/.php-btcpay-client/key.pem'); if (isset($keys) && strlen($keys) > 0) { $keys = chop($keys); diff --git a/examples/GetTokens.php b/examples/GetTokens.php index b09c635..1f087c3 100644 --- a/examples/GetTokens.php +++ b/examples/GetTokens.php @@ -27,9 +27,9 @@ $publicKey = $storageEngine->load('/tmp/btcpayserver.pub'); * Create a new client. You can see the example of how to configure this using * a yml file as well. */ -$bitpay = new \BTCPayServer\BTCPayServer( +$btcpay = new \BTCPayServer\BTCPayServer( array( - 'bitpay' => array( + 'btcpay' => array( 'public_key' => '/tmp/btcpayserver.pub', //see tutorial/001.php and 002.php 'private_key' => '/tmp/btcpayserver.pri', 'key_storage' => 'BTCPayServer\Storage\EncryptedFilesystemStorage', @@ -41,7 +41,7 @@ $bitpay = new \BTCPayServer\BTCPayServer( /** * Create the client that will be used to send requests to BTCPayServer's API */ -$client = $bitpay->get('client'); +$client = $btcpay->get('client'); $client->setPrivateKey($privateKey); $client->setPublicKey($publicKey); diff --git a/examples/tutorial/README.md b/examples/tutorial/README.md index d4b5e2c..e682be8 100644 --- a/examples/tutorial/README.md +++ b/examples/tutorial/README.md @@ -25,7 +25,7 @@ If you need testnet bitcoin please visit a testnet faucet, e.g. https://testnet. For more information about testing, please see https://btcpayserver.com/docs/testing -To install BTCPayServer's latest PHP library, please follow the instructions from https://github.com/psyb0t/btcpayserver-php-client/blob/master/README.md +To install BTCPayServer's latest PHP library, please follow the instructions from https://github.com/btcpayserver/btcpayserver-php-client/blob/master/README.md ## Script 1 & 2: configure your local installation The following two scripts need to be executed once. These scripts will generate your private/public keys and pair them to your BTCPayServer merchant account: diff --git a/integration_tests.sh b/integration_tests.sh index 7fb517d..7d95f87 100755 --- a/integration_tests.sh +++ b/integration_tests.sh @@ -7,7 +7,7 @@ set_variables () regex="^[a-z0-9!#\$%&'*+/=?^_\`{|}~-]+(\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?\$"; if [[ "$EMAIL" =~ $regex ]] then - export BITPAY_EMAIL=$EMAIL + export BTCPAY_EMAIL=$EMAIL break else echo "Please input a valid email" @@ -39,10 +39,10 @@ set_variables () if [ -z "$1" ] then echo "No parameters passed so using Environment Variables" - if [ -z "$BITPAY_EMAIL" ] || [ -z "$BITPAY_PASSWORD"] + if [ -z "$BTCPAY_EMAIL" ] || [ -z "$BTCPAY_PASSWORD"] then echo "ERROR: No Email or password are set." - echo "set BITPAY_EMAIL and BITPAY_PASSWORD as environment variables" + echo "set BTCPAY_EMAIL and BTCPAY_PASSWORD as environment variables" echo "or pass them as arguments when running this script" while true; do read -p "Do you wish to set your environment variables here? " yn @@ -53,7 +53,7 @@ then esac done else - echo "Environment Variables already exist for BITPAY." + echo "Environment Variables already exist for BTCPAY." fi else echo "Username $1 and Password $2 passed from command line" @@ -64,9 +64,9 @@ else fi -export BITPAY_EMAIL=$EMAIL -export BITPAY_PASSWORD=$PASSWORD -export BITPAY_URL=$URL +export BTCPAY_EMAIL=$EMAIL +export BTCPAY_PASSWORD=$PASSWORD +export BTCPAY_URL=$URL echo "Using Email: $EMAIL" echo "Using URL: $URL" diff --git a/package.json b/package.json index ad71026..8ecc093 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/psyb0t/btcpayserver-php-client.git" + "url": "https://github.com/btcpayserver/btcpayserver-php-client.git" }, "keywords": [ "btcpayserver", @@ -28,9 +28,9 @@ "author": "BTCPayServer Developer Community", "license": "MIT", "bugs": { - "url": "https://github.com/psyb0t/btcpayserver-php-client/issues" + "url": "https://github.com/btcpayserver/btcpayserver-php-client/issues" }, - "homepage": "https://github.com/psyb0t/btcpayserver-php-client", + "homepage": "https://github.com/btcpayserver/btcpayserver-php-client", "engines": { "node": ">=0.10.33", "npm": "~2.1.5" diff --git a/src/BTCPayServer/AccessToken.php b/src/BTCPayServer/AccessToken.php index 0f5b3c5..e61078e 100644 --- a/src/BTCPayServer/AccessToken.php +++ b/src/BTCPayServer/AccessToken.php @@ -1,7 +1,7 @@ root('bitpay'); + $rootNode = $treeBuilder->root('btcpay'); $rootNode ->children() ->scalarNode('public_key') diff --git a/src/BTCPayServer/Crypto/CryptoInterface.php b/src/BTCPayServer/Crypto/CryptoInterface.php index b80f368..0746d52 100644 --- a/src/BTCPayServer/Crypto/CryptoInterface.php +++ b/src/BTCPayServer/Crypto/CryptoInterface.php @@ -1,7 +1,7 @@ diff --git a/src/BTCPayServer/Invoice.php b/src/BTCPayServer/Invoice.php index e0beb13..a3e290b 100644 --- a/src/BTCPayServer/Invoice.php +++ b/src/BTCPayServer/Invoice.php @@ -1,7 +1,7 @@