Skip to content

Commit

Permalink
Add withholdingTax property and accessors to SubMerchantPaymentItemRe…
Browse files Browse the repository at this point in the history
…source, PaymentItemMapper, and SubMerchantPaymentItemUpdateRequest
  • Loading branch information
tarikkamat committed Dec 26, 2024
1 parent 143a5b0 commit 151bc2a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Iyzipay/Model/BasketItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public function getJsonObject()
->add("itemType", $this->getItemType())
->add("subMerchantKey", $this->getSubMerchantKey())
->addPrice("subMerchantPrice", $this->getSubMerchantPrice())
->add("withholdingTax", $this->getWithholdingTax())
->getObject();
}

Expand All @@ -133,6 +134,7 @@ public function toPKIRequestString()
->append("itemType", $this->getItemType())
->append("subMerchantKey", $this->getSubMerchantKey())
->appendPrice("subMerchantPrice", $this->getSubMerchantPrice())
->append("withholdingTax", $this->getWithholdingTax())
->getRequestString();
}
}
3 changes: 3 additions & 0 deletions src/Iyzipay/Model/Mapper/PaymentItemMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public function mapPaymentItems($itemTransactions)
if (isset($itemTransaction->convertedPayout)) {
$paymentItem->setConvertedPayout($this->mapConvertedPayout($itemTransaction->convertedPayout));
}
if (isset($itemTransaction->withholdingTax)) {
$paymentItem->setWithholdingTax($itemTransaction->withholdingTax);
}
$paymentItems[$index] = $paymentItem;
}
return $paymentItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public function mapSubMerchantPaymentItemResourceFrom(SubMerchantPaymentItemUpda
$create->setSubMerchantPrice($jsonObject->subMerchantPrice);
}

if(isset($jsonObject->withholdingTax))
{
$create->setWithholdingTax($jsonObject->withholdingTax);
}

return $create;
}

Expand Down
11 changes: 11 additions & 0 deletions src/Iyzipay/Model/SubMerchantPaymentItemResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class SubMerchantPaymentItemResource extends IyzipayResource
private $subMerchantKey;
private $paymentTransactionId;
private $subMerchantPrice;
private $withholdingTax;


public function getSubMerchantKey()
Expand Down Expand Up @@ -40,4 +41,14 @@ public function setSubMerchantPrice($subMerchantPrice)
{
$this->subMerchantPrice = $subMerchantPrice;
}

public function getWithholdingTax()
{
return $this->withholdingTax;
}

public function setWithholdingTax($withholdingTax)
{
$this->withholdingTax = $withholdingTax;
}
}
2 changes: 2 additions & 0 deletions src/Iyzipay/Request/SubMerchantPaymentItemUpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function getJsonObject()
->add("subMerchantKey", $this->getSubMerchantKey())
->add("paymentTransactionId", $this->getPaymentTransactionId())
->addPrice("subMerchantPrice", $this->getSubMerchantPrice())
->addPrice("withholdingTax", $this->getWithholdingTax())
->getObject();
}

Expand All @@ -72,6 +73,7 @@ public function toPKIRequestString()
->append("subMerchantKey", $this->getSubMerchantKey())
->append("paymentTransactionId", $this->getPaymentTransactionId())
->append("subMerchantPrice", $this->getSubMerchantPrice())
->append("withholdingTax", $this->getWithholdingTax())
->getRequestString();
}
}

0 comments on commit 151bc2a

Please sign in to comment.