pawapay-nodejs-sdk
Version:
Unofficial Node.js SDK for the PawaPay Merchant API. Simplify Mobile Money integrations (Deposits, Payouts, Refunds) with this type-safe TypeScript client.
17 lines (16 loc) • 598 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBaseUrl = getBaseUrl;
function getBaseUrl(baseUrlInput) {
if (baseUrlInput === 'sandbox') {
return 'https://api.sandbox.pawapay.io';
}
if (baseUrlInput === 'production') {
return 'https://api.pawapay.io';
}
// Basic check if it looks like a URL
if (baseUrlInput.startsWith('http')) {
return baseUrlInput.replace(/\/$/, ''); // Remove trailing slash if present
}
throw new Error('Invalid baseUrl provided. Use "sandbox", "production", or a full URL.');
}