lms/public/build/assets/paytm-Cdl_DpPj.js
2025-12-15 12:26:23 +01:00

2 lines
3.2 KiB
JavaScript

import{u as k,b as v,j as e}from"./vendor-BKmmeuxg.js";import{I as l}from"./input-error-LaPr_4wd.js";import{L as b}from"./loading-button-BnTVAMJ7.js";import{S as o}from"./switch-Db09nqXX.js";import{C as N}from"./card-D9_SJYq6.js";import{I as p}from"./input-DM0goJrn.js";import{L as n}from"./label-HmIcv5Yx.js";import{S,a as C,b as I,c as D,d as h}from"./select-CD9o3HN1.js";import{o as x}from"./inertia-SZXqLvQm.js";import"./utils-DxSsnXxD.js";import"./button-BpNwv2aE.js";import"./index-WW_1X1qx.js";import"./switch-DFFqeub-.js";const A=({payment:m})=>{const{props:u}=k(),{translate:g}=u,{settings:t,input:r,button:j,common:d}=g,{data:a,setData:c,post:y,errors:i,processing:_}=v({...m.fields,type:"paytm"}),f=s=>{s.preventDefault(),y(route("settings.payment.update",{id:m.id}))};return e.jsxs(N,{className:"p-4 sm:p-6",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold",children:t.paytm_settings}),e.jsx("p",{className:"text-gray-500",children:t.configure_payment_gateway.replace(":gateway","Paytm")})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(n,{htmlFor:"status",children:a.active?d.enabled:d.disabled}),e.jsx(o,{id:"status",checked:a.active,onCheckedChange:s=>c("active",s)})]})]}),e.jsxs("form",{onSubmit:f,className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(n,{children:r.currency}),e.jsxs(S,{value:a.currency,onValueChange:s=>c("currency",s),children:[e.jsx(C,{children:e.jsx(I,{placeholder:r.select_currency})}),e.jsxs(D,{children:[e.jsx(h,{value:"USD",children:"US Dollar (USD)"}),e.jsx(h,{value:"INR",children:"Indian Rupee (INR)"})]})]}),e.jsx(l,{message:i.currency})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:[t.test_mode,":"]}),e.jsx(o,{id:"status",checked:a.test_mode,onCheckedChange:s=>c("test_mode",s)}),e.jsx(n,{htmlFor:"status",className:"text-gray-500",children:a.test_mode?t.using_staging_environment:t.using_production_environment})]})]}),e.jsxs("div",{className:"border-b pb-6",children:[e.jsx("h3",{className:"mb-4 text-lg font-medium",children:t.api_credentials}),e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(n,{children:r.merchant_id}),e.jsx(p,{name:"public_key",value:a.public_key||"",onChange:s=>x(s,c),placeholder:r.merchant_id_placeholder}),e.jsx(l,{message:i.public_key}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a.test_mode?t.use_staging_key.replace(":key","merchant ID"):t.use_production_key.replace(":key","merchant ID")})]}),e.jsxs("div",{children:[e.jsx(n,{children:r.merchant_key}),e.jsx(p,{name:"secret_key",value:a.secret_key||"",onChange:s=>x(s,c),placeholder:r.merchant_key_placeholder,type:"password"}),e.jsx(l,{message:i.secret_key}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a.test_mode?t.use_staging_key.replace(":key","merchant key"):t.use_production_key.replace(":key","merchant key")})]})]})]}),e.jsx(b,{loading:_,type:"submit",className:"w-full",children:j.save_changes})]})]})};export{A as default};