PaymentHood Documentation
Welcome to PaymentHood's comprehensive developer documentation. PaymentHood is a cloud-native payment orchestration platform that connects your business to 15+ payment providers through a single, unified API.
What is PaymentHood?
PaymentHood simplifies payment processing by providing:
- Unified API across multiple payment providers
- Smart routing and automatic failover
- Real-time analytics and reporting
- Enterprise-grade security and compliance
- Multi-currency support
- AI-powered fraud detection
5-Minute Setup
Get started with our REST API in minutes with comprehensive guides and examples.
Enterprise Security
PCI DSS Level 1 compliant with 256-bit encryption and advanced fraud protection.
Global Scale
Process payments worldwide with 15+ providers and multi-currency support.
Quick Start Guide
Get up and running with PaymentHood in just a few steps.
1. Get Your API Keys
Sign up for a PaymentHood account and retrieve your API keys from the dashboard:
Sandbox: https://api-sandbox.paymenthood.com
Production: https://api.paymenthood.com
Test API Key: pk_test_your_test_key_here
Live API Key: pk_live_your_live_key_here
2. Make Your First Payment
Create a payment intent to start processing payments:
curl -X POST https://api.paymenthood.com/v1/payments \
-H "Authorization: Bearer pk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"amount": 2000,
"currency": "USD",
"payment_method_types": ["card"],
"description": "Test payment"
}'
3. Handle the Response
PaymentHood returns a payment object with all the necessary information:
{
"id": "pi_1234567890",
"object": "payment_intent",
"amount": 2000,
"currency": "usd",
"status": "requires_payment_method",
"client_secret": "pi_1234567890_secret_xyz",
"created": 1638360000,
"description": "Test payment"
}
Authentication
PaymentHood uses API keys to authenticate requests. Include your API key in the Authorization header:
Authorization: Bearer pk_test_your_api_key_here
API Key Types
| Key Type | Purpose | Environment |
|---|---|---|
pk_test_ |
Testing and development | Sandbox |
pk_live_ |
Production transactions | Live |
sk_test_ |
Server-side testing | Sandbox |
sk_live_ |
Server-side production | Live |
Payments API
Process payments using our unified API that works with all supported payment providers.
Create a Payment
Creates a new payment intent that can be confirmed with a payment method.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount |
integer | Yes | Amount in cents |
currency |
string | Yes | Three-letter ISO currency code |
payment_method_types |
array | Yes | Array of payment methods: card, bank_transfer |
description |
string | No | Payment description |
Example Request
{
"amount": 2000,
"currency": "USD",
"payment_method_types": ["card"],
"description": "Order #12345",
"metadata": {
"order_id": "12345",
"customer_id": "cus_abc123"
}
}
Retrieve a Payment
Retrieves the details of an existing payment.
Example Response
{
"id": "pi_1234567890",
"object": "payment_intent",
"amount": 2000,
"currency": "usd",
"status": "succeeded",
"payment_method": "pm_1234567890",
"created": 1638360000,
"description": "Order #12345",
"provider": "stripe",
"fees": {
"processing_fee": 59,
"paymenthood_fee": 12
}
}
Webhooks
PaymentHood sends webhooks to notify your application about payment events.
Setting Up Webhooks
Configure webhook endpoints in your PaymentHood dashboard to receive real-time notifications.
Webhook Events
| Event | Description | Status |
|---|---|---|
payment.succeeded |
Payment was successful | Live |
payment.failed |
Payment failed | Live |
payment.canceled |
Payment was canceled | Live |
refund.created |
Refund was processed | Live |
Webhook Signature Verification
const crypto = require('crypto');
function verifyWebhookSignature(payload, signature, secret) {
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(payload, 'utf8')
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature, 'hex'),
Buffer.from(expectedSignature, 'hex')
);
}
WHMCS Plugin Integration
The PaymentHood WHMCS plugin provides seamless integration with WHMCS billing systems.
Installation
- Download the PaymentHood WHMCS plugin from your dashboard
- Upload the plugin files to your WHMCS
/modules/gateways/directory - Log into your WHMCS admin panel
- Navigate to Setup → Payment Gateways
- Activate PaymentHood and enter your API credentials
Configuration
| Setting | Description | Required |
|---|---|---|
| API Key | Your PaymentHood API key | Yes |
| Webhook Secret | Secret for webhook verification | Yes |
| Test Mode | Enable for sandbox testing | No |
| Auto-capture | Automatically capture payments | No |
Features
- Auto-billing: Automatic recurring payment processing
- Multi-currency: Support for multiple currencies
- Recurring payments: Handle subscription billing
- Invoice integration: Seamless invoice payment processing
SDKs & Libraries
Official PaymentHood SDKs are available for popular programming languages:
JavaScript SDK
For Node.js applications and browser integration
AvailablePHP SDK
For PHP applications and WordPress plugins
AvailablePython SDK
For Django and Flask applications
BetaInstallation Examples
# Node.js
npm install paymenthood
# PHP
composer require paymenthood/paymenthood-php
# Python
pip install paymenthood
Error Codes
PaymentHood uses standard HTTP response codes to indicate success or failure of API requests.
| Code | Error | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid API key |
| 402 | Payment Required | Payment failed or card declined |
| 404 | Not Found | Resource not found |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Internal server error |
Support & Resources
Get help and connect with the PaymentHood community.
24/7 Support
Enterprise customers get priority support via email, chat, and phone.
Knowledge Base
Comprehensive guides, tutorials, and troubleshooting resources.
Developer Community
Join our Discord community to connect with other developers.
Contact Information
- Email: support@paymenthood.com
- Phone: +1 (555) 123-4567
- Discord: discord.gg/paymenthood
- Status Page: status.paymenthood.com
Service Level Agreements
| Plan | Response Time | Uptime SLA | Support Channels |
|---|---|---|---|
| Core | 24 hours | 99.5% | |
| Plus | 4 hours | 99.9% | Email, Chat, Phone |