Releases: bitpay/java-bitpay-client
v10.0.2
Overview
This is a patch release that addresses a type issue with satoshisPerByte
where it was defined as an int
but is coming back from the API as a float
. We've also updated the examples to remove .value
on the facade as it's not necessary.
What's Changed
- Fix satoshisPerByte
Full Changelog: v10.0.1...v10.0.2
v10.0.1
Overview
This is a patch version that bumps version dependencies.
What's Changed
- Bump org.codehaus.mojo:exec-maven-plugin from 3.1.0 to 3.2.0
- Bump jackson.version from 2.16.1 to 2.17.0
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.3
- Bump com.fasterxml.jackson.core:jackson-annotations from 2.15.2 to 2.17.0
- Bump org.junit.jupiter:junit-jupiter-engine from 5.9.2 to 5.10.2
- Bump to version 10.0.1
Full Changelog: v10.0.0...v10.0.1
v10.0.0
Overview
Note:
⚠️ denotes breaking changes
This is a major version that provides numerous enhancements, such as:
- Support for Java 21
- Examples in the codebase
⚠️ More consistent exceptions⚠️ Better integration with custom loggers⚠️ General improvements to align with the API
Java 21 Support
We are now running tests against Java 8, 11, 17, and 21. Mockito 4.x is implemented for Java 21.
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 logger provider, giving more control over how logs are handled.
⚠️ General Improvements
- 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
Full Changelog: v9.0.2...10.0.0
v9.0.2
Overview
This is a minor version that bumps version dependencies.
What's Changed
- Bump maven-javadoc-plugin from 2.9.1 to 3.5.0
- Bump jackson-annotations from 2.14.2 to 2.15.2
- SP-619 Automatically generate documentation on push to master
- Bump maven-gpg-plugin from 1.5 to 3.1.0
Full Changelog: v9.0.1...v9.0.2
v9.0.1
v9.0.0
Overview
We are releasing the next major version of the Java SDK - version 9.0.0.
Note: Version 9.x of the SDK has aspects that are not backward compatible with 8.x. We are detailing the differences in our documentation.
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
- Create 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 9.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 9.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.
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
- Added missing fields to models
- Updated DocBlocks to use new documentation site
- Improved client creation to use a singleton pattern, to prevent unnecessary re-instantiation
- General cleanup, added additional missing fields, added links to documentation
- Added a setup script that's easy to use from Maven
Bug Fixes
- Add "Request a webhook to be resent"
- Add "Retrieve an event token"
- Add "Retrieve all the rates for a given cryptocurrency"
- Add "Retrieve the rates for a cryptocurrency / fiat pair"
- Add
refundRequestEid
toRefund
v9.0.0-beta2
Overview
We were nearing a release of our next major version of the Java SDK - version 9.0.0. This is the second beta, and includes additional improvements and changes over the first.
What's Changed Since beta1
- Remove
docs/
directory from repo since we now use https://developer.bitpay.com - Added missing fields to models
- Update DocBlocks to use new documentation site
- Improved client creation to use a singleton pattern, to prevent unnecessary re-instantiation
- General cleanup, added additional missing fields, added links to documentation
Full Changelog: v9.0.0-beta1...v9.0.0-beta2
Version 9.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
- Create a class to handle generic REST GET, PUT, POST, and DELETE
- Created separate classes for each resource, providing a better representation of the API
- Updated BitPaySetup class so that configuration and keys can be generated
- Add unit and integration tests for new client classes
Implement POS Facade
Prior to version 9.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 9.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.
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.
v9.0.0-beta1
Overview
We were nearing a release of our next major version of the Java SDK - version 9.0.0. This is the first beta, and includes all the major changes, with subsequent betas addressing bug fixes.
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
- Create a class to handle generic REST GET, PUT, POST, and DELETE
- Created separate classes for each resource, providing a better representation of the API
- Updated BitPaySetup class so that configuration and keys can be generated
- Add unit and integration tests for new client classes
Implement POS Facade
Prior to version 9.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 9.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.
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.
Bug Fixes
- SP-369 Add "Request a webhook to be resent" to Java
- SP-371 Add "Retrieve an event token" to Java SDK
- SP-372 Add "Retrieve all the rates for a given cryptocurrency" to Java SDK
- SP-373 Add "Retrieve the rates for a cryptocurrency / fiat pair" to Java SDK
Full Changelist
- SP-311 Break down Client class
- SP-322 Create unit tests for all clients
- SP-323 Create integration tests for all clients
- SP-328 Implement POS facade in Java SDK
- SP-349 Java - Updates for POST /refunds
- SP-350 Java - GET /refunds/guid/:guid
- SP-351 Java - PUT /refunds/guid/:guid
- SP-352 Java - DELETE /refunds/guid/:guid
- SP-367 Ledger Fix - Java
- SP-369 Add "Request a webhook to be resent" to Java
- SP-371 Add "Retrieve an event token" to Java SDK
- SP-372 Add "Retrieve all the rates for a given cryptocurrency" to Java SDK
- SP-373 Add "Retrieve the rates for a cryptocurrency / fiat pair" to Java SDK
- SP-401 Java SDK 9.x: DELETE /invoices/guid/:guid
- SP-418 Java 9.0.0 Functional test suite
v8.8.0
Overview
This release adds the ability to cancel an invoice by GUID and addresses a few bugs.
Changes
- Added Dependabot!
- Added
getRates()
to retrieve the exchange rate table maintained by BitPay by baseCurrency - Added
getRate()
to retrieve the rates for a cryptocurrency / fiat pair - Added ability to retrieve an event token
- Added the ability to cancel an invoice by GUID
- Bumped version to 8.8.0
Bug fixes
- Invoices now respect a custom GUID passed to them
Details
Dependabot
Now that we have a more robust test suite, we have installed and configured Dependabot to contribute pull requests for package updates.
Get Rates (new)
public Rates getRates() throws RateQueryException {}
Get Rate (new)
public Rate getRate(String baseCurrency, String currency) throws RateQueryException {}
Retrieve an Event Token (new)
public InvoiceEventToken getInvoiceEventToken(String invoiceId) throws BitPayException {}
Cancel Invoice by GUID (new)
Default call, will set forceCancel
false.
public Invoice cancelInvoiceByGuid(String guid) throws BitPayException {
Cancel Invoice by GUID
Allow for forceCancel
to be set explicitly.
public Invoice cancelInvoiceByGuid(String guid, Boolean forceCancel) throws BitPayException {}
Invoices now respect a custom GUID passed to them (bug fix)
- If the
Invoice
object sent tocreateInvoice()
hassetGuid()
set, that GUID will be used for the invoice - If the
Invoice
object sent tocreateInvoice()
does not havesetGuid()
set, a UUIDv4 will be generated for you
v8.7.0
Overview
This release adds the ability to create, get, update, and cancel refunds by GUID, which is:
A variable provided by the merchant and designed to be used by the merchant to correlate the refund with a refund ID in their system.
Changes
- Added ability to create refund with a GUID in the method params
- Added ability to create a refund from a refund object
- Added ability to get refund by GUID
- Added ability to update refund by GUID
- Added ability to cancel refund by GUID
Details
Create Refund (Original, no change)
public Refund createRefund(String invoiceId, Double amount, Boolean preview, Boolean immediate, Boolean buyerPaysRefundFee, String reference) throws RefundCreationException, BitPayException {}
Create Refund with GUID (New)
public Refund createRefund(
String invoiceId,
Double amount,
Boolean preview,
Boolean immediate,
Boolean buyerPaysRefundFee,
String reference,
String guid
) throws RefundCreationException, BitPayException {}
Create Refund by passing a Refund object (New)
We added this method to the Client
to better align with other methods.
public Refund createRefund(Refund refund) throws
RefundCreationException, BitPayException {}
Get Refund by GUID
public Refund getRefundByGuid(String guid) throws RefundQueryException, BitPayException {}
Update Refund by GUID
public Refund updateRefundByGuid(String guid, String status) throws RefundUpdateException, BitPayException {}
Cancel Refund by GUID
public Refund cancelRefundByGuid(String guid) throws RefundCancellationException, BitPayException {}