Ejemplo n.º 1
0
 public function testFindAllPayment()
 {
     $PaymentName = "forFindPayment";
     $PaymentName2 = "forFindPayment2";
     $payment = getPaymentInstance($PaymentName);
     $Payment2 = getPaymentInstance($PaymentName2);
     $Payments = array();
     array_push($Payments, $payment, $Payment2);
     $bmapper = new PaymentMapper(self::$pdo);
     $bmapper->insert($Payments);
     $newPayments = $bmapper->findAll()->fetchAll();
     $this->assertEquals(2, count($newPayments));
 }
 public function hookActionPaymentCCAdd($params)
 {
     $PaymentMapper = new PaymentMapper();
     $PaymentMapper->processLocalUpdate($params, true, false);
 }
Ejemplo n.º 3
0
 public function testfindLOCAByUserID()
 {
     $pmapper = new PaymentMapper(self::$pdo);
     $dmapper = new DepositMapper(self::$pdo);
     $dbfacade = DBFacade::I(self::$pdo);
     $payment = getPaymentInstance();
     $deposit = getDepositInstance();
     $pmapper->insert($payment);
     $dmapper->insert($deposit);
     $result = $dbfacade->findLOCALogByUserID(1);
     // instanceは二つともuser_id=1になっているため
     $this->assertEquals(2, count($result));
 }
Ejemplo n.º 4
0
// Inventory POST
$app->post('/inventory/query', function ($request, $response, $args) {
    $data = $request->getParsedBody();
    $this->logger->info("Inventory POST query");
    $date = filter_var($data['myInput'], FILTER_SANITIZE_STRING);
    $mapper = new InventoryQueryMapper($this->db);
    $inventory = $mapper->processQuery($date);
    return $this->renderer->render($response, 'queries/query_inventory.phtml', [$args, "inventory" => $inventory]);
});
// Invoices
$app->get('/invoices/query', function ($request, $response, $args) {
    $this->logger->info("invoice GET Query Page");
    return $this->renderer->render($response, 'queries/query_invoices.phtml');
});
// Invoices POST
$app->post('/invoices/query', function ($request, $response, $args) {
    $data = $request->getParsedBody();
    $this->logger->info("invoices POST query");
    $name = filter_var($data['customerName'], FILTER_SANITIZE_STRING);
    $orderId = (int) filter_var($data['orderId'], FILTER_SANITIZE_STRING);
    $mapper = new InvoicesQueryMapper($this->db);
    $invoices = $mapper->processQuery($name, $orderId);
    return $this->renderer->render($response, 'queries/query_invoices.phtml', [$args, "invoices" => $invoices]);
});
// Payment
$app->get('/payments/query', function ($request, $response, $args) {
    $this->logger->info("Payments GET Query Page");
    $mapper = new PaymentMapper($this->db);
    $payments = $mapper->processQuery();
    return $this->renderer->render($response, 'queries/query_payments.phtml', [$args, "payments" => $payments]);
});