Fraud Prevention
using DirectScale.Disco.Extension.Hooks.FraudPrevention;
GetOrderPaymentToReview
Hook for the function that gets the OrderPayment that needs to be reviewed by Fraud Prevention integration.
public class GetOrderPaymentToReview : IHook<GetOrderPaymentToReviewHookRequest, GetOrderPaymentToReviewHookResponse>
{
public GetOrderPaymentToReview() { }
public GetOrderPaymentToReviewHookResponse Invoke(GetOrderPaymentToReviewHookRequest request, Func<GetOrderPaymentToReviewHookRequest, GetOrderPaymentToReviewHookResponse> func)
{
return func(request);
}
}
services.AddTransient<IHook<GetOrderPaymentToReviewHookRequest, GetOrderPaymentToReviewHookResponse>, GetOrderPaymentToReview>();
{
"Order": {
"BackofficeId": "string",
"LastModifiedDate": "0001-01-01T00:00:00",
"BillPhone": "string",
"CommissionDate": "0001-01-01T00:00:00",
"AssociateId": 0,
"Email": "string",
"InvoiceDate": "0001-01-01T00:00:00",
"LocalInvoiceNumber": 0,
"Name": "string",
"OrderDate": "0001-01-01T00:00:00",
"OrderType": 0,
"OrderNumber": 0,
"SpecialInstructions": "string",
"Status": "string",
"TotalBonus": 0.0,
"TotalCost": 0.0,
"TotalCV": 0.0,
"TotalQV": 0.0,
"Void": false,
"BillAddress": {
"Id": 0,
"AddressLine1": "string",
"AddressLine2": "string",
"AddressLine3": "string",
"City": "string",
"State": "string",
"PostalCode": "string",
"CountryCode": "string"
},
"PartyId": 0,
"IsPaid": false,
"IsShipped": false,
"Custom": {
"Field1": "string",
"Field2": "string",
"Field3": "string",
"Field4": "string",
"Field5": "string"
},
"CanRerun": false,
"LineItems": [],
"Packages": [],
"Totals": [],
"Payments": [],
"OrderCoupons": [],
"USDSubTotal": 0.0,
"USDTotal": 0.0,
"IsMoveable": {
"IsOrderMovable": false,
"MessageType": 0,
"Message": "string"
}
},
"Payments": null
}
{
"PaymentInfo": {
"Input1": "string",
"Input2": "string",
"Last4": "string",
"CardType": "string",
"InputMonth": 1,
"InputYear": 1900,
"SecurityCode": "string",
"Address": {
"Id": 0,
"AddressLine1": "string",
"AddressLine2": "string",
"AddressLine3": "string",
"City": "string",
"State": "string",
"PostalCode": "string",
"CountryCode": "string"
},
"MerchantId": 0,
"Amount": 0.0,
"CurrencyCode": "string",
"OrderPaymentId": 0,
"RedirectUrl": "string",
"PaymentMethodId": "string",
"ProfileType": 0,
"FraudPreventionData": {
"FraudPreventionId": "string",
"FraudPreventionProviderId": "string",
"FraudPreventionType": 0,
"IpAddress": "string"
},
"ExpireDate": "0001-01-01T00:00:00"
}
}
GetPreCheck
Hook for the function that checks a payment before it's processed to see if it looks fraudulent.
public class GetPreCheck : IHook<GetPreCheckHookRequest, GetPreCheckHookResponse>
{
public GetPreCheck() { }
public GetPreCheckHookResponse Invoke(GetPreCheckHookRequest request, Func<GetPreCheckHookRequest, GetPreCheckHookResponse> func)
{
return func(request);
}
}
services.AddTransient<IHook<GetPreCheckHookRequest, GetPreCheckHookResponse>, GetPreCheck>();
{
"Order": {
"BackofficeId": "string",
"LastModifiedDate": "0001-01-01T00:00:00",
"BillPhone": "string",
"CommissionDate": "0001-01-01T00:00:00",
"AssociateId": 0,
"Email": "string",
"InvoiceDate": "0001-01-01T00:00:00",
"LocalInvoiceNumber": 0,
"Name": "string",
"OrderDate": "0001-01-01T00:00:00",
"OrderType": 0,
"OrderNumber": 0,
"SpecialInstructions": "string",
"Status": "string",
"TotalBonus": 0.0,
"TotalCost": 0.0,
"TotalCV": 0.0,
"TotalQV": 0.0,
"Void": false,
"BillAddress": {
"Id": 0,
"AddressLine1": "string",
"AddressLine2": "string",
"AddressLine3": "string",
"City": "string",
"State": "string",
"PostalCode": "string",
"CountryCode": "string"
},
"PartyId": 0,
"IsPaid": false,
"IsShipped": false,
"Custom": {
"Field1": "string",
"Field2": "string",
"Field3": "string",
"Field4": "string",
"Field5": "string"
},
"CanRerun": false,
"LineItems": [],
"Packages": [],
"Totals": [],
"Payments": [],
"OrderCoupons": [],
"USDSubTotal": 0.0,
"USDTotal": 0.0,
"IsMoveable": {
"IsOrderMovable": false,
"MessageType": 0,
"Message": "string"
}
},
"ShipMethodId": 0,
"LanguageCode": "string",
"payments": [
{
"Input1": "string",
"Input2": "string",
"Last4": "string",
"CardType": "string",
"InputMonth": 1,
"InputYear": 1900,
"SecurityCode": "string",
"Address": {
"Id": 0,
"AddressLine1": "string",
"AddressLine2": "string",
"AddressLine3": "string",
"City": "string",
"State": "string",
"PostalCode": "string",
"CountryCode": "string"
},
"MerchantId": 0,
"Amount": 0.0,
"CurrencyCode": "string",
"OrderPaymentId": 0,
"RedirectUrl": "string",
"PaymentMethodId": "string",
"ProfileType": 0,
"FraudPreventionData": {
"FraudPreventionId": "string",
"FraudPreventionProviderId": "string",
"FraudPreventionType": 0,
"IpAddress": "string"
},
"ExpireDate": "0001-01-01T00:00:00"
}
]
}
{
"Status": 0,
"Payment": {
"PaymentType": "string",
"AuthorizationCode": "string",
"Response": "string",
"ResponseId": "string",
"TransactionNumber": "string",
"ReferenceNumber": "string",
"Status": 0,
"Amount": 0.0,
"Currency": "string",
"Merchant": 0,
"FraudPreventionId": "string",
"FraudPreventionProviderId": null,
"OrderNumber": 0,
"Redirect": false,
"RedirectURL": "string",
"SpecialInstructionsURL": "string",
"SavedPaymentId": null
}
}
ParseCallbackData
When an order is flagged to be checked for fraud, it needs to pass to another service. When that service is finished it'll call the CallbackData()
function. This is a hook for parsing that callback data.
public class ParseCallbackData : IHook<ParseCallbackDataHookRequest, ParseCallbackDataHookResponse>
{
public ParseCallbackData() { }
public ParseCallbackDataHookResponse Invoke(ParseCallbackDataHookRequest request, Func<ParseCallbackDataHookRequest, ParseCallbackDataHookResponse> func)
{
return func(request);
}
}
services.AddTransient<IHook<ParseCallbackDataHookRequest, ParseCallbackDataHookResponse>, ParseCallbackData>();
{
"CallbackData": {}
}
{
"Data": null
}
GetFraudPreventionInfo
Hook for the function that gets the fraud prevention provider information. Such as providerId
.
public class GetFraudPreventionInfo : IHook<GetFraudPreventionInfoHookRequest, GetFraudPreventionInfoHookResponse>
{
public GetFraudPreventionInfo() { }
public GetFraudPreventionInfoHookResponse Invoke(GetFraudPreventionInfoHookRequest request, Func<GetFraudPreventionInfoHookRequest, GetFraudPreventionInfoHookResponse> func)
{
return func(request);
}
}
services.AddTransient<IHook<GetFraudPreventionInfoHookRequest, GetFraudPreventionInfoHookResponse>, GetFraudPreventionInfo>();
{}
{
"Info": {
"ProviderId": 0,
"ClientSideCode": "string",
"FraudPreventionId": "string"
}
}
Kount Hooks
using DirectScale.Disco.Extension.Hooks.FraudPrevention;
The following Hook is specific to Kount Fraud Prevention provider.
GetUserDefinedFields
public class GetUserDefinedFields : IHook<GetUserDefinedFieldsHookRequest, GetUserDefinedFieldsHookResponse>
{
public GetUserDefinedFields() { }
public GetUserDefinedFieldsHookResponse Invoke(GetUserDefinedFieldsHookRequest request, Func<GetUserDefinedFieldsHookRequest, GetUserDefinedFieldsHookResponse> func)
{
return func(request);
}
}
services.AddTransient<IHook<GetUserDefinedFieldsHookRequest, GetUserDefinedFieldsHookResponse>, GetUserDefinedFields>();
{
"KountMerchantId": 0,
"Order": {
"BackofficeId": "string",
"LastModifiedDate": "0001-01-01T00:00:00",
"BillPhone": "string",
"CommissionDate": "0001-01-01T00:00:00",
"AssociateId": 0,
"Email": "string",
"InvoiceDate": "0001-01-01T00:00:00",
"LocalInvoiceNumber": 0,
"Name": "string",
"OrderDate": "0001-01-01T00:00:00",
"OrderType": 0,
"OrderNumber": 0,
"SpecialInstructions": "string",
"Status": "string",
"TotalBonus": 0.0,
"TotalCost": 0.0,
"TotalCV": 0.0,
"TotalQV": 0.0,
"Void": false,
"BillAddress": {
"Id": 0,
"AddressLine1": "string",
"AddressLine2": "string",
"AddressLine3": "string",
"City": "string",
"State": "string",
"PostalCode": "string",
"CountryCode": "string"
},
"PartyId": 0,
"IsPaid": false,
"IsShipped": false,
"Custom": {
"Field1": "string",
"Field2": "string",
"Field3": "string",
"Field4": "string",
"Field5": "string"
},
"CanRerun": false,
"LineItems": [],
"Packages": [],
"Totals": [],
"Payments": [],
"OrderCoupons": [],
"USDSubTotal": 0.0,
"USDTotal": 0.0,
"IsMoveable": {
"IsOrderMovable": false,
"MessageType": 0,
"Message": "string"
}
},
"Payment": {
"Input1": "string",
"Input2": "string",
"Last4": "string",
"CardType": "string",
"InputMonth": 1,
"InputYear": 1900,
"SecurityCode": "string",
"Address": {
"Id": 0,
"AddressLine1": "string",
"AddressLine2": "string",
"AddressLine3": "string",
"City": "string",
"State": "string",
"PostalCode": "string",
"CountryCode": "string"
},
"MerchantId": 0,
"Amount": 0.0,
"CurrencyCode": "string",
"OrderPaymentId": 0,
"RedirectUrl": "string",
"PaymentMethodId": "string",
"ProfileType": 0,
"FraudPreventionData": {
"FraudPreventionId": "string",
"FraudPreventionProviderId": "string",
"FraudPreventionType": 0,
"IpAddress": "string"
},
"ExpireDate": "0001-01-01T00:00:00"
},
"IpAddress": "string",
"Associate": {
"AssociateId": 0,
"ShipAddress": {
"Id": 0,
"AddressLine1": "string",
"AddressLine2": "string",
"AddressLine3": "string",
"City": "string",
"State": "string",
"PostalCode": "string",
"CountryCode": "string"
},
"Address": {
"Id": 0,
"AddressLine1": "string",
"AddressLine2": "string",
"AddressLine3": "string",
"City": "string",
"State": "string",
"PostalCode": "string",
"CountryCode": "string"
},
"AcceptTerms": false,
"AssociateBaseType": 0,
"AssociateType": 0,
"PriceGroup": 0,
"AssociateTypeName": "string",
"BackOfficeId": "string",
"BirthDate": "0001-01-01T00:00:00",
"CompanyName": "string",
"DormantDate": "0001-01-01T00:00:00",
"EmailAddress": "string",
"Name": "string string",
"DisplayFirstName": "string",
"DisplayLastName": "string",
"LegalFirstName": "string",
"LegalLastName": "string",
"RomanizedFirstName": "string",
"RomanizedLastName": "string",
"PrimaryPhone": "string",
"SecondaryPhone": "string",
"LanguageCode": "string",
"ShipAttention": "string",
"ShipPhone": "string",
"SignupDate": "0001-01-01T00:00:00",
"UpgradeDate": "0001-01-01T00:00:00",
"SignupMethod": "string",
"TaxExempt": false,
"TaxId": "string",
"TaxResaleNo": "string",
"TeamId": 0,
"TextNumber": "string",
"ExternalId": "string",
"StatusId": 0,
"Void": false,
"Custom": {
"Field1": "string",
"Field2": "string",
"Field3": "string",
"Field4": "string",
"Field5": "string"
}
}
}
{
"UserDefinedFields": null
}
Updated over 3 years ago