-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathexample.php
40 lines (36 loc) · 1.25 KB
/
example.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
36
37
38
39
40
<?php
require_once("SEPASDD.php");
$config = array("name" => "Test",
"IBAN" => "NL41BANK1234567890",
//"BIC" => "BANKNL2A", <- Optional, banks may disallow BIC in future
"batch" => True,
"creditor_id" => "00000",
"currency" => "EUR",
//"validate" => False, <- Optional, will disable internal validation of BIC and IBAN.
"version" => "3"
);
$payment = array("name" => "Test von Testenstein",
"IBAN" => "NL40BANK1234567890",
//"BIC" => "BANKNL2A", <- Optional, banks may disallow BIC in future
"amount" => "1000",
"type" => "FRST",
"collection_date" => date("Y-m-d"),
"mandate_id" => "1234",
"mandate_date" => date("2014-02-01"),
"description" => "Test transaction"
);
try{
$SEPASDD = new SEPASDD($config);
$SEPASDD->addPayment($payment);
$xml = $SEPASDD->save();
if($SEPASDD->validate($xml)){
print_r($xml);
}else{
print_r($SEPASDD->validate($xml));
}
print_r($SEPASDD->getDirectDebitInfo());
}catch(Exception $e){
echo $e->getMessage();
exit;
}
?>