Skip to content

Commit

Permalink
Change PreciseNumber from parseString to parseFloat
Browse files Browse the repository at this point in the history
Remove precise number from add fund and change the amount from invoice base income to total with tax
  • Loading branch information
ChristianGabs committed Jun 14, 2024
1 parent c4c69ea commit cb8ad7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/BTCPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ public function processTransaction($api_admin, $id, $data, $gateway_id): string

// Update the account funds
$client = $this->di['db']->getExistingModelById('Client', $invoice->client_id);
$clientService->addFunds($client, PreciseNumber::parseString($invoiceService->getTotalWithTax($invoice)), "BTCPay transaction {$payloadData->invoiceId}", [
'amount' => $invoice->base_income,
$clientService->addFunds($client, $invoiceService->getTotalWithTax($invoice), "BTCPay transaction {$payloadData->invoiceId}", [
'amount' => $invoiceService->getTotalWithTax($invoice),
'description' => 'Stripe transaction '.$payloadData->invoiceId,
'type' => 'transaction',
'rel_id' => $id,
Expand Down Expand Up @@ -288,7 +288,7 @@ protected function _generateForm(Model_Invoice $invoice): string
$request = $this->btcpay->createInvoice(
$this->config['store_id'],
$invoice->currency,
PreciseNumber::parseString($invoiceService->getTotalWithTax($invoice)),
PreciseNumber::parseFloat($invoiceService->getTotalWithTax($invoice), 2),
uniqid()."#{$invoice->nr}",
$invoice->buyer_email,
$metaData,
Expand Down

0 comments on commit cb8ad7e

Please sign in to comment.