Merge pull request #48 from vstaheev/paymentCreate
add site attribute in ordersPaymentCreate method
This commit is contained in:
commit
aa79e774f1
@ -71,6 +71,7 @@ trait Orders
|
|||||||
* Create an order payment
|
* Create an order payment
|
||||||
*
|
*
|
||||||
* @param array $payment order data
|
* @param array $payment order data
|
||||||
|
* @param null $site site code
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
* @throws \RetailCrm\Exception\CurlException
|
* @throws \RetailCrm\Exception\CurlException
|
||||||
@ -78,7 +79,7 @@ trait Orders
|
|||||||
*
|
*
|
||||||
* @return \RetailCrm\Response\ApiResponse
|
* @return \RetailCrm\Response\ApiResponse
|
||||||
*/
|
*/
|
||||||
public function ordersPaymentCreate(array $payment)
|
public function ordersPaymentCreate(array $payment, $site = null)
|
||||||
{
|
{
|
||||||
if (!count($payment)) {
|
if (!count($payment)) {
|
||||||
throw new \InvalidArgumentException(
|
throw new \InvalidArgumentException(
|
||||||
@ -89,7 +90,10 @@ trait Orders
|
|||||||
return $this->client->makeRequest(
|
return $this->client->makeRequest(
|
||||||
'/orders/payments/create',
|
'/orders/payments/create',
|
||||||
"POST",
|
"POST",
|
||||||
['payment' => json_encode($payment)]
|
$this->fillSite(
|
||||||
|
$site,
|
||||||
|
['payment' => json_encode($payment)]
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user