121: g_cash_receipt_id := cc_cash_receipt_id;
122: /* Print input parameters */
123: /* bug3771406 */
124: IF PG_DEBUG in ('Y', 'C') THEN
125: arp_file.write_log('Cash Receipt Id : [' || cc_cash_receipt_id ||']');
126: arp_file.write_log('g_cash_receipt_id :[' || g_cash_receipt_id ||']');
127: arp_file.write_log('PSON :[' || cc_pay_server_order_num ||']');
128: arp_file.write_log('cc_currency : [' || cc_currency ||']');
129: arp_file.write_log('cc_merchant_id :[' || cc_merchant_id ||']');
122: /* Print input parameters */
123: /* bug3771406 */
124: IF PG_DEBUG in ('Y', 'C') THEN
125: arp_file.write_log('Cash Receipt Id : [' || cc_cash_receipt_id ||']');
126: arp_file.write_log('g_cash_receipt_id :[' || g_cash_receipt_id ||']');
127: arp_file.write_log('PSON :[' || cc_pay_server_order_num ||']');
128: arp_file.write_log('cc_currency : [' || cc_currency ||']');
129: arp_file.write_log('cc_merchant_id :[' || cc_merchant_id ||']');
130: arp_file.write_log('cc_pmt_instr_id :[' || substrb(cc_pmt_instr_id,1,4) ||']');
123: /* bug3771406 */
124: IF PG_DEBUG in ('Y', 'C') THEN
125: arp_file.write_log('Cash Receipt Id : [' || cc_cash_receipt_id ||']');
126: arp_file.write_log('g_cash_receipt_id :[' || g_cash_receipt_id ||']');
127: arp_file.write_log('PSON :[' || cc_pay_server_order_num ||']');
128: arp_file.write_log('cc_currency : [' || cc_currency ||']');
129: arp_file.write_log('cc_merchant_id :[' || cc_merchant_id ||']');
130: arp_file.write_log('cc_pmt_instr_id :[' || substrb(cc_pmt_instr_id,1,4) ||']');
131: arp_file.write_log('cc_pmt_instr_exp :[' || cc_pmt_instr_exp ||']');
124: IF PG_DEBUG in ('Y', 'C') THEN
125: arp_file.write_log('Cash Receipt Id : [' || cc_cash_receipt_id ||']');
126: arp_file.write_log('g_cash_receipt_id :[' || g_cash_receipt_id ||']');
127: arp_file.write_log('PSON :[' || cc_pay_server_order_num ||']');
128: arp_file.write_log('cc_currency : [' || cc_currency ||']');
129: arp_file.write_log('cc_merchant_id :[' || cc_merchant_id ||']');
130: arp_file.write_log('cc_pmt_instr_id :[' || substrb(cc_pmt_instr_id,1,4) ||']');
131: arp_file.write_log('cc_pmt_instr_exp :[' || cc_pmt_instr_exp ||']');
132: END IF;
125: arp_file.write_log('Cash Receipt Id : [' || cc_cash_receipt_id ||']');
126: arp_file.write_log('g_cash_receipt_id :[' || g_cash_receipt_id ||']');
127: arp_file.write_log('PSON :[' || cc_pay_server_order_num ||']');
128: arp_file.write_log('cc_currency : [' || cc_currency ||']');
129: arp_file.write_log('cc_merchant_id :[' || cc_merchant_id ||']');
130: arp_file.write_log('cc_pmt_instr_id :[' || substrb(cc_pmt_instr_id,1,4) ||']');
131: arp_file.write_log('cc_pmt_instr_exp :[' || cc_pmt_instr_exp ||']');
132: END IF;
133: /* FETCH iPayment Transactionid */
126: arp_file.write_log('g_cash_receipt_id :[' || g_cash_receipt_id ||']');
127: arp_file.write_log('PSON :[' || cc_pay_server_order_num ||']');
128: arp_file.write_log('cc_currency : [' || cc_currency ||']');
129: arp_file.write_log('cc_merchant_id :[' || cc_merchant_id ||']');
130: arp_file.write_log('cc_pmt_instr_id :[' || substrb(cc_pmt_instr_id,1,4) ||']');
131: arp_file.write_log('cc_pmt_instr_exp :[' || cc_pmt_instr_exp ||']');
132: END IF;
133: /* FETCH iPayment Transactionid */
134:
127: arp_file.write_log('PSON :[' || cc_pay_server_order_num ||']');
128: arp_file.write_log('cc_currency : [' || cc_currency ||']');
129: arp_file.write_log('cc_merchant_id :[' || cc_merchant_id ||']');
130: arp_file.write_log('cc_pmt_instr_id :[' || substrb(cc_pmt_instr_id,1,4) ||']');
131: arp_file.write_log('cc_pmt_instr_exp :[' || cc_pmt_instr_exp ||']');
132: END IF;
133: /* FETCH iPayment Transactionid */
134:
135: OPEN cc_iby_trxn_id_cur;
157: cc_returntrxn_rec.nls_lang := NULL;
158: cc_returntrxn_rec.TrxnRef := cc_unique_reference;
159:
160: IF PG_DEBUG in ('Y', 'C') THEN
161: arp_file.write_log('Calling iby_payment_adapter_pub.OraPmtReturn()+..');
162: END IF;
163:
164: /* Call Payment return API */
165: BEGIN
194: 'Exception in Return api: ');
195: Return;
196: END;
197: IF PG_DEBUG in ('Y', 'C') THEN
198: arp_file.write_log('OraPmtReturn return status..'||cc_return_status);
199: arp_file.write_log('OraPmtReturn status code..'||cc_status_code);
200: arp_file.write_log('iby_payment_adapter_pub.OraPmtReturn()-');
201: END IF;
202:
195: Return;
196: END;
197: IF PG_DEBUG in ('Y', 'C') THEN
198: arp_file.write_log('OraPmtReturn return status..'||cc_return_status);
199: arp_file.write_log('OraPmtReturn status code..'||cc_status_code);
200: arp_file.write_log('iby_payment_adapter_pub.OraPmtReturn()-');
201: END IF;
202:
203: /* Check the return status. An S means Success. If it failed
196: END;
197: IF PG_DEBUG in ('Y', 'C') THEN
198: arp_file.write_log('OraPmtReturn return status..'||cc_return_status);
199: arp_file.write_log('OraPmtReturn status code..'||cc_status_code);
200: arp_file.write_log('iby_payment_adapter_pub.OraPmtReturn()-');
201: END IF;
202:
203: /* Check the return status. An S means Success. If it failed
204: when need to check the status code as you can only give a
223: cc_status_code = 'IBY_50308'
224: THEN
225: /* we need to begin the CREDIT process instead of REFUND */
226: IF PG_DEBUG in ('Y', 'C') THEN
227: arp_file.write_log('We need to begin the CREDIT process instead of REFUND ');
228: END If;
229:
230: /* Clear out NOCOPY variable used in Refund Call */
231: cc_return_status := NULL;
247:
248: IF cc_iby_trxn_pson is not null THEN
249: cc_pay_server_order_num := cc_iby_trxn_pson;
250: IF PG_DEBUG in ('Y', 'C') THEN
251: arp_file.write_log('Corrected PSON is..'||cc_pay_server_order_num);
252: END IF;
253:
254: ELSIF cc_iby_dup_cur%NOTFOUND THEN
255:
256: SELECT 'AR_'||ar_payment_server_ord_num_s.nextval
257: INTO cc_pay_server_order_num
258: FROM DUAL;
259: IF PG_DEBUG in ('Y', 'C') THEN
260: arp_file.write_log('Generated PSON is..'||cc_pay_server_order_num);
261: END IF;
262: END IF;
263:
264: /* ASSIGN Values to Credit Card Credit Api Record Variables */
279: cc_credittrxn_rec.pmtmode := 'ONLINE' ;
280: cc_credittrxn_rec.TrxnRef := cc_unique_reference;
281:
282: IF PG_DEBUG in ('Y', 'C') THEN
283: arp_file.write_log('Calling iby_payment_adapter_pub.OraPmtCredit()+...');
284: END IF;
285:
286: /* Call Credit API */
287: iby_payment_adapter_pub.OraPmtCredit (
315: /* Following condition added for bug 3646482. IBY_20402 has to be treated as success */
316:
317: IF (cc_return_status <> FND_API.G_RET_STS_SUCCESS) AND (cc_status_code = 'IBY_20402') THEN
318: IF PG_DEBUG in ('Y', 'C') THEN
319: arp_file.write_log('OraPmtCredit API returned status code..'||cc_status_code);
320: END IF;
321: cc_return_status := FND_API.G_RET_STS_SUCCESS;
322: RETURN;
323: END IF;
335: 'Exception in Credit api: ');
336: Return;
337: END IF;
338: IF PG_DEBUG in ('Y', 'C') THEN
339: arp_file.write_log('iby_payment_adapter_pub.OraPmtCredit()-');
340: END IF;
341: ELSE
342: IF( cc_vend_err_code IS NULL) THEN
343: cc_vend_err_code := '4 PMT-RETURN ERR'; /* bug4220521 */