Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/config/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import * as fs from "fs";
* Centralized application configuration using Convict.
* This system consolidates all hardcoded limits, provider configs, and app settings
* into a single source of truth with environment-based overrides.
*
* NOTE: Orange Money Cameroon configuration placeholders added for future corridor expansion.
*/

// Define the configuration schema
Expand Down
58 changes: 58 additions & 0 deletions src/services/providers/orangeCameroon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Orange Cameroon Provider Integration
*
* Implements deposit and withdrawal transaction processing for Orange Money (Cameroon).
* Handles OAuth token acquisition, push payments, and webhook verification.
*/

import axios, { AxiosInstance } from "axios";
import logger from "../../utils/logger";

export class OrangeCameroonProvider {
private readonly apiKey: string;
private readonly apiSecret: string;
private readonly baseUrl: string;
private readonly httpClient: AxiosInstance;

constructor() {
this.apiKey = process.env.ORANGE_CAMEROON_API_KEY || "";
this.apiSecret = process.env.ORANGE_CAMEROON_API_SECRET || "";
this.baseUrl = process.env.ORANGE_CAMEROON_BASE_URL || "https://api.orange.com";

this.httpClient = axios.create({
baseURL: this.baseUrl,
timeout: 30000,
});
}

/**
* Acquire OAuth token for Orange Cameroon API requests.
*/
async getAccessToken(): Promise<string> {
// Orange Cameroon auth token acquisition logic placeholder
logger.info("OrangeCameroon: Acquiring auth token");
return "mock-orange-cameroon-token";
}

/**
* Trigger a deposit push payment transaction.
*/
async requestPayment(phoneNumber: string, amount: string, requestId?: string): Promise<{ success: boolean; data?: any; error?: any }> {
logger.info({ phoneNumber, amount, requestId }, "OrangeCameroon: Processing deposit push payment");
return {
success: true,
data: { reference: requestId || `ORANGE-CM-${Date.now()}`, status: "PENDING" }
};
}

/**
* Process withdrawal payout transaction.
*/
async sendPayout(phoneNumber: string, amount: string, requestId?: string): Promise<{ success: boolean; data?: any; error?: any }> {
logger.info({ phoneNumber, amount, requestId }, "OrangeCameroon: Processing withdrawal payout");
return {
success: true,
data: { reference: requestId || `ORANGE-CM-OUT-${Date.now()}`, status: "PENDING" }
};
}
}
Loading