@lorenstuff/paypal-api
Advanced tools
Comparing version
@@ -0,1 +1,6 @@ | ||
## 0.2.0 | ||
Added some Payment related types. | ||
There is no new functionality related to these... yet. | ||
## 0.1.10 | ||
@@ -2,0 +7,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { PayPalHATEOASLink } from "./Shared.js"; | ||
import { PayPalAmount, PayPalAmountWithBreakdown, PayPalDisbursementMode, PayPalHATEOASLink } from "./Shared.js"; | ||
/** Completes an capture payment for an order. */ | ||
@@ -32,97 +32,2 @@ export interface PayPalCaptureOrderRequest { | ||
} | ||
/** The breakdown of the amount. Breakdown provides details such as total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. */ | ||
export interface PayPalAmountBreakdown { | ||
/** | ||
* The subtotal for all items. | ||
* | ||
* Required if the request includes purchase_units[].items[].unit_amount. | ||
* Must equal the sum of (items[].unit_amount * items[].quantity) for all items. | ||
* item_total.value can not be a negative number. | ||
*/ | ||
item_total?: PayPalAmount; | ||
/** | ||
* The shipping fee for all items within a given purchase_unit. | ||
* | ||
* shipping.value can not be a negative number. | ||
*/ | ||
shipping?: PayPalAmount; | ||
/** | ||
* The handling fee for all items within a given purchase_unit. | ||
* | ||
* handling.value can not be a negative number. | ||
*/ | ||
handling?: PayPalAmount; | ||
/** | ||
* The total tax for all items. | ||
* | ||
* Required if the request includes purchase_units.items.tax. | ||
* Must equal the sum of (items[].tax * items[].quantity) for all items. | ||
* tax_total.value can not be a negative number. | ||
*/ | ||
tax_total?: PayPalAmount; | ||
/** | ||
* The insurance fee for all items within a given purchase_unit. | ||
* | ||
* insurance.value can not be a negative number. | ||
*/ | ||
insurance?: PayPalAmount; | ||
/** | ||
* The shipping discount for all items within a given purchase_unit. | ||
* | ||
* shipping_discount.value can not be a negative number. | ||
*/ | ||
shipping_discount?: PayPalAmount; | ||
/** | ||
* The discount for all items within a given purchase_unit. | ||
* | ||
* discount.value can not be a negative number. | ||
*/ | ||
discount?: PayPalAmount; | ||
} | ||
/** | ||
* The total order amount. | ||
* | ||
* The amount must be a positive number. | ||
* | ||
* For listed of supported currencies and decimal precision, | ||
* @see https://developer.paypal.com/docs/integration/direct/rest/currency-codes/ | ||
*/ | ||
export interface PayPalAmount { | ||
/** | ||
* The three-character ISO-4217 currency code that identifies the currency. | ||
* | ||
* See https://developer.paypal.com/api/rest/reference/currency-codes/ | ||
* | ||
* 3 characters. | ||
*/ | ||
currency_code: string; | ||
/** | ||
* The value, which might be: | ||
* - An integer for currencies like JPY that are not typically fractional. | ||
* - A decimal fraction for currencies like TND that are subdivided into thousandths. | ||
* | ||
* For the required number of decimal places for a currency code, see https://developer.paypal.com/api/rest/reference/currency-codes/ | ||
* | ||
* 32 characters max. | ||
*/ | ||
value: string; | ||
} | ||
/** | ||
* The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. | ||
* | ||
* If you specify amount.breakdown, the amount equals item_total plus tax_total plus shipping plus handling plus insurance minus shipping_discount minus discount. | ||
* | ||
* The amount must be a positive number. | ||
* | ||
* For listed of supported currencies and decimal precision, | ||
* @see https://developer.paypal.com/docs/integration/direct/rest/currency-codes/ | ||
*/ | ||
export interface PayPalAmountWithBreakdown extends PayPalAmount { | ||
/** | ||
* The breakdown of the amount. | ||
* | ||
* Breakdown provides details such as total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. | ||
*/ | ||
breakdown?: PayPalAmountBreakdown; | ||
} | ||
/** The customer who approves and pays for the order. The customer is also known as the payer. */ | ||
@@ -761,11 +666,2 @@ export interface PayPalCustomer { | ||
/** | ||
* The funds that are held on behalf of the merchant. | ||
* | ||
* INSTANT: The funds are released to the merchant immediately. | ||
* DELAYED: The funds are held for a finite number of days. The actual duration depends on the region and type of integration. | ||
* You can release the funds through a referenced payout. | ||
* Otherwise, the funds disbursed automatically after the specified duration. | ||
*/ | ||
export type PayPalDisbursementMode = "INSTANT" | "DELAYED"; | ||
/** | ||
* The item category type. | ||
@@ -772,0 +668,0 @@ * |
@@ -0,1 +1,96 @@ | ||
/** The breakdown of the amount. Breakdown provides details such as total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. */ | ||
export interface PayPalAmountBreakdown { | ||
/** | ||
* The subtotal for all items. | ||
* | ||
* Required if the request includes purchase_units[].items[].unit_amount. | ||
* Must equal the sum of (items[].unit_amount * items[].quantity) for all items. | ||
* item_total.value can not be a negative number. | ||
*/ | ||
item_total?: PayPalAmount; | ||
/** | ||
* The shipping fee for all items within a given purchase_unit. | ||
* | ||
* shipping.value can not be a negative number. | ||
*/ | ||
shipping?: PayPalAmount; | ||
/** | ||
* The handling fee for all items within a given purchase_unit. | ||
* | ||
* handling.value can not be a negative number. | ||
*/ | ||
handling?: PayPalAmount; | ||
/** | ||
* The total tax for all items. | ||
* | ||
* Required if the request includes purchase_units.items.tax. | ||
* Must equal the sum of (items[].tax * items[].quantity) for all items. | ||
* tax_total.value can not be a negative number. | ||
*/ | ||
tax_total?: PayPalAmount; | ||
/** | ||
* The insurance fee for all items within a given purchase_unit. | ||
* | ||
* insurance.value can not be a negative number. | ||
*/ | ||
insurance?: PayPalAmount; | ||
/** | ||
* The shipping discount for all items within a given purchase_unit. | ||
* | ||
* shipping_discount.value can not be a negative number. | ||
*/ | ||
shipping_discount?: PayPalAmount; | ||
/** | ||
* The discount for all items within a given purchase_unit. | ||
* | ||
* discount.value can not be a negative number. | ||
*/ | ||
discount?: PayPalAmount; | ||
} | ||
/** | ||
* The total order amount. | ||
* | ||
* The amount must be a positive number. | ||
* | ||
* For listed of supported currencies and decimal precision, | ||
* @see https://developer.paypal.com/docs/integration/direct/rest/currency-codes/ | ||
*/ | ||
export interface PayPalAmount { | ||
/** | ||
* The three-character ISO-4217 currency code that identifies the currency. | ||
* | ||
* See https://developer.paypal.com/api/rest/reference/currency-codes/ | ||
* | ||
* 3 characters. | ||
*/ | ||
currency_code: string; | ||
/** | ||
* The value, which might be: | ||
* - An integer for currencies like JPY that are not typically fractional. | ||
* - A decimal fraction for currencies like TND that are subdivided into thousandths. | ||
* | ||
* For the required number of decimal places for a currency code, see https://developer.paypal.com/api/rest/reference/currency-codes/ | ||
* | ||
* 32 characters max. | ||
*/ | ||
value: string; | ||
} | ||
/** | ||
* The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. | ||
* | ||
* If you specify amount.breakdown, the amount equals item_total plus tax_total plus shipping plus handling plus insurance minus shipping_discount minus discount. | ||
* | ||
* The amount must be a positive number. | ||
* | ||
* For listed of supported currencies and decimal precision, | ||
* @see https://developer.paypal.com/docs/integration/direct/rest/currency-codes/ | ||
*/ | ||
export interface PayPalAmountWithBreakdown extends PayPalAmount { | ||
/** | ||
* The breakdown of the amount. | ||
* | ||
* Breakdown provides details such as total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. | ||
*/ | ||
breakdown?: PayPalAmountBreakdown; | ||
} | ||
/** The error details. */ | ||
@@ -96,2 +191,11 @@ export interface PayPalError { | ||
/** | ||
* The funds that are held on behalf of the merchant. | ||
* | ||
* INSTANT: The funds are released to the merchant immediately. | ||
* DELAYED: The funds are held for a finite number of days. The actual duration depends on the region and type of integration. | ||
* You can release the funds through a referenced payout. | ||
* Otherwise, the funds disbursed automatically after the specified duration. | ||
*/ | ||
export type PayPalDisbursementMode = "INSTANT" | "DELAYED"; | ||
/** | ||
* The operation. | ||
@@ -98,0 +202,0 @@ * |
{ | ||
"name": "@lorenstuff/paypal-api", | ||
"version": "0.1.10", | ||
"version": "0.2.0", | ||
"description": "A library for interacting with PayPal's API.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
87139
8.91%18
12.5%1672
8.15%