Skip to content

Commit 676653d

Browse files
authored
- Remove createAndBuy function (#424)
1 parent b70489a commit 676653d

File tree

4 files changed

+1
-200
lines changed

4 files changed

+1
-200
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Remove `withCarbonOffset` parameter from shipment create and buy functions
66
- Remove `carbon_offset` property of `Rate` object
77
- Fixes a pagination issue by passing along additional params used when fetching first page
8+
- Remove `createAndBuy` function from `Batch` service (deprecated endpoint server-side)
89

910
## v6.8.2 (2023-10-20)
1011

src/services/batch_service.js

-19
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,6 @@ export default (easypostClient) =>
105105
}
106106
}
107107

108-
/**
109-
* Create and purchase a {@link Batch batch} in a single request.
110-
* See {@link https://www.easypost.com/docs/api/node#batches EasyPost API Documentation} for more information.
111-
* @param {Object} params - Parameters for the batch to be created and purchased.
112-
* @returns {Batch} - The created and purchased batch.
113-
*/
114-
static async createAndBuy(params) {
115-
const url = `batches/create_and_buy`;
116-
const wrappedParams = { batch: params };
117-
118-
try {
119-
const response = await easypostClient._post(url, wrappedParams);
120-
121-
return this._convertToEasyPostObject(response.body, wrappedParams);
122-
} catch (e) {
123-
return Promise.reject(e);
124-
}
125-
}
126-
127108
/**
128109
* Purchase a {@link Batch batch}.
129110
* See {@link https://www.easypost.com/docs/api/node#buy-a-batch EasyPost API Documentation} for more information.

test/cassettes/Batch-Service_3950244400/creates-and-buys-a-batch-in-a-single-call_1654959317/recording.har

-171
This file was deleted.

test/services/batch.test.js

-10
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ describe('Batch Service', function () {
5353
});
5454
});
5555

56-
it('creates and buys a batch in a single call', async function () {
57-
const batch = await this.client.Batch.createAndBuy({
58-
shipments: [Fixture.oneCallBuyShipment(), Fixture.oneCallBuyShipment()],
59-
});
60-
61-
expect(batch).to.be.an.instanceOf(Batch);
62-
expect(batch.id).to.match(/^batch_/);
63-
expect(batch.num_shipments).to.equal(2);
64-
});
65-
6656
it('buys a batch', async function () {
6757
const batch = await this.client.Batch.create({
6858
shipments: [Fixture.oneCallBuyShipment()],

0 commit comments

Comments
 (0)