Skip to content

Commit

Permalink
Add PaymentControl
Browse files Browse the repository at this point in the history
  • Loading branch information
daaner committed Jun 12, 2024
1 parent 7bb3e79 commit c55b270
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)]()
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"require": {
"php": ">=7.2.5",
"laravel/framework": ">=7.0",
"carbon/carbon": "*",
"ext-json": "*"
},
"autoload": {
Expand Down
6 changes: 5 additions & 1 deletion docs/InternetDocument.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ $recipient = [
];

$np->setRecipient($recipient);
//наложный платеж

//наложный платеж либо Контроль оплаты для предпринимателей
//"Контроль оплаты" имеет приоритет перед наложкой!!!
$np->setBackwardDeliveryData(386);
//или
$np->setAfterpaymentOnGoodsCost(386)

$np->setAdditionalInformation('Добавление информации');

Expand Down
18 changes: 17 additions & 1 deletion src/Traits/InternetDocumentProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ trait InternetDocumentProperty
protected $Cost;
protected $Weight;
protected $BackwardDeliveryData;
protected $AfterpaymentOnGoodsCost;
protected $Note;
protected $AdditionalInformation;

Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit c55b270

Please sign in to comment.