Merge pull request #69 from strelcov/api-payments
Добавлены методы для интеграционных платежей
This commit is contained in:
commit
6714723dc2
@ -57,4 +57,5 @@ class ApiVersion5 extends AbstractLoader
|
||||
use V5\Tasks;
|
||||
use V5\Telephony;
|
||||
use V5\Users;
|
||||
use V5\IntegrationPayments;
|
||||
}
|
||||
|
77
lib/RetailCrm/Methods/V5/IntegrationPayments.php
Normal file
77
lib/RetailCrm/Methods/V5/IntegrationPayments.php
Normal 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)
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user