Skip to content

Commit

Permalink
SP-803 PHP SDK - Proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarzybok-sumoheavy committed Feb 6, 2024
1 parent 4de29cf commit b3a475f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/BitPaySDK/Model/Settlement/InvoiceData.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class InvoiceData
protected ?string $currency = null;
protected ?string $transactionCurrency = null;
protected ?float $overPaidAmount = null;
protected ?float $payoutPercentage = null;
protected ?array $payoutPercentage = null;
protected ?RefundInfo $refundInfo = null;

public function __construct()
Expand Down Expand Up @@ -154,19 +154,19 @@ public function setOverPaidAmount(float $overPaidAmount): void
/**
* Gets The payout percentage defined by the merchant on his BitPay account settings
*
* @return float|null the payout percentage
* @return array|null the payout percentage
*/
public function getPayoutPercentage(): ?float
public function getPayoutPercentage(): ?array
{
return $this->payoutPercentage;
}

/**
* Sets The payout percentage defined by the merchant on his BitPay account settings
*
* @param float $payoutPercentage the payout percentage
* @param array $payoutPercentage the payout percentage
*/
public function setPayoutPercentage(float $payoutPercentage): void
public function setPayoutPercentage(array $payoutPercentage): void
{
$this->payoutPercentage = $payoutPercentage;
}
Expand Down
6 changes: 3 additions & 3 deletions test/unit/BitPaySDK/Model/Settlement/InvoiceDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function testGetOverPaidAmount()

public function testGetPayoutPercentage()
{
$expectedPayoutPercentage = 15;
$expectedPayoutPercentage = ['USD' => 15.12];

$invoiceData = $this->createClassObject();
$invoiceData->setPayoutPercentage($expectedPayoutPercentage);
Expand Down Expand Up @@ -108,7 +108,7 @@ public function testToArray()
self::assertEquals(12.9, $invoiceDataArray['price']);
self::assertEquals('BTC', $invoiceDataArray['currency']);
self::assertEquals('BTC', $invoiceDataArray['transactionCurrency']);
self::assertEquals(15, $invoiceDataArray['payoutPercentage']);
self::assertEquals(15.12, $invoiceDataArray['payoutPercentage']['USD']);
self::assertEquals([], $invoiceDataArray['refundInfo']);
}

Expand All @@ -124,7 +124,7 @@ private function setSetters(InvoiceData $invoiceData)
$invoiceData->setPrice(12.9);
$invoiceData->setCurrency('BTC');
$invoiceData->setTransactionCurrency('BTC');
$invoiceData->setPayoutPercentage(15);
$invoiceData->setPayoutPercentage(['USD' => 15.12]);
$invoiceData->setRefundInfo($this->getMockBuilder(RefundInfo::class)->getMock());
}
}

0 comments on commit b3a475f

Please sign in to comment.