diff --git a/CHANGELOG.md b/CHANGELOG.md index f3a4155..2436bbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to `NovaPoshta` will be documented in this file +### 2024-06-13 +- [Add] Добавление метода `setAfterpaymentOnGoodsCost` в `InternetDocument` + ### 2023-03-25 - [Fix] Исправления снятия наложного платежа с заявки в `AdditionalService` diff --git a/README.md b/README.md index dd865cb..9092fee 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel NovaPoshta API 3.0 +# Laravel NovaPoshta API 2.0 [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/daaner/novaposhta/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/daaner/novaposhta/?branch=master) [![Laravel Support](https://img.shields.io/badge/Laravel-7+-brightgreen.svg)]() diff --git a/composer.json b/composer.json index b41449a..91f23bd 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "require": { "php": ">=7.2.5", "laravel/framework": ">=7.0", + "carbon/carbon": "*", "ext-json": "*" }, "autoload": { diff --git a/docs/InternetDocument.md b/docs/InternetDocument.md index f6655e1..00e16e5 100644 --- a/docs/InternetDocument.md +++ b/docs/InternetDocument.md @@ -112,8 +112,12 @@ $recipient = [ ]; $np->setRecipient($recipient); -//наложный платеж + +//наложный платеж либо Контроль оплаты для предпринимателей +//"Контроль оплаты" имеет приоритет перед наложкой!!! $np->setBackwardDeliveryData(386); +//или +$np->setAfterpaymentOnGoodsCost(386) $np->setAdditionalInformation('Добавление информации'); diff --git a/src/Traits/InternetDocumentProperty.php b/src/Traits/InternetDocumentProperty.php index 0440b34..4726f73 100644 --- a/src/Traits/InternetDocumentProperty.php +++ b/src/Traits/InternetDocumentProperty.php @@ -13,6 +13,7 @@ trait InternetDocumentProperty protected $Cost; protected $Weight; protected $BackwardDeliveryData; + protected $AfterpaymentOnGoodsCost; protected $Note; protected $AdditionalInformation; @@ -253,12 +254,27 @@ public function setBackwardDeliveryData($RedeliveryString, ?string $PayerType = return $this; } + /** + * Услуга Контроль оплаты + * + * @param string|int $AfterpaymentOnGoodsCost Контроль оплаты (Наложка на карту предпринимателя) + * @return $this + */ + public function setAfterpaymentOnGoodsCost($AfterpaymentOnGoodsCost): self + { + $this->AfterpaymentOnGoodsCost = $AfterpaymentOnGoodsCost; + + return $this; + } + /** * @return void */ public function getBackwardDeliveryData(): void { - if ($this->BackwardDeliveryData) { + if ($this->AfterpaymentOnGoodsCost) { + $this->methodProperties['AfterpaymentOnGoodsCost'] = $this->AfterpaymentOnGoodsCost; + } else if ($this->BackwardDeliveryData) { $this->methodProperties['BackwardDeliveryData'][] = $this->BackwardDeliveryData; } }