-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathOrderController.php
More file actions
62 lines (51 loc) · 1.82 KB
/
OrderController.php
File metadata and controls
62 lines (51 loc) · 1.82 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
<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* https://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Plugin\SamplePayment\Controller\Admin;
use Eccube\Controller\AbstractController;
use Eccube\Entity\Order;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
class OrderController extends AbstractController
{
/**
* 受注編集 > 決済のキャンセル処理
*
* @Method("POST")
* @Route("/%eccube_admin_route%/sample_payment/order/cancel/{id}", requirements={"id" = "\d+"}, name="sample_payment_admin_order_cancel")
*/
public function cancel(Request $request, Order $Order)
{
if ($request->isXmlHttpRequest() && $this->isTokenValid()) {
// 通信処理
$this->addSuccess('sample_payment.admin.order.cancel.success', 'admin');
return $this->json([]);
}
throw new BadRequestHttpException();
}
/**
* 受注編集 > 決済の金額変更
*
* @Method("POST")
* @Route("/%eccube_admin_route%/sample_payment/order/change_price/{id}", requirements={"id" = "\d+"}, name="sample_payment_admin_order_change_price")
*/
public function changePrice(Request $request, Order $Order)
{
if ($request->isXmlHttpRequest() && $this->isTokenValid()) {
// 通信処理
$this->addSuccess('sample_payment.admin.order.change_price.success', 'admin');
return $this->json([]);
}
throw new BadRequestHttpException();
}
}