Created
July 28, 2016 21:40
-
-
Save jlav1n/729a86562e29f131451b08561c818f6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Shipment/FedEx.pm b/lib/Shipment/FedEx.pm | |
index 67ca542..b15897e 100644 | |
--- a/lib/Shipment/FedEx.pm | |
+++ b/lib/Shipment/FedEx.pm | |
@@ -262,6 +262,7 @@ sub _build_services { | |
PackageCount => $self->count_packages || 1, | |
PackageDetail => 'INDIVIDUAL_PACKAGES', | |
RequestedPackageLineItems => \@pieces, | |
+ RateRequestTypes => 'LIST', | |
}, | |
}, | |
); | |
@@ -453,6 +454,7 @@ sub rate { | |
PackageCount => $self->count_packages, | |
PackageDetail => 'INDIVIDUAL_PACKAGES', | |
RequestedPackageLineItems => \@pieces, | |
+ RateRequestTypes => 'LIST', | |
}, | |
}, | |
); | |
@@ -480,6 +482,11 @@ sub rate { | |
->get_ShipmentRateDetail->get_TotalNetCharge | |
->get_Currency, | |
), | |
+ discount => Data::Currency->new( | |
+ $response->get_RateReplyDetails() | |
+ ->get_RatedShipmentDetails->[0] | |
+ ->get_EffectiveNetDiscount->get_Amount, | |
+ ), | |
) | |
); | |
} | |
diff --git a/lib/Shipment/Service.pm b/lib/Shipment/Service.pm | |
index 7fffd10..37a442c 100644 | |
--- a/lib/Shipment/Service.pm | |
+++ b/lib/Shipment/Service.pm | |
@@ -122,6 +122,11 @@ has 'extras' => ( | |
default => sub { {} }, | |
); | |
+has 'discount' => ( | |
+ is => 'rw', | |
+ isa => InstanceOf ['Data::Currency'], | |
+ default => sub { Data::Currency->new(0) }, | |
+); | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! This has been merged in!