1
0
mirror of synced 2024-11-24 14:26:06 +03:00

Merge pull request #69 from strelcov/api-payments

Добавлены методы для интеграционных платежей
This commit is contained in:
Alex Lushpai 2019-07-11 14:36:21 +03:00 committed by GitHub
commit 6714723dc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 78 additions and 0 deletions

View File

@ -57,4 +57,5 @@ class ApiVersion5 extends AbstractLoader
use V5\Tasks;
use V5\Telephony;
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)
]
);
}
}