Integration Methods
Choose the right integration method for your YagoutPay implementation.
YagoutPay offers multiple integration methods to suit different business needs and technical requirements. Choose the approach that best fits your application architecture and security requirements.
Hosted Checkout
Best for: Quick implementation and PCI compliance
Redirect users to YagoutPay's secure payment page where they complete the payment process. This method requires minimal integration effort and ensures PCI compliance.
✅ Advantages
- • Quick to implement
- • PCI DSS compliant
- • No card data handling
- • Mobile optimized
- • Multi-language support
⚠️ Considerations
- • User leaves your site
- • Limited customization
- • Redirect dependency
// Example: Redirect to hosted checkout
const paymentUrl = 'https://checkout.yagoutpay.com/pay';
const params = {
merchant_id: 'your_merchant_id',
amount: '100.00',
currency: 'ETB',
order_id: 'ORDER_123'
};
window.location.href = paymentUrl + '?' + new URLSearchParams(params);
Direct API Integration
Best for: Custom payment flows and full control
Process payments directly through API calls without redirecting users. This method provides complete control over the payment experience but requires PCI compliance.
✅ Advantages
- • Full control over UX
- • Seamless user experience
- • Custom payment forms
- • Real-time processing
- • Advanced features
⚠️ Considerations
- • PCI DSS compliance required
- • More complex implementation
- • Security considerations
- • Card data handling
// Example: Direct API call
const response = await fetch('/api/process-payment', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
amount: '100.00',
currency: 'ETB',
card_number: '4111111111111111',
expiry_month: '12',
expiry_year: '2025',
cvv: '123'
})
});
const result = await response.json();
Payment Links
Best for: Invoice payments and shared links
Generate shareable payment links that can be sent via email, SMS, or embedded in websites. Perfect for invoices, donations, and one-time payments.
✅ Advantages
- • Easy to share
- • No integration required
- • Works on any device
- • QR code support
- • Email/SMS delivery
⚠️ Considerations
- • Limited customization
- • External dependency
- • Link expiration
// Example: Generate payment link
const paymentLink = await fetch('/api/create-payment-link', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
amount: '500.00',
currency: 'ETB',
description: 'Invoice #INV-001',
customer_email: 'customer@example.com',
expiry_days: 7
})
});
const { link_url, qr_code } = await paymentLink.json();
Webhooks
Real-time payment notifications
Receive instant notifications when payment events occur. Essential for order management, inventory updates, and customer notifications.
// Example: Webhook endpoint
app.post('/webhook/yagoutpay', (req, res) => {
const { event_type, payment_id, status, amount } = req.body;
switch (event_type) {
case 'payment.success':
updateOrderStatus(payment_id, 'completed');
sendConfirmationEmail(payment_id);
break;
case 'payment.failed':
updateOrderStatus(payment_id, 'failed');
notifyCustomer(payment_id);
break;
}
res.status(200).send('OK');
});
Choosing the Right Method
Quick Start
Use Hosted Checkout for fastest implementation
Full Control
Use Direct API for complete customization
Flexible
Use Payment Links for easy sharing
Need help choosing?
Our integration specialists can help you choose the right method for your specific use case.
Contact our team