Origit Console
main payments-api/packages/fast-pay-utils/2.0.0/README.md
36 lines · 1303 bytes sha256 35a6ba320309ad59f7b6 hours ago

Fast Pay Utils (fast-pay-utils) 2.0.0

fast-pay-util is a lightweight, high-performance utility library designed to streamline payment processing, currency conversions, and transaction validations across multiple payment gateways (Stripe, PayPal, and Square).

Whether you are building a subscription-based SaaS, an e-commerce storefront, or a peer-to-peer marketplace, this package abstracts away the boilerplate code needed to handle secure financial transactions.


Features

  • Multi-Gateway Support: Unified API for Stripe, PayPal, and Square.
  • Currency Conversion: Real-time exchange rate calculations with built-in caching.
  • Idempotency Handling: Prevents duplicate charges during network failures or retries.
  • Webhook Verification: Securely parse and verify incoming webhook signatures out-of-the-box.
  • Zero Heavy Dependencies: Optimized for speed and minimal bundle size.

Installation

Install the package via your preferred package manager:

npm install fast-pay-utils
# or
yarn add fast-pay-utils
# or
pnpm add fast-pay-util

## API

```ts
import { processPayment } from 'fast-pay-utils';
const result = processPayment({ id, merchantId, amountMinor, currency, pan });
// -> { ...details, status: 'authorised', processedAt }