SDK Documentation

Integrate ZenPay's payment processing capabilities into your applications with our official SDKs.

Last updated: July 10, 2023
Next: Example Applications

Quick Start

Install ZenPay SDK

Using npm
npm install @zenpay/js
Using yarn
yarn add @zenpay/js

Initialize ZenPay

Initialize ZenPay
import { ZenPay } from '@zenpay/js';

// Initialize with your public API key
const zenpay = new ZenPay('pk_test_ZenPay123456789DEMO');

Available SDKs

ZenPay offers official SDKs for popular programming languages and frameworks to simplify your integration process. Each SDK provides idiomatic access to our APIs and handles common tasks like authentication, error handling, and webhook validation.

JavaScript / TypeScript

For web and Node.js applications

npm install @zenpay/js
Browser and Node.js support
TypeScript typings included
Promise-based API

Python

For server-side applications

pip install zenpay
Python 3.7+ compatible
Async support with asyncio
Django & Flask helpers

Java

For Java applications

Maven or Gradle compatible
Java 8+ support
Spring Boot integration
Android compatibility

Core SDK Features

All ZenPay SDKs provide a consistent set of core features designed to simplify integration with our payment APIs.

API Access

Complete access to all ZenPay API endpoints with properly structured requests and response handling. All SDKs handle authentication, error handling, and retry logic automatically.

Webhook Handling

Utilities for verifying and processing ZenPay webhooks, making it easy to respond to payment events in real-time. Includes signature validation and event parsing functionality.

Framework Integrations

Language-specific framework integrations that make it easier to use ZenPay with popular web frameworks like React, Angular, Vue, Rails, Django, Laravel, and more.

Idiomatic Implementation

Each SDK follows the conventions and best practices of its target language or platform, providing a natural and familiar developer experience for users of that ecosystem.

Getting Started

Follow these general steps to get started with any ZenPay SDK:

1

Install the SDK

Use your language's package manager to install the ZenPay SDK:

Install ZenPay SDK
# Example for JavaScript npm install @zenpay/js
2

Initialize with API Keys

Configure the SDK with your API keys. Always use test keys for development.

Initialize ZenPay
// JavaScript example const zenpay = new ZenPay('sk_test_your_secret_key');
3

Create Your First Payment

Use the SDK to create a payment:

Create a Payment
// Create a payment const payment = await zenpay.payments.create({ amount: 2000, // $20.00 currency: 'usd', payment_method: 'pm_card_visa', description: 'Example payment' });
4

Handle Webhooks

Process webhook events to get notified about payment status changes:

Process Webhooks
// Verify and process webhooks const event = zenpay.webhooks.constructEvent( requestBody, signature, webhookSecret );

Client Libraries vs. Server SDKs

ZenPay offers two categories of integration libraries:

Server-Side SDKs

Our server-side SDKs provide full API access and should be used for operations that require your secret API key, such as creating payments, managing subscriptions, and handling webhooks.

  • Secure secret key operations
  • Complete API access
  • Webhook processing

Available for Node.js, Python, PHP, Ruby, Java, .NET, and more.

Client-Side Libraries

Our client-side libraries are designed for browser environments and work with your publishable API key to safely collect payment information and create payment tokens.

  • Secure card collection
  • Payment UI components
  • Mobile wallet integration

Available for browsers, React, Vue, Angular, iOS, and Android.

Next Steps

Choose a language-specific SDK guide or explore these related resources:

API Reference

Learn about all available API endpoints

Example Applications

Explore complete example projects

Webhooks Integration

Set up real-time payment notifications

Testing Guide

Learn how to test your integration

Was this helpful?