1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\ShoppingContent\Resource;
19
20use Google\Service\ShoppingContent\OrderinvoicesCreateChargeInvoiceRequest;
21use Google\Service\ShoppingContent\OrderinvoicesCreateChargeInvoiceResponse;
22use Google\Service\ShoppingContent\OrderinvoicesCreateRefundInvoiceRequest;
23use Google\Service\ShoppingContent\OrderinvoicesCreateRefundInvoiceResponse;
24
25/**
26 * The "orderinvoices" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $contentService = new Google\Service\ShoppingContent(...);
30 *   $orderinvoices = $contentService->orderinvoices;
31 *  </code>
32 */
33class Orderinvoices extends \Google\Service\Resource
34{
35  /**
36   * Creates a charge invoice for a shipment group, and triggers a charge capture
37   * for orderinvoice enabled orders. (orderinvoices.createchargeinvoice)
38   *
39   * @param string $merchantId The ID of the account that manages the order. This
40   * cannot be a multi-client account.
41   * @param string $orderId The ID of the order.
42   * @param OrderinvoicesCreateChargeInvoiceRequest $postBody
43   * @param array $optParams Optional parameters.
44   * @return OrderinvoicesCreateChargeInvoiceResponse
45   */
46  public function createchargeinvoice($merchantId, $orderId, OrderinvoicesCreateChargeInvoiceRequest $postBody, $optParams = [])
47  {
48    $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
49    $params = array_merge($params, $optParams);
50    return $this->call('createchargeinvoice', [$params], OrderinvoicesCreateChargeInvoiceResponse::class);
51  }
52  /**
53   * Creates a refund invoice for one or more shipment groups, and triggers a
54   * refund for orderinvoice enabled orders. This can only be used for line items
55   * that have previously been charged using `createChargeInvoice`. All amounts
56   * (except for the summary) are incremental with respect to the previous
57   * invoice. (orderinvoices.createrefundinvoice)
58   *
59   * @param string $merchantId The ID of the account that manages the order. This
60   * cannot be a multi-client account.
61   * @param string $orderId The ID of the order.
62   * @param OrderinvoicesCreateRefundInvoiceRequest $postBody
63   * @param array $optParams Optional parameters.
64   * @return OrderinvoicesCreateRefundInvoiceResponse
65   */
66  public function createrefundinvoice($merchantId, $orderId, OrderinvoicesCreateRefundInvoiceRequest $postBody, $optParams = [])
67  {
68    $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
69    $params = array_merge($params, $optParams);
70    return $this->call('createrefundinvoice', [$params], OrderinvoicesCreateRefundInvoiceResponse::class);
71  }
72}
73
74// Adding a class alias for backwards compatibility with the previous class name.
75class_alias(Orderinvoices::class, 'Google_Service_ShoppingContent_Resource_Orderinvoices');
76