From a63a41f923c664034e003873ee31dc29ffc3ed25 Mon Sep 17 00:00:00 2001 From: Artem Dvornichenko Date: Wed, 3 Dec 2025 16:25:34 +0200 Subject: [PATCH 1/4] API-8577: Add support for $ip field --- Sift/Schema/add_item_to_cart.json | 3 + Sift/Schema/add_promotion.json | 3 + Sift/Schema/chargeback.json | 3 + Sift/Schema/content_status.json | 4 +- Sift/Schema/create_account.json | 3 + Sift/Schema/create_order.json | 3 + Sift/Schema/flag_content.json | 3 + Sift/Schema/link_session_to_user.json | 3 + Sift/Schema/logout.json | 3 + Sift/Schema/order_status.json | 3 + Sift/Schema/remove_item_from_cart.json | 4 +- Sift/Schema/security_notification.json | 3 + Sift/Schema/transaction.json | 3 + Sift/Schema/update_account.json | 3 + Sift/Schema/update_order.json | 4 +- Sift/Schema/verification.json | 3 + Test.Integration.Net/EventsAPI/Account.cs | 6 +- Test.Integration.Net/EventsAPI/Cart.cs | 6 +- Test.Integration.Net/EventsAPI/Chargebacks.cs | 3 +- Test.Integration.Net/EventsAPI/Contents.cs | 6 +- Test.Integration.Net/EventsAPI/LoginLogout.cs | 3 +- .../EventsAPI/Notifications.cs | 3 +- Test.Integration.Net/EventsAPI/Order.cs | 9 ++- Test.Integration.Net/EventsAPI/Promotions.cs | 3 +- Test.Integration.Net/EventsAPI/Sessions.cs | 3 +- .../EventsAPI/Transactions.cs | 3 +- .../EventsAPI/Verifications.cs | 3 +- Test/Test.cs | 65 +++++++++++-------- 28 files changed, 119 insertions(+), 45 deletions(-) diff --git a/Sift/Schema/add_item_to_cart.json b/Sift/Schema/add_item_to_cart.json index 629db807..bc84c276 100644 --- a/Sift/Schema/add_item_to_cart.json +++ b/Sift/Schema/add_item_to_cart.json @@ -46,6 +46,9 @@ }, "$verification_phone_number": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/add_promotion.json b/Sift/Schema/add_promotion.json index d2fb0b15..db8f0c2c 100644 --- a/Sift/Schema/add_promotion.json +++ b/Sift/Schema/add_promotion.json @@ -44,6 +44,9 @@ }, "$verification_phone_number": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/chargeback.json b/Sift/Schema/chargeback.json index f9d4b4e6..afb1c0bd 100644 --- a/Sift/Schema/chargeback.json +++ b/Sift/Schema/chargeback.json @@ -46,6 +46,9 @@ }, "$ach_return_code": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/content_status.json b/Sift/Schema/content_status.json index e0572d19..c4aa54ea 100644 --- a/Sift/Schema/content_status.json +++ b/Sift/Schema/content_status.json @@ -44,9 +44,11 @@ "$user_email": { "type": [ "string", "null" ] }, - "$verification_phone_number": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/create_account.json b/Sift/Schema/create_account.json index beacf7d5..ebd1a4c3 100644 --- a/Sift/Schema/create_account.json +++ b/Sift/Schema/create_account.json @@ -82,6 +82,9 @@ }, "$verification_phone_number": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/create_order.json b/Sift/Schema/create_order.json index 985bd32d..a971cc09 100644 --- a/Sift/Schema/create_order.json +++ b/Sift/Schema/create_order.json @@ -117,6 +117,9 @@ "$shipping_tracking_numbers": { "type": [ "array", "null" ], "items": { "type": "string" } + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/flag_content.json b/Sift/Schema/flag_content.json index 669e2622..274bf8f4 100644 --- a/Sift/Schema/flag_content.json +++ b/Sift/Schema/flag_content.json @@ -40,6 +40,9 @@ }, "$verification_phone_number": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/link_session_to_user.json b/Sift/Schema/link_session_to_user.json index c18cb300..9d982920 100644 --- a/Sift/Schema/link_session_to_user.json +++ b/Sift/Schema/link_session_to_user.json @@ -25,6 +25,9 @@ { "$ref": "ComplexTypes/browser.json" }, { "type": "null" } ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/logout.json b/Sift/Schema/logout.json index b6d32dde..9f6f9a74 100644 --- a/Sift/Schema/logout.json +++ b/Sift/Schema/logout.json @@ -31,6 +31,9 @@ }, "$site_domain": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/order_status.json b/Sift/Schema/order_status.json index 6ba105a2..1761dd6d 100644 --- a/Sift/Schema/order_status.json +++ b/Sift/Schema/order_status.json @@ -55,6 +55,9 @@ }, "$site_domain": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/remove_item_from_cart.json b/Sift/Schema/remove_item_from_cart.json index 00d40677..350038bb 100644 --- a/Sift/Schema/remove_item_from_cart.json +++ b/Sift/Schema/remove_item_from_cart.json @@ -44,9 +44,11 @@ "$user_email": { "type": [ "string", "null" ] }, - "$verification_phone_number": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/security_notification.json b/Sift/Schema/security_notification.json index b150ffc7..d66e24b0 100644 --- a/Sift/Schema/security_notification.json +++ b/Sift/Schema/security_notification.json @@ -43,6 +43,9 @@ }, "$site_domain": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/transaction.json b/Sift/Schema/transaction.json index d8155b89..8c9e9e7a 100644 --- a/Sift/Schema/transaction.json +++ b/Sift/Schema/transaction.json @@ -136,6 +136,9 @@ "$verification_phone_number": { "type": [ "string", "null" ] }, + "$ip": { + "type": [ "string", "null" ] + }, "$minimum_deposit_amount": { "type": [ "integer", "null" ], "format": "long" diff --git a/Sift/Schema/update_account.json b/Sift/Schema/update_account.json index 599ee762..0c48edcf 100644 --- a/Sift/Schema/update_account.json +++ b/Sift/Schema/update_account.json @@ -85,6 +85,9 @@ "$promotions": { "type": [ "array", "null" ], "items": { "$ref": "ComplexTypes/promotion.json" } + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Sift/Schema/update_order.json b/Sift/Schema/update_order.json index e55464ba..e4e133ed 100644 --- a/Sift/Schema/update_order.json +++ b/Sift/Schema/update_order.json @@ -116,8 +116,10 @@ { "$ref": "ComplexTypes/merchant_profile.json" }, { "type": "null" } ] + }, + "$ip": { + "type": [ "string", "null" ] } - } } \ No newline at end of file diff --git a/Sift/Schema/verification.json b/Sift/Schema/verification.json index c5b9df4f..6f9c1c96 100644 --- a/Sift/Schema/verification.json +++ b/Sift/Schema/verification.json @@ -52,6 +52,9 @@ }, "$site_domain": { "type": [ "string", "null" ] + }, + "$ip": { + "type": [ "string", "null" ] } } } diff --git a/Test.Integration.Net/EventsAPI/Account.cs b/Test.Integration.Net/EventsAPI/Account.cs index 72f51da9..24710040 100644 --- a/Test.Integration.Net/EventsAPI/Account.cs +++ b/Test.Integration.Net/EventsAPI/Account.cs @@ -115,7 +115,8 @@ public void CreateAccount() zipcode = "03257" } - } + }, + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { @@ -217,7 +218,8 @@ public void UpdateAccount() zipcode = "03257" } - } + }, + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { diff --git a/Test.Integration.Net/EventsAPI/Cart.cs b/Test.Integration.Net/EventsAPI/Cart.cs index 881d173a..103b6106 100644 --- a/Test.Integration.Net/EventsAPI/Cart.cs +++ b/Test.Integration.Net/EventsAPI/Cart.cs @@ -53,7 +53,8 @@ public void AddItemToCartEvent() brand_name = "sift", site_country = "US", site_domain = "sift.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() @@ -99,7 +100,8 @@ public void RemoveItemFromCart() brand_name = "sift", site_country = "US", site_domain = "sift.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() diff --git a/Test.Integration.Net/EventsAPI/Chargebacks.cs b/Test.Integration.Net/EventsAPI/Chargebacks.cs index 50f29c97..9ef2b6b0 100644 --- a/Test.Integration.Net/EventsAPI/Chargebacks.cs +++ b/Test.Integration.Net/EventsAPI/Chargebacks.cs @@ -47,7 +47,8 @@ public void ChargebackTest() zipcode = "03257" } - } + }, + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { diff --git a/Test.Integration.Net/EventsAPI/Contents.cs b/Test.Integration.Net/EventsAPI/Contents.cs index aadc4c3a..3fde6437 100644 --- a/Test.Integration.Net/EventsAPI/Contents.cs +++ b/Test.Integration.Net/EventsAPI/Contents.cs @@ -526,7 +526,8 @@ private EventResponse FlagContent(Client sift) content_id = ContentId, flagged_by = FlaggedBy, reason = "$toxic", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { @@ -553,7 +554,8 @@ private EventResponse ContentStatus(Client sift) brand_name = "sift", site_country = "US", site_domain = "sift.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() diff --git a/Test.Integration.Net/EventsAPI/LoginLogout.cs b/Test.Integration.Net/EventsAPI/LoginLogout.cs index 99bcdfa8..5ed1ad4a 100644 --- a/Test.Integration.Net/EventsAPI/LoginLogout.cs +++ b/Test.Integration.Net/EventsAPI/LoginLogout.cs @@ -69,7 +69,8 @@ public void Logout() }, brand_name = "sift", site_domain = "sift.com", - site_country = "US" + site_country = "US", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { diff --git a/Test.Integration.Net/EventsAPI/Notifications.cs b/Test.Integration.Net/EventsAPI/Notifications.cs index fa368208..74b58f7a 100644 --- a/Test.Integration.Net/EventsAPI/Notifications.cs +++ b/Test.Integration.Net/EventsAPI/Notifications.cs @@ -37,7 +37,8 @@ public void SecurityNotificationTest() }, brand_name = "sift", site_domain = "sift.com", - site_country = "US" + site_country = "US", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { diff --git a/Test.Integration.Net/EventsAPI/Order.cs b/Test.Integration.Net/EventsAPI/Order.cs index 338ec6bc..a3898b83 100644 --- a/Test.Integration.Net/EventsAPI/Order.cs +++ b/Test.Integration.Net/EventsAPI/Order.cs @@ -174,7 +174,8 @@ private EventResponse CreateOrder(Client sift) user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", accept_language = "en-US", content_language = "en-GB" - } + }, + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { @@ -297,7 +298,8 @@ private EventResponse UpdateOrder(Client sift) user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", accept_language = "en-US", content_language = "en-GB" - } + }, + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { @@ -327,7 +329,8 @@ private EventResponse OrderStatus(Client sift) }, brand_name = "sift", site_country = "US", - site_domain = "sift.com" + site_domain = "sift.com", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { diff --git a/Test.Integration.Net/EventsAPI/Promotions.cs b/Test.Integration.Net/EventsAPI/Promotions.cs index c8305088..053c8167 100644 --- a/Test.Integration.Net/EventsAPI/Promotions.cs +++ b/Test.Integration.Net/EventsAPI/Promotions.cs @@ -65,7 +65,8 @@ public void AddPromotionTest() brand_name = "sift", site_country = "US", site_domain = "sift.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { diff --git a/Test.Integration.Net/EventsAPI/Sessions.cs b/Test.Integration.Net/EventsAPI/Sessions.cs index b2facf99..5f4d174c 100644 --- a/Test.Integration.Net/EventsAPI/Sessions.cs +++ b/Test.Integration.Net/EventsAPI/Sessions.cs @@ -23,7 +23,8 @@ public void LinkSessionToUserTest() var linkSessionToUser = new LinkSessionToUser { user_id = UserId, - session_id = SessionId + session_id = SessionId, + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { diff --git a/Test.Integration.Net/EventsAPI/Transactions.cs b/Test.Integration.Net/EventsAPI/Transactions.cs index 9dc52463..d02eb8b6 100644 --- a/Test.Integration.Net/EventsAPI/Transactions.cs +++ b/Test.Integration.Net/EventsAPI/Transactions.cs @@ -175,7 +175,8 @@ public void TransactionTest() digital_asset = "BTC" } }, - receiver_external_address = true + receiver_external_address = true, + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { diff --git a/Test.Integration.Net/EventsAPI/Verifications.cs b/Test.Integration.Net/EventsAPI/Verifications.cs index 030cc19a..fe0d2941 100644 --- a/Test.Integration.Net/EventsAPI/Verifications.cs +++ b/Test.Integration.Net/EventsAPI/Verifications.cs @@ -41,7 +41,8 @@ public void VerificationTest() reason = "$user_setting", brand_name = "sift", site_domain = "sift.com", - site_country = "US" + site_country = "US", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() { diff --git a/Test/Test.cs b/Test/Test.cs index 2c519bb3..25017e8b 100644 --- a/Test/Test.cs +++ b/Test/Test.cs @@ -155,7 +155,8 @@ public void TestEventRequest() }, site_country = "US", site_domain = "sift.com", - brand_name = "sift" + brand_name = "sift", + ip = "1.2.3.4" }; // Augment with custom fields @@ -178,7 +179,7 @@ public void TestEventRequest() "\"$app_version\":\"1.0\",\"$client_language\":\"en-US\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\"," + "\"$ordered_from\":{\"$store_id\":\"123\",\"$store_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\"," + "\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\"," + - "\"$phone\":\"1-415-555-6040\"}},\"foo\":\"bar\"}", + "\"$phone\":\"1-415-555-6040\"}},\"$ip\":\"1.2.3.4\",\"foo\":\"bar\"}", createOrder.ToJson()); @@ -284,14 +285,15 @@ public void TestTransactionEvent() session_id = sessionId, transaction_type = "$sale", transaction_status = "$failure", - decline_category = "$invalid" + decline_category = "$invalid", + ip = "1.2.3.4" }; // Augment with custom fields transaction.AddField("foo", "bar"); Assert.Equal("{\"$type\":\"$transaction\",\"$user_id\":\"test_dotnet_transaction_event\",\"$session_id\":\"sessionId\"," + "\"$transaction_type\":\"$sale\",\"$transaction_status\":\"$failure\",\"$amount\":1000000000000,\"$currency_code\":\"USD\"," + - "\"$decline_category\":\"$invalid\",\"foo\":\"bar\"}", transaction.ToJson()); + "\"$decline_category\":\"$invalid\",\"$ip\":\"1.2.3.4\",\"foo\":\"bar\"}", transaction.ToJson()); EventRequest eventRequest = new EventRequest { @@ -1112,7 +1114,8 @@ public void TestChargebackEvent() zipcode = "03257" } }, - ach_return_code = "B02" + ach_return_code = "B02", + ip = "1.2.3.4" }; // Augment with custom fields @@ -1122,7 +1125,7 @@ public void TestChargebackEvent() "\"$merchant_profile\":{\"$merchant_id\":\"123\",\"$merchant_category_code\":\"9876\",\"$merchant_name\":\"ABC Merchant\",\"$merchant_address\":" + "{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\"," + "\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6040\"}}," + - "\"$ach_return_code\":\"B02\",\"foo\":\"bar\"}", + "\"$ach_return_code\":\"B02\",\"$ip\":\"1.2.3.4\",\"foo\":\"bar\"}", chargeback.ToJson()); EventRequest eventRequest = new EventRequest @@ -1173,7 +1176,8 @@ public void TestCreateAccountEvent() zipcode = "03257" } }, - account_types = new ObservableCollection() { "merchant", "premium" } + account_types = new ObservableCollection() { "merchant", "premium" }, + ip = "1.2.3.4" }; // Augment with custom fields @@ -1184,7 +1188,7 @@ public void TestCreateAccountEvent() "\"$twitter\",\"$merchant_profile\":{\"$merchant_id\":\"123\",\"$merchant_category_code\":\"9876\",\"$merchant_name\":\"ABC Merchant\"," + "\"$merchant_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\"," + "\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6040\"}},\"$account_types\":" + - "[\"merchant\",\"premium\"],\"foo\":\"bar\"}", + "[\"merchant\",\"premium\"],\"$ip\":\"1.2.3.4\",\"foo\":\"bar\"}", createAccount.ToJson()); EventRequest eventRequest = new EventRequest @@ -1235,7 +1239,8 @@ public void TestUpdateAccountEvent() zipcode = "03257" } }, - account_types = new ObservableCollection() { "merchant", "premium" } + account_types = new ObservableCollection() { "merchant", "premium" }, + ip = "1.2.3.4" }; // Augment with custom fields @@ -1246,7 +1251,7 @@ public void TestUpdateAccountEvent() "\"$twitter\",\"$merchant_profile\":{\"$merchant_id\":\"123\",\"$merchant_category_code\":\"9876\",\"$merchant_name\":\"ABC Merchant\"," + "\"$merchant_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":" + "\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6040\"}}," + - "\"$account_types\":[\"merchant\",\"premium\"],\"foo\":\"bar\"}", + "\"$account_types\":[\"merchant\",\"premium\"],\"$ip\":\"1.2.3.4\",\"foo\":\"bar\"}", updateAccount.ToJson()); EventRequest eventRequest = new EventRequest @@ -1895,10 +1900,11 @@ public void TestAdditemtocartEvent() site_country = "US", site_domain = "sift.com", user_email = "billjones1@example.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; - string addItemToCartBody = "{\"$type\":\"$add_item_to_cart\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$item\":{\"$item_id\":\"B004834GQO\",\"$product_title\":\"The Slanket Blanket-Texas Tea\",\"$price\":39990000,\"$currency_code\":\"USD\",\"$quantity\":16,\"$upc\":\"6786211451001\",\"$sku\":\"004834GQ\",\"$isbn\":\"0446576220\",\"$brand\":\"Slanket\",\"$manufacturer\":\"Slanket\",\"$category\":\"Blankets & Throws\",\"$tags\":[\"Awesome\",\"Wintertime specials\"],\"$color\":\"Texas Tea\"},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"billjones1@example.com\",\"$verification_phone_number\":\"+123456789012\"}"; + string addItemToCartBody = "{\"$type\":\"$add_item_to_cart\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$item\":{\"$item_id\":\"B004834GQO\",\"$product_title\":\"The Slanket Blanket-Texas Tea\",\"$price\":39990000,\"$currency_code\":\"USD\",\"$quantity\":16,\"$upc\":\"6786211451001\",\"$sku\":\"004834GQ\",\"$isbn\":\"0446576220\",\"$brand\":\"Slanket\",\"$manufacturer\":\"Slanket\",\"$category\":\"Blankets & Throws\",\"$tags\":[\"Awesome\",\"Wintertime specials\"],\"$color\":\"Texas Tea\"},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"billjones1@example.com\",\"$verification_phone_number\":\"+123456789012\",\"$ip\":\"1.2.3.4\"}"; Assert.Equal(addItemToCartBody, addItemToCart.ToJson()); @@ -1964,10 +1970,11 @@ public void TestAddPromotionEvent() site_country = "US", site_domain = "sift.com", user_email = "billjones1@example.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; - string addPromotionbody = "{\"$type\":\"$add_promotion\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$promotions\":[{\"$promotion_id\":\"NewCustomerReferral2016\",\"$status\":\"$success\",\"$failure_reason\":\"$already_used\",\"$description\":\"$5 off your first 5 rides\",\"$referrer_user_id\":\"elon-m93903\",\"$discount\":{\"$percentage_off\":0.2,\"$amount\":5000000,\"$currency_code\":\"USD\",\"$minimum_purchase_amount\":50000000},\"$credit_point\":{\"$amount\":5000,\"$credit_point_type\":\"character xp points\"}},{\"$promotion_id\":\"NewCustomerReferral2016\"}],\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"billjones1@example.com\",\"$verification_phone_number\":\"+123456789012\"}"; + string addPromotionbody = "{\"$type\":\"$add_promotion\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$promotions\":[{\"$promotion_id\":\"NewCustomerReferral2016\",\"$status\":\"$success\",\"$failure_reason\":\"$already_used\",\"$description\":\"$5 off your first 5 rides\",\"$referrer_user_id\":\"elon-m93903\",\"$discount\":{\"$percentage_off\":0.2,\"$amount\":5000000,\"$currency_code\":\"USD\",\"$minimum_purchase_amount\":50000000},\"$credit_point\":{\"$amount\":5000,\"$credit_point_type\":\"character xp points\"}},{\"$promotion_id\":\"NewCustomerReferral2016\"}],\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"billjones1@example.com\",\"$verification_phone_number\":\"+123456789012\",\"$ip\":\"1.2.3.4\"}"; Assert.Equal(addPromotionbody, addPromotion.ToJson()); @@ -2008,10 +2015,11 @@ public void TestContentStatusEvent() site_country = "US", site_domain = "sift.com", user_email = "billjones1@example.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; - string contentStatusbody = "{\"$type\":\"$content_status\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$content_id\":\"9671500641\",\"$status\":\"$paused\",\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"billjones1@example.com\",\"$verification_phone_number\":\"+123456789012\"}"; + string contentStatusbody = "{\"$type\":\"$content_status\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$content_id\":\"9671500641\",\"$status\":\"$paused\",\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"billjones1@example.com\",\"$verification_phone_number\":\"+123456789012\",\"$ip\":\"1.2.3.4\"}"; Assert.Equal(contentStatusbody, contentStatus.ToJson()); @@ -2050,10 +2058,11 @@ public void TestFlagContentEvent() accept_language = "en-US", content_language = "en-GB" }, - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; - string flagcontentbody = "{\"$type\":\"$flag_content\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$content_id\":\"9671500641\",\"$flagged_by\":\"jamieli89\",\"$reason\":\"$toxic\",\"$user_email\":\"billjones1@example.com\",\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$verification_phone_number\":\"+123456789012\"}"; + string flagcontentbody = "{\"$type\":\"$flag_content\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$content_id\":\"9671500641\",\"$flagged_by\":\"jamieli89\",\"$reason\":\"$toxic\",\"$user_email\":\"billjones1@example.com\",\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$verification_phone_number\":\"+123456789012\",\"$ip\":\"1.2.3.4\"}"; Assert.Equal(flagcontentbody, flagContent.ToJson()); @@ -2108,10 +2117,11 @@ public void TestRemoveItemFromCartEvent() site_country = "US", site_domain = "sift.com", user_email = "billjones1@example.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; - string removeitemfromcartbody = "{\"$type\":\"$remove_item_from_cart\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$item\":{\"$item_id\":\"B004834GQO\",\"$product_title\":\"The Slanket Blanket-Texas Tea\",\"$price\":39990000,\"$currency_code\":\"USD\",\"$quantity\":2,\"$upc\":\"6786211451001\",\"$sku\":\"004834GQ\",\"$isbn\":\"0446576220\",\"$brand\":\"Slanket\",\"$manufacturer\":\"Slanket\",\"$category\":\"Blankets & Throws\",\"$tags\":[\"Awesome\",\"Wintertime specials\"],\"$color\":\"Texas Tea\"},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"billjones1@example.com\",\"$verification_phone_number\":\"+123456789012\"}"; + string removeitemfromcartbody = "{\"$type\":\"$remove_item_from_cart\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$item\":{\"$item_id\":\"B004834GQO\",\"$product_title\":\"The Slanket Blanket-Texas Tea\",\"$price\":39990000,\"$currency_code\":\"USD\",\"$quantity\":2,\"$upc\":\"6786211451001\",\"$sku\":\"004834GQ\",\"$isbn\":\"0446576220\",\"$brand\":\"Slanket\",\"$manufacturer\":\"Slanket\",\"$category\":\"Blankets & Throws\",\"$tags\":[\"Awesome\",\"Wintertime specials\"],\"$color\":\"Texas Tea\"},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"billjones1@example.com\",\"$verification_phone_number\":\"+123456789012\",\"$ip\":\"1.2.3.4\"}"; Assert.Equal(removeitemfromcartbody, removeItemFromCart.ToJson()); @@ -2249,9 +2259,10 @@ public void TestCreateOrderEvent() user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", accept_language = "en-US", content_language = "en-GB" - } + }, + ip = "1.2.3.4" }; - string createorderbody = "{\"$type\":\"$create_order\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$order_id\":\"ORDER-28168441\",\"$user_email\":\"billjones1@example.com\",\"$amount\":115940000,\"$currency_code\":\"USD\",\"$billing_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$payment_methods\":[{\"$payment_type\":\"$credit_card\",\"$payment_gateway\":\"$braintree\",\"$card_bin\":\"542486\",\"$card_last4\":\"4444\"},{\"$payment_type\":\"$credit_card\"}],\"$shipping_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$expedited_shipping\":true,\"$items\":[{\"$item_id\":\"12344321\",\"$product_title\":\"Microwavable Kettle Corn: Original Flavor\",\"$price\":4990000,\"$currency_code\":\"USD\",\"$quantity\":4,\"$upc\":\"097564307560\",\"$sku\":\"03586005\",\"$isbn\":\"0446576220\",\"$brand\":\"Peters Kettle Corn\",\"$manufacturer\":\"Peters Kettle Corn\",\"$category\":\"Food and Grocery\",\"$tags\":[\"Popcorn\",\"Snacks\",\"On Sale\"],\"$color\":\"Texas Tea\"},{\"$item_id\":\"12344321\"}],\"$seller_user_id\":\"slinkys_emporium\",\"$promotions\":[{\"$promotion_id\":\"FirstTimeBuyer\",\"$status\":\"$success\",\"$description\":\"$5 off\",\"$discount\":{\"$amount\":5000000,\"$currency_code\":\"USD\",\"$minimum_purchase_amount\":25000000}}],\"$shipping_method\":\"$physical\",\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$ordered_from\":{\"$store_id\":\"123\",\"$store_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6040\"}},\"$verification_phone_number\":\"+123456789012\",\"$shipping_carrier\":\"UPS\",\"$shipping_tracking_numbers\":[\"1Z204E380338943508\",\"1Z204E380338943509\"]}"; + string createorderbody = "{\"$type\":\"$create_order\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$order_id\":\"ORDER-28168441\",\"$user_email\":\"billjones1@example.com\",\"$amount\":115940000,\"$currency_code\":\"USD\",\"$billing_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$payment_methods\":[{\"$payment_type\":\"$credit_card\",\"$payment_gateway\":\"$braintree\",\"$card_bin\":\"542486\",\"$card_last4\":\"4444\"},{\"$payment_type\":\"$credit_card\"}],\"$shipping_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$expedited_shipping\":true,\"$items\":[{\"$item_id\":\"12344321\",\"$product_title\":\"Microwavable Kettle Corn: Original Flavor\",\"$price\":4990000,\"$currency_code\":\"USD\",\"$quantity\":4,\"$upc\":\"097564307560\",\"$sku\":\"03586005\",\"$isbn\":\"0446576220\",\"$brand\":\"Peters Kettle Corn\",\"$manufacturer\":\"Peters Kettle Corn\",\"$category\":\"Food and Grocery\",\"$tags\":[\"Popcorn\",\"Snacks\",\"On Sale\"],\"$color\":\"Texas Tea\"},{\"$item_id\":\"12344321\"}],\"$seller_user_id\":\"slinkys_emporium\",\"$promotions\":[{\"$promotion_id\":\"FirstTimeBuyer\",\"$status\":\"$success\",\"$description\":\"$5 off\",\"$discount\":{\"$amount\":5000000,\"$currency_code\":\"USD\",\"$minimum_purchase_amount\":25000000}}],\"$shipping_method\":\"$physical\",\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$ordered_from\":{\"$store_id\":\"123\",\"$store_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6040\"}},\"$verification_phone_number\":\"+123456789012\",\"$shipping_carrier\":\"UPS\",\"$shipping_tracking_numbers\":[\"1Z204E380338943508\",\"1Z204E380338943509\"],\"$ip\":\"1.2.3.4\"}"; Assert.Equal(createorderbody, createOrder.ToJson()); @@ -2406,9 +2417,10 @@ public void TestUpdateOrderEvent() zipcode = "03257" } - } + }, + ip = "1.2.3.4" }; - string updateorderbody = "{\"$type\":\"$update_order\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$order_id\":\"ORDER-28168441\",\"$user_email\":\"billjones1@example.com\",\"$amount\":115940000,\"$currency_code\":\"USD\",\"$billing_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$payment_methods\":[{\"$payment_type\":\"$credit_card\",\"$payment_gateway\":\"$braintree\",\"$card_bin\":\"542486\",\"$card_last4\":\"4444\"},{\"$payment_type\":\"$credit_card\"}],\"$shipping_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$expedited_shipping\":true,\"$items\":[{\"$item_id\":\"12344321\",\"$product_title\":\"Microwavable Kettle Corn: Original Flavor\",\"$price\":4990000,\"$currency_code\":\"USD\",\"$quantity\":4,\"$upc\":\"097564307560\",\"$sku\":\"03586005\",\"$isbn\":\"0446576220\",\"$brand\":\"Peters Kettle Corn\",\"$manufacturer\":\"Peters Kettle Corn\",\"$category\":\"Food and Grocery\",\"$tags\":[\"Popcorn\",\"Snacks\",\"On Sale\"],\"$color\":\"Texas Tea\"},{\"$item_id\":\"12344321\"}],\"$seller_user_id\":\"slinkys_emporium\",\"$promotions\":[{\"$promotion_id\":\"FirstTimeBuyer\",\"$status\":\"$success\",\"$description\":\"$5 off\",\"$discount\":{\"$amount\":5000000,\"$currency_code\":\"USD\",\"$minimum_purchase_amount\":25000000}}],\"$shipping_method\":\"$physical\",\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$ordered_from\":{\"$store_id\":\"123\",\"$store_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6040\"}},\"$verification_phone_number\":\"+123456789012\",\"$shipping_carrier\":\"UPS\",\"$shipping_tracking_numbers\":[\"1Z204E380338943508\",\"1Z204E380338943509\"],\"$merchant_profile\":{\"$merchant_id\":\"AX527123\",\"$merchant_category_code\":\"1234\",\"$merchant_name\":\"Dream Company\",\"$merchant_address\":{\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6040\"}}}"; + string updateorderbody = "{\"$type\":\"$update_order\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"gigtleqddo84l8cm15qe4il\",\"$order_id\":\"ORDER-28168441\",\"$user_email\":\"billjones1@example.com\",\"$amount\":115940000,\"$currency_code\":\"USD\",\"$billing_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$payment_methods\":[{\"$payment_type\":\"$credit_card\",\"$payment_gateway\":\"$braintree\",\"$card_bin\":\"542486\",\"$card_last4\":\"4444\"},{\"$payment_type\":\"$credit_card\"}],\"$shipping_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$expedited_shipping\":true,\"$items\":[{\"$item_id\":\"12344321\",\"$product_title\":\"Microwavable Kettle Corn: Original Flavor\",\"$price\":4990000,\"$currency_code\":\"USD\",\"$quantity\":4,\"$upc\":\"097564307560\",\"$sku\":\"03586005\",\"$isbn\":\"0446576220\",\"$brand\":\"Peters Kettle Corn\",\"$manufacturer\":\"Peters Kettle Corn\",\"$category\":\"Food and Grocery\",\"$tags\":[\"Popcorn\",\"Snacks\",\"On Sale\"],\"$color\":\"Texas Tea\"},{\"$item_id\":\"12344321\"}],\"$seller_user_id\":\"slinkys_emporium\",\"$promotions\":[{\"$promotion_id\":\"FirstTimeBuyer\",\"$status\":\"$success\",\"$description\":\"$5 off\",\"$discount\":{\"$amount\":5000000,\"$currency_code\":\"USD\",\"$minimum_purchase_amount\":25000000}}],\"$shipping_method\":\"$physical\",\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$ordered_from\":{\"$store_id\":\"123\",\"$store_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6040\"}},\"$verification_phone_number\":\"+123456789012\",\"$shipping_carrier\":\"UPS\",\"$shipping_tracking_numbers\":[\"1Z204E380338943508\",\"1Z204E380338943509\"],\"$merchant_profile\":{\"$merchant_id\":\"AX527123\",\"$merchant_category_code\":\"1234\",\"$merchant_name\":\"Dream Company\",\"$merchant_address\":{\"$address_1\":\"2100 Main Street\",\"$address_2\":\"Apt 3B\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6040\"}},\"$ip\":\"1.2.3.4\"}"; Assert.Equal(updateorderbody, updateOrder.ToJson()); @@ -2513,10 +2525,11 @@ public void TestVerificationEvent() reason = "$user_setting", brand_name = "xyz", site_country = "AU", - site_domain = "somehost.example.com" + site_domain = "somehost.example.com", + ip = "1.2.3.4" }; - Assert.Equal("{\"$type\":\"$verification\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"sessionId\",\"$status\":\"$pending\",\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-GB\",\"$content_language\":\"en-US\"},\"$verified_event\":\"$login\",\"$verified_entity_id\":\"123\",\"$verification_type\":\"$sms\",\"$verified_value\":\"14155551212\",\"$reason\":\"$user_setting\",\"$brand_name\":\"xyz\",\"$site_country\":\"AU\",\"$site_domain\":\"somehost.example.com\"}", + Assert.Equal("{\"$type\":\"$verification\",\"$user_id\":\"billy_jones_301\",\"$session_id\":\"sessionId\",\"$status\":\"$pending\",\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-GB\",\"$content_language\":\"en-US\"},\"$verified_event\":\"$login\",\"$verified_entity_id\":\"123\",\"$verification_type\":\"$sms\",\"$verified_value\":\"14155551212\",\"$reason\":\"$user_setting\",\"$brand_name\":\"xyz\",\"$site_country\":\"AU\",\"$site_domain\":\"somehost.example.com\",\"$ip\":\"1.2.3.4\"}", verification.ToJson()); EventRequest eventRequest = new EventRequest From 75672ae43c433c4dfe8f066fdd6a0d4dac15e1b2 Mon Sep 17 00:00:00 2001 From: Artem Dvornichenko Date: Wed, 3 Dec 2025 17:09:01 +0200 Subject: [PATCH 2/4] API-8577: Add missing fields for content events --- Sift/Schema/ComplexTypes/review.json | 3 +++ Sift/Schema/create_content.json | 3 +++ Sift/Schema/update_content.json | 6 +++++ Test.Integration.Net/EventsAPI/Contents.cs | 29 +++++++++++++++++----- Test/Test.cs | 29 ++++++++++++++++------ 5 files changed, 57 insertions(+), 13 deletions(-) diff --git a/Sift/Schema/ComplexTypes/review.json b/Sift/Schema/ComplexTypes/review.json index d63baaef..af366cf4 100644 --- a/Sift/Schema/ComplexTypes/review.json +++ b/Sift/Schema/ComplexTypes/review.json @@ -22,6 +22,9 @@ "$reviewed_content_id": { "type": [ "string", "null" ] }, + "$reviewed_user_id": { + "type": [ "string", "null" ] + }, "$rating": { "type": [ "number", "null" ] }, diff --git a/Sift/Schema/create_content.json b/Sift/Schema/create_content.json index 2bd3b1ab..ade9d88e 100644 --- a/Sift/Schema/create_content.json +++ b/Sift/Schema/create_content.json @@ -80,6 +80,9 @@ "$site_domain": { "type": [ "string", "null" ] }, + "$user_email": { + "type": [ "string", "null" ] + }, "$verification_phone_number": { "type": [ "string", "null" ] } diff --git a/Sift/Schema/update_content.json b/Sift/Schema/update_content.json index d895ecb1..2848b9e4 100644 --- a/Sift/Schema/update_content.json +++ b/Sift/Schema/update_content.json @@ -79,6 +79,12 @@ }, "$site_domain": { "type": [ "string", "null" ] + }, + "$user_email": { + "type": [ "string", "null" ] + }, + "$verification_phone_number": { + "type": [ "string", "null" ] } } } diff --git a/Test.Integration.Net/EventsAPI/Contents.cs b/Test.Integration.Net/EventsAPI/Contents.cs index 3fde6437..3041c9c2 100644 --- a/Test.Integration.Net/EventsAPI/Contents.cs +++ b/Test.Integration.Net/EventsAPI/Contents.cs @@ -140,7 +140,9 @@ public void CreateContentListing() }, brand_name = "sift", site_domain = "sift.com", - site_country = "US" + site_country = "US", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; EventRequest eventRequest = new EventRequest() { @@ -170,6 +172,8 @@ public void CreateContentMessage() brand_name = "sift", site_domain = "sift.com", site_country = "US", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012", message = new Message() { subject = "2 Bedroom Apartment for Rent", @@ -270,7 +274,9 @@ public void CreateContentPost() }, brand_name = "sift", site_domain = "sift.com", - site_country = "US" + site_country = "US", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; EventRequest eventRequest = new EventRequest() { @@ -329,7 +335,9 @@ public void CreateContentProfile() }, brand_name = "sift", site_domain = "sift.com", - site_country = "US" + site_country = "US", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; EventRequest eventRequest = new EventRequest() { @@ -396,6 +404,7 @@ public void CreateContentReview() size = "6", }, reviewed_content_id = "listing-234234", + reviewed_user_id = "fyw3989sjpqr71", rating = 4.5, images = new ObservableCollection() { @@ -413,7 +422,9 @@ public void CreateContentReview() }, brand_name = "sift", site_domain = "sift.com", - site_country = "US" + site_country = "US", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; EventRequest eventRequest = new EventRequest() { @@ -460,7 +471,9 @@ private EventResponse CreateContentComment(Client sift) }, brand_name = "sift", site_domain = "sift.com", - site_country = "US" + site_country = "US", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; EventRequest eventRequest = new EventRequest() { @@ -507,7 +520,9 @@ private EventResponse UpdateContentComment(Client sift) }, brand_name = "sift", site_domain = "sift.com", - site_country = "US" + site_country = "US", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; EventRequest eventRequest = new EventRequest() { @@ -526,6 +541,7 @@ private EventResponse FlagContent(Client sift) content_id = ContentId, flagged_by = FlaggedBy, reason = "$toxic", + user_email = "bill@gmail.com", verification_phone_number = "+123456789012", ip = "1.2.3.4" }; @@ -554,6 +570,7 @@ private EventResponse ContentStatus(Client sift) brand_name = "sift", site_country = "US", site_domain = "sift.com", + user_email = "bill@gmail.com", verification_phone_number = "+123456789012", ip = "1.2.3.4" }; diff --git a/Test/Test.cs b/Test/Test.cs index 25017e8b..35648b2d 100644 --- a/Test/Test.cs +++ b/Test/Test.cs @@ -1392,9 +1392,11 @@ public void TestUpdateContentComment() brand_name = "sift", site_country = "US", site_domain = "sift.com", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; - string updateCommentBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"comment-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$comment\":{\"$body\":\"Congrats on the new role!\",\"$contact_email\":\"alex_301@domain.com\",\"$parent_comment_id\":\"comment-23407\",\"$root_content_id\":\"listing-12923213\",\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"An old picture\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}]},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\"}"; + string updateCommentBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"comment-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$comment\":{\"$body\":\"Congrats on the new role!\",\"$contact_email\":\"alex_301@domain.com\",\"$parent_comment_id\":\"comment-23407\",\"$root_content_id\":\"listing-12923213\",\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"An old picture\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}]},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"bill@gmail.com\",\"$verification_phone_number\":\"+123456789012\"}"; Assert.Equal(updateCommentBody, updateContent.ToJson()); @@ -1508,9 +1510,11 @@ public void TestUpdateContentListing() brand_name = "sift", site_country = "US", site_domain = "sift.com", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; - string updateListingBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"listing-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$listing\":{\"$subject\":\"2 Bedroom Apartment for Rent\",\"$body\":\"Capitol Hill Seattle brand new condo. 2 bedrooms and 1 full bath.\",\"$contact_email\":\"alex_301@domain.com\",\"$contact_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$locations\":[{\"$name\":\"Bill Jones\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"Seattle\",\"$region\":\"Washington\",\"$country\":\"US\",\"$zipcode\":\"98112\",\"$phone\":\"1-415-555-6041\"},{\"$name\":\"Bill Jones\"}],\"$listed_items\":[{\"$item_id\":\"0cc175b9c0f1b6a831c399e269772661\",\"$product_title\":\"https://www.domain.com/file.png\",\"$price\":2950000000,\"$currency_code\":\"USD\",\"$quantity\":1,\"$upc\":\"6786211451001\",\"$sku\":\"abc\",\"$isbn\":\"0446576220\",\"$brand\":\"abc\",\"$manufacturer\":\"abc\",\"$category\":\"abc\",\"$tags\":[\"heat\",\"washer/dryer\"],\"$color\":\"ab\",\"$size\":\"ab\"}],\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"Billy's picture\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}],\"$expiration_time\":1549063157000},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\"}"; + string updateListingBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"listing-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$listing\":{\"$subject\":\"2 Bedroom Apartment for Rent\",\"$body\":\"Capitol Hill Seattle brand new condo. 2 bedrooms and 1 full bath.\",\"$contact_email\":\"alex_301@domain.com\",\"$contact_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$locations\":[{\"$name\":\"Bill Jones\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"Seattle\",\"$region\":\"Washington\",\"$country\":\"US\",\"$zipcode\":\"98112\",\"$phone\":\"1-415-555-6041\"},{\"$name\":\"Bill Jones\"}],\"$listed_items\":[{\"$item_id\":\"0cc175b9c0f1b6a831c399e269772661\",\"$product_title\":\"https://www.domain.com/file.png\",\"$price\":2950000000,\"$currency_code\":\"USD\",\"$quantity\":1,\"$upc\":\"6786211451001\",\"$sku\":\"abc\",\"$isbn\":\"0446576220\",\"$brand\":\"abc\",\"$manufacturer\":\"abc\",\"$category\":\"abc\",\"$tags\":[\"heat\",\"washer/dryer\"],\"$color\":\"ab\",\"$size\":\"ab\"}],\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"Billy's picture\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}],\"$expiration_time\":1549063157000},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"bill@gmail.com\",\"$verification_phone_number\":\"+123456789012\"}"; Assert.Equal(updateListingBody, updateContent.ToJson()); @@ -1572,9 +1576,11 @@ public void TestUpdateContentMessage() brand_name = "sift", site_country = "US", site_domain = "sift.com", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; - string updateMessageBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"message-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$message\":{\"$body\":\"Let’s meet at 5pm\",\"$contact_email\":\"alex_301@domain.com\",\"$root_content_id\":\"listing-123\",\"$recipient_user_ids\":[\"fy9h989sjphh71\"],\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"My hike today!\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}]},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\"}"; + string updateMessageBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"message-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$message\":{\"$body\":\"Let’s meet at 5pm\",\"$contact_email\":\"alex_301@domain.com\",\"$root_content_id\":\"listing-123\",\"$recipient_user_ids\":[\"fy9h989sjphh71\"],\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"My hike today!\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}]},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"bill@gmail.com\",\"$verification_phone_number\":\"+123456789012\"}"; Assert.Equal(updateMessageBody, updateContent.ToJson()); @@ -1667,9 +1673,11 @@ public void TestUpdateContentPost() brand_name = "sift", site_country = "US", site_domain = "sift.com", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; - string updatePostBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"post-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$post\":{\"$subject\":\"My new apartment!\",\"$body\":\"Moved into my new apartment yesterday.\",\"$contact_email\":\"alex_301@domain.com\",\"$contact_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$locations\":[{\"$name\":\"Bill Jones\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"Seattle\",\"$region\":\"Washington\",\"$country\":\"US\",\"$zipcode\":\"98112\",\"$phone\":\"1-415-555-6041\"},{\"$name\":\"Bill Jones\"}],\"$categories\":[\"Personal\"],\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"View from the window!\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}],\"$expiration_time\":1549063157000},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\"}"; + string updatePostBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"post-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$post\":{\"$subject\":\"My new apartment!\",\"$body\":\"Moved into my new apartment yesterday.\",\"$contact_email\":\"alex_301@domain.com\",\"$contact_address\":{\"$name\":\"Bill Jones\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$locations\":[{\"$name\":\"Bill Jones\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"Seattle\",\"$region\":\"Washington\",\"$country\":\"US\",\"$zipcode\":\"98112\",\"$phone\":\"1-415-555-6041\"},{\"$name\":\"Bill Jones\"}],\"$categories\":[\"Personal\"],\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"View from the window!\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}],\"$expiration_time\":1549063157000},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"bill@gmail.com\",\"$verification_phone_number\":\"+123456789012\"}"; Assert.Equal(updatePostBody, updateContent.ToJson()); @@ -1741,9 +1749,11 @@ public void TestUpdateContentProfile() brand_name = "sift", site_country = "US", site_domain = "sift.com", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; - string updateProfileBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"listing-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$profile\":{\"$body\":\"Hi! My name is Alex and I just moved to New London!\",\"$contact_email\":\"alex_301@domain.com\",\"$contact_address\":{\"$name\":\"Alex Smith\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"Alex’s picture\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}],\"$categories\":[\"Friends\",\"Long-term dating\"]},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\"}"; + string updateProfileBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"listing-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$profile\":{\"$body\":\"Hi! My name is Alex and I just moved to New London!\",\"$contact_email\":\"alex_301@domain.com\",\"$contact_address\":{\"$name\":\"Alex Smith\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"New London\",\"$region\":\"New Hampshire\",\"$country\":\"US\",\"$zipcode\":\"03257\",\"$phone\":\"1-415-555-6041\"},\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"Alex’s picture\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}],\"$categories\":[\"Friends\",\"Long-term dating\"]},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"bill@gmail.com\",\"$verification_phone_number\":\"+123456789012\"}"; Assert.Equal(updateProfileBody, updateContent.ToJson()); @@ -1818,6 +1828,7 @@ public void TestUpdateContentReview() }, reviewed_content_id = "listing-234234", + reviewed_user_id = "fyw3989sjpqr71", rating = 4.5, images = new ObservableCollection() { @@ -1842,9 +1853,11 @@ public void TestUpdateContentReview() brand_name = "sift", site_country = "US", site_domain = "sift.com", + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; - string updateReviewBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"review-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$review\":{\"$subject\":\"Amazing Tacos!\",\"$body\":\"I ate the tacos.\",\"$contact_email\":\"alex_301@domain.com\",\"$locations\":[{\"$name\":\"Bill Jones\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"Seattle\",\"$region\":\"Washington\",\"$country\":\"US\",\"$zipcode\":\"98112\",\"$phone\":\"1-415-555-6041\"},{\"$name\":\"Bill Jones\"}],\"$item_reviewed\":{\"$item_id\":\"B004834GQO\",\"$product_title\":\"The Slanket Blanket-Texas Tea\",\"$price\":39990000,\"$currency_code\":\"USD\",\"$upc\":\"6786211451001\",\"$sku\":\"004834GQ\",\"$isbn\":\"0446576220\",\"$brand\":\"Slanket\",\"$manufacturer\":\"Slanket\",\"$category\":\"Blankets & Throws\",\"$tags\":[\"Awesome\",\"Wintertime specials\"],\"$color\":\"Texas Tea\",\"$size\":\"6\"},\"$reviewed_content_id\":\"listing-234234\",\"$rating\":4.5,\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"Calamari tacos.\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}]},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\"}"; + string updateReviewBody = "{\"$type\":\"$update_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"review-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$review\":{\"$subject\":\"Amazing Tacos!\",\"$body\":\"I ate the tacos.\",\"$contact_email\":\"alex_301@domain.com\",\"$locations\":[{\"$name\":\"Bill Jones\",\"$address_1\":\"abc\",\"$address_2\":\"xyz\",\"$city\":\"Seattle\",\"$region\":\"Washington\",\"$country\":\"US\",\"$zipcode\":\"98112\",\"$phone\":\"1-415-555-6041\"},{\"$name\":\"Bill Jones\"}],\"$item_reviewed\":{\"$item_id\":\"B004834GQO\",\"$product_title\":\"The Slanket Blanket-Texas Tea\",\"$price\":39990000,\"$currency_code\":\"USD\",\"$upc\":\"6786211451001\",\"$sku\":\"004834GQ\",\"$isbn\":\"0446576220\",\"$brand\":\"Slanket\",\"$manufacturer\":\"Slanket\",\"$category\":\"Blankets & Throws\",\"$tags\":[\"Awesome\",\"Wintertime specials\"],\"$color\":\"Texas Tea\",\"$size\":\"6\"},\"$reviewed_content_id\":\"listing-234234\",\"$reviewed_user_id\":\"fyw3989sjpqr71\",\"$rating\":4.5,\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"Calamari tacos.\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}]},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$brand_name\":\"sift\",\"$site_country\":\"US\",\"$site_domain\":\"sift.com\",\"$user_email\":\"bill@gmail.com\",\"$verification_phone_number\":\"+123456789012\"}"; Assert.Equal(updateReviewBody, updateContent.ToJson()); @@ -2479,9 +2492,11 @@ public void TestCreateContentCommentEvent() accept_language = "en-US", content_language = "en-GB" }, + user_email = "bill@gmail.com", + verification_phone_number = "+123456789012" }; - string createcontentbody = "{\"$type\":\"$create_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"comment-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$comment\":{\"$body\":\"Congrats on the new role!\",\"$contact_email\":\"alex_301@domain.com\",\"$parent_comment_id\":\"comment-23407\",\"$root_content_id\":\"listing-12923213\",\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"An old picture\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}]},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"}}"; + string createcontentbody = "{\"$type\":\"$create_content\",\"$user_id\":\"fyw3989sjpqr71\",\"$content_id\":\"comment-23412\",\"$session_id\":\"a234ksjfgn435sfg\",\"$status\":\"$active\",\"$ip\":\"255.255.255.0\",\"$comment\":{\"$body\":\"Congrats on the new role!\",\"$contact_email\":\"alex_301@domain.com\",\"$parent_comment_id\":\"comment-23407\",\"$root_content_id\":\"listing-12923213\",\"$images\":[{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\",\"$link\":\"https://www.domain.com/file.png\",\"$description\":\"An old picture\"},{\"$md5_hash\":\"0cc175b9c0f1b6a831c399e269772661\"}]},\"$browser\":{\"$user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\"$accept_language\":\"en-US\",\"$content_language\":\"en-GB\"},\"$user_email\":\"bill@gmail.com\",\"$verification_phone_number\":\"+123456789012\"}"; Assert.Equal(createcontentbody, createContent.ToJson()); From 9c4ef49ab9e3ebe1d65731ebb8832bcebf6253b9 Mon Sep 17 00:00:00 2001 From: Artem Dvornichenko Date: Wed, 3 Dec 2025 20:25:15 +0200 Subject: [PATCH 3/4] API-8577: Update version and changelog --- CHANGES.MD | 8 ++++++++ Sift/Sift.csproj | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES.MD b/CHANGES.MD index c2290c77..c5ea4ebe 100644 --- a/CHANGES.MD +++ b/CHANGES.MD @@ -1,5 +1,13 @@ # CHANGES +## 1.7.0 (2025-12-03) + +### Added +- **`$ip`** field support in events +- **`$user_email`** field in `$create_content`, `$update_content` events +- **`$verification_phone_number`** field in `$update_content` event +- **`$reviewed_user_id`** field in `$review` complex type + ## 1.6.0 (2025-10-18) ### NuGet Package Updates diff --git a/Sift/Sift.csproj b/Sift/Sift.csproj index c4e250be..76009fc7 100644 --- a/Sift/Sift.csproj +++ b/Sift/Sift.csproj @@ -4,8 +4,8 @@ Sift Sift Sift - 1.6.0 - Release 1.6.0 + 1.7.0 + Release 1.7.0 netstandard2.0 Sift sift;siftscience;client;api;client;async From d035cbebbb4ddddff041ec39faa16bcd9d01c795 Mon Sep 17 00:00:00 2001 From: Artem Dvornichenko Date: Thu, 4 Dec 2025 13:18:25 +0200 Subject: [PATCH 4/4] API-8577: Update readme --- README.md | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8e4478ba..f5e2940e 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,7 @@ The official Sift .NET client, supporting .NET Standard 2.0+ -## Latest Release (v1.6.0) - -- Full Sift API v205 compliance with multi-currency support (`$exchange_rate`), enhanced payment validation (`$card_bin_metadata`), and account promotions tracking -- **Breaking:** `$iata_carrier_code` moved from `Booking` to `Segment` complex type -- iGaming API enhancements with `$wager`, `$deposit`, and `$withdrawal` transaction support +## Latest Release (v1.7.0) See [CHANGES.MD](CHANGES.MD) for full release history. @@ -150,7 +146,8 @@ var booking = new Booking site_country = "US", site_domain = "sift.com", user_email = "billjones1@example.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() @@ -208,7 +205,8 @@ var booking = new Booking site_country = "US", site_domain = "sift.com", user_email = "billjones1@example.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() @@ -242,7 +240,8 @@ var booking = new Booking site_country = "US", site_domain = "sift.com", user_email = "billjones1@example.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() @@ -274,7 +273,8 @@ var booking = new Booking accept_language = "en-US", content_language = "en-GB" }, - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() @@ -322,7 +322,8 @@ var booking = new Booking site_country = "US", site_domain = "sift.com", user_email = "billjones1@example.com", - verification_phone_number = "+123456789012" + verification_phone_number = "+123456789012", + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() @@ -453,7 +454,8 @@ var booking = new Booking user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", accept_language = "en-US", content_language = "en-GB" - } + }, + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() @@ -601,7 +603,8 @@ var booking = new Booking zipcode = "03257" } - } + }, + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest() @@ -688,7 +691,8 @@ var booking = new Booking reason = "$user_setting", brand_name = "xyz", site_country = "AU", - site_domain = "somehost.example.com" + site_domain = "somehost.example.com", + ip = "1.2.3.4" }; var sift = new Client("API_KEY"); @@ -720,6 +724,7 @@ var booking = new Booking }, user_email = "billjones1@example.com", verification_phone_number = "+123456789012", + ip = "1.2.3.4", transaction_type = "$sale", transaction_status = "$failure", decline_category = "$bank_decline", @@ -882,7 +887,8 @@ var booking = new Booking user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", accept_language = "en-US", content_language = "en-GB" - } + }, + ip = "1.2.3.4" }; EventRequest eventRequest = new EventRequest()