Payment Integration Guide
Comprehensive documentation for implementing secure payment processing with Orbita
Prerequisites
- Next.js 13+ Application
One Item Basic Payment
Simple fixed-price payment implementation
1. Installation
npm install orbita-sdkor
yarn add orbita-sdk2. Importing the Checkout Function
In your React/TypeScript file, import the single exported helper:
import { handleBasicCheckout } from 'orbita-sdk'3. Function Call Example
Basic usage of the checkout function:
handleBasicCheckout(paymentId: string, returnUrl: string)4. Quick Start Example
Here's a complete React component that opens the Orbita checkout page on button click:
import React, { useState } from 'react'
import { Button } from '@/components/ui/button'
import { handleBasicCheckout } from 'orbita-sdk'
export default function SubscriptionButton() {
const [loading, setLoading] = useState(false)
const handleClick = () => {
setLoading(true)
try {
handleBasicCheckout(
'YOUR_BASIC_PAYMENT_ID', // your basic payment ID
'https://your-shop.com/success' // URL to redirect on success
)
} finally {
setLoading(false)
}
}
return (
<Button onClick={handleClick} disabled={loading}>
{loading ? 'Processing…' : 'Subscribe Now'}
</Button>
)
}