Prerequisites
Before you start, make sure you have:
API Keys
Get your test API keys from the Dashboard
Never share your secret API key publicly. Use environment variables to store them securely.
Step 1: Get your API keys
Navigate to API Keys
Click on Settings > API Keys in the sidebar
Copy your test keys
Copy your test secret key (starts with sk_test_)
Test keys allow you to simulate payments without real money. Use them during development.
Step 2: Install an SDK (optional)
Choose your preferred language:
npm install @yabetoo/sdk-js
Step 3: Create your first payment
Option A: Hosted Checkout (Recommended)
The fastest way to accept payments. Redirect your customers to a Yabetoo-hosted page.
import Yabetoo from "@yabetoo/sdk-js";
const yabetoo = new Yabetoo("sk_test_XXXXXXXXXXXXXXXXXXXXXXXX");
const session = await yabetoo.sessions.create({
accountId: "acct_xxxxxxxx",
total: 5000,
currency: "xaf",
successUrl: "https://your-site.com/success",
cancelUrl: "https://your-site.com/cancel",
items: [
{
productId: "prod_123",
productName: "Premium Plan",
quantity: 1,
price: 5000,
},
],
});
// Redirect customer to session.url
console.log(session.url);
Option B: Custom Integration
For full control over the payment experience, use the Payment Intent API.
import Yabetoo from "@yabetoo/sdk-js";
const yabetoo = new Yabetoo("sk_test_XXXXXXXXXXXXXXXXXXXXXXXX");
// Step 1: Create payment intent
const intent = await yabetoo.payments.create({
amount: 5000,
currency: "xaf",
description: "Premium Plan subscription",
});
// Step 2: Confirm with customer's payment method
const payment = await yabetoo.payments.confirm(intent.id, {
clientSecret: intent.clientSecret,
firstName: "John",
lastName: "Doe",
receiptEmail: "john@example.com",
paymentMethodData: {
type: "momo",
momo: {
country: "cg",
msisdn: "242123456789",
operatorName: "mtn",
},
},
});
console.log(payment.status); // "succeeded"
Step 4: Test your integration
Use these test phone numbers in sandbox mode:
| Phone Number | Behavior |
|---|
242000000001 | Always succeeds |
242000000002 | Always fails (insufficient funds) |
242000000003 | Pending for 30 seconds, then succeeds |
Check your Dashboard to see all test transactions in real-time.
Step 5: Go live
When you’re ready to accept real payments:
Complete account verification
Submit your business documents in the Dashboard
Switch to production keys
Replace sk_test_ with sk_live_ in your code
Update webhook endpoints
Point webhooks to your production server
Congratulations! You’re now ready to accept payments with Yabetoo.
Next steps
Handle Webhooks
Get notified when payments complete
Explore SDKs
Discover all SDK features
API Reference
Full API documentation
Error Handling
Handle errors gracefully