Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InvoiceCaptureTest.php
Go to the documentation of this file.
1 <?php
8 
10 
15 {
16  const SERVICE_VERSION = 'V1';
17 
18  const SERVICE_NAME = 'salesInvoiceManagementV1';
19 
24  public function testInvoiceCapture()
25  {
28  $invoice = $objectManager->get(\Magento\Sales\Model\Order\Invoice::class)->loadByIncrementId('100000001');
29  $serviceInfo = [
30  'rest' => [
31  'resourcePath' => '/V1/invoices/' . $invoice->getId() . '/capture',
33  ],
34  'soap' => [
35  'service' => self::SERVICE_NAME,
36  'serviceVersion' => self::SERVICE_VERSION,
37  'operation' => self::SERVICE_NAME . 'setCapture',
38  ],
39  ];
40  $requestData = ['id' => $invoice->getId()];
41  $this->_webApiCall($serviceInfo, $requestData);
42  }
43 }
$objectManager
Definition: bootstrap.php:17
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
$invoice