Skip to content
Closed
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
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ The official Sift .NET client, supporting .NET Standard 2.0+
user_email = "billjones1@example.com",
verification_phone_number = "+123456789012",
amount = 115940000,
currency_code = "USD",
currency_code = "CAD",
amount_usd = 100940000,
billing_address = new Address()
{
name = "Bill Jones",
Expand All @@ -332,7 +333,10 @@ The official Sift .NET client, supporting .NET Standard 2.0+
payment_type = "$credit_card",
payment_gateway = "$braintree",
card_bin = "542486",
card_last4 = "4444"
card_last4 = "4444",
card_bin_country = "US",
card_brand = "visa",
card_type = "gold"
},
new PaymentMethod()
{
Expand Down Expand Up @@ -381,7 +385,8 @@ The official Sift .NET client, supporting .NET Standard 2.0+
item_id = "12344321",
product_title = "Microwavable Kettle Corn: Original Flavor",
price = 4990000,
currency_code = "USD",
currency_code = "CAD",
price_usd = 4500000
upc = "097564307560",
sku = "03586005",
isbn = "0446576220",
Expand All @@ -408,7 +413,8 @@ The official Sift .NET client, supporting .NET Standard 2.0+
discount = new Discount()
{
amount = 5000000,
currency_code = "USD",
currency_code = "CAD",
amount_usd = 4700000
minimum_purchase_amount = 25000000
}
}
Expand Down Expand Up @@ -444,7 +450,8 @@ The official Sift .NET client, supporting .NET Standard 2.0+
user_email = "billjones1@example.com",
verification_phone_number = "+123456789012",
amount = 115940000,
currency_code = "USD",
currency_code = "CAD",
amount_usd = 100940000,
billing_address = new Address()
{
name = "Bill Jones",
Expand All @@ -463,7 +470,10 @@ The official Sift .NET client, supporting .NET Standard 2.0+
payment_type = "$credit_card",
payment_gateway = "$braintree",
card_bin = "542486",
card_last4 = "4444"
card_last4 = "4444",
card_bin_country = "US",
card_brand = "visa",
card_type = "gold"
},
new PaymentMethod()
{
Expand Down Expand Up @@ -512,7 +522,8 @@ The official Sift .NET client, supporting .NET Standard 2.0+
item_id = "12344321",
product_title = "Microwavable Kettle Corn: Original Flavor",
price = 4990000,
currency_code = "USD",
currency_code = "CAD",
price_usd = 4500000
upc = "097564307560",
sku = "03586005",
isbn = "0446576220",
Expand All @@ -539,7 +550,8 @@ The official Sift .NET client, supporting .NET Standard 2.0+
discount = new Discount()
{
amount = 5000000,
currency_code = "USD",
currency_code = "CAD",
amount_usd = 4700000
minimum_purchase_amount = 25000000
}
}
Expand Down Expand Up @@ -677,7 +689,8 @@ The official Sift .NET client, supporting .NET Standard 2.0+
{
"$user_id" : "billy_jones_301",
"$amount" : 506790000,
"$currency_code" : "USD",
"$currency_code" : "CAD",
"$amount_usd" : 480090000,
"$user_email" : "billjones1@example.com",
"$verification_phone_number" : "+123456789012",
"$transaction_type" : "$sale",
Expand Down Expand Up @@ -716,7 +729,10 @@ The official Sift .NET client, supporting .NET Standard 2.0+
"$payment_type" : "$credit_card",
"$payment_gateway" : "$braintree",
"$card_bin" : "542486",
"$card_last4" : "4444"
"$card_last4" : "4444",
"card_bin_country = "US",
"card_brand = "visa",
"card_type = "gold"
},
"$status_3ds" : "$attempted",
"$triggered_3ds" : "$processor",
Expand Down Expand Up @@ -767,7 +783,8 @@ The official Sift .NET client, supporting .NET Standard 2.0+
"$wager_type" : "spread",
"$wager_status" : "$accept",
"$amount" : 506790000,
"$currency_code" : "USD",
"$currency_code" : "CAD",
"$amount_usd" : 480090000,
"$event_type" : "Sportsbook",
"$event_name" : "NFL",
"$event_id" : "KHG23423093",
Expand Down
4 changes: 4 additions & 0 deletions Sift/Schema/ComplexTypes/booking.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
"$currency_code": {
"type": [ "string", "null" ]
},
"$price_usd": {
"type": [ "integer", "null" ],
"format": "long"
},
"$iata_carrier_code": {
"type": [ "string", "null" ]
},
Expand Down
6 changes: 5 additions & 1 deletion Sift/Schema/ComplexTypes/discount.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
"$currency_code": {
"type": [ "string", "null" ]
},
"$minimum_purchase_amount": {
"$amount_usd": {
"type": [ "integer", "null" ],
"format": "long"
},
"$minimum_purchase_amount": {
"type": [ "integer", "null" ],
"format": "long"
}
}
}
4 changes: 4 additions & 0 deletions Sift/Schema/ComplexTypes/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"$currency_code": {
"type": [ "string", "null" ]
},
"$price_usd": {
"type": [ "integer", "null" ],
"format": "long"
},
"$quantity": {
"type": [ "integer", "null" ]
},
Expand Down
9 changes: 9 additions & 0 deletions Sift/Schema/ComplexTypes/payment_method.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
"$card_last4": {
"type": [ "string", "null" ]
},
"$card_bin_country": {
"type": [ "string", "null" ]
},
"$card_brand": {
"type": [ "string", "null" ]
},
"$card_type": {
"type": [ "string", "null" ]
},
"$avs_result_code": {
"type": [ "string", "null" ]
},
Expand Down
4 changes: 4 additions & 0 deletions Sift/Schema/create_order.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"$currency_code": {
"type": [ "string", "null" ]
},
"$amount_usd": {
"type": [ "integer", "null" ],
"format": "long"
},
"$billing_address": {
"oneOf": [
{ "$ref": "ComplexTypes/address.json" },
Expand Down
4 changes: 4 additions & 0 deletions Sift/Schema/transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
"$currency_code": {
"type": [ "string", "null" ]
},
"$amount_usd": {
"type": [ "integer", "null" ],
"format": "long"
},
"$order_id": {
"type": [ "string", "null" ]
},
Expand Down
4 changes: 4 additions & 0 deletions Sift/Schema/update_order.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"$currency_code": {
"type": [ "string", "null" ]
},
"$amount_usd": {
"type": [ "integer", "null" ],
"format": "long"
},
"$billing_address": {
"oneOf": [
{ "$ref": "ComplexTypes/address.json" },
Expand Down
4 changes: 4 additions & 0 deletions Sift/Schema/wager.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"$currency_code": {
"type": [ "string", "null" ]
},
"$amount_usd": {
"type": [ "integer", "null" ],
"format": "long"
},
"$wager_event_type": {
"type": [ "string", "null" ]
},
Expand Down
4 changes: 2 additions & 2 deletions Sift/Sift.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Authors>Sift</Authors>
<AssemblyTitle>Sift</AssemblyTitle>
<AssemblyName>Sift</AssemblyName>
<VersionPrefix>1.5.0</VersionPrefix>
<PackageReleaseNotes>Release 1.5.0</PackageReleaseNotes>
<VersionPrefix>1.6.0</VersionPrefix>
<PackageReleaseNotes>Release 1.6.0</PackageReleaseNotes>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>Sift</PackageId>
<PackageTags>sift;siftscience;client;api;client;async</PackageTags>
Expand Down
54 changes: 54 additions & 0 deletions Test.Integration.Net7/EventsAPI/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,5 +321,59 @@ private EventResponse OrderStatus(Client sift)
EventResponse res = sift.SendAsync(eventRequest).Result;
return res;
}

[Fact]
public void UpdateOrderEventWithItemBookingDiscountPricesInUsdTest()
{
var sift = new Client(ApiKey);

var updateOrder = new UpdateOrder
{
user_id = UserId,
session_id = SessionId,
order_id = OrderId,
amount = 100000,
currency_code = "EUR",
amount_usd = 120000,
items = new ObservableCollection<Item>()
{
new Item()
{
price = 100000,
currency_code = "EUR",
price_usd = 120000
}
},
bookings = new ObservableCollection<Booking>()
{
new Booking()
{
booking_type = "$flight",
price = 100000,
currency_code = "EUR",
price_usd = 120000
}
},
promotions = new ObservableCollection<Promotion>()
{
new Promotion()
{
discount = new Discount()
{
amount = 100000,
currency_code = "EUR",
amount_usd = 120000
}
}
}
};

EventRequest eventRequest = new EventRequest()
{
Event = updateOrder
};
EventResponse res = sift.SendAsync(eventRequest).Result;
Assert.Equal("0", res.Status.ToString());
}
}
}
32 changes: 32 additions & 0 deletions Test.Integration.Net7/EventsAPI/Transactions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,5 +240,37 @@ public void WithdrawalTransactionTest()
EventResponse res = sift.SendAsync(eventRequest).Result;
Assert.Equal("0", res.Status.ToString());
}

[Fact]
public void TransactionEventWithAmountAndBinMetadataFieldsTest()
{
var sift = new Client(ApiKey);
var transaction = new Transaction
{
user_id = "test_dotnet_transaction_event",
amount = 100000000L,
currency_code = "EUR",
amount_usd = 120000000L,
transaction_type = "$withdrawal",
transaction_status = "$failure",
payment_method = new PaymentMethod
{
payment_type = "$credit_card",
card_bin = "542486",
card_last4 = "4444",
card_bin_country = "US",
card_brand = "Visa",
card_type = "Gold"
}
};

EventRequest eventRequest = new EventRequest()
{
Event = transaction
};
EventResponse res = sift.SendAsync(eventRequest).Result;
Assert.Equal("0", res.Status.ToString());
}

}
}
3 changes: 2 additions & 1 deletion Test.Integration.Net7/EventsAPI/Wagers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public void WagerTest()
wager_type = "$parlay",
wager_status = "$accept",
amount = 5000,
currency_code = "USD",
currency_code = "EUR",
amount_usd = 6000,
minimum_wager_amount = 100L,
wager_event_type = "NBA",
wager_event_name = "Bulls-Lakers",
Expand Down
54 changes: 54 additions & 0 deletions Test.Integration.NetFx48/EventsAPI/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,59 @@ public void OrderStatus()
EventResponse res = sift.SendAsync(eventRequest).Result;
Assert.Equal("0", res.Status.ToString());
}

[Fact]
public void UpdateOrderEventWithItemBookingDiscountPricesInUsdTest()
{
var sift = new Client(ApiKey);

var updateOrder = new UpdateOrder
{
user_id = UserId,
session_id = SessionId,
order_id = OrderId,
amount = 100000,
currency_code = "EUR",
amount_usd = 120000,
items = new ObservableCollection<Item>()
{
new Item()
{
price = 100000,
currency_code = "EUR",
price_usd = 120000
}
},
bookings = new ObservableCollection<Booking>()
{
new Booking()
{
booking_type = "$flight",
price = 100000,
currency_code = "EUR",
price_usd = 120000
}
},
promotions = new ObservableCollection<Promotion>()
{
new Promotion()
{
discount = new Discount()
{
amount = 100000,
currency_code = "EUR",
amount_usd = 120000
}
}
}
};

EventRequest eventRequest = new EventRequest()
{
Event = updateOrder
};
EventResponse res = sift.SendAsync(eventRequest).Result;
Assert.Equal("0", res.Status.ToString());
}
}
}
Loading
Loading