Contract preview. This interface is not available for public use yet. Keep all secret keys server-side.
// Private local Node workspace · run npm run build:all first
// Server-side only; set both environment variables privately.
import { createClient } from 'khpayment-sdk';
const client = createClient({
baseUrl: process.env.KHPAYMENT_BASE_URL,
apiKey: process.env.KHPAYMENT_API_KEY,
});
const payment = await client.createPayment({
"amount": "12.50",
"currency": "USD"
}, {
idempotencyKey: 'example-order-001',
});
console.log(JSON.stringify(payment));Authentication guide