You are here

public function CartCouponsResource::get in Commerce Cart API 8

File

src/Plugin/rest/resource/CartCouponsResource.php, line 96

Class

CartCouponsResource
Provides a cart collection resource for current session.

Namespace

Drupal\commerce_cart_api\Plugin\rest\resource

Code

public function get(OrderInterface $commerce_order) {
  $response = new ResourceResponse($commerce_order
    ->get('coupons'));
  $response
    ->addCacheableDependency($commerce_order);
  return $response;
}