refactor: ( d-money ) update trade_type and business_type

This commit is contained in:
Abubeker Yasin
2026-06-25 14:46:07 +03:00
parent 5b89c5852d
commit 29fd5cec34
3 changed files with 7 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ export default registerAs("dmoney", () => ({
returnUrl: process.env.DMONEY_RETURN_URL ?? "", returnUrl: process.env.DMONEY_RETURN_URL ?? "",
timeoutExpress: process.env.DMONEY_TIMEOUT_EXPRESS ?? "120m", timeoutExpress: process.env.DMONEY_TIMEOUT_EXPRESS ?? "120m",
language: process.env.DMONEY_LANGUAGE ?? "en", language: process.env.DMONEY_LANGUAGE ?? "en",
currency: process.env.DMONEY_CURRENCY ?? "FDJ", currency: process.env.DMONEY_CURRENCY ?? "DJF",
privateKey: process.env.DMONEY_PRIVATE_KEY ?? "", privateKey: process.env.DMONEY_PRIVATE_KEY ?? "",
publicKey: process.env.DMONEY_PUBLIC_KEY ?? "", publicKey: process.env.DMONEY_PUBLIC_KEY ?? "",
insecureTls: process.env.DMONEY_INSECURE_TLS === "true", insecureTls: process.env.DMONEY_INSECURE_TLS === "true",

View File

@@ -206,18 +206,16 @@ export class DMoneyProvider implements PaymentProvider {
appid: this.merchantAppId, appid: this.merchantAppId,
merch_code: this.merchantCode, merch_code: this.merchantCode,
merch_order_id: input.merchantOrderId, merch_order_id: input.merchantOrderId,
trade_type: "Checkout" as const, trade_type: "WebCheckout" as const,
business_type: "OnlineMerchant" as const,
title: `${input.orderRef}`, title: `${input.orderRef}`,
total_amount: totalAmount, total_amount: totalAmount,
trans_currency: 1 == 1 ? "DJF": this.currency, trans_currency: this.currency,
timeout_express: this.timeoutExpress, timeout_express: this.timeoutExpress,
...(redirectUrl ? { redirect_url: redirectUrl } : {}), ...(redirectUrl ? { redirect_url: redirectUrl } : {}),
}, },
}; };
console.log("\n\n\n")
console.log(req)
console.log("\n\n\n")
const sign = signRequestObject( const sign = signRequestObject(
req as unknown as Record<string, unknown>, req as unknown as Record<string, unknown>,
this.privateKey, this.privateKey,
@@ -265,7 +263,7 @@ export class DMoneyProvider implements PaymentProvider {
`sign=${sign}`, `sign=${sign}`,
"sign_type=SHA256WithRSA", "sign_type=SHA256WithRSA",
"version=1.0", "version=1.0",
"trade_type=Checkout", "trade_type=WebCheckout",
`language=${this.language}`, `language=${this.language}`,
].join("&"); ].join("&");
return `${this.webBaseUrl}/payment/web/paygate?${query}`; return `${this.webBaseUrl}/payment/web/paygate?${query}`;

View File

@@ -10,12 +10,12 @@ export interface DMoneyPreOrderBizContent {
appid: string; appid: string;
merch_code: string; merch_code: string;
merch_order_id: string; merch_order_id: string;
trade_type: 'Checkout'; trade_type: 'WebCheckout';
business_type: 'OnlineMerchant';
title: string; title: string;
total_amount: string; total_amount: string;
trans_currency: string; trans_currency: string;
timeout_express: string; timeout_express: string;
business_type?: string;
redirect_url?: string; redirect_url?: string;
callback_info?: string; callback_info?: string;
} }