diff --git a/lib/RetailCrm/Client/ApiVersion5.php b/lib/RetailCrm/Client/ApiVersion5.php index ea08891..bc1050b 100644 --- a/lib/RetailCrm/Client/ApiVersion5.php +++ b/lib/RetailCrm/Client/ApiVersion5.php @@ -57,4 +57,5 @@ class ApiVersion5 extends AbstractLoader use V5\Tasks; use V5\Telephony; use V5\Users; + use V5\IntegrationPayments; } diff --git a/lib/RetailCrm/Methods/V5/IntegrationPayments.php b/lib/RetailCrm/Methods/V5/IntegrationPayments.php new file mode 100644 index 0000000..32c4cec --- /dev/null +++ b/lib/RetailCrm/Methods/V5/IntegrationPayments.php @@ -0,0 +1,77 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://www.retailcrm.ru/docs/Developers/ApiVersion5 + */ + +namespace RetailCrm\Methods\V5; + +/** + * PHP version 5.4 + * + * Orders class + * + * @category RetailCrm + * @package RetailCrm + * @author RetailCrm + * @license https://opensource.org/licenses/MIT MIT License + * @link http://www.retailcrm.ru/docs/Developers/ApiVersion5 + */ +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) + ] + ); + } +}