feat: ( payment ) implement d-money

This commit is contained in:
Abubeker Yasin
2026-07-13 09:51:17 +03:00
parent 6ff04a35dc
commit 594dd76ab7
3 changed files with 6 additions and 2 deletions

View File

@@ -203,6 +203,7 @@ export default function PaymentMethodsPage() {
{ value: 'CBE_BIRR', label: 'CBE Birr' },
{ value: 'EBIRR', label: 'eBirr' },
{ value: 'WAAFI', label: 'Waafi' },
{ value: 'DMONEY', label: 'dMoney' },
{ value: 'CARD', label: 'Card Payment' },
{ value: 'WALLET', label: 'Internal Wallet' },
];

View File

@@ -124,7 +124,7 @@ export default function PaymentPage() {
onSuccess: async (data: any) => {
setPaymentError(null);
if ((selectedMethod === 'TELEBIRR' || selectedMethod === 'WAAFI') && data?.clientAction?.type === 'REDIRECT') {
if ((selectedMethod === 'TELEBIRR' || selectedMethod === 'WAAFI' || selectedMethod === 'DMONEY') && data?.clientAction?.type === 'REDIRECT') {
setPaymentIntent(data.intentId);
updateStatus("REQUIRES_ACTION");
window.location.href = data.clientAction.url;

View File

@@ -23,7 +23,10 @@ import { useSearchParams } from "next/navigation";
*/
const ALLOWED_HOSTS = (
process.env.NEXT_PUBLIC_DMONEY_ALLOWED_HOSTS ?? "d-money.dj"
// Default allows both D-Money environments:
// test/sandbox → pgtest.d-money.dj (base domain d-money.dj)
// production → pg.d-moneyservice.dj (base domain d-moneyservice.dj)
process.env.NEXT_PUBLIC_DMONEY_ALLOWED_HOSTS ?? "d-money.dj,d-moneyservice.dj"
)
.split(",")
.map((h) => h.trim().toLowerCase())