Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLUG-96: Fix loss of precision of float to int conversion on payment … #7

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.0.7] - 2024-03-14

### Fixed

- Payment totals not being rounded up, occasionally leading to a 1p difference

## [v1.0.6] - 2023-09-13

### Changed:

- Wait for payment status updates on customer checkout
- Admin panel improvements and fixes
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
Loading