add admin fee midtrans

dev
Aji Kamaludin 1 year ago
parent 7b37eefa23
commit 354d3d4abb
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -68,6 +68,7 @@ class SettingController extends Controller
'MIDTRANS_SERVER_KEY' => 'required|string', 'MIDTRANS_SERVER_KEY' => 'required|string',
'MIDTRANS_CLIENT_KEY' => 'required|string', 'MIDTRANS_CLIENT_KEY' => 'required|string',
'MIDTRANS_MERCHANT_ID' => 'required|string', 'MIDTRANS_MERCHANT_ID' => 'required|string',
'MIDTRANS_ADMIN_FEE' => 'required|numeric',
'MIDTRANS_ENABLED' => 'required|in:0,1', 'MIDTRANS_ENABLED' => 'required|in:0,1',
'midtrans_logo_file' => 'nullable|image', 'midtrans_logo_file' => 'nullable|image',
]); ]);

@ -8,6 +8,7 @@ import TextArea from '@/Components/TextArea'
import FormFile from '@/Components/FormFile' import FormFile from '@/Components/FormFile'
import Checkbox from '@/Components/Checkbox' import Checkbox from '@/Components/Checkbox'
import { extractValue } from './utils' import { extractValue } from './utils'
import FormInputNumeric from '@/Components/FormInputNumeric'
export default function General(props) { export default function General(props) {
const { setting, midtrans_notification_url } = props const { setting, midtrans_notification_url } = props
@ -15,6 +16,7 @@ export default function General(props) {
MIDTRANS_SERVER_KEY: extractValue(setting, 'MIDTRANS_SERVER_KEY'), MIDTRANS_SERVER_KEY: extractValue(setting, 'MIDTRANS_SERVER_KEY'),
MIDTRANS_CLIENT_KEY: extractValue(setting, 'MIDTRANS_CLIENT_KEY'), MIDTRANS_CLIENT_KEY: extractValue(setting, 'MIDTRANS_CLIENT_KEY'),
MIDTRANS_MERCHANT_ID: extractValue(setting, 'MIDTRANS_MERCHANT_ID'), MIDTRANS_MERCHANT_ID: extractValue(setting, 'MIDTRANS_MERCHANT_ID'),
MIDTRANS_ADMIN_FEE: extractValue(setting, 'MIDTRANS_ADMIN_FEE'),
MIDTRANS_LOGO_URL: extractValue(setting, 'MIDTRANS_LOGO'), MIDTRANS_LOGO_URL: extractValue(setting, 'MIDTRANS_LOGO'),
MIDTRANS_ENABLED: extractValue(setting, 'MIDTRANS_ENABLED'), MIDTRANS_ENABLED: extractValue(setting, 'MIDTRANS_ENABLED'),
midtrans_logo_file: null, midtrans_logo_file: null,
@ -32,11 +34,7 @@ export default function General(props) {
} }
const handleSubmit = () => { const handleSubmit = () => {
post(route('setting.payment'), { post(route('setting.payment'))
onSuccess: () => {
setTimeout(() => router.get(route(route().current())), 3000)
},
})
} }
return ( return (
@ -75,6 +73,13 @@ export default function General(props) {
label="Client Key" label="Client Key"
error={errors.MIDTRANS_CLIENT_KEY} error={errors.MIDTRANS_CLIENT_KEY}
/> />
<FormInputNumeric
name="MIDTRANS_ADMIN_FEE"
value={data.MIDTRANS_ADMIN_FEE}
onChange={handleOnChange}
label="ADMIN FEE"
error={errors.MIDTRANS_ADMIN_FEE}
/>
<FormFile <FormFile
label={'Logo'} label={'Logo'}
onChange={(e) => onChange={(e) =>

Loading…
Cancel
Save