diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index c055c4601..531748901 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -11,6 +11,7 @@ - fixed #12152: PayPal Standard ignores shop-credit - fixed #12119: Locale setting for paypal - fixed #12156: Asset Manager performance + - fixed #12158: Shop credit cannot be used to pay for Shipping on PayPal 7.10.17 - fixed: Forced to use a PayDriver even with a balance of 0 in the cart. diff --git a/lib/WebGUI/Shop/PayDriver/PayPal/PayPalStd.pm b/lib/WebGUI/Shop/PayDriver/PayPal/PayPalStd.pm index d4a320d1f..cf7936595 100644 --- a/lib/WebGUI/Shop/PayDriver/PayPal/PayPalStd.pm +++ b/lib/WebGUI/Shop/PayDriver/PayPal/PayPalStd.pm @@ -265,7 +265,7 @@ sub paymentVariables { cancel_return => $cancel->as_string, lc => $i18n->getLanguage->{locale}, - handling_cart => $cart->calculateShipping, ##According to https://www.x.com/message/180018#180018 + #handling_cart => $cart->calculateShipping, ##According to https://www.x.com/message/180018#180018 tax_cart => $cart->calculateTaxes, discount_amount_cart => abs($cart->calculateShopCreditDeduction), @@ -276,11 +276,18 @@ sub paymentVariables { my $counter = 0; foreach my $item (@{ $cart->getItems}) { - my $n = ++$counter; - $params{"amount_$n"} = $item->getSku->getPrice; - $params{"quantity_$n"} = $item->get('quantity'); - $params{"item_name_$n"} = $item->get('configuredTitle'); - $params{"item_number_$n"} = $item->get('itemId'); + ++$counter; + $params{"amount_$counter"} = $item->getSku->getPrice; + $params{"quantity_$counter"} = $item->get('quantity'); + $params{"item_name_$counter"} = $item->get('configuredTitle'); + $params{"item_number_$counter"} = $item->get('itemId'); + } + if ($cart->requiresShipping) { + ++$counter; + $params{"amount_$counter"} = $cart->calculateShipping; + $params{"quantity_$counter"} = 1; + $params{"item_name_$counter"} = $i18n->get('shipping', 'Shop'); + $params{"item_number_$counter"} = 'Shipping'; } return \%params;