# SDKs Overview

ZevPay provides client-side SDKs for collecting payments and a server-side SDK for managing transactions from your backend.

## Integration options

| Feature | Inline Checkout | Standard Checkout | React | Flutter | Node.js SDK | PHP SDK | Python SDK | Laravel | WooCommerce |
|---------|----------------|-------------------|-------|---------|-------------|---------|------------|---------|-------------|
| **Integration** | JavaScript SDK on your page | Redirect to hosted page | React components/hooks | WebView in mobile app | Server-side library | Server-side library | Server-side library | Laravel package | WordPress plugin |
| **User experience** | Modal overlay, user stays on your site | Full-page checkout on ZevPay | Modal overlay (React) | In-app WebView checkout | Backend API calls | Backend API calls | Backend API calls | Backend API calls | Inline modal or redirect |
| **Session creation** | Client-side (SDK handles it) | Server-side (you create, then redirect) | Client-side (SDK handles it) | Client-side (SDK handles it) | Server-side | Server-side | Server-side | Server-side | Plugin handles it |
| **API key type** | Public key only | Public key (page) + Secret key (server) | Public key only | Public key only | Secret key only | Secret key only | Secret key only | Secret key only | Both (configured in settings) |
| **Callbacks** | JavaScript functions | URL query parameters | React props / hooks | Dart async/await | Promises / async-await | Return values / exceptions | Return values / exceptions | Events / exceptions | WooCommerce order lifecycle |
| **Best for** | Vanilla JS, jQuery sites | E-commerce carts, invoices, email payments | React / Next.js apps | Flutter mobile apps | Node.js / Express / NestJS | WordPress, any PHP app | Django, FastAPI, Flask apps | Laravel apps | WooCommerce stores |

## Inline Checkout

Embed a payment modal directly on your website. The SDK handles session creation, payment method selection, and polling — all you need is a public API key.

```html
<script src="https://js.zevpaycheckout.com/v1/inline.js"></script>
<script>
  var checkout = new ZevPay.ZevPayCheckout();
  checkout.checkout({
    apiKey: 'pk_test_your_public_key',
    email: 'customer@example.com',
    amount: 500000, // ₦5,000 in kobo
    onSuccess: function(reference) {
      alert('Payment complete! Ref: ' + reference);
    },
  });
</script>
```

[Full inline SDK documentation →](./inline)

## React

React components and hooks wrapping the Inline SDK. Use `<ZevPayButton>` for a drop-in button or `useZevPayCheckout()` for full control.

```tsx
import { ZevPayButton } from '@zevpay/react';

function CheckoutPage() {
  return (
    <ZevPayButton
      apiKey="pk_test_your_public_key"
      email="customer@example.com"
      amount={500000}
      onSuccess={(ref) => verifyPayment(ref)}
    >
      Pay ₦5,000
    </ZevPayButton>
  );
}
```

[Full React SDK documentation →](./react)

## Flutter

Accept payments in your Flutter mobile app. The SDK opens the standard checkout page in a WebView and returns the result via async/await.

```dart
import 'package:zevpay_checkout/zevpay_checkout.dart';

final result = await ZevPayCheckout.open(
  context: context,
  options: CheckoutOptions(
    apiKey: 'pk_test_your_public_key',
    email: 'customer@example.com',
    amount: 500000, // ₦5,000 in kobo
  ),
);

if (result.isSuccess) {
  print('Paid! Reference: ${result.reference}');
}
```

[Full Flutter SDK documentation →](./flutter)

## Standard Checkout

Redirect customers to a hosted checkout page. Create a session on your server, then redirect the customer using the returned URL.

```js
// Your server
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/session/initialize', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'sk_test_your_secret_key',
  },
  body: JSON.stringify({
    amount: 500000,
    currency: 'NGN',
    email: 'customer@example.com',
    callback_url: 'https://yoursite.com/payment/callback',
  }),
});

const { data } = await response.json();
// Redirect customer to: data.checkout_url
```

[Full standard SDK documentation →](./standard)

## Node.js SDK

Full REST API coverage from your server. Handle checkout sessions, transfers, invoices, PayIDs, virtual accounts, and webhook verification — all with TypeScript support.

```typescript
import ZevPay from '@zevpay/node';

const zevpay = new ZevPay('sk_test_your_secret_key');

// Initialize a checkout session
const session = await zevpay.checkout.initialize({
  amount: 500000, // ₦5,000 in kobo
  email: 'customer@example.com',
  reference: 'ORDER-123',
  callbackUrl: 'https://yoursite.com/callback',
});

// Send a bank transfer
const transfer = await zevpay.transfers.create({
  type: 'bank_transfer',
  amount: 1000000,
  accountNumber: '0123456789',
  bankCode: '044',
  accountName: 'John Doe',
  narration: 'Payout',
});
```

[Full Node.js SDK documentation →](./nodejs)

## PHP SDK

Full REST API coverage for PHP applications. Works with Laravel, WordPress, and any PHP 8.1+ project.

```php
use ZevPay\ZevPay;

$zevpay = new ZevPay('sk_test_your_secret_key');

$session = $zevpay->checkout->initialize([
    'amount' => 500000, // ₦5,000 in kobo
    'email' => 'customer@example.com',
    'reference' => 'ORDER-123',
    'callback_url' => 'https://yoursite.com/callback',
]);

echo $session['checkout_url'];
```

[Full PHP SDK documentation →](./php)

## Python SDK

Full REST API coverage for Python applications. Works with Django, FastAPI, Flask, and any Python 3.8+ project.

```python
from zevpay import ZevPay

client = ZevPay("sk_test_your_secret_key")

session = client.checkout.initialize(
    amount=500000,  # ₦5,000 in kobo
    email="customer@example.com",
    reference="ORDER-123",
    callback_url="https://yoursite.com/callback",
)

print(session["checkout_url"])
```

[Full Python SDK documentation →](./python)

## Laravel

Laravel integration wrapping the PHP SDK. Provides a service provider, facade, webhook controller with signature verification middleware, and event dispatching for all webhook types.

```php
use ZevPay\Laravel\Facades\ZevPay;

// Initialize a checkout session
$session = ZevPay::checkout()->initialize([
    'amount' => 500000, // ₦5,000 in kobo
    'email' => 'customer@example.com',
    'callback_url' => 'https://yoursite.com/callback',
]);

return redirect($session['checkout_url']);
```

- **Facade** — `ZevPay::checkout()`, `ZevPay::transfers()`, etc.
- **Webhooks** — Auto-registered route with signature verification
- **Events** — `ChargeSuccess`, `TransferSuccess`, `InvoicePaid`, etc.
- **Artisan** — `zevpay:verify-keys`, `zevpay:webhook-test`

[Full Laravel documentation →](./laravel)

## WooCommerce

Accept ZevPay payments in your WooCommerce store. Supports inline modal and standard (redirect) checkout modes, configurable payment methods, and webhook verification.

```php
// Automatic — just install, configure API keys, and choose your checkout mode.
// The plugin handles session creation, payment verification, and order updates.
```

- **Inline Mode** — Modal overlay on your checkout page
- **Standard Mode** — Redirect to ZevPay hosted checkout
- Configure payment methods per store or use Dashboard settings
- WooCommerce Blocks and HPOS compatible

[Full WooCommerce plugin documentation →](./woocommerce)

## Payment methods

Both SDKs support the same payment methods:

| Method | Key | Description |
|--------|-----|-------------|
| Bank Transfer | `bank` | Customer transfers to a virtual account |
| ZevPay ID | `payid` | Customer pays via ZevPay ID (P2P) |
| Card | `card` | Card payment (coming soon) |

## Amount format

All amounts are in **kobo** (the smallest currency unit for NGN):

| Naira amount | Kobo value |
|--------------|------------|
| ₦100 | `10000` |
| ₦1,000 | `100000` |
| ₦5,000 | `500000` |
| ₦50,000 | `5000000` |

::: warning
Minimum transaction amount is ₦100 (10,000 kobo).
:::
