Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@easypost/api

Package Overview
Dependencies
Maintainers
6
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@easypost/api - npm Package Compare versions

Comparing version 7.2.0 to 7.3.0

5

CHANGELOG.md
# CHANGELOG
## v7.3.0 (2024-04-10)
- Fix payment method funding and deletion failures due to undetermined payment method type
- Adds `refund` function in Insurance service for requesting a refund of standalone insurance.
## v7.2.0 (2024-01-22)

@@ -4,0 +9,0 @@

2

package.json
{
"name": "@easypost/api",
"description": "EasyPost Node Client Library",
"version": "7.2.0",
"version": "7.3.0",
"author": "Easypost Engineering <oss@easypost.com>",

@@ -6,0 +6,0 @@ "homepage": "https://easypost.com",

@@ -76,2 +76,3 @@ import Constants from '../constants';

let paymentMethodID;
let paymentMethodObjectType;
let endpoint;

@@ -82,5 +83,6 @@ const errorString = 'The chosen payment method is not valid. Please try again.';

paymentMethodID = paymentMethods[paymentMethodToUse].id;
if (paymentMethodID.startsWith('card_')) {
paymentMethodObjectType = paymentMethods[paymentMethodToUse].object;
if (paymentMethodObjectType === 'CreditCard') {
endpoint = 'credit_cards';
} else if (paymentMethodID.startsWith('bank_')) {
} else if (paymentMethodObjectType === 'BankAccount') {
endpoint = 'bank_accounts';

@@ -87,0 +89,0 @@ } else {

@@ -59,2 +59,15 @@ import baseService from './base_service';

}
/**
* Refund an {@link Insurance insurance} record by its ID.
* See {@link https://www.easypost.com/docs/api/node#refund-an-insurance EasyPost API Documentation} for more information.
* @param {string} id - The ID of the insurance to be refunded.
* @returns {Insurance} - The refunded insurance.
*/
static async refund(id) {
const url = `insurances/${id}/refund`;
const response = await easypostClient._post(url);
return this._convertToEasyPostObject(response.body);
}
};

@@ -164,2 +164,12 @@ import { IAddress } from '../Address';

): Promise<{ insurances: Insurance[]; has_more: boolean }>;
/**
* Refund an Insurance by id.
*
* @see https://www.easypost.com/docs/api/node#refund-an-insurance
*
* @param insuranceId Unique, starts with "ins_"
* @returns {Promise<Insurance>} The refunded {@link Insurance}.
*/
static refund(insuranceId: string): Promise<Insurance>;
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc