Skip to content

Commit

Permalink
PLUG-96: Fix loss of precision of float to int conversion on payment …
Browse files Browse the repository at this point in the history
…amounts
  • Loading branch information
lighe committed Mar 14, 2024
1 parent 7d1eb77 commit e18267e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
strategy:
matrix:
include:
- PHP_VERSION: php81-fpm
MAGENTO_VERSION: 2.4.4
- PHP_VERSION: php82-fpm
MAGENTO_VERSION: 2.4.6

runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/setup-di-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ jobs:
fail-fast: false
matrix:
include:
- PHP_VERSION: php74-fpm
MAGENTO_VERSION: 2.4.3-p1
- PHP_VERSION: php81-fpm
MAGENTO_VERSION: 2.4.4
- PHP_VERSION: php81-fpm
MAGENTO_VERSION: 2.4.5
- PHP_VERSION: php82-fpm
MAGENTO_VERSION: 2.4.6
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Service/Order/MakeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ private function getMerchantAccountId(ClientInterface $client, Quote $quote)

/**
* @param Quote $quote
*
* @param string $merchantAccountId
* @return array
*/
private function prepareData(Quote $quote, string $merchantAccountId): array
{
$customerEmail = $quote->getBillingAddress()->getEmail() ?: $quote->getCustomerEmail();

$data = [
"amount_in_minor" => (int)bcmul((string)$quote->getBaseGrandTotal(), '100'),
"amount_in_minor" => (int) round($quote->getBaseGrandTotal() * 100, 0, PHP_ROUND_HALF_UP),
"currency" => $quote->getBaseCurrencyCode(),
"payment_method" => [
"provider_selection" => [
Expand Down

0 comments on commit e18267e

Please sign in to comment.