Payment delete & custom dictionary creation fix (#46)
This commit is contained in:
parent
4f57734e92
commit
9aab02c189
@ -196,7 +196,7 @@ trait CustomFields
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->client->makeRequest(
|
return $this->client->makeRequest(
|
||||||
"/custom-fields/dictionaries/{$customDictionary['code']}/create",
|
"/custom-fields/dictionaries/create",
|
||||||
"POST",
|
"POST",
|
||||||
['customDictionary' => json_encode($customDictionary)]
|
['customDictionary' => json_encode($customDictionary)]
|
||||||
);
|
);
|
||||||
|
@ -127,4 +127,25 @@ trait Orders
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit an order payment
|
||||||
|
*
|
||||||
|
* @param string $id payment id
|
||||||
|
*
|
||||||
|
* @return \RetailCrm\Response\ApiResponse
|
||||||
|
*/
|
||||||
|
public function ordersPaymentDelete($id)
|
||||||
|
{
|
||||||
|
if (!$id) {
|
||||||
|
throw new \InvalidArgumentException(
|
||||||
|
'Parameter `id` must be set'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->client->makeRequest(
|
||||||
|
sprintf('/orders/payments/%s/delete', $id),
|
||||||
|
"POST"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,10 +403,8 @@ class ApiClientOrdersTest extends TestCase
|
|||||||
|
|
||||||
$paymentEdit = [
|
$paymentEdit = [
|
||||||
'id' => $response['id'],
|
'id' => $response['id'],
|
||||||
'externalId' => $externalId,
|
|
||||||
'amount' => 1500,
|
'amount' => 1500,
|
||||||
'comment' => 'test payment!',
|
'comment' => 'test payment!',
|
||||||
'type' => 'cash',
|
|
||||||
'status' => 'paid'
|
'status' => 'paid'
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -414,7 +412,14 @@ class ApiClientOrdersTest extends TestCase
|
|||||||
|
|
||||||
static::assertTrue(
|
static::assertTrue(
|
||||||
$responseAgain->isSuccessful(),
|
$responseAgain->isSuccessful(),
|
||||||
'Got payment'
|
'Edit payment'
|
||||||
|
);
|
||||||
|
|
||||||
|
$responseLast = $client->request->ordersPaymentDelete($response['id']);
|
||||||
|
|
||||||
|
static::assertTrue(
|
||||||
|
$responseLast->isSuccessful(),
|
||||||
|
'Delete payment'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user