Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ayan4m1/paypal-fee
https://github.com/ayan4m1/paypal-fee
library nodejs paypal typescript
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ayan4m1/paypal-fee
- Owner: ayan4m1
- License: mit
- Created: 2023-09-15T18:01:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-08T03:16:31.000Z (9 months ago)
- Last Synced: 2024-10-10T00:14:35.541Z (3 months ago)
- Topics: library, nodejs, paypal, typescript
- Language: TypeScript
- Homepage:
- Size: 271 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# paypal-fee
[![Package Version](https://badge.fury.io/js/paypal-fee.svg)](https://www.npmjs.com/package/paypal-fee)
[![Code Coverage](https://codecov.io/gh/ayan4m1/paypal-fee/graph/badge.svg?token=IjghFTPyZf)](https://codecov.io/gh/ayan4m1/paypal-fee)**NOTE**: Most recent audit of PayPal fees was done in September 2023. Fees are subject to change at any time, and this is not an official PayPal module. All use is at your own risk.
## features
- Written in TypeScript
- Less than 2kB of code
- No runtime dependencies
- Supports ESM and CommonJS
- Comprehensive integration tests## requirements
- Node 16+
## usage
To use this module, simply install it using your favorite package manager and then import the `calculateFee` function.
`calculateFee` takes a payment value in USD and a `PaymentType`, and returns a fee amount in USD.
Payment types are as follows:
## example
```ts
import { calculateFee, PaymentType } from 'paypal-fee';const fee = calculateFee(100, PaymentType.GoodsAndServices);
console.log(fee);
```will output `3.98`.