-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample.php
More file actions
90 lines (82 loc) · 3.77 KB
/
example.php
File metadata and controls
90 lines (82 loc) · 3.77 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
require_once dirname(__FILE__) . '/../init.php';
try {
$companyCode = 'J0098765430001220000002598';
$encrytionKey = '12ASDFG456KWE078';
$orderNumber = substr(time(), -8);
$amount = '1,55';
$draweeName = 'Fabiano Couto';
$draweeDocTypeCode = '01';
$draweeDocNumber = '61022645099';
$draweeAddress = 'Av Presidente Vargas';
$draweeAddressDistrict = 'Centro';
$draweeAddressCity = 'Rio de Janeiro';
$draweeAddressState = 'RJ';
$draweeAddressZipCode = '20070006';
$bankSlipDueDate = date('dmY', strtotime('+7 day'));
$bankSlipNoteLine1 = 'Sr. Caixa,';
$bankSlipNoteLine2 = 'Não receber após o vencimento.';
$bankSlipNoteLine3 = 'Obrigado.';
$bankSlipNote = 3;
$itaucripto = new \Itaucripto\Itaucripto();
$itaucripto->setCompanyCode($companyCode);
$itaucripto->setEncryptionKey($encrytionKey);
$itaucripto->setOrderNumber($orderNumber);
$itaucripto->setAmount($amount);
$itaucripto->setDraweeName($draweeName);
$itaucripto->setDraweeDocTypeCode($draweeDocTypeCode);
$itaucripto->setDraweeDocNumber($draweeDocNumber);
$itaucripto->setDraweeAddress($draweeAddress);
$itaucripto->setDraweeAddressDistrict($draweeAddressDistrict);
$itaucripto->setDraweeAddressCity($draweeAddressCity);
$itaucripto->setDraweeAddressState($draweeAddressState);
$itaucripto->setDraweeAddressZipCode($draweeAddressZipCode);
$itaucripto->setBankSlipDueDate($bankSlipDueDate);
$itaucripto->setBankSlipNoteLine1($bankSlipNoteLine1);
$itaucripto->setBankSlipNoteLine2($bankSlipNoteLine2);
$itaucripto->setBankSlipNoteLine3($bankSlipNoteLine3);
$itaucripto->setNote($bankSlipNote);
// $itaucripto->setCallbackUrl('http://www.domain.com/callback');
$dataGenerate = $itaucripto->generateData();
$dataQuery = $itaucripto->generateQuery(0);
} catch (Exception $e) {
die(var_dump($e));
}
?>
<!DOCTYPE html>
<html>
<head>
<title>SHOPLINE</title>
<link href="style.css" media="screen" rel="stylesheet" type="text/css" />
<style type="text/css">
body {font-family: Futura, 'Trebuchet MS', Arial, sans-serif; background-color: #fe6100; font-size: 13px;}
div {background-color: #fff; margin: 25px; border-radius: 5px; padding: 25px; display: block; width: auto;}
input[type=submit] {background-color: #011f7c; color: #faf73d; border-radius: 5px; padding: 8px; margin-bottom: 5px; width: 100px;}
form {display: inline; padding: 0; margin: 0;}
</style>
</head>
<body>
<div>
<h1>Itaú Shopline</h1>
<p>
Order: <?php print $orderNumber; ?> <br>
Amount: R$ <?php print $amount; ?> <br>
Name: <?php print $draweeName; ?> <br>
Address: <?php print $draweeAddress.', '.$draweeAddressDistrict.', '.$draweeAddressCity.', '.$draweeAddressState.', '.$draweeAddressZipCode; ?> <br>
</p>
<form action="https://shopline.itau.com.br/shopline/shopline.aspx" method="post" name="form" onsubmit="itauShoplinePopup()" target="SHOPLINE">
<input type="hidden" name="DC" value="<?php print $dataGenerate; ?>" />
<input type="submit" name="Shopline" value="Generate" />
</form>
<form action="https://shopline.itau.com.br/shopline/consulta.aspx" method="post" name="form" onsubmit="itauShoplinePopup()" target="SHOPLINE">
<input type="hidden" name="DC" value="<?php print $dataQuery; ?>" />
<input type="submit" name="Shopline" value="Query" />
</form>
</div>
<script language='JavaScript'>
function itauShoplinePopup(){
window.open('','SHOPLINE','toolbar=yes,menubar=yes,resizable=yes,status=no,scrollbars=yes,width=815,height=575');
}
</script>
</body>
</html>