2019-07-10 16:25:50 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PHP version 5.4
|
|
|
|
*
|
|
|
|
* Orders
|
|
|
|
*
|
|
|
|
* @category RetailCrm
|
|
|
|
* @package RetailCrm
|
|
|
|
* @author RetailCrm <integration@retailcrm.ru>
|
|
|
|
* @license https://opensource.org/licenses/MIT MIT License
|
2019-08-30 14:10:52 +03:00
|
|
|
* @link https://help.retailcrm.ru/Developers/ApiVersion5
|
2019-07-10 16:25:50 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace RetailCrm\Methods\V5;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PHP version 5.4
|
|
|
|
*
|
|
|
|
* Orders class
|
|
|
|
*
|
|
|
|
* @category RetailCrm
|
|
|
|
* @package RetailCrm
|
|
|
|
* @author RetailCrm <integration@retailcrm.ru>
|
|
|
|
* @license https://opensource.org/licenses/MIT MIT License
|
2019-08-30 14:10:52 +03:00
|
|
|
* @link https://help.retailcrm.ru/Developers/ApiVersion5
|
2019-07-10 16:25:50 +03:00
|
|
|
*/
|
|
|
|
trait IntegrationPayments
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Update Invoice
|
|
|
|
*
|
|
|
|
* @param array $updateInvoice
|
|
|
|
* @return \RetailCrm\Response\ApiResponse
|
|
|
|
*/
|
|
|
|
public function paymentUpdateInvoice($updateInvoice)
|
|
|
|
{
|
|
|
|
if (!count($updateInvoice)) {
|
|
|
|
throw new \InvalidArgumentException(
|
|
|
|
'Parameters `updateInvoice` must contains a data'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* @noinspection PhpUndefinedMethodInspection */
|
|
|
|
return $this->client->makeRequest(
|
|
|
|
'/payment/update-invoice',
|
|
|
|
'POST',
|
|
|
|
[
|
|
|
|
'updateInvoice' => json_encode($updateInvoice)
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check Invoice
|
|
|
|
*
|
|
|
|
* @param array $check
|
|
|
|
* @return \RetailCrm\Response\ApiResponse
|
|
|
|
*/
|
|
|
|
public function paymentCheckInvoice($check)
|
|
|
|
{
|
|
|
|
if (!count($check)) {
|
|
|
|
throw new \InvalidArgumentException(
|
|
|
|
'Parameters `check` must contains a data'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* @noinspection PhpUndefinedMethodInspection */
|
|
|
|
return $this->client->makeRequest(
|
|
|
|
'/payment/check',
|
|
|
|
'POST',
|
|
|
|
[
|
|
|
|
'check' => json_encode($check)
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|