I take payment on my site using PayPal Express Checkout with the Classic API. Here's the API documentation:
https://developer.paypal.com/docs/classic/api/merchant/DoExpressCheckoutPayment_API_Operation_SOAP/
To consume the service I use the following library:
https://www.nuget.org/packages/PayPalMerchantSDK/
I have been tasked with presenting fraud information against the PayPal transactions. The information we would like to display is the address verification (AVS) and the security code verification (CSC).
To test this I have tried to log the fraud information. Here's my code which creates the Express Checkout request and then gets the response:
var request = new DoExpressCheckoutPaymentReq() {
DoExpressCheckoutPaymentRequest = new DoExpressCheckoutPaymentRequestType() {
DoExpressCheckoutPaymentRequestDetails = new DoExpressCheckoutPaymentRequestDetailsType() {
Token = details.Token,
PaymentAction = PaymentActionCodeType.SALE,
PayerID = details.PayerInfo.PayerID,
PaymentDetails = details.PaymentDetails
},
ReturnFMFDetails = 1
}
};
var response = DoExpressCheckoutPayment(request);
Notice above I have added the following line:
ReturnFMFDetails = 1
According to the documentation this should return the appropriate fraud information. Finally I added the following code to the bottom to log the fraud information:
var sb = new StringBuilder();
try {
var paymentInfo = response.DoExpressCheckoutPaymentResponseDetails.PaymentInfo;
for (var i = 0; i < paymentInfo.Count; i++) {
var fmfDetails = paymentInfo[i].FMFDetails;
if (fmfDetails != null) {
if (fmfDetails.AcceptFilters != null) {
foreach (var filter in fmfDetails.AcceptFilters.Filters) {
sb.AppendLine("Accept Filter (" + i + "): " + filter.Id + " - " + filter.Name);
}
}
if (fmfDetails.DenyFilters != null) {
foreach (var filter in fmfDetails.DenyFilters.Filters) {
sb.AppendLine("Deny Filter (" + i + "): " + filter.Id + " - " + filter.Name);
}
}
if (fmfDetails.PendingFilters != null) {
foreach (var filter in fmfDetails.PendingFilters.Filters) {
sb.AppendLine("Pending Filter (" + i + "): " + filter.Id + " - " + filter.Name);
}
}
if (fmfDetails.ReportFilters != null) {
foreach (var filter in fmfDetails.ReportFilters.Filters) {
sb.AppendLine("Report Filter (" + i + "): " + filter.Id + " - " + filter.Name);
}
}
}
}
} catch (Exception ex) {
sb.AppendLine(ex.Message);
}
Logger.Log(sb.ToString());
However the information logged is always empty. I'd appreciate it if someone could show me what I am doing wrong. Thanks
Before PayPal Fraud Management Filters (FMF) can be used, you must setup & configure the filters in your account's Filter Settings. By default, the filters aren't setup and won't return any information.
Once you get it setup & configured, then you should start receiving the appropriate FMF information.