Skip to content

Commit

Permalink
Added:
Browse files Browse the repository at this point in the history
Link for group orders to the founder order
Sender name
Delivered at
Recipient object
  • Loading branch information
Omri Mosseri committed Dec 30, 2015
1 parent e49ee40 commit c2c8f81
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
24 changes: 17 additions & 7 deletions Riskified.SDK.Sample/OrderTransmissionExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ private static Order GenerateOrder(int orderNum)

var items = new[]
{
new LineItem(title: "Bag",price: 55.44,quantityPurchased: 1,productId: 48484,sku: "1272727",deliveredTo: DeliveredToType.StorePickup),
new LineItem(title: "Bag",price: 55.44,quantityPurchased: 1,productId: 48484,sku: "1272727",deliveredTo: DeliveredToType.StorePickup, delivered_at:new DateTime(2016, 12, 8, 14, 12, 12, DateTimeKind.Local)),
new LineItem(title: "Monster", price: 22.3, quantityPurchased: 3, seller: new Seller(customer: customer,correspondence: 1, priceNegotiated: true, startingPrice: 120)),
// Events Tickets Industry
new LineItem(title: "Concert",
Expand All @@ -385,7 +385,8 @@ private static Order GenerateOrder(int orderNum)
message: "Happy Birthday",
greeting_message: "Happy Birthday from John",
card_type: "regular",
card_sub_type: "birthday"),
card_sub_type: "birthday",
sender_email: "[email protected]"),
};

var discountCodes = new[] { new DiscountCode(moneyDiscountSum: 7, code: "1") };
Expand All @@ -395,15 +396,22 @@ private static Order GenerateOrder(int orderNum)
// This is an example for an order with charge free sums (e.g. gift card payment)
var chargeFreePayments = new ChargeFreePaymentDetails(
gateway: "giftcard",
amount: 45
);
amount: 45);

// This is an example for client details section
var clientDetails = new ClientDetails(
accept_language: "en-CA",
user_agent: "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"
);
user_agent: "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)");

var recipientSocial = new SocialDetails(
network: "Facebook",
publicUsername:"john.smith",
accountUrl:"http://www.facebook.com/john.smith");

var recipient = new Recipient(
email: "[email protected]",
phone: "96522444221",
social: recipientSocial);

var order = new Order(
merchantOrderId: orderNum.ToString(),
Expand All @@ -428,7 +436,9 @@ private static Order GenerateOrder(int orderNum)
vendorName: "domestic",
additionalEmails: new [] {"[email protected]","[email protected]"},
chargeFreePaymentDetails: chargeFreePayments,
clientDetails: clientDetails);
clientDetails: clientDetails,
groupInitiatorOrderID: "2222",
recipient: recipient);

return order;
}
Expand Down
18 changes: 17 additions & 1 deletion Riskified.SDK/Model/OrderElements/LineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public LineItem(string title,
string message = null,
string greeting_message = null,
string card_type = null,
string card_sub_type = null)
string card_sub_type = null,
DateTime? delivered_at = null,
string sender_email = null)
{

Title = title;
Expand Down Expand Up @@ -84,6 +86,8 @@ public LineItem(string title,
GreetingMessage = greeting_message;
CardType = card_type;
CardSubtype = card_sub_type;
DeliveredAt = delivered_at;
SenderEmail = sender_email;
}

/// <summary>
Expand Down Expand Up @@ -224,6 +228,12 @@ public void Validate(Validations validationType = Validations.Weak)
[JsonProperty(PropertyName = "sender_name")]
public string SenderName { get; set; }

/// <summary>
/// The digital good's (giftcard) sender email.
/// </summary>
[JsonProperty(PropertyName = "sender_email")]
public string SenderEmail { get; set; }

/// <summary>
/// The digital good's (giftcard) display name.
/// </summary>
Expand Down Expand Up @@ -271,5 +281,11 @@ public void Validate(Validations validationType = Validations.Weak)
/// </summary>
[JsonProperty(PropertyName = "card_subtype")]
public string CardSubtype { get; set; }

/// <summary>
/// The delivery date of the goods (e.g. gift card).
/// </summary>
[JsonProperty(PropertyName = "delivered_at")]
public DateTime? DeliveredAt { 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.4.2")]
[assembly: AssemblyFileVersion("2.0.4.2")]
[assembly: AssemblyVersion("2.0.4.3")]
[assembly: AssemblyFileVersion("2.0.4.3")]
1 change: 1 addition & 0 deletions Riskified.SDK/Riskified.SDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<Compile Include="Model\OrderElements\IPaymentDetails.cs" />
<Compile Include="Model\OrderElements\NoChargeDetails.cs" />
<Compile Include="Model\OrderElements\PaypalPaymentDetails.cs" />
<Compile Include="Model\OrderElements\Recipient.cs" />
<Compile Include="Model\OrderElements\Seller.cs" />
<Compile Include="Model\OrderElements\SocialDetails.cs" />
<Compile Include="Model\OrderElements\FulfillmentStatusCode.cs" />
Expand Down

0 comments on commit c2c8f81

Please sign in to comment.