Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

111 Commits

Repository files navigation

SiftScienceNet

SiftScienceNet is a .NET class library that provides an easy-to-use async interface for the SiftScience SiftScience web api.

##Installation

This package is on NuGet

Enter Install-Package SiftScienceNet into the NuGet package manager console.

##Initializing

SiftScienceClientsiftClient=newSiftScienceClient("<Your Api key>");

Than to create an events

varresponse=awaitsiftClient.CreateOrder(newOrder{ ...});

##Sending events to Siftscience

SiftScience events api

###Create Order

varresponse=siftClient.CreateOrder(newOrder{Amount=1000000,BillingAddress=newAddress{Address1="190 Mulhouse street",Address2="Unit 5",City="Sydney",Country="AU",FullName="Mathieu Kempe",Region="NSW",ZipCode="2021"},ShippingAddress=newAddress{Address1="address1",Address2="address2",City="Sydney",Country="AU",FullName="Mathieu kempe",Region="NSW",ZipCode="2021"},CurrencyCode="USD",Items=newList<Item>{newItem{Category="digital",CurrencyCode="USD",Tags=newList<string>{"tag1","tag2","tag3"},Quantity=4,Brand="brand",Color="red",Isbn="isbn",ItemId="12334",Manufacturer="rebok",Price=100000000,ProductTitle="Some product",Size="Large",Sku="V4C3D5R2Z6",Upc="654321",}},UserId="mathieukempe@gmail.com",UserEmail="mathieukempe@somemail.com",OrderId="12234",SellerUserId="4",ExpeditedShipping=false,PaymentMethods=newList<PaymentMethod>{newPaymentMethod{CardBin="123456",CardLast4="1234",PaymentType=PaymentType.CreditCard}},}).Result;

###Transaction

varresponse=siftClient.Transaction(newTransaction{Amount=100M.ToMicros(),BillingAddress=newAddress{Address1="312 Mulhouse street",Address2="Unit 123",City="Sydney",Country="AU",FullName="Mathieu kempe",Region="NSW",ZipCode="2021"},CurrencyCode="AUD",UserId="1",OrderId="234423",SessionId="u4ryixmnkwxm1aviiyq4yez1",ShippingAddress=newAddress{Address1="312 Mulhouse street",Address2="Unit 123",City="Sydney",Country="AU",FullName="Mathieu kempe",Region="NSW",ZipCode="2021"},PaymentMethod=newPaymentMethod{CardBin="123456",CardLast4="1234",PaymentType=PaymentType.CreditCard,AvsResultCode="T",PaymentGateway=PaymentGateway.Paypal,},TransactionStatus=Status.Success,TransactionType=TransactionType.Capture,UserEmail="mathieukempe@somemail.com",TransactionId="234423"}).Result;

###Create account

siftClient.CreateAccount(newAccount{UserId="1",UserEmail="mathieu@selz.com",SessionId="54f3ds25423523gfdsgf4gfds",Name="Mathieu Kempe",SocialSignOn=SocialSignOn.Facebook,BillingAddress=newAddress{City="Mulhouse",Country="FR"}}).Result;

###Update account

siftClient.UpdateAccount(newAccount{UserId="1",UserEmail="mathieukempe@somemail.com",SessionId="54f3ds25423523gfdsgf4gfds",Name="Mathieu Kempe",BillingAddress=newAddress{Address1="address1",Address2="address2",City="Sydney",Country="AU",FullName="Mathieu kempe",Region="NSW",ZipCode="2021"},ChangedPassword=true}).Result;

###Add item to cart

siftClient.AddItemToCart("1",newItem{Category="digital",CurrencyCode="USD",Tags=newList<string>{"tag1","tag2","tag3"},Quantity=4,Brand="brand",Color="red",Isbn="isbn",ItemId="12334",Manufacturer="reebok",Price=100000000,ProductTitle="Some product",Size="Large",Sku="2342",Upc="234423",},"54f3ds25423523gfdsgf4gfds").Result;

###Remove item from cart

siftClient.RemoveItemToCart("1",newItem{Category="digital",CurrencyCode="USD",Tags=newList<string>{"tag1","tag2","tag3"},Quantity=4,Brand="brand",Color="red",Isbn="isbn",ItemId="12334",Manufacturer="reybok",Price=100000000,ProductTitle="Some product",Size="Large",Sku="2342",Upc="234423",},1,"54f3ds25423523gfdsgf4gfds").Result;

###Send message

siftClient.SendMessage("1","4","some subject","hello ").Result;

###Login (Success)

siftClient.Login("1","u4ryixmnkwxm1aviiyq4yez1",true).Result;

###Login (Failure)

siftClient.Login("1","u4ryixmnkwxm1aviiyq4yez1",false).Result;

###Logout

siftClient.Logout("1").Result;

###Link user to session

siftClient.LinkSessionToUser("1","u4ryixmnkwxm1aviiyq4yez1").Result;

##Label users in Siftscience

SiftScience labels api

siftClient.Label("1",true,newList<Reason>{Reason.Chargeback,Reason.Funneling}).Result;

##User score from Siftscience

SiftScience scores api

ScoreResponsescoreResponse=siftClient.GetSiftScore("1").Result;

##Sending Historical data

SiftScience sending historical data

Order, Transaction and Account have a Time property

varresponse=siftClient.CreateOrder(newOrder{Time=DateTime.Now.AddDays(-4).ToUnixTime()
...

About

SiftScienceNet is a .NET class library that provides an easy-to-use interface for the SiftScience web api.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages