Merge branch 'high-performance' of https://github.com/Traceworks2023/nxtgauge-admin-solid into high-performance

This commit is contained in:
Ashwin Kumar Sivakumar 2026-07-02 06:51:14 +05:30
commit 2f042bbc15

View file

@ -13,10 +13,10 @@ type PaymentGatewayConfig = {
}; };
const DEFAULT_CONFIG: PaymentGatewayConfig = { const DEFAULT_CONFIG: PaymentGatewayConfig = {
provider: 'BeepScepter', provider: 'Razorpay',
mode: 'sandbox', mode: 'sandbox',
enabled: true, enabled: true,
baseUrl: '', baseUrl: 'https://api.razorpay.com',
callbackUrl: '', callbackUrl: '',
webhookUrl: '', webhookUrl: '',
merchantId: '', merchantId: '',
@ -26,16 +26,10 @@ const DEFAULT_CONFIG: PaymentGatewayConfig = {
const READ_ENDPOINTS = [ const READ_ENDPOINTS = [
'/api/admin/payment-gateway-config', '/api/admin/payment-gateway-config',
'/api/admin/settings/payment-gateway',
'/api/admin/system-config/payment-gateway',
'/api/gateway/admin/payment-gateway-config',
]; ];
const WRITE_ENDPOINTS = [ const WRITE_ENDPOINTS = [
'/api/admin/payment-gateway-config', '/api/admin/payment-gateway-config',
'/api/admin/settings/payment-gateway',
'/api/admin/system-config/payment-gateway',
'/api/gateway/admin/payment-gateway-config',
]; ];
function authHeaders() { function authHeaders() {
@ -151,7 +145,7 @@ export default function PaymentGatewayManagementPage() {
<div class="w-full space-y-6 pb-8"> <div class="w-full space-y-6 pb-8">
<div style="margin-bottom:1.5rem"> <div style="margin-bottom:1.5rem">
<h1 class="text-[28px] font-bold leading-tight text-[#111827]">Payment Gateway Management</h1> <h1 class="text-[28px] font-bold leading-tight text-[#111827]">Payment Gateway Management</h1>
<p class="mt-1 text-[14px] text-[#6B7280]">Manage provider credentials and callback URLs for platform payments.</p> <p class="mt-1 text-[14px] text-[#6B7280]">Manage Razorpay credentials, mode, and callback URLs for platform payments.</p>
</div> </div>
<Show when={error()}> <Show when={error()}>
@ -169,7 +163,7 @@ export default function PaymentGatewayManagementPage() {
<form onSubmit={save} class="grid grid-cols-1 gap-4 sm:grid-cols-2"> <form onSubmit={save} class="grid grid-cols-1 gap-4 sm:grid-cols-2">
<div> <div>
<label class={labelCls}>Provider</label> <label class={labelCls}>Provider</label>
<input class={inputCls} value={cfg().provider} onInput={(e) => setField('provider', e.currentTarget.value)} /> <input class={inputCls} value={cfg().provider} onInput={(e) => setField('provider', e.currentTarget.value)} placeholder="Razorpay" />
</div> </div>
<div> <div>
<label class={labelCls}>Mode</label> <label class={labelCls}>Mode</label>
@ -179,19 +173,19 @@ export default function PaymentGatewayManagementPage() {
</select> </select>
</div> </div>
<div> <div>
<label class={labelCls}>Base URL</label> <label class={labelCls}>Base API URL</label>
<input class={inputCls} value={cfg().baseUrl} onInput={(e) => setField('baseUrl', e.currentTarget.value)} placeholder="https://api.provider.com" /> <input class={inputCls} value={cfg().baseUrl} onInput={(e) => setField('baseUrl', e.currentTarget.value)} placeholder="https://api.provider.com" />
</div> </div>
<div> <div>
<label class={labelCls}>Merchant ID</label> <label class={labelCls}>Merchant / Account ID</label>
<input class={inputCls} value={cfg().merchantId} onInput={(e) => setField('merchantId', e.currentTarget.value)} /> <input class={inputCls} value={cfg().merchantId} onInput={(e) => setField('merchantId', e.currentTarget.value)} placeholder="Optional internal reference" />
</div> </div>
<div> <div>
<label class={labelCls}>API Key</label> <label class={labelCls}>Razorpay Key ID</label>
<input class={inputCls} value={cfg().apiKey} onInput={(e) => setField('apiKey', e.currentTarget.value)} /> <input class={inputCls} value={cfg().apiKey} onInput={(e) => setField('apiKey', e.currentTarget.value)} placeholder="rzp_test_xxxxx" />
</div> </div>
<div> <div>
<label class={labelCls}>Secret Key</label> <label class={labelCls}>Razorpay Key Secret</label>
<div class="flex gap-2"> <div class="flex gap-2">
<input <input
type={showSecret() ? 'text' : 'password'} type={showSecret() ? 'text' : 'password'}