Skip to content

Releases: bitpay/php-bitpay-client-v2

9.0.2

13 May 14:53
Compare
Choose a tag to compare

What's Changed

  • SP-935: Update satoshisPerByte to float and bump version

Full Changelog: 9.0.1...9.0.2

9.0.1

22 Apr 18:45
5e8db0c
Compare
Choose a tag to compare

Overview

This is a patch update that provides the following:

  • Package updates

What's Changed

  • Updated dependencies

Full Changelog: 9.0.0...9.0.1

9.0.0

12 Apr 17:47
2b5da00
Compare
Choose a tag to compare

Overview

Note: ⚠️ denotes breaking changes

This is a major version that provides numerous enhancements, such as:

  • Examples in the codebase
  • ⚠️ More consistent exceptions
  • ⚠️ Better integration with custom loggers
  • ⚠️ General improvements to align with the API

PHP 8.3 Support

The SDK now supports PHP 8.3.

Examples in the Codebase

There are new examples in the codebase to show how the SDK can be used for various scenarios:

  • Logging
    • Using a custom logger with the SDK
  • Bills (Merchant Facade)
    • Creating a bill
    • Getting a bill
    • Updating a bill
    • Delivering a bill via email
  • Invoices (Merchant Facade)
    • Creating an invoice
    • Getting an invoice
    • Updating an invoice
    • Canceling an invoice
    • Requesting an invoice notification
  • Ledgers (Merchant Facade)
    • Getting ledgers
    • Getting ledger entries
  • Refunds (Merchant Facade)
    • Creating a refund
    • Updating a refund
    • Getting a refund
    • Canceling a refund
    • Request a refund notification to be resent
  • Settlements (Merchant Facade)
    • Getting a settlement reconciliation report
  • Payouts (Payout Facade)
    • Creating a payout
    • Getting a payout
    • Canceling a payout
    • Requesting a payout webhook to be resent
    • Requesting payout notifications
  • Recipients (Payout Facade)
    • Invite payout recipients
    • Get payout recipients
    • Update payout recipients
    • Remove payout recipients
  • Bills (POS Facade)
    • Creating a bill
    • Getting a bill
    • Delivering a bill
  • Invoices (POS Facade)
    • Creating an invoice
    • Getting an invoice
  • Rates (Public Facade)
    • Get rates for a cryptocurrency
    • Get cryptocurrency / fiat currency pair rates
  • Wallets (Public Facade)
    • Get supported wallets

⚠️ More Consistent Exceptions

We have removed the old exception classes that added a tremendous amount of duplication across the SDK in favor of parsing the errors from the API. This makes the SDK less opinionated and relies on the API to inform consumers what happened, providing more consistency between the SDK and API. The result is that response messages and codes in exceptions thrown by the SDK will be 1:1 with API.

⚠️ Better Integration with Custom Loggers

You can now use your own logging framework using the new provider, giving more control over how logs are handled.

⚠️ General Improvements

  • Updated dependencies
  • Updated field types where they were misaligned with the API
  • Added fields to the SDK that were missing
  • Removed fields that are no longer in the API
  • Fixed an issue when using a proxy
  • Updated the config generator to be interactive

Full Changelog: 8.0.3...9.0.0

7.5.0

04 Apr 19:50
Compare
Choose a tag to compare

Overview

This is a minor release that only adds support for PHP 8.2 and 8.3, and allows for symfony/yaml version 7 to be used. This is to support the upcoming version of Magento 2.4.7

What's Changed

  • Adds support for PHP 8.2 and 8.3 to the PHP SDK 7.x.x version
  • Add support for symfony/yaml version 7

Notes

Full Changelog: 7.4.0...7.5.0

8.0.3

13 Feb 15:56
7f3769c
Compare
Choose a tag to compare

Overview

This is a patch update that provides the following:

  • Package updates
  • Test improvements
  • Bug fixes

What's Changed

  • Improved null and boolean assertions
  • Updated dependencies
  • Fixed a bug where the payoutPercentage property on BitPaySDK\Model\Settlement was a float instead of an array
  • Fixed a bug where the SDK looked for "proxy" instead of "Proxy" in the config file keys

Thank you @peter279k for your contributions!

Full Changelog: 8.0.2...8.0.3

8.0.2

24 Aug 01:54
Compare
Choose a tag to compare

Overview

This is a patch update that provides the following:

  • Package updates
  • Documentation updates

What's Changed

  • SP-626 PHPdoc - @see tag updates
  • Bump phpunit/phpunit from 9.6.10 to 9.6.11

Full Changelog: 8.0.1...8.0.2

8.0.1

21 Jul 17:58
31c3207
Compare
Choose a tag to compare

Overview

This is a patch update that provides the following:

  • Package updates
  • Auto-generated documentation
  • Fixes PHP 8.0 support

Full Changelog: 8.0.0...8.0.1

8.0.0

28 Jun 01:55
Compare
Choose a tag to compare

Overview

We were releasing our next major version of the PHP SDK - version 8.0.0.

Highlights

Client Class Breakdown

The Client class was very large, at over 2,000 lines. To make this easier to work on and more testable, we have:

  • Implemented a facade for the client
  • Created a class to handle generic REST GET, PUT, POST, and DELETE
  • Created separate classes for each resource, providing a better representation of the API
  • Add unit and integration tests for new client classes

Implement POS Facade

Prior to version 8.0.0, we had two separate SDKs, the "Light" SDK, which could only use the POS facade, and the "Full" SDK, which used the merchant and payout facades. This created the need for additional effort both in maintaining and implementing the SDK.

As of version 8.0.0, the SDK supports both methods. You can use just the POS facade, which is limited in feature set but does not require signed requests (no private key to manage) or with the merchant/payout facade, which has more functionality but is more complex to implement.

This provides an easier upgrade path and reduces the duplicate work of maintaining two separate SDKs regarding dependency upgrades, bug fixes, etc.

Standardization

We've implemented PSR-12 across the entire SDK and are using PHPCS to check every commit.

Functional Test Suite

A functional test suite has been added to the codebase that will run against the test API. Due to there being so many outside variables from external resources, this does not run in the GitHub Actions pipeline.

Other Notes

  • Overall improvements to approach
  • Added Composer setup script for simpler token creation
  • Removed phpcs exceptions
  • Added strict types & copyright
  • Added generated PHPDoc
  • Only actively supported versions of PHP will be supported starting with this version

Bug Fixes

  • Fixed an issue when getting Ledgers

7.4.0

19 Jun 16:41
Compare
Choose a tag to compare

Overview

This release adds support for Payout Groups, which are preferred over Payout Batches, which are deprecated.

What's Changed

  • Added support for Payout Groups

Notes

Full Changelog: 7.3.1...7.4.0

7.3.1

08 May 21:37
c9581b6
Compare
Choose a tag to compare

Overview

This release addresses an issue with Payout Batches, which are a deprecated feature of the API but are still used by some clients.

What's Changed

  • Bump symfony/yaml from 5.4.17 to 5.4.19
  • Addressed an issue with PayoutBatch deserialization and maintained backwards compatibility which addresses issue #238

Notes

The main change here updates the _computeAndSetAmount() function to catch a case where it can be stdClass and is related to the use of JsonMapper. For historical reasons, the 7.x version of the API includes JsonMapper in a manual fashion, and the upcoming 8.x release includes it via Composer.

    private function _computeAndSetAmount()
    {
        $amount = 0.0;
        if ($this->_instructions) {
            foreach ($this->_instructions as $instruction) {
                if ($instruction instanceof PayoutInstruction) {
                    $amount += $instruction->getAmount();
                } elseif ($instruction instanceof \stdClass) {
                    $amount += $instruction->amount;
                } else {
                    $amount += $instruction['amount'];
                }
            }
        }
        $this->_amount = $amount;
    }

Full Changelog: 7.3.0...7.3.1