|
|
|
|
@ -8,8 +8,19 @@ function App() {
|
|
|
|
|
const [payerAddress, setPayerAddress] = useState('');
|
|
|
|
|
const [clientId, setClientId] = useState('');
|
|
|
|
|
const [payerBankAccount, setPayerBankAccount] = useState('');
|
|
|
|
|
const [amount, setAmount] = useState('0-00');
|
|
|
|
|
|
|
|
|
|
const handleBlur = () => {
|
|
|
|
|
console.log(amount);
|
|
|
|
|
console.log(payerBankAccount);
|
|
|
|
|
console.log(payerINN);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const URLParams = new URLSearchParams(window.location.search);
|
|
|
|
|
const cnum = URLParams.get('cnum');
|
|
|
|
|
const ftype = URLParams.get('type');
|
|
|
|
|
|
|
|
|
|
const fetchUsingAsyncAwaitWithFetchApi = async () => {
|
|
|
|
|
const response = await fetch('/pmtvalidation/validate/', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
@ -20,8 +31,8 @@ function App() {
|
|
|
|
|
body: JSON.stringify({
|
|
|
|
|
fields: [
|
|
|
|
|
{ name: 'payer_account' },
|
|
|
|
|
{ name: 'client_id', value: '00234052' },
|
|
|
|
|
{ name: 'form_type', value: 'EXT-RUB' },
|
|
|
|
|
{ name: 'client_id', value: cnum },
|
|
|
|
|
{ name: 'form_type', value: ftype },
|
|
|
|
|
],
|
|
|
|
|
action: 'getClientInfo',
|
|
|
|
|
}),
|
|
|
|
|
@ -58,16 +69,30 @@ function App() {
|
|
|
|
|
<div className="child">{`${payerName} ${clientId}`}</div>
|
|
|
|
|
<div className="child">Номер счета:</div>
|
|
|
|
|
<div className="child">
|
|
|
|
|
<select>
|
|
|
|
|
<option>{payerBankAccount}</option>
|
|
|
|
|
<select
|
|
|
|
|
onChange={(e) => setPayerBankAccount(e.target.value)}
|
|
|
|
|
onBlur={handleBlur}
|
|
|
|
|
>
|
|
|
|
|
<option id="1">{payerBankAccount}</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="child">ИНН:</div>
|
|
|
|
|
<div className="child">{payerINN}</div>
|
|
|
|
|
<div className="child">
|
|
|
|
|
<input
|
|
|
|
|
value={payerINN}
|
|
|
|
|
onChange={(e) => setPayerINN(e.target.value)}
|
|
|
|
|
onBlur={handleBlur}
|
|
|
|
|
style={{ maxWidth: '16ch' }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="child">Сумма:</div>
|
|
|
|
|
<div className="child">
|
|
|
|
|
<span>
|
|
|
|
|
<input value="0-00"></input>
|
|
|
|
|
<input
|
|
|
|
|
value={amount}
|
|
|
|
|
onChange={(e) => setAmount(e.target.value)}
|
|
|
|
|
onBlur={handleBlur}
|
|
|
|
|
/>
|
|
|
|
|
RUB
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|