DBA Data[Home] [Help]

PACKAGE BODY: APPS.IBE_CUSTOMER_PVT

Source


1 package body ibe_customer_pvt AS
2 /* $Header: IBEVACTB.pls 120.6.12010000.2 2009/06/03 10:02:51 scnagara ship $ */
3 
4 l_true VARCHAR2(1) := FND_API.G_TRUE;
5 
6 
7 --PROCEDURE Set_Bank_Acct_End_Date : This API has been removed: mannamra:10/07/2005
8 
9 
10 
11 /*
12  *PROCEDURE:
13  *      setOptInOutPreference
14  *DESCRIPTION:
15  *      -calls HZ_CONTACT_PREFERENCE_V2PUB to update the preference code
16  *      -creates a row in HZ_CONTACT_PREFERENCES if no row exists for party_id
17  */
18 PROCEDURE setOptInOutPreference(
19     p_party_id           IN    NUMBER,
20     p_preference         IN    VARCHAR2,
21     p_init_msg_list      IN    VARCHAR2 := FND_API.G_TRUE,
22     p_commit             IN    VARCHAR2 := FND_API.G_FALSE,
23     p_api                IN    NUMBER,
24     x_return_status      OUT  NOCOPY VARCHAR2,
25     x_msg_count          OUT  NOCOPY NUMBER,
26     x_msg_data           OUT  NOCOPY VARCHAR2
27 
28    )
29 IS
30     l_contact_preference_rec                hz_contact_preference_v2pub.contact_preference_rec_type;
31     l_contact_preference_rec2               hz_contact_preference_v2pub.contact_preference_rec_type;
32     l_contact_preference_id                 NUMBER;
33     l_object_version_number                 NUMBER;
34     l_id                                    NUMBER;
35     l_date                                  DATE;
36     l_obj_ver                               NUMBER;
37 
38 BEGIN
39     --IBE_UTIL.enable_debug();
40     -- standard start of API savepoint
41     SAVEPOINT setOptInOutPreference;
42 
43     -- standard call to check for call compatibility
44     IF NOT FND_API.compatible_api_call(1.0,
45                                        p_api,
46                                        'getOptInOutPreference',
47                                        G_PKG_NAME)
48     THEN
49       RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
50     END IF;
51 
52     -- initialize message list if p_init_msg_list is set to TRUE.
53     IF FND_API.to_boolean(p_init_msg_list) THEN
54       FND_MSG_PUB.initialize;
55     END IF;
56 
57     --begin set/create contact preferences
58     BEGIN
59       SELECT contact_preference_id, last_update_date, object_version_number
60       INTO   l_id, l_date, l_obj_ver
61       From   hz_contact_preferences
62       WHERE  contact_level_table='HZ_PARTIES'
63       AND    contact_level_table_id=p_party_id;
64       --update reason_code if record found
65       l_contact_preference_rec.contact_preference_id := l_id;
66       l_contact_preference_rec.preference_code := p_preference;
67       l_object_version_number := l_obj_ver;
68       HZ_CONTACT_PREFERENCE_V2PUB.update_contact_preference(
69             FND_API.G_FALSE,
70             l_contact_preference_rec,
71             l_object_version_number,
72             x_return_status,
73             x_msg_count,
74             x_msg_data
75         );
76 
77       --create row when no record found
78       EXCEPTION WHEN NO_DATA_FOUND THEN
79         l_contact_preference_rec2.contact_level_table := 'HZ_PARTIES';
80         l_contact_preference_rec2.contact_level_table_id := p_party_id;
81         l_contact_preference_rec2.contact_type := 'ALL';
82         l_contact_preference_rec2.preference_code := p_preference;
83         l_contact_preference_rec2.requested_by := 'INTERNAL';
84         l_contact_preference_rec2.status := 'A';
85         l_contact_preference_rec2.created_by_module := 'TCA_V1_API';
86         HZ_CONTACT_PREFERENCE_V2PUB.create_contact_preference(
87                 FND_API.G_FALSE,
88                 l_contact_preference_rec2,
89                 l_contact_preference_id,
90                 x_return_status,
91                 x_msg_count,
92                 x_msg_data
93         );
94     END;
95     --end set/create contact preferences
96 
97 
98     -- standard check of p_commit
99     IF FND_API.to_boolean(p_commit) THEN
100       commit;
101     END IF;
102     -- standard call to get message count and if count is 1, get message info
103     FND_MSG_PUB.count_and_get(
104       p_encoded => FND_API.G_FALSE,
105       p_count => x_msg_count,
106       p_data => x_msg_data
107     );
108     --IBE_UTIL.disable_debug();
109 
110 --standard exception catching for main body
111 EXCEPTION
112   WHEN FND_API.G_EXC_ERROR THEN
113     --IBE_UTIL.enable_debug();
114 
115     ROLLBACK TO setOptInOutPreference;
116     x_return_status := FND_API.G_RET_STS_ERROR;
117     FND_MSG_PUB.count_and_get(
118       p_encoded => FND_API.G_FALSE,
119       p_count => x_msg_count,
120       p_data => x_msg_data
121     );
122     IF (IBE_UTIL.G_DEBUGON = l_true) THEN
123        IBE_UTIL.debug('G_EXC_ERROR exception');
124        IBE_UTIL.debug('x_msg_count ' || to_char(x_msg_count));
125        IBE_UTIL.debug('x_msg_data ' || x_msg_data);
126        IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
127        IBE_UTIL.debug('error text : '|| SQLERRM);
128     END IF;
129 
130     --IBE_UTIL.disable_debug();
131 
132   WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
133     --IBE_UTIL.enable_debug();
134 
135     ROLLBACK TO setOptInOutPreference;
136     x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
137     FND_MSG_PUB.count_and_get(
138       p_encoded => FND_API.G_FALSE,
139       p_count => x_msg_count,
140       p_data => x_msg_data
141     );
142     IF (IBE_UTIL.G_DEBUGON = l_true) THEN
143        IBE_UTIL.debug('G_EXC_UNEXPECTED_ERROR exception');
144        IBE_UTIL.debug('x_msg_count ' || to_char(x_msg_count));
145        IBE_UTIL.debug('x_msg_data ' || x_msg_data);
146        IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
147        IBE_UTIL.debug('error text : '|| SQLERRM);
148     END IF;
149 
150     --IBE_UTIL.disable_debug();
151 
152   WHEN OTHERS THEN
153     --IBE_UTIL.enable_debug();
154 
155     ROLLBACK TO setOptInOutPreference;
156     x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
157     FND_MSG_PUB.count_and_get(
158       p_encoded => FND_API.G_FALSE,
159       p_count => x_msg_count,
160       p_data => x_msg_data
161     );
162     IF (IBE_UTIL.G_DEBUGON = l_true) THEN
163        IBE_UTIL.debug('OTHER exception');
164        IBE_UTIL.debug('x_msg_count ' || to_char(x_msg_count));
165        IBE_UTIL.debug('x_msg_data ' || x_msg_data);
166        IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
167        IBE_UTIL.debug('error text : '|| SQLERRM);
168     END IF;
169 
170     --IBE_UTIL.disable_debug();
171 
172 END setOptInOutPreference;
173 
174 
175 
176 /* Local Function to get credit card type given the number
177 
178    -- Input Parameter(s)
179        - p_credit_card_number NUMBER
180    -- Returns
181          Credit_card_type VARCHAR2
182 */
183 function get_credit_card_type(
184      --fix 2861827
185      --p_Credit_Card_Number NUMBER
186      p_Credit_Card_Number VARCHAR2
187 ) RETURN VARCHAR2
188 AS
189      l_credit_Card_number Varchar2(30);
190      l_credit_card_length Number;
191 Begin
192     --fix 2861827
193      --l_credit_card_number := to_char(p_credit_card_number);
194      l_credit_card_number := p_credit_card_number;
195      l_credit_card_length := length(l_credit_card_number);
196 
197      If (l_credit_Card_length = 16 and substr(l_credit_card_number,1,2) in ('51','52','53','54','55') ) Then
198           Return ('MC');
199      Elsif ((l_credit_Card_length = 13 or l_credit_card_length = 16)  and substr(l_credit_card_number,1,1) = '4') Then
200           Return ('VISA');
201      Elsif (l_credit_Card_length = 15 and substr(l_credit_card_number,1,2) in ('34','37')) Then
202           Return ('AMEX');
203      Elsif (l_credit_card_length = 14 and substr(l_credit_card_number,1,3) in ('300','301','302','303','305','36','38')) Then
204           Return('DINERS');
205      Elsif (l_credit_card_length = 16 and substr(l_credit_card_number,1,4) = '6011')Then
206           Return ('DISCOVER');
207      Elsif ((l_credit_card_length = 15 and substr(l_credit_card_number,1,4) in ('2014','2149')) or
208      ((l_credit_card_length = 15 or l_credit_card_length = 16) and (substr(l_credit_card_number,1,1) = '3' or substr(l_credit_card_number,1,4) in ('2131','1800')))) Then
209           Return ('OTHERS');
210      Else
211           Return('ERROR');
212      End If;
213 
214 End get_credit_card_type;
215 
216 
217 -- This procedure will return a valid credit card information
218 -- if it can find a default credit card.
219 procedure get_default_credit_card_info(
220     p_api_version            IN  NUMBER,
221     p_init_msg_list          IN  VARCHAR2 := FND_API.G_FALSE,
222     p_commit                 IN  VARCHAR2 := FND_API.G_FALSE,
223     p_cust_account_id        IN  NUMBER,
224     p_party_id               IN  NUMBER,
225     p_mini_site_id           IN  NUMBER,
226     x_return_status          OUT NOCOPY VARCHAR2,
227     x_msg_count              OUT NOCOPY NUMBER,
228     x_msg_data               OUT NOCOPY VARCHAR2,
229     x_cc_assignment_id        OUT NOCOPY NUMBER
230                               )
231 IS
232   l_api_name               CONSTANT VARCHAR2(30) := 'get_default_credit_card_info';
233   l_api_version            CONSTANT NUMBER       := 1.0;
234 
235   prm_bank_acct_num AP_BANK_ACCOUNTS.BANK_ACCOUNT_NUM%TYPE := NULL;
236   prm_inactive_date AP_BANK_ACCOUNTS.INACTIVE_DATE%TYPE := NULL;
237   prm_acct_holder_name AP_BANK_ACCOUNTS.BANK_ACCOUNT_NAME%TYPE := NULL;
238   prm_credit_card_type VARCHAR2(50) := NULL;
239 
240   def_bank_acct_num AP_BANK_ACCOUNTS.BANK_ACCOUNT_NUM%TYPE := NULL;
241   def_inactive_date AP_BANK_ACCOUNTS.INACTIVE_DATE%TYPE := NULL;
242   def_acct_holder_name AP_BANK_ACCOUNTS.BANK_ACCOUNT_NAME%TYPE:= NULL;
243   def_credit_card_type VARCHAR2(50) := NULL;
244 
245   l_credit_card_type VARCHAR2(50) := NULL;
246 
247 
248 
249   CURSOR c_getPrimaryCCInfo(l_cust_acct_id NUMBER,l_party_id NUMBER,l_msite_id NUMBER) IS
250  SELECT assign.instr_assignment_id
251          FROM   iby_fndcpt_payer_assgn_instr_v assign
252          WHERE  assign.party_id = l_party_id
253          AND    assign.order_of_preference = 1
254          AND    assign.org_id is null
255          AND    assign.cust_account_id is null
256          AND    assign.instrument_type = 'CREDITCARD'
257          and    assign.ACCT_SITE_USE_ID is null
258          AND    nvl(CARD_EXPIRYDATE, sysdate) >= sysdate
259          and
260 			 exists
261 			 (select msite_information1
262 			  from ibe_msite_information m, fnd_lookup_values b
263 		       where
264 				   m.msite_id =l_msite_id and
265 				   b.lookup_type = 'CREDIT_CARD' and
266 				   b.view_application_id = 660 and
267 			        b.enabled_flag = 'Y' and
268 				 (b.tag = 'Y' or b.tag is null) and
269 				   b.language = userenv('lang') and
270 				msite_information_context = 'CC_TYPE' and
271 			--	  b.lookup_code = msite_information1		 -- bug 8550854, scnagara
272 			decode(b.lookup_code, 'MASTERCARD', 'MASTERCARD','MC', 'MASTERCARD', b.lookup_code)  = msite_information1
273                      and msite_information1 = assign.card_issuer_code);
274 
275 CURSOR c_getFirstCCInfo(l_cust_acct_id NUMBER,l_party_id NUMBER,l_msite_id NUMBER) IS
276         SELECT assign.instr_assignment_id
277          FROM   iby_fndcpt_payer_assgn_instr_v assign
278         WHERE  assign.party_id = l_party_id
279          AND    assign.org_id is null
280          AND    assign.cust_account_id is null
281          AND    assign.instrument_type = 'CREDITCARD'
282          and    assign.ACCT_SITE_USE_ID is null
283          AND    nvl(CARD_EXPIRYDATE, sysdate) >= sysdate
284          and
285                 exists
286                (select msite_information1
287                 from ibe_msite_information m, fnd_lookup_values b
288                 where
289                       m.msite_id = l_msite_id and
290                       b.lookup_type = 'CREDIT_CARD' and
291                       (b.tag = 'Y' or b.tag is null) and
292                       b.language = userenv('lang') and
293                       msite_information_context = 'CC_TYPE' and
294                   --  b.lookup_code = msite_information1	 -- bug 8550854, scnagara
295 		   decode(b.lookup_code, 'MASTERCARD', 'MASTERCARD','MC', 'MASTERCARD', b.lookup_code) = msite_information1
296                 and msite_information1 = assign.card_issuer_code)
297                 and rownum < 2
298         order by assign.order_of_preference asc;
299 
300         l_def_cc_assignment_id NUMBER;
301         l_cc_assignment_id NUMBER;
302 BEGIN
303 
304   --IBE_UTIL.enable_debug();
305 
306   IF (IBE_UTIL.G_DEBUGON = l_true) THEN
307      IBE_UTIL.debug('enter ibe_customer_pvt.get_default_credit_card_info');
308   END IF;
309 
310 
311   IF NOT FND_API.compatible_api_call(l_api_version,
312                                      p_api_version,
313                                      l_api_name,
314                                      G_PKG_NAME)
315   THEN
316     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
317   END IF;
318 
319   -- initialize message list if p_init_msg_list is set to TRUE.
320   IF FND_API.to_boolean(p_init_msg_list) THEN
321     FND_MSG_PUB.initialize;
322   END IF;
323 
324     -- Initialize API return status to success
325   x_return_status := FND_API.G_RET_STS_SUCCESS;
326 
327 
328   IF (IBE_UTIL.G_DEBUGON = l_true) THEN
329      IBE_UTIL.debug('call cursor c_getPrimaryCCInfo()');
330   END IF;
331   -- call cursor c_getPrimaryInfo
332 
333   IF (IBE_UTIL.G_DEBUGON = l_true) THEN
334      IBE_UTIL.debug('cust_acct_id = '||p_cust_account_id||'party_id = '||p_party_id||' minisite_id : '||p_mini_site_id);
335   END IF;
336 
337   OPEN c_getPrimaryCCInfo(p_cust_account_id,p_party_id,p_mini_site_id);
338 
339   FETCH c_getPrimaryCCInfo INTO l_cc_assignment_id ;
340 
341  IF (IBE_UTIL.G_DEBUGON = l_true) THEN
342     IBE_UTIL.debug('call cursor c_getFirstCCInfo()');
343  END IF;
344   OPEN c_getFirstCCInfo(p_cust_account_id,p_party_id,p_mini_site_id);
345 
346   FETCH c_getFirstCCInfo INTO l_def_cc_assignment_id;
347 
348   if c_getPrimaryCCInfo%FOUND then
349       IF (IBE_UTIL.G_DEBUGON = l_true) THEN
350          IBE_UTIL.debug('Primary CC found');
351       END IF;
352 
353      x_cc_assignment_id:= l_cc_assignment_id;
354        IF (IBE_UTIL.G_DEBUGON = l_true) THEN
355        IBE_UTIL.debug('x_cc_assign_id : '||l_cc_assignment_id);
356       END IF;
357  --else
358    --IBE_UTIL.debug('No Primary Info found');
359    --close c_getPrimaryCCInfo;
360  --end if;
361  elsif (c_getFirstCCInfo%FOUND) then
362 
363       IF (IBE_UTIL.G_DEBUGON = l_true) THEN
364          IBE_UTIL.debug('Default CC found ');
365       END IF;
366 
367         x_cc_assignment_id := l_def_cc_assignment_id;
368           IF (IBE_UTIL.G_DEBUGON = l_true) THEN
369        IBE_UTIL.debug('x_def_cc_assign_id : '||l_def_cc_assignment_id);
370       END IF;
371  else
372 
373       IF (IBE_UTIL.G_DEBUGON = l_true) THEN
374          IBE_UTIL.debug(' No default Credit card info found ');
375       END IF;
376       close c_getFirstCCInfo;
377       close c_getPrimaryCCInfo;
378 end if;
379 
380     /* 3/3/05: comment out
381     IF (IBE_UTIL.G_DEBUGON = l_true) THEN
382        IBE_UTIL.debug('x_credit_card_num : '||x_credit_card_num);
383         IBE_UTIL.debug('x_card_holder_name : '||x_card_holder_name);
384         IBE_UTIL.debug('x_credit_card_exp_date : '||x_credit_card_exp_date);
385         IBE_UTIL.debug('x_credit_card_type : '||x_credit_card_type);
386     END IF;
387     */
388 
389 
390     x_return_status := FND_API.G_RET_STS_SUCCESS;
391   -- standard check of p_commit
392   IF FND_API.to_boolean(p_commit) THEN
393     commit;
394   END IF;
395 
396   -- standard call to get message count and if count is 1, get message info
397   FND_MSG_PUB.count_and_get(
398     p_encoded => FND_API.G_FALSE,
399     p_count => x_msg_count,
400     p_data => x_msg_data
401   );
402 
403 
404   IF (IBE_UTIL.G_DEBUGON = l_true) THEN
405      IBE_UTIL.debug('exit ibe_customer_pvt.get_default_credit_card_info');
406   END IF;
407 
408   --IBE_UTIL.disable_debug();
409 
410 EXCEPTION
411 
412      WHEN FND_API.G_EXC_ERROR THEN
413     --IBE_UTIL.enable_debug();
414 
415      --ROLLBACK TO create_credit_card;
416 
417      x_return_status := FND_API.G_RET_STS_ERROR;
418 	FND_MSG_PUB.ADD;
419      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
420                                p_data       =>      x_msg_data,
421                                p_encoded    =>      'F');
422 
423     IF (IBE_UTIL.G_DEBUGON = l_true) THEN
424        IBE_UTIL.debug('G_EXC_ERROR exception');
425        IBE_UTIL.debug('x_msg_count ' || to_char(x_msg_count));
426        IBE_UTIL.debug('x_msg_data ' || x_msg_data);
427        IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
428        IBE_UTIL.debug('error text : '|| SQLERRM);
429     END IF;
430 
431 
432     --IBE_UTIL.disable_debug();
433 
434 
435 
436 
437     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
438     --IBE_UTIL.enable_debug();
439 
440      --ROLLBACK TO create_credit_card;
441      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
442 	FND_MSG_PUB.ADD;
443      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
444                                p_data       =>      x_msg_data,
445                                p_encoded    =>      'F');
446 
447     IF (IBE_UTIL.G_DEBUGON = l_true) THEN
448        IBE_UTIL.debug('G_EXC_UNEXPECTED_ERROR exception');
449        IBE_UTIL.debug('x_msg_count ' || to_char(x_msg_count));
450        IBE_UTIL.debug('x_msg_data ' || x_msg_data);
451        IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
452        IBE_UTIL.debug('error text : '|| SQLERRM);
453     END IF;
454 
455     --IBE_UTIL.disable_debug();
456 
457 
458 
459 
460     WHEN OTHERS THEN
461     --IBE_UTIL.enable_debug();
462 
463      --ROLLBACK TO create_credit_card;
464      FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
465      FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
466      FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
467      FND_MESSAGE.Set_Token('REASON', SQLERRM);
468      FND_MSG_PUB.Add;
469      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
470 	 FND_MSG_PUB.Add;
471 	 FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
472 		  				  p_data       =>      x_msg_data,
473 						  p_encoded    =>      'F');
474 
475 
476     --IBE_UTIL.debug('OTHER exception');
477     IF (IBE_UTIL.G_DEBUGON = l_true) THEN
478        IBE_UTIL.debug('x_msg_count ' || to_char(x_msg_count));
479        IBE_UTIL.debug('x_msg_data ' || x_msg_data);
480        IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
481        IBE_UTIL.debug('error text : '|| SQLERRM);
482     END IF;
483 
484     --IBE_UTIL.disable_debug();
485 
486 
487 
488 
489 END;
490 
491 -- This procedure gets the primary credit card id if it already exists
492 
493 procedure get_primary_credit_card_id(p_username         IN VARCHAR2,
494                                      x_credit_card_id   OUT NOCOPY NUMBER)
495 IS
496 
497 cursor C_get_primary_credit_card(c_party_id NUMBER) is
498 SELECT instr_assignment_id
499 FROM   IBY_FNDCPT_PAYER_ASSGN_INSTR_V
500 WHERE  party_id          = c_party_id
501 AND    org_id            is null
502 AND    cust_account_id   is null
503 AND    acct_site_use_id  IS NULL
504 AND    instrument_type   = 'CREDITCARD'
505 AND    payment_function  = 'CUSTOMER_PAYMENT'
506 and    order_of_preference = 1;
507 
508 cursor C_get_party_cust_accnt(c_username VARCHAR2) is
509 SELECT customer_id, person_party_id
510 FROM    fnd_user
511 WHERE  user_name = c_username;
512 
513 rec_get_primary_credit_card c_get_primary_credit_card%rowtype;
514 rec_get_party_cust_accnt    c_get_party_cust_accnt%rowtype;
515 
516 l_customer_id     NUMBER;
517 l_person_party_id NUMBER;
518 l_assignment_id   NUMBER;
519 l_party_to_use    NUMBER;
520 
521 BEGIN
522   --IBE_UTIL.enable_debug();
523 
524   IF (IBE_UTIL.G_DEBUGON = l_true) THEN
525      IBE_UTIL.debug('enter ibe_customer_pvt.get_primary_credit_card_id');
526   END IF;
527 
528   FOR rec_get_party_cust_accnt in C_get_party_cust_accnt(p_username) LOOP
529     l_customer_id     := rec_get_party_cust_accnt.customer_id;
530     l_person_party_id := rec_get_party_cust_accnt.person_party_id;
531     exit when c_get_party_cust_accnt%notfound;
532   END LOOP;
533 
534   IF (l_customer_id is null) THEN
535     l_party_to_use := l_person_party_id;
536     IF (IBE_UTIL.G_DEBUGON = l_true) THEN
537       IBE_UTIL.debug('customer_id does not have any value, using the person_party_id');
538     END IF;
539   ELSE
540     IF (IBE_UTIL.G_DEBUGON = l_true) THEN
541       IBE_UTIL.debug('customer_id has a value,l_party_to_use: '||l_customer_id);
542     END IF;
543     l_party_to_use := l_customer_id;
544   END IF;
545 
546   FOR rec_get_primary_credit_card in c_get_primary_credit_card(l_party_to_use) LOOP
547     l_assignment_id := rec_get_primary_credit_card.instr_assignment_id;
548     EXIT when c_get_primary_credit_card%NOTFOUND;
549   END LOOP;
550 
551   IF (IBE_UTIL.G_DEBUGON = l_true) THEN
552     IBE_UTIL.debug('primary card asignment id is '||l_assignment_id);
553   END IF;
554   x_credit_card_id := l_assignment_id;
555 END ;
556 
557 
558 -- This procedure updates the primary credit card id if it already exists,
559 -- it also sets the primary credit card id if it does not exists.
560 
561 /*procedure set_primary_credit_card_id: mannamra: 11/14/2005 : Bug 4725304: This API can be obsoleted because it is
562 used to set the value of FND Preference PRIMARY_CARD but going forward primary credit card setting will be
563 @ done in iPayment schema. */
564 
565 
566 -- This procedure creates a new credit card by calling
567 -- arp_bank_pkg.process_bank_account. It also sets the
568 -- new credit card id as primary credit card if a primary
569 -- credit card id does not exists.
570 
571 /*procedure create_credit_card: mannamra: 11/14/2005 : Bug 4725304:  This API can be obsoleted because it is used to create a credit card in AP's
572 @ Bank Accouts' schema but going forward credit cards will be stored in
573 @ iPayment schema. IBE_PAYMENT_INT_PVT.saveCC() will be used to perform this
574  operation.*/
575 
576 
577 END ibe_customer_pvt;