forked from aaronpk/checks
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcan-wallet.php
More file actions
63 lines (49 loc) · 1.39 KB
/
can-wallet.php
File metadata and controls
63 lines (49 loc) · 1.39 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
<?php
date_default_timezone_set('UTC');
include("lib/can-wallet.php");
$CHK = new CheckGenerator;
$check['logo'] = "";
$check['from_name'] = "Your Name";
$check['from_address1'] = "234 Bay Street";
$check['from_address2'] = "Toronto, ON M5K 1B2";
$check['transit_number'] = "12345";
// include dashes in your account number
// BMO - 123456-123
// BNS - 12345-12
// RBC - 123-123-1
// TD - 1234-1234567
// NBC - 12-123-12
// CIBC - 12-12345
// DESJ - 123-123-1
// CU - 12345678-123
$check['account_number'] = "123-456-789";
$check['inst_number'] = "001";
$check['bank_1'] = "Bank of Canada";
$check['bank_2'] = "234 Wellington Street";
$check['bank_3'] = "Ottawa, ON K1A 0G9";
$check['bank_4'] = "";
$check['signature'] = "";
$check['pay_to'] = "YOUR MOM";
$check['amount'] = '12345.56';
$check['date'] = "2020-01-01";
$check['memo'] = "TEST";
// 3 checks per page
$check['check_number'] = 1000;
$CHK->AddCheck($check);
$check['check_number']++;
$CHK->AddCheck($check);
$check['check_number']++;
$CHK->AddCheck($check);
if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
// Called from a browser
header('Content-Type: application/octet-stream', false);
header('Content-Type: application/pdf', false);
$CHK->PrintChecks();
} else {
// Called from the command line
ob_start();
$CHK->PrintChecks();
$pdf = ob_get_clean();
file_put_contents('checks.pdf', $pdf);
echo "Saved to file: checks.pdf\n";
}