Skip to content

Commit

Permalink
add customer phone and line item delivered to (erez)
Browse files Browse the repository at this point in the history
  • Loading branch information
Omri Mosseri committed Oct 20, 2015
1 parent a4acf9d commit f35d9ca
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Riskified.SDK.Sample/OrderTransmissionExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ private static Order GenerateOrder(int orderNum)
email: "[email protected]",
verifiedEmail: true,
createdAt: new DateTime(2013, 12, 8, 14, 12, 12),
notes: "No additional info");
notes: "No additional info",
phone: "55523369");

// putting sample billing details
var billing = new AddressInformation(
Expand Down
4 changes: 3 additions & 1 deletion Riskified.SDK/Model/OrderElements/Customer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Customer : IJsonSerializable
/// <param name="verifiedEmail">Signs if the email was verified by the merchant is some way (optional)</param>
/// <param name="createdAt">The time of creation of the customer card (optional)</param>
/// <param name="notes">Additional notes regarding the customer (optional)</param>
public Customer(string firstName, string lastName,string id, int? ordersCount = null,string email = null, bool? verifiedEmail = null, DateTime? createdAt = null, string notes = null, SocialDetails[] social = null)
public Customer(string firstName, string lastName, string id, int? ordersCount = null, string email = null, bool? verifiedEmail = null, DateTime? createdAt = null, string notes = null, SocialDetails[] social = null, string phone = null)
{
FirstName = firstName;
LastName = lastName;
Expand Down Expand Up @@ -104,6 +104,8 @@ public void Validate(Validations validationType = Validations.Weak)
[JsonProperty(PropertyName = "buyer_anonymous_id")]
public string AnonymousId { get; set; }

[JsonProperty(PropertyName = "phone")]
public string Phone { get; set; }

}
}
18 changes: 18 additions & 0 deletions Riskified.SDK/Model/OrderElements/DeliveredToType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Riskified.SDK.Model.OrderElements
{
// Used on the line item level, the pickup location for that product
public enum DeliveredToType
{
[EnumMember(Value = "shipping_address")]
ShippingAddress,
[EnumMember(Value = "store_pickup")]
StorePickup
}
}
11 changes: 9 additions & 2 deletions Riskified.SDK/Model/OrderElements/LineItem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Riskified.SDK.Utils;
using System;

Expand All @@ -15,7 +16,7 @@ public class LineItem : IJsonSerializable
/// <param name="productId">The Product ID number (optional)</param>
/// <param name="sku">The stock keeping unit of the product (optional)</param>
public LineItem(string title, double price, int quantityPurchased, int? productId = null, string sku = null, string condition = null, bool? requiresShipping = null, Seller seller = null,
string eventSubCategoryName = null, string eventName = null, string eventSectionName = null, DateTime? eventDate = null)
string eventSubCategoryName = null, string eventName = null, string eventSectionName = null, DateTime? eventDate = null, DeliveredToType deliveredTo = DeliveredToType.ShippingAddress)
{

Title = title;
Expand All @@ -32,6 +33,7 @@ public LineItem(string title, double price, int quantityPurchased, int? productI
EventName = eventName;
EventSectionName = eventSectionName;
EventDate = eventDate;
DeliveredTo = deliveredTo;
}

/// <summary>
Expand Down Expand Up @@ -160,6 +162,11 @@ public void Validate(Validations validationType = Validations.Weak)
[JsonProperty(PropertyName = "brand")]
public string Brand { get; set; }

/// <summary>
/// The devlivered_to will tell us where is the customer would like to get the product
/// </summary>
[JsonProperty(PropertyName = "delivered_to")]
[JsonConverter(typeof(StringEnumConverter))]
public DeliveredToType DeliveredTo { get; set; }
}

}
4 changes: 2 additions & 2 deletions Riskified.SDK/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.3.10")]
[assembly: AssemblyFileVersion("2.0.3.10")]
[assembly: AssemblyVersion("2.0.3.11")]
[assembly: AssemblyFileVersion("2.0.3.11")]
1 change: 1 addition & 0 deletions Riskified.SDK/Riskified.SDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Exceptions\RiskifiedAuthenticationException.cs" />
<Compile Include="Model\OrderElements\DeliveredToType.cs" />
<Compile Include="Model\OrderElements\ExternalStatusType.cs" />
<Compile Include="Model\IJsonSerializable.cs" />
<Compile Include="Model\Internal\OrderCheckoutWrapper.cs" />
Expand Down

0 comments on commit f35d9ca

Please sign in to comment.