@easypost/api
Advanced tools
Comparing version 7.2.0 to 7.3.0
# 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 @@ |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
815837
12521