Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
hilrob committed May 2, 2018
2 parents b8e1b8f + d6d70c2 commit e566b47
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 33 deletions.
11 changes: 10 additions & 1 deletion Model/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,13 @@ public function getPayment($paymentId)
*/
public function createPayment($webProfile, $quote, $taxFailure = false)
{
/**
* Skip if grand total is zero
*/
if ($quote->getBaseGrandTotal() == "0.0000") {
return false;
}

$payer = $this->buildPayer($quote);

$itemList = $this->buildItemList($quote, $taxFailure);
Expand Down Expand Up @@ -746,7 +753,9 @@ protected function buildItemList($quote, $taxFailure)
protected function buildAmount($quote)
{
$details = new Details();
$details->setShipping($quote->getShippingAddress()->getBaseShippingAmount())
$shippingCost = $quote->getShippingAddress()->getFreeShipping() ? 0 : $quote->getShippingAddress()->getBaseShippingAmount();

$details->setShipping($shippingCost)
->setTax(
$quote->getShippingAddress()->getBaseTaxAmount()
+ $quote->getShippingAddress()->getBaseHiddenTaxAmount()
Expand Down
9 changes: 9 additions & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
==== 1.1.7 ====
Fixed minicart not empty after order success
Fixed shipping calculation with free shipping
Skip payment creation call if total is zero
Removed unused file sections.xml

==== 1.1.6 ====
Hide PayPal Express in checkout if PPP is active

==== 1.1.5 ====
US address validation error handling.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
],
"type": "magento2-module",
"version": "1.1.5",
"version": "1.1.7",
"license": [
"OSL-3.0"
],
Expand Down
30 changes: 0 additions & 30 deletions etc/frontend/sections.xml

This file was deleted.

2 changes: 1 addition & 1 deletion marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"type": "magento2-module",
"version": "1.1.5",
"version": "1.1.7",
"license": [
"OSL-3.0"
],
Expand Down
12 changes: 12 additions & 0 deletions view/frontend/templates/paypalplus/success.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,15 @@
<?php elseif ($block->isPPP()): ?>
<div class="ppp-success"><?php /* @noEscape */ echo __('<i>processed by PayPal</i>');?></div>
<?php endif; ?>
<?php if ($block->isPPP()): ?>
<script>
require([
'Magento_Customer/js/customer-data',
'jquery'
], function (customerData, $) {
$(function(){
customerData.invalidate(['cart', 'customer', 'last-ordered-items']);
});
});
</script>
<?php endif; ?>
3 changes: 3 additions & 0 deletions view/frontend/web/js/view/payment/method-renderer/payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ define(
language: self.language,
preselection: "paypal",
thirdPartyPaymentMethods: self.getThirdPartyPaymentMethods(),
onLoad: function() {
self.lastCall = 'enableContinue';
},
onThirdPartyPaymentMethodSelected: function (data) {
self.lastCall = 'onThirdPartyPaymentMethodSelected';
self.selectedMethod = self.paymentCodeMappings[data.thirdPartyPaymentMethod];
Expand Down

0 comments on commit e566b47

Please sign in to comment.