https://github.com/ayan4m1/paypal-fee
https://github.com/ayan4m1/paypal-fee
library nodejs paypal typescript
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ayan4m1/paypal-fee
- Owner: ayan4m1
- License: mit
- Archived: true
- Created: 2023-09-15T18:01:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-05T23:58:12.000Z (8 months ago)
- Last Synced: 2025-03-16T17:06:36.152Z (4 months ago)
- Topics: library, nodejs, paypal, typescript
- Language: TypeScript
- Homepage:
- Size: 401 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
[](https://www.npmjs.com/package/paypal-fee)
[](https://codecov.io/gh/ayan4m1/paypal-fee)**NOTE**: PayPal has significantly changed their fee structure, this module needs to be rewritten to be useful as of today.
## 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`.