Replace bitpay strings with btcpayserver and remove a couple of unrelated stuff

This commit is contained in:
Ciprian Mandache 2019-03-06 09:18:25 +02:00
parent 1e08ee7c91
commit c6870347ed
140 changed files with 373 additions and 552 deletions

View File

@ -1,170 +1 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [2.2.20] - 2018-03-28
### Fixed
- Fixed failing phpunit tests (#262)
- Fixed DateTime zone issues (#261)
- Fixed $invoice->getPaymentTotals() returns subTotals instead (#264)
## [2.2.19] - 2018-03-08
### Added
- Added support for BCH fields in the invoice: transactionCurrency, amountPaid, exchangeRates, paymentSubtotals, paymentTotals
### Fixed
- Set timezone to UTC (=timezone that BitPay invoices use), to prevent PHP errors when no default timezone is set
### Deprecated
- Deprecated BTC specific fields, as documented at https://bitpay.com/api#resource-Invoices
## [2.2.18] - 2018-01-15
### Fixed
- Pushed actual code changes to GitHub from previous release
## [2.2.17] - 2018-01-15
### Fixed
- Fixed decimal check for currencies without decimals (e.g. HUF)
## [2.2.16] - 2017-12-12
### Fixed
- Fixed invoice time being set in milliseconds, whereas seconds are expected (Issue #256 and #257)
- Removed deprecated factory methods from services.xml
## [2.2.15] - 2017-11-28
### Fixed
- Fixed invoice time being set as numeric instead of datetime object
### Removed
- Removed support for mcrypt (#254)
## [2.2.14] - 2017-09-27
### Fixed
- Fixed token check in get invoices method for public facade calls (#243)
- Spell fixes (#233 and #233)
- Fix some of the tests (#228)
### Added
- Added encrypt & decrypt functions to OpenSSL (#247)
## [2.2.13] - 2017-05-12
### Fixed
- Updated VERSION and changelog
- Clarified tutorial text
## [2.2.12] - 2017-05-09
### Added
- Included IPN processor example in tutorials
### Fixed
- broken exception in Client.php
## [2.2.11] - 2017-05-09
### Added
- Added refund addresses to getInvoice
- Included extendedNotifications
Included buyer notify field (when creating an invoice)
### Fixed
- Improved tutorial (https://github.com/bitpay/php-bitpay-client/tree/master/examples/tutorial)
- Made fullNotifications=true default
- Symfony v3 compatibility fixes
- PHP 7 compatibility fixes
## [2.2.9] - 2017-02-21
### Fixed
- HTTP 100 messages not parsed correctly when doing payouts
## [Unreleased][unreleased]
### Changed
- Refactored function calls out of loops
## [2.2.5] - 2015-06-23
### Fixed
- Item::setPrice accepts en_US formatted numeric strings
- getInvoice now works with merchant and public facades
## [2.2.4] - 2015-06-04
### Added
- Token functionality for client-sided pairing
- Set payout bitcoin amount, as returned by BitPay
- Utility method for checking requirements
- Autoloader documentation
### Changed
- Documentation from RST to Markdown
- Autoloader now loads relative to library root directory
- Client now sets invoice tokens upon creation and retrieval
## [2.2.3] - 2015-05-29
### Fixed
- BitPay API errors are now passthrough
## [2.2.2] - 2015-01-13
### Added
- Mink/Behat testing
### Fixed
- Corrected behavior of Math::mod
## [2.2.1] - 2014-12-10
### Added
- Payroll feature
- Detailed tutorials
### Fixed
- Math Engine issues
- Stalling tests
## [2.2.0] - 2014-11-21
### Changed
- No longer solely depends on GMP for big integer math. Can now use BCMath as well
## [2.1.1] - 2014-11-19
### Changed
- Encrypted file storage is now default persistance for keys
### Fixed
- McryptExtensionTest no longer fails randomly
### Removed
- PHP 5.3 support. Now requires PHP >= 5.4
## [2.1.0] - 2014-11-10
### Added
- Code Coverage tools
- Integration testing
- CA Bundle for Curl Adapter
- Additional invoice tests
- PEM Encoding and Decoding
- Storage Class tutorial
- `fullNotifications` for invoices
### Changed
- Point arrays to objects
- Better exception handling for Curl errors
- Refactored `isGenerated`
### Fixed
- MCrypt cipher type default is now a valid cipher type
## 2.0.0 - 2014-09-27
### Changed
- Client library now uses BitPay's new API
[unreleased]: https://github.com/bitpay/php-bitpay-client/compare/v2.2.5...HEAD
[2.2.5]: https://github.com/bitpay/php-bitpay-client/compare/v2.2.4...v2.2.5
[2.2.4]: https://github.com/bitpay/php-bitpay-client/compare/v2.2.3...v2.2.4
[2.2.3]: https://github.com/bitpay/php-bitpay-client/compare/v2.2.2...v2.2.3
[2.2.2]: https://github.com/bitpay/php-bitpay-client/compare/v2.2.1...v2.2.2
[2.2.1]: https://github.com/bitpay/php-bitpay-client/compare/v2.2.0...v2.2.1
[2.2.0]: https://github.com/bitpay/php-bitpay-client/compare/v2.1.1...v2.2.0
[2.1.1]: https://github.com/bitpay/php-bitpay-client/compare/v2.1.0...v2.1.1
[2.1.0]: https://github.com/bitpay/php-bitpay-client/compare/v2.0.0...v2.1.0
UPDATE THIS ACCORDINGLY

View File

@ -1,6 +1,6 @@
# The MIT License (MIT)
Copyright © 2015 BitPay
Copyright © 2019 BTCPayServer
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal

View File

@ -1,18 +1,18 @@
bitpay/php-bitpay-client
btcpayserver/php-bitpay-client
=================
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/bitpay/php-bitpay-client/master/LICENSE.md)
[![Travis](https://img.shields.io/travis/bitpay/php-bitpay-client.svg?style=flat-square)](https://travis-ci.org/bitpay/php-bitpay-client)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/btcpayserver/php-bitpay-client/master/LICENSE.md)
[![Travis](https://img.shields.io/travis/btcpayserver/php-bitpay-client.svg?style=flat-square)](https://travis-ci.org/btcpayserver/php-bitpay-client)
[![Packagist](https://img.shields.io/packagist/v/bitpay/php-client.svg?style=flat-square)](https://packagist.org/packages/bitpay/php-client)
[![Code Climate](https://img.shields.io/codeclimate/github/bitpay/php-bitpay-client.svg?style=flat-square)](https://codeclimate.com/github/bitpay/php-bitpay-client)
[![Scrutinizer](https://img.shields.io/scrutinizer/g/bitpay/php-bitpay-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/bitpay/php-bitpay-client/)
[![Coveralls](https://img.shields.io/coveralls/bitpay/php-bitpay-client.svg?style=flat-square)](https://coveralls.io/r/bitpay/php-bitpay-client)
[![Code Climate](https://img.shields.io/codeclimate/github/btcpayserver/php-bitpay-client.svg?style=flat-square)](https://codeclimate.com/github/btcpayserver/php-bitpay-client)
[![Scrutinizer](https://img.shields.io/scrutinizer/g/btcpayserver/php-bitpay-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/btcpayserver/php-bitpay-client/)
[![Coveralls](https://img.shields.io/coveralls/btcpayserver/php-bitpay-client.svg?style=flat-square)](https://coveralls.io/r/btcpayserver/php-bitpay-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/bitpay/php-client/downloads.svg)](https://packagist.org/packages/bitpay/php-client)
[![Latest Unstable Version](https://poser.pugx.org/bitpay/php-client/v/unstable.svg)](https://packagist.org/packages/bitpay/php-client)
This is a self-contained PHP implementation of BitPay's new cryptographically secure API: https://bitpay.com/api
This is a self-contained PHP implementation of BTCPayServer's cryptographically secure API: https://github.com/btcpayserver/btcpayserver-doc/blob/master/CustomIntegration.md
# Installation
@ -33,7 +33,7 @@ Add to your composer.json file by hand.
...
"require": {
...
"bitpay/php-client": "dev-master"
"btcpayserver/php-client": "master"
},
"repositories": [
...
@ -49,18 +49,18 @@ Add to your composer.json file by hand.
Once you have added this, just run:
```bash
php composer.phar update bitpay/php-client
php composer.phar update btcpayserver/php-client
```
### Install using composer
```bash
php composer.phar require bitpay/php-client:~2.2
php composer.phar require btcpayserver/php-client
```
# Configuration
See https://support.bitpay.com/hc/en-us/articles/115003001063-How-do-I-configure-the-PHP-BitPay-Client-Library-
See https://github.com/btcpayserver/php-bitpay-client/tree/master/examples
# Usage
@ -78,7 +78,7 @@ if (true === file_exists($autoloader) &&
require_once $autoloader;
\Bitpay\Autoloader::register();
} else {
throw new Exception('BitPay Library could not be loaded');
throw new Exception('BTCPayServer Library could not be loaded');
}
```
@ -88,21 +88,18 @@ Please see the ``docs`` directory for information on how to use this library
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 BitPay invoice:
https://github.com/bitpay/php-bitpay-client/blob/master/examples/tutorial/
The ``examples/tutorial`` directory provides four scripts that guide you with creating a BTCPayServer invoice:
https://github.com/btcpayserver/php-bitpay-client/blob/master/examples/tutorial/
# Support
* https://github.com/bitpay/php-bitpay-client/issues
* https://support.bitpay.com
When you receive blank IPN responses, please check https://support.bitpay.com/hc/en-us/articles/115003025706-Why-am-I-getting-a-blank-IPN-post-response-from-BitPay-when-using-PHP-
* https://github.com/btcpayserver/php-bitpay-client/issues
# License
The MIT License (MIT)
Copyright (c) 2017 BitPay, Inc.
Copyright (c) 2017 BTCPayServer, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1 +1 @@
2.2.20
UPDATE THIS ACCORDINGLY

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="bitpay/package" default="build">
<project name="btcpayserver/package" default="build">
<target name="build" depends="lint,phpunit,phpcs" />
<target name="lint"

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* @license Copyright 2011-2015 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2015 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
-->
<phpunit bootstrap="../vendor/autoload.php" colors="true">

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
/**
* @license Copyright 2011-2015 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2015 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
-->
<ruleset name="BitPay PHP Client PHPMD Ruleset">
<ruleset name="BTCPayServer PHP Client PHPMD Ruleset">
<!--
<rule ref="rulesets/cleancode.xml" />
<rule ref="rulesets/codesize.xml" />

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2015 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2015 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
require_once 'phar://bitpay.phar/src/Bitpay/Autoloader.php';

View File

@ -1,5 +1,5 @@
####
# Copyright (c) 2011-2015 BitPay
# Copyright (c) 2011-2015 BTCPayServer
#
# This is the configuration file used for testing
#

View File

@ -1,20 +1,18 @@
{
"name": "bitpay/php-client",
"description": "PHP Library to work with the new cryptographically secure BitPay API",
"name": "btcpayserver/php-client",
"description": "PHP Library to work with the new cryptographically secure BTCPayServer API",
"license": "MIT",
"minimum-stability": "stable",
"keywords": ["bitpay", "bitcoin"],
"homepage": "https://github.com/bitpay/php-bitpay-client",
"keywords": ["btcpayserver", "bitcoin"],
"homepage": "https://github.com/btcpayserver/php-bitpay-client",
"support": {
"email": "support+php@bitpay.com",
"issues": "https://github.com/bitpay/php-bitpay-client/issues",
"source": "https://github.com/bitpay/php-bitpay-client"
"issues": "https://github.com/btcpayserver/php-bitpay-client/issues",
"source": "https://github.com/btcpayserver/php-bitpay-client"
},
"authors": [
{
"name": "BitPay Integrations Development Team",
"email": "integrations@bitpay.com",
"homepage": "https://bitpay.com/integrations"
"name": "BTCPayServer Developer Community",
"homepage": "https://github.com/btcpayserver"
}
],
"autoload": {
@ -50,10 +48,5 @@
},
"config": {
"bin-dir": "bin"
},
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev"
}
}
}

View File

@ -85,17 +85,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/BitPayPHPLibrary.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/BTCPayServerPHPLibrary.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/BitPayPHPLibrary.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/BTCPayServerPHPLibrary.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/BitPayPHPLibrary"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/BitPayPHPLibrary"
@echo "# mkdir -p $$HOME/.local/share/devhelp/BTCPayServerPHPLibrary"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/BTCPayServerPHPLibrary"
@echo "# devhelp"
epub:

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# BitPay PHP Library documentation build configuration file, created by
# BTCPayServer PHP Library documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 22 13:29:09 2014.
#
# This file is execfile()d with the current directory set to its
@ -43,8 +43,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'BitPay PHP Library'
copyright = u'2014, BitPay Inc'
project = u'BTCPayServer PHP Library'
copyright = u'2014, BTCPayServer Inc'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -176,7 +176,7 @@ html_static_path = ['_static']
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'BitPayPHPLibrarydoc'
htmlhelp_basename = 'BTCPayServerPHPLibrarydoc'
# -- Options for LaTeX output ---------------------------------------------
@ -196,8 +196,8 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'BitPayPHPLibrary.tex', u'BitPay PHP Library Documentation',
u'BitPay Developers', 'manual'),
('index', 'BTCPayServerPHPLibrary.tex', u'BTCPayServer PHP Library Documentation',
u'BTCPayServer Developers', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@ -226,8 +226,8 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'bitpayphplibrary', u'BitPay PHP Library Documentation',
[u'BitPay Developers'], 1)
('index', 'bitpayphplibrary', u'BTCPayServer PHP Library Documentation',
[u'BTCPayServer Developers'], 1)
]
# If true, show URL addresses after external links.
@ -240,8 +240,8 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'BitPayPHPLibrary', u'BitPay PHP Library Documentation',
u'BitPay Developers', 'BitPayPHPLibrary', 'One line description of project.',
('index', 'BTCPayServerPHPLibrary', u'BTCPayServer PHP Library Documentation',
u'BTCPayServer Developers', 'BTCPayServerPHPLibrary', 'One line description of project.',
'Miscellaneous'),
]

View File

@ -1,5 +1,5 @@
## BitPay PHP Library Documentation
This is end user documentation for the BitPay PHP library. This document
## BTCPayServer PHP Library Documentation
This is end user documentation for the BTCPayServer PHP library. This document
SHOULD answer all questions a developer has and helps new developers
gain a deeper understanding of the PHP Client Library.

View File

@ -1,12 +1,12 @@
## Invoices
Creating an invoice allows you to accept payment in bitcoins. You can
also query the BitPay's system to find out more information about the
also query the BTCPayServer's system to find out more information about the
invoice that you created.
Working with an Invoice Object
==============================
Every invoice can have lots of data that can be used and sent to BitPay
Every invoice can have lots of data that can be used and sent to BTCPayServer
as reference. Feel free to take a look at `Bitpay\InvoiceInterface` for
code comments on what each method returns and a more in depth
explanation.
@ -19,7 +19,7 @@ $invoice = new \Bitpay\Invoice();
> **note**
>
> You can also set an Order ID that you can use to reference BitPay's
> You can also set an Order ID that you can use to reference BTCPayServer's
> invoice with the invoice in your order system.
>
> `$invoice->setOrderId('You Order ID here')`
@ -42,7 +42,7 @@ $item->setPrice('19.95');
$invoice->setItem($item);
```
The only thing left is to now send the invoice off to BitPay for the
The only thing left is to now send the invoice off to BTCPayServer for the
invoice to be created and for you to send it to your customer.
Creating an Invoice
@ -91,7 +91,7 @@ $client->createInvoice($invoice);
```
The code will update the `$invoice` object and you will be able to
forward your customer to BitPay's fullscreen invoice.
forward your customer to BTCPayServer's fullscreen invoice.
``` {.sourceCode .php}
header('Location: ' . $invoice->getUrl());
@ -109,4 +109,4 @@ $invoice->setNotificationUrl('https://example.com/bitpay/ipn');
By adding the Notification URL, it will receive an IPN when the invoice
is updated. For more information on IPNs, please see the documentation
on BitPay's website.
on BTCPayServer's website.

View File

@ -29,5 +29,5 @@ received is confirmed.
complete
========
This means that BitPay has credited the Merchants account with the
This means that BTCPayServer has credited the Merchants account with the
payment received.

View File

@ -1,4 +1,4 @@
## 'Instant Payment Notifications (IPN)'
If enabled, IPNs are sent from BitPay servers to your requested
If enabled, IPNs are sent from BTCPayServer servers to your requested
Notification URL using a POST request with a JSON body containing
information about the invoice.

View File

@ -72,4 +72,4 @@ $keyManager->persist($privateKey);
Cookbook
========
* [Creating your own storage clas](https://github.com/bitpay/php-bitpay-client/blob/master/docs/keypairs/storage.md)
* [Creating your own storage clas](https://github.com/btcpayserver/php-bitpay-client/blob/master/docs/keypairs/storage.md)

View File

@ -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/bitpay/php-bitpay-client/blob/master/src/Bitpay/Storage/StorageInterface.php).
[StorageInterface](https://github.com/btcpayserver/php-bitpay-client/blob/master/src/Bitpay/Storage/StorageInterface.php).
``` {.sourceCode .php}
use Bitpay\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/bitpay/php-bitpay-client/blob/master/src/Bitpay/KeyManager.php)
[KeyManager](https://github.com/btcpayserver/php-bitpay-client/blob/master/src/Bitpay/KeyManager.php)
``` {.sourceCode .php}
$storage = new ArrayStorage();

View File

@ -1,7 +1,7 @@
## License
The MIT License (MIT)
Copyright (c) 2011-2014 BitPay Inc.
Copyright (c) 2011-2014 BTCPayServer Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the

View File

@ -1,7 +1,7 @@
## Testing
Current Build Status:
[![image](https://travis-ci.org/bitpay/php-bitpay-client.svg?branch=master)](https://travis-ci.org/bitpay/php-bitpay-client)
[![image](https://travis-ci.org/btcpayserver/php-bitpay-client.svg?branch=master)](https://travis-ci.org/btcpayserver/php-bitpay-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
@ -21,7 +21,7 @@ npm install
>
> node is used for PhantomJS and a few other tools that help out with
> the required testing to make sure that the code is able to talk to
> BitPay servers and should give us an early warning if things update or
> BTCPayServer servers and should give us an early warning if things update or
> change without notice.
PHPUnit
@ -143,6 +143,6 @@ php bin/behat tests/integrations/invoice_create.feature:20
>
> A timing issue will occasionally occur saying: "Notice: Undefined
> variable: response in tests/integrations/bootstrap/FeatureContext.php
> line 368" and there will be a message from BitPay saying: "This
> line 368" and there will be a message from BTCPayServer saying: "This
> endpoint does not support the public facade" This is likely a timing
> issue and the tests will likely pass when run again.

View File

@ -18,7 +18,7 @@ if (true === file_exists($autoloader) &&
require_once $autoloader;
\Bitpay\Autoloader::register();
} else {
throw new Exception('BitPay Library could not be loaded');
throw new Exception('BTCPayServer Library could not be loaded');
}
```
@ -36,12 +36,12 @@ Services
========
Inside the container there are a few services that will help you develop
your application to work with BitPay. For example, the `client` service
your application to work with BTCPayServer. For example, the `client` service
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/bitpay/php-bitpay-client/blob/master/src/Bitpay/DependencyInjection/services.xml)
[services.xml](https://github.com/btcpayserver/php-bitpay-client/blob/master/src/Bitpay/DependencyInjection/services.xml)
file.
To gain access to any of these services, you first need to instantiate
@ -59,12 +59,12 @@ $bitpay = \Bitpay\Bitpay($configuration);
Sending your own Requests
=========================
You can easily send your own requests to BitPay's API with a little
You can easily send your own requests to BTCPayServer's API with a little
work. For all the requests you can make, please see the [API
Documentation](https://bitpay.com/api) on the website.
To get started you need to create your
[Request](https://github.com/bitpay/php-bitpay-client/blob/master/src/Bitpay/Client/Request.php)
[Request](https://github.com/btcpayserver/php-bitpay-client/blob/master/src/Bitpay/Client/Request.php)
``` {.sourceCode .php}
$request = new \Bitpay\Client\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/bitpay/php-bitpay-client/blob/master/src/Bitpay/Client/ResponseInterface.php)
[Response](https://github.com/btcpayserver/php-bitpay-client/blob/master/src/Bitpay/Client/ResponseInterface.php)
object in return which you can use to do whatever it is you need to do.

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*/
require __DIR__ . '/../vendor/autoload.php';

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*
* WARNING - This example will NOT work until you have generated your public
* and private keys. Please see the example documentation on generating your
@ -56,7 +56,7 @@ $invoice
->setNotificationUrl('https://store.example.com/bitpay/callback');
/**
* BitPay offers services for many different currencies. You will need to
* BTCPayServer offers services for many different currencies. You will need to
* configure the currency in which you are selling products with.
*/
$currency = new \Bitpay\Currency();
@ -80,7 +80,7 @@ $publicKey = $storageEngine->load('/tmp/public.key');
$bitpay = new \Bitpay\Bitpay();
/**
* Create the client that will be used to send requests to BitPay's API
* Create the client that will be used to send requests to BTCPayServer's API
*/
$client = $bitpay->get('client');

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*/
require __DIR__ . '/../vendor/autoload.php';

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*/
/**
@ -18,7 +18,7 @@ $time = gmdate("Y-m-d\TH:i:s\.", 1414691179)."000Z";
$token = new \Bitpay\Token();
$token
->setFacade('payroll')
->setToken('<your payroll facade-enable token>'); //this is a special api that requires a explicit payroll relationship with BitPay
->setToken('<your payroll facade-enable token>'); //this is a special api that requires a explicit payroll relationship with BTCPayServer
$instruction1 = new \Bitpay\PayoutInstruction();
$instruction1

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*/
require __DIR__ . '/../vendor/autoload.php';

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2016 BitPay
* Copyright (c) 2014-2016 BTCPayServer
*/
require __DIR__ . '/../vendor/autoload.php';

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*/
require __DIR__ . '/../vendor/autoload.php';

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*/
/**
@ -39,7 +39,7 @@ $bitpay = new \Bitpay\Bitpay(
);
/**
* Create the client that will be used to send requests to BitPay's API
* Create the client that will be used to send requests to BTCPayServer's API
*/
$client = $bitpay->get('client');

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*/
/**

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*/
require __DIR__ . '/../vendor/autoload.php';
@ -11,6 +11,6 @@ $curl_options = array(
CURLOPT_SSL_VERIFYHOST => false,
);
// If nothing is passed into the CurlAdapter
// If nothing is passed into the CurlAdapter
// then default values are used
$adapter = new Bitpay\Client\Adapter\CurlAdapter($curl_options);

View File

@ -1,5 +1,5 @@
####
# Copyright (c) 2014-2015 BitPay
# Copyright (c) 2014-2015 BTCPayServer
#
# Example config using a yml file
#

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*
* 001 - Generate and Persist Keys
*

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*
* 002 - Pairing
*
@ -29,8 +29,8 @@ $publicKey = $storageEngine->load('/tmp/bitpay.pub');
$client = new \Bitpay\Client\Client();
/**
* The adapter is what will make the calls to BitPay and return the response
* from BitPay. This can be updated or changed as long as it implements the
* The adapter is what will make the calls to BTCPayServer and return the response
* from BTCPayServer. This can be updated or changed as long as it implements the
* AdapterInterface
*/
$adapter = new \Bitpay\Client\Adapter\CurlAdapter();

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2015 BitPay
* Copyright (c) 2014-2015 BTCPayServer
*
* 003 - Creating Invoices
*
@ -59,7 +59,7 @@ $item
$invoice->setItem($item);
/**
* BitPay supports multiple different currencies. Most shopping cart applications
* BTCPayServer supports multiple different currencies. Most shopping cart applications
* and applications in general have defined set of currencies that can be used.
* Setting this to one of the supported currencies will create an invoice using
* the exchange rate for that currency.
@ -80,7 +80,7 @@ $invoice
* a customer can view the invoice.
*/
try {
echo "Creating invoice at BitPay now.".PHP_EOL;
echo "Creating invoice at BTCPayServer now.".PHP_EOL;
$client->createInvoice($invoice);
} catch (\Exception $e) {
echo "Exception occured: " . $e->getMessage().PHP_EOL;

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2017 BitPay
* Copyright (c) 2014-2017 BTCPayServer
*
* 004 - Hosted payment page: create & display invoice
* For details on displaying invoices, see https://bitpay.com/docs/display-invoice
@ -62,7 +62,7 @@ $item
$invoice->setItem($item);
/**
* BitPay supports multiple different currencies. Most shopping cart applications
* BTCPayServer supports multiple different currencies. Most shopping cart applications
* and applications in general have defined set of currencies that can be used.
* Setting this to one of the supported currencies will create an invoice using
* the exchange rate for that currency.
@ -93,11 +93,11 @@ try {
}
?>
<html>
<head><title>BitPay - Modal CSS invoice demo</title></head>
<head><title>BTCPayServer - Modal CSS invoice demo</title></head>
<body bgcolor="rgb(21,28,111)" textcolor="rgb(255,255,255)">
<button onclick="openInvoice()">Pay Now</button>
<br><br><br>
For more information about BitPay's modal CSS invoice, please see <a href="https://bitpay.com/docs/display-invoice" target="_blank">https://bitpay.com/docs/display-invoice</a>
For more information about BTCPayServer's modal CSS invoice, please see <a href="https://bitpay.com/docs/display-invoice" target="_blank">https://bitpay.com/docs/display-invoice</a>
</body>
<script src="https://bitpay.com/bitpay.js"> </script>
<script>

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2017 BitPay
* Copyright (c) 2014-2017 BTCPayServer
*
* 004 - IPN logger
*
@ -14,7 +14,7 @@
require __DIR__.'/../../vendor/autoload.php';
$myfile = fopen("/tmp/BitPayIPN.log", "a");
$myfile = fopen("/tmp/BTCPayServerIPN.log", "a");
$raw_post_data = file_get_contents('php://input');
@ -29,9 +29,9 @@ if (false === $raw_post_data) {
$ipn = json_decode($raw_post_data);
if (true === empty($ipn)) {
fwrite($myfile, $date . " : Error. Could not decode the JSON payload from BitPay.\n");
fwrite($myfile, $date . " : Error. Could not decode the JSON payload from BTCPayServer.\n");
fclose($myfile);
throw new \Exception('Could not decode the JSON payload from BitPay.');
throw new \Exception('Could not decode the JSON payload from BTCPayServer.');
}
if (true === empty($ipn->id)) {
@ -40,7 +40,7 @@ if (true === empty($ipn->id)) {
throw new \Exception('Invalid Bitpay payment notification message received - did not receive invoice ID.');
}
// Now fetch the invoice from BitPay
// Now fetch the invoice from BTCPayServer
// This is needed, since the IPN does not contain any authentication
$storageEngine = new \Bitpay\Storage\EncryptedFilesystemStorage('YourTopSecretPassword');
$privateKey = $storageEngine->load('/tmp/bitpay.pri');
@ -66,9 +66,9 @@ $invoiceStatus = $invoice->getStatus();
$invoiceExceptionStatus = $invoice->getExceptionStatus();
$invoicePrice = $invoice->getPrice();
fwrite($myfile, $date . " : IPN received for BitPay invoice ".$invoiceId." . Status = " .$invoiceStatus." / exceptionStatus = " . $invoiceExceptionStatus." Price = ". $invoicePrice." Tax Included = ". $taxIncluded."\n");
fwrite($myfile, $date . " : IPN received for BTCPayServer invoice ".$invoiceId." . Status = " .$invoiceStatus." / exceptionStatus = " . $invoiceExceptionStatus." Price = ". $invoicePrice." Tax Included = ". $taxIncluded."\n");
fwrite($myfile, "Raw IPN: ". $raw_post_data."\n");
//Respond with HTTP 200, so BitPay knows the IPN has been received correctly
//If BitPay receives <> HTTP 200, then BitPay will try to send the IPN again with increasing intervals for two more hours.
//Respond with HTTP 200, so BTCPayServer knows the IPN has been received correctly
//If BTCPayServer receives <> HTTP 200, then BTCPayServer will try to send the IPN again with increasing intervals for two more hours.
header("HTTP/1.1 200 OK");

View File

@ -1,23 +1,23 @@
# Creating BitPay invoices - the tutorial
# Creating BTCPayServer invoices - the tutorial
==========================
## About this tutorial
This tutorial contains five scripts. These scripts allow you to do the following:
1) Create keys to communicate with BitPay's API
2) Pair your keys to your BitPay merchant account
3) Create BitPay invoices
4) Display a BitPay invoice using BitPay's hosted payment page
1) Create keys to communicate with BTCPayServer's API
2) Pair your keys to your BTCPayServer merchant account
3) Create BTCPayServer invoices
4) Display a BTCPayServer invoice using BTCPayServer's hosted payment page
5) Log Instant Payment Notifications (IPNs, also called webhooks)
Script 001 & 002 need to be executed once, to properly configure your local installation.
Script 003 creates BitPay invoices; this script can be run permanently.
Script 003 creates BTCPayServer invoices; this script can be run permanently.
Script 004 is very similar to script 003. The main difference is that script 004 outputs HTML, so you can run this on your webserver.
IPNs will be sent after a BitPay invoice receives a payment. IPNs can be logged or processed with IPNlogger.php
IPNs will be sent after a BTCPayServer invoice receives a payment. IPNs can be logged or processed with IPNlogger.php
## Getting started
To begin please visit https://test.bitpay.com/dashboard/signup and register for a BitPay merchant test account. Please fill in all questions, so you get a fully working test account. When filling in the settlement address in your BitPay merchant test account, make sure to fill in a testnet bitcoin address (starting with m or n).
To begin please visit https://test.bitpay.com/dashboard/signup and register for a BTCPayServer merchant test account. Please fill in all questions, so you get a fully working test account. When filling in the settlement address in your BTCPayServer merchant test account, make sure to fill in a testnet bitcoin address (starting with m or n).
If you are looking for a testnet bitcoin wallet to test with, please visit https://bitpay.com/wallet and create a new wallet.
@ -25,36 +25,36 @@ If you need testnet bitcoin please visit a testnet faucet, e.g. https://testnet.
For more information about testing, please see https://bitpay.com/docs/testing
To install BitPay's latest PHP library, please follow the instructions from https://github.com/bitpay/php-bitpay-client/blob/master/README.md
To install BTCPayServer's latest PHP library, please follow the instructions from https://github.com/btcpayserver/php-bitpay-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 BitPay merchant account:
1. 001_generateKeys.php : generates the private/public keys to sign the communication with BitPay. The private/public keys are stored in your filesystem for later usage.
2. 002_pair.php : pairs your private/public keys to your BitPay merchant account. Please make sure to first create a pairing code in your BitPay merchant account (Payment Tools -> Manage API tokens -> Add new token -> Add token) and put this 7 character pairing code in the script. The script returns an API token that should be put put in 003_createInvoice.php, to create invoices permanently.
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:
1. 001_generateKeys.php : generates the private/public keys to sign the communication with BTCPayServer. The private/public keys are stored in your filesystem for later usage.
2. 002_pair.php : pairs your private/public keys to your BTCPayServer merchant account. Please make sure to first create a pairing code in your BTCPayServer merchant account (Payment Tools -> Manage API tokens -> Add new token -> Add token) and put this 7 character pairing code in the script. The script returns an API token that should be put put in 003_createInvoice.php, to create invoices permanently.
These first two scripts need to be executed only once.
## Script 3: create a BitPay invoice
3. 003_createInvoice.php : creates a BitPay invoice. Please make sure to update the script with the API token received from 002_pair.php
## Script 3: create a BTCPayServer invoice
3. 003_createInvoice.php : creates a BTCPayServer invoice. Please make sure to update the script with the API token received from 002_pair.php
This script returns a BitPay invoice object. You can display the invoice by loading the invoice URL in a web browser. You can pay the invoice with your bitcoin wallet.
This script returns a BTCPayServer invoice object. You can display the invoice by loading the invoice URL in a web browser. You can pay the invoice with your bitcoin wallet.
## Script 4: display a BitPay invoice using BitPay's hosted payment page
4. 004_HostedPaymentPage.php : creates a BitPay invoice and returns the HTML to show the invoice. Please make sure to update the script with the API token received from 002_pair.php
## Script 4: display a BTCPayServer invoice using BTCPayServer's hosted payment page
4. 004_HostedPaymentPage.php : creates a BTCPayServer invoice and returns the HTML to show the invoice. Please make sure to update the script with the API token received from 002_pair.php
For more information about paying a BitPay invoice, please see https://support.bitpay.com/hc/en-us/articles/203281456-How-do-I-pay-a-BitPay-invoice-
For more information about paying a BTCPayServer invoice, please see https://support.bitpay.com/hc/en-us/articles/203281456-How-do-I-pay-a-BTCPayServer-invoice-
Script 003_createInvoice.php and 004_HostedPaymentPage.php can be run permanently with the token from 002_pair.php
## Script 5: log Instant Payment Notifications
After you've paid the invoice, BitPay will send an IPN to the notificationURL of the invoice. A script to process the IPN should be put on your server and be reachable from the internet. Your should put the URL of IPNLogger.php in 003_createInvoice.php, e.g.:
After you've paid the invoice, BTCPayServer will send an IPN to the notificationURL of the invoice. A script to process the IPN should be put on your server and be reachable from the internet. Your should put the URL of IPNLogger.php in 003_createInvoice.php, e.g.:
```
// You will receive IPN's at this URL, should be HTTPS for security purposes!
$invoice->setNotificationUrl('https://yourserver.com/IPNlogger.php');
```
IPNs can be used by the merchant to update order statuses. Please note to use IPNs as a trigger to fetch the BitPay invoice status, since the IPNs are not authenticated.
IPNs can be used by the merchant to update order statuses. Please note to use IPNs as a trigger to fetch the BTCPayServer invoice status, since the IPNs are not authenticated.
For more information about IPNs see https://bitpay.com/docs/invoice-callbacks
Examples (c) 2014-2017 BitPay
Examples (c) 2014-2017 BTCPayServer

View File

@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2014-2017 BitPay
* Copyright (c) 2014-2017 BTCPayServer
*
* getInvoice
*
@ -13,7 +13,7 @@
*/
require __DIR__.'/../../vendor/autoload.php';
// Now fetch the invoice from BitPay
// Now fetch the invoice from BTCPayServer
$storageEngine = new \Bitpay\Storage\EncryptedFilesystemStorage('YourTopSecretPassword');
$privateKey = $storageEngine->load('/tmp/bitpay.pri');

View File

@ -1,6 +1,6 @@
{
"name": "php-bitpay-client",
"description": "PHP Client Library for the BitPay Bitcoin Payment Gateway",
"description": "PHP Client Library for the BTCPayServer Crypto Payment Gateway",
"directories": {
"lib": "src",
"doc": "docs",
@ -12,7 +12,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/bitpay/php-bitpay-client.git"
"url": "https://github.com/btcpayserver/php-bitpay-client.git"
},
"keywords": [
"bitpay",
@ -25,12 +25,12 @@
"merchant",
"money"
],
"author": "BitPay Integrations Development Team",
"author": "BTCPayServer Developer Community",
"license": "MIT",
"bugs": {
"url": "https://github.com/bitpay/php-bitpay-client/issues"
"url": "https://github.com/btcpayserver/php-bitpay-client/issues"
},
"homepage": "https://github.com/bitpay/php-bitpay-client",
"homepage": "https://github.com/btcpayserver/php-bitpay-client",
"engines": {
"node": ">=0.10.33",
"npm": "~2.1.5"

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2015 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2015 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2015 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2015 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2015 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2015 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;
@ -12,7 +12,7 @@ namespace Bitpay;
class Autoloader
{
/**
* Register the autoloader, by default this will put the BitPay autoloader
* Register the autoloader, by default this will put the BTCPayServer autoloader
* first on the stack, to append the autoloader, pass `false` as an argument.
*
* Some applications will throw exceptions if the class isn't found and

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Client\Adapter;
@ -18,7 +18,7 @@ use Bitpay\Client\ResponseInterface;
interface AdapterInterface
{
/**
* Send request to BitPay
* Send request to BTCPayServer
*
* @param RequestInterface $request
*

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Client\Adapter;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Client;
@ -16,7 +16,7 @@ use Bitpay\PublicKey;
use Bitpay\PrivateKey;
/**
* Client used to send requests and receive responses for BitPay's Web API
* Client used to send requests and receive responses for BTCPayServer's Web API
*
* @package Bitpay
*/
@ -63,7 +63,7 @@ class Client implements ClientInterface
}
/**
* Set the Public Key to use to help identify who you are to BitPay. Please
* Set the Public Key to use to help identify who you are to BTCPayServer. Please
* note that you must first pair your keys and get a token in return to use.
*
* @param PublicKey $key
@ -107,7 +107,7 @@ class Client implements ClientInterface
*/
protected function fillInvoiceData(InvoiceInterface $invoice, $data)
{
# BitPay returns the invoice time in milliseconds. PHP's DateTime object expects the time to be in seconds
# BTCPayServer returns the invoice time in milliseconds. PHP's DateTime object expects the time to be in seconds
$invoiceTime = is_numeric($data['invoiceTime']) ? intval($data['invoiceTime']/1000) : $data['invoiceTime'];
$expirationTime = is_numeric($data['expirationTime']) ? intval($data['expirationTime']/1000) : $data['expirationTime'];
$currentTime = is_numeric($data['currentTime']) ? intval($data['currentTime']/1000) : $data['currentTime'];
@ -562,7 +562,7 @@ class Client implements ClientInterface
}
/**
* Returns the Response object that BitPay returned from the request that
* Returns the Response object that BTCPayServer returned from the request that
* was sent
*
* @return ResponseInterface
@ -573,7 +573,7 @@ class Client implements ClientInterface
}
/**
* Returns the request object that was sent to BitPay
* Returns the request object that was sent to BTCPayServer
*
* @return RequestInterface
*/
@ -692,7 +692,7 @@ class Client implements ClientInterface
'User-Agent',
sprintf('%s/%s (PHP %s)', self::NAME, self::VERSION, phpversion())
);
$request->setHeader('X-BitPay-Plugin-Info', sprintf('%s/%s', self::NAME, self::VERSION));
$request->setHeader('X-BTCPayServer-Plugin-Info', sprintf('%s/%s', self::NAME, self::VERSION));
$request->setHeader('Content-Type', 'application/json');
$request->setHeader('X-Accept-Version', '2.0.0');
}

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Client;
@ -20,12 +20,12 @@ interface ClientInterface
const LIVENET = '0x00';
/**
* These can be changed/updated so when the request is sent to BitPay it
* These can be changed/updated so when the request is sent to BTCPayServer it
* gives insight into what is making the calls.
*
* @see RFC2616 section 14.43 for User-Agent Format
*/
const NAME = 'BitPay PHP-Client';
const NAME = 'BTCPayServer PHP-Client';
const VERSION = '2.2.20';
//public function createApplication(ApplicationInterface $application);

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Client;
@ -51,7 +51,7 @@ class Request implements RequestInterface
// Set some sane default headers
$this->headers = array(
'Content-Type' => 'application/json',
'X-BitPay-Plugin-Info' => null,
'X-BTCPayServer-Plugin-Info' => null,
);
$this->port = 443;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Client;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Client;
@ -65,14 +65,14 @@ class Response implements ResponseInterface
$tmp = explode($delimiter, $rawResponse, 2);// grab the 100 Continue header
$rawResponse = $tmp[1];// update the response, purging the most recent 100 Continue header
}// repeat
$lines = preg_split('/(\\r?\\n)/', $rawResponse);
$linesLen = count($lines);
for ($i = 0; $i < $linesLen; $i++) {
if (0 == $i) {
preg_match('/^HTTP\/(\d\.\d)\s(\d+)\s(.+)/', $lines[$i], $statusLine);
$response->setStatusCode($statusCode = $statusLine[2]);
continue;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Client;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Config;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Crypto;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Crypto;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Crypto;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\DependencyInjection;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\DependencyInjection\Loader;

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
/**
* @license Copyright 2011-2017 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2017 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
-->
<container xmlns="http://symfony.com/schema/dic/services">

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;
@ -43,7 +43,7 @@ interface InvoiceInterface
const STATUS_CONFIRMED = 'confirmed';
/**
* When an invoice is complete, it means that BitPay.com has credited the
* When an invoice is complete, it means that BTCPayServer.com has credited the
* merchants account for the invoice.  Currently, 6 confirmation blocks on the
* bitcoin network are required for an invoice to be complete.  Note, in the future (for
* qualified payers), invoices may move to a complete status immediately upon
@ -62,7 +62,7 @@ interface InvoiceInterface
* An invoice is considered invalid when it was paid, but payment was not confirmed
* within 1 hour after receipt.  It is possible that some transactions on the bitcoin
* network can take longer than 1 hour to be included in a block.  In such
* circumstances, once payment is confirmed, BitPay.com will make arrangements
* circumstances, once payment is confirmed, BTCPayServer.com will make arrangements
* with the merchant regarding the funds (which can either be credited to the
* merchant account on another invoice, or returned to the buyer).
*/
@ -226,7 +226,7 @@ interface InvoiceInterface
public function getExpirationTime();
/**
* The current time on the BitPay.com system (by subtracting the current time from
* The current time on the BTCPayServer.com system (by subtracting the current time from
* the expiration time, the amount of time remaining for payment can be
* determined). Time format is “2014­01­01T19:01:01.123Z”.
*
@ -235,7 +235,7 @@ interface InvoiceInterface
public function getCurrentTime();
/**
* Used to display your public order number to the buyer on the BitPay invoice. In
* Used to display your public order number to the buyer on the BTCPayServer invoice. In
* the merchant Account Summary page, this value is used to identify the ledger
* entry. Maximum string length is 100 characters.
*

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;
@ -102,7 +102,7 @@ abstract class Key extends Point implements KeyInterface
$this->dec
) = unserialize($data);
}
/**
* @return boolean
*/

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Math;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Math;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Math;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Math;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Storage;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Storage;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Storage;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Storage;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;
@ -143,11 +143,11 @@ class Token implements TokenInterface
{
return $this->pairingCode;
}
public function setPairingCode($pairingCode)
{
$this->pairingCode = $pairingCode;
return $this;
}

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;
@ -35,7 +35,7 @@ interface TokenInterface
* @return array
*/
public function getPolicies();
/**
* @return string
*/

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;
@ -292,7 +292,7 @@ class User implements UserInterface
{
return $this->notify;
}
/**
* @param bool $boolvalue
*

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Util;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Util;

View File

@ -1,7 +1,7 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
* @license Copyright 2011-2014 BTCPayServer Inc., MIT License
* see https://github.com/btcpayserver/php-bitpay-client/blob/master/LICENSE
*/
namespace Bitpay\Util;

Some files were not shown because too many files have changed in this diff Show More