dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
payment_claim_policy_test.php
Go to the documentation of this file.
1<?php
2
3require_once dirname(__DIR__) . '/include/dbxShopRepository.class.php';
4
5$repo = new \dbx\dbxShop\dbxShopRepository();
6$method = new ReflectionMethod($repo, 'isStalePaymentProcessing');
7$method->setAccessible(true);
8$now = strtotime('2026-07-24 12:00:00');
9
10$fail = static function (string $message, int $code): void {
11 fwrite(STDERR, "FAIL: $message\n");
12 exit($code);
13};
14
15if ($method->invoke($repo, array(
16 'payment_status' => 'created',
17 'update_date' => '2026-07-24 11:00:00',
18), 300, $now)) {
19 $fail('Ein nicht laufender Status wurde als verwaister Claim bewertet.', 1);
20}
21
22if ($method->invoke($repo, array(
23 'payment_status' => 'processing',
24 'update_date' => '2026-07-24 11:59:01',
25), 300, $now)) {
26 $fail('Ein frischer processing-Claim wurde zu frueh freigegeben.', 2);
27}
28
29if (!$method->invoke($repo, array(
30 'payment_status' => 'processing',
31 'update_date' => '2026-07-24 11:55:00',
32), 300, $now)) {
33 $fail('Ein abgelaufener processing-Claim wurde nicht freigegeben.', 3);
34}
35
36if (!$method->invoke($repo, array(
37 'payment_status' => 'PROCESSING',
38 'update_date' => '2026-07-24 11:59:00',
39), 1, $now)) {
40 $fail('Die Mindest-Leasezeit von 60 Sekunden ist nicht wirksam.', 4);
41}
42
43if ($method->invoke($repo, array(
44 'payment_status' => 'processing',
45 'update_date' => '',
46), 300, $now)) {
47 $fail('Ein Claim ohne belastbaren Zeitstempel wurde freigegeben.', 5);
48}
49
50echo "OK shop payment claim policy\n";
exit
Definition index.php:146