From 6decc7c8a3e630f0473861985e95e0646a7fe443 Mon Sep 17 00:00:00 2001 From: Brandon Moffett Date: Mon, 19 May 2025 18:24:06 -0700 Subject: [PATCH 1/2] Enhance DutiesPayment structure in FedExShipmentProvider Updated the DutiesPayment property to include a new Payor object. This object now contains a ResponsibleParty with an AccountNumber set from shipmentDetails, improving the payment handling logic. --- .../RestApi/Impl/FedExShipmentProvider.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/EasyKeys.Shipping.FedEx.Shipment/RestApi/Impl/FedExShipmentProvider.cs b/src/EasyKeys.Shipping.FedEx.Shipment/RestApi/Impl/FedExShipmentProvider.cs index ac5ce9d..86e284a 100644 --- a/src/EasyKeys.Shipping.FedEx.Shipment/RestApi/Impl/FedExShipmentProvider.cs +++ b/src/EasyKeys.Shipping.FedEx.Shipment/RestApi/Impl/FedExShipmentProvider.cs @@ -308,7 +308,17 @@ public async Task CreateShipmentAsync(FedExServiceType serviceTyp case "RECIPIENT": shipmentRequest.RequestedShipment.CustomsClearanceDetail.DutiesPayment = new Payment_1 { - PaymentType = Payment_1PaymentType.RECIPIENT + PaymentType = Payment_1PaymentType.RECIPIENT, + Payor = new Payor_1 + { + ResponsibleParty = new Party_2 + { + AccountNumber = new PartyAccountNumber + { + Value = shipmentDetails.AccountNumber + } + } + } }; break; } From b948e0c0578c409be171e5b00b0210657a2ee0de Mon Sep 17 00:00:00 2001 From: Brandon Moffett Date: Mon, 19 May 2025 18:28:46 -0700 Subject: [PATCH 2/2] Add THIRD_PARTY payment handling in FedEx logic Introduce handling for "THIRD_PARTY" payment type in the FedEx shipment processing. Set up `ShippingChargesPayment` with appropriate `Payment` object and account number. Add default case for other payment types to set `DutiesPayment` as `RECIPIENT`. --- .../RestApi/Impl/FedExShipmentProvider.cs | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/EasyKeys.Shipping.FedEx.Shipment/RestApi/Impl/FedExShipmentProvider.cs b/src/EasyKeys.Shipping.FedEx.Shipment/RestApi/Impl/FedExShipmentProvider.cs index 86e284a..6c2a98a 100644 --- a/src/EasyKeys.Shipping.FedEx.Shipment/RestApi/Impl/FedExShipmentProvider.cs +++ b/src/EasyKeys.Shipping.FedEx.Shipment/RestApi/Impl/FedExShipmentProvider.cs @@ -321,6 +321,29 @@ public async Task CreateShipmentAsync(FedExServiceType serviceTyp } }; break; + + case "THIRD_PARTY": + shipmentRequest.RequestedShipment.ShippingChargesPayment = new Payment + { + PaymentType = PaymentType.THIRD_PARTY, + Payor = new Payor + { + ResponsibleParty = new ResponsiblePartyParty + { + AccountNumber = new PartyAccountNumber + { + Value = shipmentDetails.AccountNumber + } + } + } + }; + break; + default: + shipmentRequest.RequestedShipment.CustomsClearanceDetail.DutiesPayment = new Payment_1 + { + PaymentType = Payment_1PaymentType.RECIPIENT + }; + break; } } @@ -348,6 +371,23 @@ public async Task CreateShipmentAsync(FedExServiceType serviceTyp } }; break; + + case "THIRD_PARTY": + shipmentRequest.RequestedShipment.ShippingChargesPayment = new Payment + { + PaymentType = PaymentType.THIRD_PARTY, + Payor = new Payor + { + ResponsibleParty = new ResponsiblePartyParty + { + AccountNumber = new PartyAccountNumber + { + Value = shipmentDetails.AccountNumber + } + } + } + }; + break; } var token = await _authService.GetTokenAsync(cancellationToken);