Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional SupplierIDs property to AuthorizeCCTransaction #137

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,17 @@ public class AuthorizeCCTransaction
/// An optional header value used by some processors to enforce idempotency.
/// </summary>
public string RequestID { get; set; }
}
/// <summary>
/// An optional list of OrderCloud Order IDs associated with each supplier included in the transaction.
/// </summary>
public List<SupplierOrderID> SupplierOrderIDs { get; set; }
}

public class SupplierOrderID
{
public string SupplierID { get; set; }
public string OrderID { get; set; }
}

public class CCTransactionResult
{
Expand Down
2 changes: 1 addition & 1 deletion OrderCloud.Catalyst/OrderCloud.Catalyst.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>2.6.1</Version>
<Version>2.7.0</Version>
<PackageId>ordercloud-dotnet-catalyst</PackageId>
<Title>OrderCloud SDK Extensions for Azure App Services</Title>
<Authors>OrderCloud Team</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public List<PurchaseUnit> 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()
Expand All @@ -48,7 +51,7 @@ public List<PurchaseUnit> MapToPurchaseUnit(AuthorizeCCTransaction transaction,
},
description = transaction?.OrderWorksheet?.Order?.Comments,
reference_id = Guid.NewGuid().ToString(),
invoice_id = transaction?.OrderID,
invoice_id = invoiceID
};
if (address != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>2.6.1</Version>
<Version>2.7.0</Version>
<PackageId>OrderCloud.Integrations.Payment.PayPal</PackageId>
<Title>OrderCloud Payment Integration with PayPal</Title>
<Authors>OrderCloud Team</Authors>
Expand Down
Loading