Skip to content

Commit 09bf042

Browse files
author
Antonio Buedo
committed
- README added
1 parent 004edaf commit 09bf042

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
bitpay/bitpay-php-keyutils
2+
=================
3+
4+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/bitpay/bitpay-php-keyutils/master/LICENSE.md)
5+
[![Packagist](https://img.shields.io/packagist/v/bitpay/key-utils.svg?style=flat-square)](https://packagist.org/packages/bitpay/key-utils)
6+
[![Total Downloads](https://poser.pugx.org/bitpay/key-utils/downloads.svg)](https://packagist.org/packages/bitpay/key-utils)
7+
[![Latest Unstable Version](https://poser.pugx.org/bitpay/key-utils/v/unstable.svg)](https://packagist.org/packages/bitpay/key-utils)
8+
9+
This dependency file provides utilities for use with the BitPay API. It enables creating keys, retrieving public keys, retrieving private keys, creating the SIN that is used in retrieving tokens from BitPay, and signing payloads for the `X-Signature` header in a BitPay API request.
10+
11+
# Installation
12+
13+
## Composer
14+
15+
### Install Composer
16+
17+
```bash
18+
curl -sS https://getcomposer.org/installer | php
19+
```
20+
21+
### Install via composer by hand
22+
23+
Add to your composer.json file by hand.
24+
25+
```javascript
26+
{
27+
...
28+
"require": {
29+
...
30+
"bitpay/key-utils": "~1.0"
31+
}
32+
...
33+
}
34+
```
35+
36+
Once you have added this, just run:
37+
38+
```bash
39+
php composer.phar update bitpay/key-utils
40+
```
41+
42+
### Install using composer
43+
44+
```bash
45+
php composer.phar require bitpay/key-utils:~1.0
46+
```
47+
48+
# Usage
49+
50+
## Autoloader
51+
52+
To use the library's autoloader (which doesn't include composer dependencies)
53+
instead of composer's autoloader, use the following code:
54+
55+
```php
56+
<?php
57+
$autoloader = __DIR__ . '/relative/path/to/Bitpay/Autoloader.php';
58+
if (true === file_exists($autoloader) &&
59+
true === is_readable($autoloader))
60+
{
61+
require_once $autoloader;
62+
\Bitpay\Autoloader::register();
63+
} else {
64+
throw new Exception('BitPay Library could not be loaded');
65+
}
66+
```
67+
68+
## Documentation
69+
70+
Please see the [examples.php](https://github.com/bitpay/bitpay-php-keyutils/blob/master/examples.php) script for examples on using this library.
71+
72+
# Support
73+
74+
* https://github.com/bitpay/bitpay-php-keyutils/issues
75+
* https://support.bitpay.com
76+
77+
# License
78+
79+
MIT License
80+
81+
Copyright (c) 2019 BitPay
82+
83+
Permission is hereby granted, free of charge, to any person obtaining a copy
84+
of this software and associated documentation files (the "Software"), to deal
85+
in the Software without restriction, including without limitation the rights
86+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
87+
copies of the Software, and to permit persons to whom the Software is
88+
furnished to do so, subject to the following conditions:
89+
90+
The above copyright notice and this permission notice shall be included in all
91+
copies or substantial portions of the Software.
92+
93+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
94+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
95+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
96+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
97+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
98+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
99+
SOFTWARE.

examples.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
/**
99
* Generate new private key for every new merchant.
1010
* Make sure you provide an easy recognizable name for each private key/Merchant
11+
* NOTE: In case you are providing the BitPay services to your clients,
12+
* you MUST generate a different key per each of your clients
1113
*
1214
* WARNING: It is EXTREMELY IMPORTANT to place this key files in a very SECURE location
1315
**/

0 commit comments

Comments
 (0)