1
0
mirror of synced 2024-11-21 21:06:07 +03:00

Add methods for intagration payments

This commit is contained in:
Alexandr Streltsov 2019-07-10 16:25:50 +03:00
parent 275721aea7
commit 934d3ba751
2 changed files with 78 additions and 0 deletions

View File

@ -57,4 +57,5 @@ class ApiVersion5 extends AbstractLoader
use V5\Tasks; use V5\Tasks;
use V5\Telephony; use V5\Telephony;
use V5\Users; use V5\Users;
use V5\IntegrationPayments;
} }

View File

@ -0,0 +1,77 @@
<?php
/**
* PHP version 5.4
*
* Orders
*
* @category RetailCrm
* @package RetailCrm
* @author RetailCrm <integration@retailcrm.ru>
* @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 <integration@retailcrm.ru>
* @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)
]
);
}
}