Created
July 16, 2017 19:25
-
-
Save XOlegator/5dfb60d46a4d487597d313f56cbd2697 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Подключим зависимые библиотеки (API RetailCRM) | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$site = 'https://site'; | |
$apiKey = 'key'; | |
$siteCode = 'TestCompany'; | |
$arBy = ['id', 'externalId']; | |
$arTestPaymentData = [ | |
'externalId' => '38', | |
'amount' => 19800.00, | |
'status' => 'paid', | |
'id' => '95' | |
]; | |
$clientRetailCRM = new \RetailCrm\ApiClient( | |
$site, | |
$apiKey, | |
\RetailCrm\ApiClient::V5, | |
$siteCode | |
); | |
foreach ($arBy as $by) { | |
try { | |
$response = $clientRetailCRM->request->ordersPaymentEdit($arTestPaymentData, $by, $siteCode); | |
echo '<pre>'; print_r($response); echo '</pre>'; | |
} catch (\RetailCrm\Exception\CurlException $e) { | |
echo 'RetailCRM_Api ordersPaymentEdit() ' . $e->getMessage(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Вывод скрипта: