Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This project uses [Semantic Versioning 2.0.0](http://semver.org/), the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## main

### Changed

- Updated the `listCharges` test fixture to include a certificate purchase entry demonstrating that `getProductReference` returns a string even when it represents a numeric ID. (#248)

## 5.3.0 - 2026-04-15

### Added
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/com/dnsimple/endpoints/BillingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ public class BillingTest extends DnsimpleTestBase {
public void testListChargesProducesChargeList() {
server.stubFixtureAt("listCharges/success.http");
List<Charge> charges = client.billing.listCharges(1010, ListOptions.empty()).getData();
assertThat(charges, hasSize(3));
assertThat(charges, hasSize(4));
assertThat(charges.get(0).getTotalAmount(), is(new BigDecimal("14.50")));
assertThat(charges.get(0).getBalanceAmount(), is(new BigDecimal("0.00")));
assertThat(charges.get(0).getItems().get(0).getAmount(), is(new BigDecimal("14.50")));
assertThat(charges.get(0), is(new Charge("2023-08-17T05:53:36Z", "14.50", "0.00", "1-2", "collected", List.of(new ChargeItem("Register bubble-registered.com", "14.50", 1L, "domain-registration", "bubble-registered.com")))));
assertThat(charges.get(1), is(new Charge("2023-08-17T05:57:53Z", "14.50", "0.00", "2-2", "refunded", List.of(new ChargeItem("Register example.com", "14.50", 2L, "domain-registration", "example.com")))));
assertThat(charges.get(2), is(new Charge("2023-10-24T07:49:05Z", "1099999.99", "0.00", "4-2", "collected", List.of(new ChargeItem("Test Line Item 1", "99999.99", null, "manual", null), new ChargeItem("Test Line Item 2", "1000000.00", null, "manual", null)))));
assertThat(charges.get(3), is(new Charge("2023-10-24T09:00:00Z", "20.00", "0.00", "5-2", "collected", List.of(new ChargeItem("Purchase Certificate www.bubble-registered.com", "20.00", 42L, "certificate-purchase", "42")))));
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/com/dnsimple/listCharges/success.http
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ cache-control: no-store, must-revalidate, private, max-age=0
x-request-id: a57a87c8-626a-4361-9fb8-b55ca9be8e5d
x-runtime: 0.060526

{"data":[{"invoiced_at":"2023-08-17T05:53:36Z","total_amount":"14.50","balance_amount":"0.00","reference":"1-2","state":"collected","items":[{"description":"Register bubble-registered.com","amount":"14.50","product_id":1,"product_type":"domain-registration","product_reference":"bubble-registered.com"}]},{"invoiced_at":"2023-08-17T05:57:53Z","total_amount":"14.50","balance_amount":"0.00","reference":"2-2","state":"refunded","items":[{"description":"Register example.com","amount":"14.50","product_id":2,"product_type":"domain-registration","product_reference":"example.com"}]},{"invoiced_at":"2023-10-24T07:49:05Z","total_amount":"1099999.99","balance_amount":"0.00","reference":"4-2","state":"collected","items":[{"description":"Test Line Item 1","amount":"99999.99","product_id":null,"product_type":"manual","product_reference":null},{"description":"Test Line Item 2","amount":"1000000.00","product_id":null,"product_type":"manual","product_reference":null}]}],"pagination":{"current_page":1,"per_page":30,"total_entries":3,"total_pages":1}}
{"data":[{"invoiced_at":"2023-08-17T05:53:36Z","total_amount":"14.50","balance_amount":"0.00","reference":"1-2","state":"collected","items":[{"description":"Register bubble-registered.com","amount":"14.50","product_id":1,"product_type":"domain-registration","product_reference":"bubble-registered.com"}]},{"invoiced_at":"2023-08-17T05:57:53Z","total_amount":"14.50","balance_amount":"0.00","reference":"2-2","state":"refunded","items":[{"description":"Register example.com","amount":"14.50","product_id":2,"product_type":"domain-registration","product_reference":"example.com"}]},{"invoiced_at":"2023-10-24T07:49:05Z","total_amount":"1099999.99","balance_amount":"0.00","reference":"4-2","state":"collected","items":[{"description":"Test Line Item 1","amount":"99999.99","product_id":null,"product_type":"manual","product_reference":null},{"description":"Test Line Item 2","amount":"1000000.00","product_id":null,"product_type":"manual","product_reference":null}]},{"invoiced_at":"2023-10-24T09:00:00Z","total_amount":"20.00","balance_amount":"0.00","reference":"5-2","state":"collected","items":[{"description":"Purchase Certificate www.bubble-registered.com","amount":"20.00","product_id":42,"product_type":"certificate-purchase","product_reference":"42"}]}],"pagination":{"current_page":1,"per_page":30,"total_entries":4,"total_pages":1}}