Payment Intent

(Node.js client for 3pa-y payment API)

Overview

3pa-y is an official Node.js SDK for integrating with the 3pa-y payment gateway. It helps developers easily create transactions, check payment status, and handle callbacks without manually writing API requests.

Installation

Using npm npm install 3pa-y

Or using Yarn: yarn add 3pa-y

You can also use it in browsers via CDN:

Quick Start Get Your API Keys Sign up at 3pa-y.com to get your API credentials.

Security & Best Practices

Store your apiKey and especially apiSecret in environment variables or on server side. Don’t expose them in client code.

Always validate callbacks on server side: when your webhook receives a request, fetch transaction status via getTransaction (or a verifyPayment method if exists) to confirm authenticity.

Use HTTPS for all communication (callback URLs, API calls).

Handle error states: timeouts, invalid params, transaction expiry, etc.

🛠️ Demo / Example Scenario

You can use the browser demo provided in the repo, which shows how to embed the checkout in a simple front-end. GitHub

Explain how a user would go through the flow:

Customer enters amount, chooses currency, clicks “Pay”

SDK opens a checkout UI or popup

Customer confirms payment

Payment gateway triggers a callback/webhook to your server

Your backend uses getTransaction to verify & update your records

📚 Resources & Support

GitHub repo: rivalfinance/3pay-sdk GitHub

Support / Contact: [email protected]