forked from larabook/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
saman-redirector.blade.php
37 lines (29 loc) · 1.15 KB
/
saman-redirector.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<html>
<body>
<script>
var form = document.createElement("form");
form.setAttribute("method", "POST");
form.setAttribute("action", "https://sep.shaparak.ir/Payment.aspx");
form.setAttribute("target", "_self");
var params = {
Amount: '{{$amount}}',
MID: '{{$merchant}}',
ResNum: '{{$resNum}}',
RedirectURL: '{{$callBackUrl}}',
ResNum1: '{{ isset( $resNum1 ) ? $resNum1 : "" }}',
ResNum2: '{{ isset( $resNum2 ) ? $resNum2 : "" }}',
ResNum3: '{{ isset( $resNum3 ) ? $resNum3 : "" }}',
ResNum4: '{{ isset( $resNum4 ) ? $resNum4 : "" }}',
};
for(var key in params){
var hiddenField = document.createElement("input");
hiddenField.setAttribute("name", key);
hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField);
}
document.body.appendChild(form);
form.submit();
document.body.removeChild(form);
</script>
</body>
</html>