diff --git a/OrderCloud.Catalyst/Integrations/Interfaces/ICreditCardProcessor.cs b/OrderCloud.Catalyst/Integrations/Interfaces/ICreditCardProcessor.cs index 80b8ced..1e6a6a9 100644 --- a/OrderCloud.Catalyst/Integrations/Interfaces/ICreditCardProcessor.cs +++ b/OrderCloud.Catalyst/Integrations/Interfaces/ICreditCardProcessor.cs @@ -79,7 +79,17 @@ public class AuthorizeCCTransaction /// An optional header value used by some processors to enforce idempotency. /// public string RequestID { get; set; } - } + /// + /// An optional list of OrderCloud Order IDs associated with each supplier included in the transaction. + /// + public List SupplierOrderIDs { get; set; } + } + + public class SupplierOrderID + { + public string SupplierID { get; set; } + public string OrderID { get; set; } + } public class CCTransactionResult { diff --git a/OrderCloud.Catalyst/OrderCloud.Catalyst.csproj b/OrderCloud.Catalyst/OrderCloud.Catalyst.csproj index 1830449..50762fc 100644 --- a/OrderCloud.Catalyst/OrderCloud.Catalyst.csproj +++ b/OrderCloud.Catalyst/OrderCloud.Catalyst.csproj @@ -3,7 +3,7 @@ netstandard2.0 True - 2.6.1 + 2.7.0 ordercloud-dotnet-catalyst OrderCloud SDK Extensions for Azure App Services OrderCloud Team diff --git a/OrderCloud.Integrations.Payment.PayPal/Mappers/PayPalOrderPaymentMapper.cs b/OrderCloud.Integrations.Payment.PayPal/Mappers/PayPalOrderPaymentMapper.cs index 27c3e9d..6fefded 100644 --- a/OrderCloud.Integrations.Payment.PayPal/Mappers/PayPalOrderPaymentMapper.cs +++ b/OrderCloud.Integrations.Payment.PayPal/Mappers/PayPalOrderPaymentMapper.cs @@ -32,6 +32,9 @@ public List MapToPurchaseUnit(AuthorizeCCTransaction transaction, { var merchantLines = transaction?.OrderWorksheet?.LineItems?.Where(li => li.Product.DefaultSupplierID == m.SupplierID).ToList(); + var merchantInvoice = transaction.SupplierOrderIDs?.FirstOrDefault(t => t.SupplierID == m.SupplierID); + var invoiceID = merchantInvoice != null ? merchantInvoice.OrderID : transaction?.OrderID; + if (merchantLines != null && merchantLines.Any()) { var merchantUnit = new PurchaseUnit() @@ -48,7 +51,7 @@ public List MapToPurchaseUnit(AuthorizeCCTransaction transaction, }, description = transaction?.OrderWorksheet?.Order?.Comments, reference_id = Guid.NewGuid().ToString(), - invoice_id = transaction?.OrderID, + invoice_id = invoiceID }; if (address != null) { diff --git a/OrderCloud.Integrations.Payment.PayPal/OrderCloud.Integrations.Payment.PayPal.csproj b/OrderCloud.Integrations.Payment.PayPal/OrderCloud.Integrations.Payment.PayPal.csproj index 88a031c..98d5c1a 100644 --- a/OrderCloud.Integrations.Payment.PayPal/OrderCloud.Integrations.Payment.PayPal.csproj +++ b/OrderCloud.Integrations.Payment.PayPal/OrderCloud.Integrations.Payment.PayPal.csproj @@ -3,7 +3,7 @@ netstandard2.0 True - 2.6.1 + 2.7.0 OrderCloud.Integrations.Payment.PayPal OrderCloud Payment Integration with PayPal OrderCloud Team