feat: upgrade to v2.3.1 enterprise zero-risk COD with Google Maps Platform and Steadfast fraud API

This commit is contained in:
2026-09-10 19:35:25 +00:00
parent 5d7bce0e70
commit bd178ef05f
12 changed files with 1028 additions and 227 deletions
+16 -1
View File
@@ -15,8 +15,9 @@ export class SteadfastAdapter implements CourierAdapter {
constructor(apiKey: string, secretKey: string, baseUrl: string) {
this.enabled = Boolean(apiKey && secretKey);
const resolvedBase = baseUrl || "https://portal.steadfast.com.bd/api/v1";
this.client = axios.create({
baseURL: baseUrl,
baseURL: resolvedBase,
headers: {
"Api-Key": apiKey,
"Secret-Key": secretKey,
@@ -100,4 +101,18 @@ export class SteadfastAdapter implements CourierAdapter {
raw_response: data,
};
}
/**
* 100% Real Live Steadfast Fraud Check API
* Endpoint: GET /fraud_check/{phone}
* Returns nationwide parcel history across Bangladesh: total_parcels, total_delivered, total_cancelled
*/
async fraudCheck(phone: string): Promise<any> {
if (!this.enabled) {
throw new Error("Steadfast Courier credentials are not configured.");
}
const cleanPhone = phone.replace(/\D/g, "");
const response = await this.client.get(`/fraud_check/${encodeURIComponent(cleanPhone)}`);
return response.data;
}
}