mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 03:05:42 +00:00
feat: ( payment ) implement d-money
This commit is contained in:
@@ -203,6 +203,7 @@ export default function PaymentMethodsPage() {
|
|||||||
{ value: 'CBE_BIRR', label: 'CBE Birr' },
|
{ value: 'CBE_BIRR', label: 'CBE Birr' },
|
||||||
{ value: 'EBIRR', label: 'eBirr' },
|
{ value: 'EBIRR', label: 'eBirr' },
|
||||||
{ value: 'WAAFI', label: 'Waafi' },
|
{ value: 'WAAFI', label: 'Waafi' },
|
||||||
|
{ value: 'DMONEY', label: 'dMoney' },
|
||||||
{ value: 'CARD', label: 'Card Payment' },
|
{ value: 'CARD', label: 'Card Payment' },
|
||||||
{ value: 'WALLET', label: 'Internal Wallet' },
|
{ value: 'WALLET', label: 'Internal Wallet' },
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ export default function PaymentPage() {
|
|||||||
onSuccess: async (data: any) => {
|
onSuccess: async (data: any) => {
|
||||||
setPaymentError(null);
|
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);
|
setPaymentIntent(data.intentId);
|
||||||
updateStatus("REQUIRES_ACTION");
|
updateStatus("REQUIRES_ACTION");
|
||||||
window.location.href = data.clientAction.url;
|
window.location.href = data.clientAction.url;
|
||||||
|
|||||||
@@ -23,7 +23,10 @@ import { useSearchParams } from "next/navigation";
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const ALLOWED_HOSTS = (
|
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(",")
|
.split(",")
|
||||||
.map((h) => h.trim().toLowerCase())
|
.map((h) => h.trim().toLowerCase())
|
||||||
|
|||||||
Reference in New Issue
Block a user