Developer Guides

Learn. Integrate. Ship Faster.

Step-by-step technical guides for PSP onboarding, payment testing, multi-PSP failover configuration, and PCI compliance — all built around the PayServ platform.

4 Guides
Code Included
Regularly Updated

All Guides

Onboarding Beginner 8 min read

Getting Started with PayServ SDKs

This guide gets you up and running with the PayServ client library. We will install the package, initialize the SDK with API credentials, configure a mock payment source, and execute a charge request against our sandbox routing middleware.

Steps

1
Install the SDK

First, add the PayServ SDK package to your Node.js backend dependencies using npm or yarn.

2
Initialize the Client

Import the PayServ SDK and instantiate the client using your sandbox API key and environment selector.

3
Construct Payment Payload

Define your payment details including amount, currency, merchant account ID, and standard card token parameters.

4
Submit the Transaction Request

Call the core transactions module to execute the charge and handle success or error callbacks.

TYPESCRIPT Example
import { PayServClient } from '@payserv/node-sdk';

// Initialize sandbox client
const client = new PayServClient({
  apiKey: process.env.PAYSERV_SANDBOX_KEY,
  environment: 'sandbox'
});

async function runTestPayment() {
  try {
    const payment = await client.transactions.create({
      amount: 4999, // $49.99 in cents
      currency: 'USD',
      merchantAccountId: 'merch_dev_99182',
      paymentMethod: {
        token: 'tok_sandbox_visa_success'
      },
      metadata: {
        orderId: 'ord_9182A',
        customerId: 'cust_8812'
      }
    });

    console.log('Payment executed successfully:', payment.id);
    console.log('Routing provider:', payment.routing.provider);
  } catch (error) {
    console.error('Payment execution failed:', error.message);
  }
}

runTestPayment();
Ready to implement this in your project?

Access the full PayServ sandbox with pre-configured PSP connectors and test this guide live.