From 5912e48d06cf5572dc9a9fb589561420f4bc3653 Mon Sep 17 00:00:00 2001 From: Paul Canning Date: Mon, 9 Dec 2019 10:45:06 +0000 Subject: [PATCH 1/3] Add `uk-maestro` to CC Types to fully support Maestro cards. --- Gateway/Response/CardDetailsHandler.php | 8 +++++--- etc/config.xml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Gateway/Response/CardDetailsHandler.php b/Gateway/Response/CardDetailsHandler.php index 5815d987..26570a60 100755 --- a/Gateway/Response/CardDetailsHandler.php +++ b/Gateway/Response/CardDetailsHandler.php @@ -53,7 +53,10 @@ public function __construct( } /** - * @inheritdoc + * @param array $handlingSubject + * @param array $response + * @throws InputException + * @throws NoSuchEntityException */ public function handle(array $handlingSubject, array $response) { @@ -67,7 +70,6 @@ public function handle(array $handlingSubject, array $response) $payment->setCcLast4($creditCard[self::CARD_LAST4]); $payment->setCcExpMonth($creditCard[self::CARD_EXP_MONTH]); $payment->setCcExpYear($creditCard[self::CARD_EXP_YEAR]); - $payment->setCcType($this->getCreditCardType($creditCard[self::CARD_TYPE])); // set card details to additional info @@ -83,7 +85,7 @@ public function handle(array $handlingSubject, array $response) * @throws InputException * @throws NoSuchEntityException */ - private function getCreditCardType($type): string + private function getCreditCardType(string $type): string { $replaced = str_replace(' ', '-', strtolower($type)); $mapper = $this->config->getCcTypesMapper(); diff --git a/etc/config.xml b/etc/config.xml index a0067814..ffca61a0 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -30,7 +30,7 @@ 1 AE,VI,MC,DI,JCB,CUP,DN,MI 1 - + processing sandbox 0 From 386bf5f0c7cbef64204e64df4230f3d32b7ae337 Mon Sep 17 00:00:00 2001 From: Paul Canning Date: Mon, 9 Dec 2019 12:37:21 +0000 Subject: [PATCH 2/3] Use `getBasePrice` due to inconsistent return type of `getPrice`. --- Gateway/Request/Level23ProcessingDataBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gateway/Request/Level23ProcessingDataBuilder.php b/Gateway/Request/Level23ProcessingDataBuilder.php index 69f3bdf4..4c77f6a0 100644 --- a/Gateway/Request/Level23ProcessingDataBuilder.php +++ b/Gateway/Request/Level23ProcessingDataBuilder.php @@ -115,9 +115,9 @@ public function build(array $buildSubject): array $filteredFields['name'], TransactionLineItem::DEBIT, $this->numberToString($item->getQtyOrdered(), 2), - $this->numberToString($item->getPrice(), 2), + $this->numberToString($item->getBasePrice(), 2), $filteredFields['unit_of_measure'], - $this->numberToString($item->getQtyOrdered() * $item->getPrice(), 2), + $this->numberToString($item->getQtyOrdered() * $item->getBasePrice(), 2), $item->getTaxAmount() === null ? '0.00' : $this->numberToString($item->getTaxAmount(), 2), $item->getTaxAmount() === null ? '0.00' : $this->numberToString($item->getDiscountAmount(), 2), $filteredFields['sku'], From b8aa2ca63345e92af43ebd57e9b503208cef6cb1 Mon Sep 17 00:00:00 2001 From: Paul Canning Date: Mon, 9 Dec 2019 16:06:17 +0000 Subject: [PATCH 3/3] Updated versions. --- CHANGELOG.md | 6 ++++++ composer.json | 2 +- etc/module.xml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 313fde2f..58abd838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ 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). +## [3.4.2] - 2019-12-09 +### Fixed +- Issue where Level 2/3 Processing data builder was using a string where a float was required +- Issue when trying to use a UK Maestro card to checkout + ## [3.4.1] - 2019-11-20 ### Fixed - Hotfix for bug that stopped stored cards being used when CVV Re-verification is disabled @@ -119,6 +124,7 @@ a bug in core Magento 2.3.1 means that if the Vault is turned off, cards are alw ### Fixed - Vaulted cards now work correctly +[3.4.2]: https://github.com/genecommerce/module-braintree-magento2/compare/3.4.1...3.4.2 [3.4.1]: https://github.com/genecommerce/module-braintree-magento2/compare/3.4.0...3.4.1 [3.4.0]: https://github.com/genecommerce/module-braintree-magento2/compare/3.3.3...3.4.0 [3.3.3]: https://github.com/genecommerce/module-braintree-magento2/compare/3.3.2...3.3.3 diff --git a/composer.json b/composer.json index e6ae0ff6..d936db0e 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "gene/module-braintree", "description": "Fork from the Magento Braintree 2.2.0 module by Gene Commerce for PayPal.", - "version": "3.4.1", + "version": "3.4.2", "type": "magento2-module", "license": "proprietary", "require": { diff --git a/etc/module.xml b/etc/module.xml index 20d2fe17..0609fa60 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -6,7 +6,7 @@ */ --> - +