FraudDetect(3pm)

πŸ“¦
version 3.05 Β· 2 versions
  • 3.05 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 3.05 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ•΅οΈβ™€οΈ FraudDetect β€” the Business::FraudDetect(3pm) manual, but make it a vibe

okay so bestie, gather round πŸ’– this is the manual page for Business::FraudDetect, which the original describes as "A cohort to Business::OnlinePayment". It's a Perl module, it lives in the 3pm section, and it is literally just Business::OnlinePayment with a fraud-detection glow-up. Slay.


✨ NAME ✨

Business::FraudDetect β€” a cohort to Business::OnlinePayment 🫢


✨ SYNOPSIS ✨

Here's the whole flex, verbatim, no cap:

  my %processor_info = ( fraud_detection => 'preCharge',
                         maximum_fraud_score => 500,
                         preCharge_id => '1000000000000001',
                         preCharge_security1 => 'abcdef0123',
                         preCharge_security2 => '3210fedcba',
                        )
  my $transaction = new Business::OnlinePayment($processor, %processor_info);
  $transaction->content(
                        type       => 'Visa',
                        amount     => '49.95',
                        cardnumber => '1234123412341238',
                        expiration => '0100',
                        name       => 'John Q Doe',
                       );
  $transaction->submit();

  if($transaction->is_success()) {
    print "Card processed successfully: ".$transaction->authorization()."\n";
  } else {
    print "Card was rejected: ".$transaction->error_message()."\n";
  }

like… the whole fraud check just happens inside that submit() and you get a yes/no at the end. main character energy tbh πŸ‘‘


🌸 DESCRIPTION 🌸

This is the module that adds functionality to Business::OnlinePayment. Go read Business::OnlinePayment too, it's the parent situation πŸ’…

So the way this works: you instantiate a Business::OnlinePayment object like you always do, except you slide in three processor directives. Three. That's the whole trick. Obsessed.

  • fraud_detection β€” tells it which Fraud Detection module to use.
  • maximum_fraud_score β€” FraudDetection drivers are expected to return a numeric "risk" factor, and this parameter is your threshold for rejecting the transaction based on that risk. Heads up bestie: higher numbers are "riskier" transactions. πŸ“ˆπŸ’€
  • other driver-specific parameters β€” yeah these exist too. Consult the specific Fraud Detection module you intend to use for its required parameters, because I do not know them and neither does this page.

okay now the actual ✨magic✨. The $tx->submit() method is overridden to interpose a FraudDetection phase. A subordinate object gets created using the same content as the parent OnlinePayment object, and then a Fraud Detect action is run against that subordinate object.

  • if the resulting fraud score is less than or equal to the maximum_risk parameter β†’ the parent transaction is allowed to proceed, we love to see it πŸŽ‰
  • otherwise β†’ a failure state will exist, with a suitable error message. it's giving rejected. 😭
ngl the exact boundary matters: less than or equal to passes, anything above gets denied. Don't be sloppy about it.

πŸŽ€ METHODS πŸŽ€

Real talk: this module provides no new methods. Zero. None. πŸ™ˆ

What it does do is override the submit method to interpose an additional Fraud Detection phase. That's it. That's the whole contribution. And honestly? iconic.


πŸ’œ AUTHORS πŸ’œ

  • Original author: Lawrence Statton <lawrence@cluon.com>
  • Current maintainer: Ivan Kohler <ivan-bop@420.am> as part of the Business::OnlinePayment distribution.

shoutout to the people keeping this alive, fr fr 🫢


πŸ‘‘ DISCLAIMER πŸ‘‘

Read this one carefully, it's the serious bit:

THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

translation: no promises, no guarantees, you're on your own bestie πŸ’€


🌈 SEE ALSO 🌈


and that's the whole page, bestie! πŸ’– this was perl v5.36.0, dated 2023-01-22, and it's FraudDetect(3pm) β€” go forth and detect some fraud, you absolute legend βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from