DBA Data[Home] [Help]

PACKAGE BODY: APPS.IBY_EVAL_RISKY_INSTR_PKG

Source


1 PACKAGE BODY iby_eval_risky_instr_pkg AS
2 /*$Header: ibyevrkb.pls 120.2.12020000.2 2012/07/12 17:06:23 sgogula ship $*/
3 
4 
5 /*
6 ** Procedure: eval_factor
7 ** Purpose: Evaluates the risk associated with Risky Instruments
8 **          risk factor.
9 **          The risky instrument(creditcard numeber) will be passed into this routine
10 **          Compare the credit card number with the information stored in the
11 **          risky instrument repository ,if the ccnumber exists then the credit card
12 **          is fruadulent- return the risk score of 100.
13 */
14 
15 procedure eval_factor(i_instrid number,
16                       i_ccnumber in varchar2,
17                       i_payeeid in varchar2,
18                       o_score out nocopy number)
19 
20 is
21 l_count number;
22 l_ccnumber varchar2(30);
23 lx_cc_number iby_creditcard.ccnumber%TYPE;
24 lx_return_status VARCHAR2(1);
25 lx_msg_count     NUMBER;
26 lx_msg_data      VARCHAR2(200);
27 l_cc_hash1  iby_irf_risky_instr.cc_number_hash1%TYPE;
28 l_cc_hash2  iby_irf_risky_instr.cc_number_hash2%TYPE;
29 l_cc_strip_number iby_creditcard.ccnumber%TYPE;
30 begin
31 --dbms_output.put_line('ccnumber = '||i_ccnumber);
32 --dbms_output.put_line('instrid = '||to_char(i_instrid));
33 if (i_ccnumber is null and i_instrid <> -99) then
34    select ccnumber into l_ccnumber
35    from iby_creditcard
36    where instrid = i_instrid;
37 else
38    l_ccnumber := i_ccnumber;
39 end if;
40 
41 -- Added for bug# 7228388. Compare the hash values of the credit card instead of
42 -- plain credit card number
43 IBY_CC_VALIDATE.StripCC
44 (1.0, FND_API.G_FALSE, l_ccnumber,
45 IBY_CC_VALIDATE.c_FillerChars,
46 lx_return_status, lx_msg_count, lx_msg_data, lx_cc_number);
47 -- Get hash values of the credit number
48 l_cc_hash1 := iby_security_pkg.get_hash(lx_cc_number,FND_API.G_FALSE);
49 l_cc_hash2 := iby_security_pkg.get_hash(lx_cc_number,FND_API.G_TRUE);
50 -- changed the query to include hash values in the column comparison
51 select count(*) into l_count
52 from iby_irf_risky_instr
53 where instrtype = 'CREDITCARD' and
54       cc_number_hash1 = l_cc_hash1 and
55       cc_number_hash2 = l_cc_hash2;
56 
57 if (l_count = 0) then
58    o_score := 0;
59 else
60    o_score := iby_risk_scores_pkg.getscore(i_payeeid,'H');
61 end if;
62 
63 end eval_factor;
64 end iby_eval_risky_instr_pkg;