Monday, May 16, 2011

Create Credit Card in Oracle Payments using API (IBY_FNDCPT_SETUP_PUB.CREATE_CARD)


                                                                                                                            

Below script will help you to create a credit card details in IBY_CREDITCARD table using the API IBY_FNDCPT_SETUP_PUB.CREATE_CARD
Test InstanceR12.1.1
Parameters:
CREDITCARD_REC_TYPE
Meaning
Owner_Id
Owner TCA Party ID
Card_Holder_Name
Name of the card holder as mentioned on the card
Billing_Address_Id
Party Site Id (of a Party Site created previously) linking the Owner_Id (above) and a Location Id containing the Billing Address for the CC. The Party Site must have a created Party Site Use (BILL_TO) before invoking the API.
Card_Number:
The number of the credit card
Expiration_Date
Expiration date of the card
Instrument_Type
Must be 'CREDITCARD'
PurchaseCard_Flag
N' if a CC, 'Y' if a PC.
Card_Issuer
VISA', 'MASTERCARD', 'AMEX', etc…
Note: 'UNKNOWN' credit card type will bypass CC number validation.
Single_Use_Flag
allways set to 'N'
Info_Only_Flag
allways set to 'N', otherwise the CC wont be usable for Payments

SCRIPT:
DECLARE
   l_return_status     VARCHAR2 (1000);
   l_msg_count         NUMBER;
   l_msg_data          VARCHAR2 (4000);
   l_card_id           NUMBER;
   l_msg_data_out      VARCHAR2 (240);
   l_mesg              VARCHAR2 (240);
   p_count             NUMBER;
   l_response          iby_fndcpt_common_pub.result_rec_type;
   l_card_instrument   iby_fndcpt_setup_pub.creditcard_rec_type;
   v_context           VARCHAR2 (10);

   FUNCTION set_context (
      i_user_name   IN   VARCHAR2,
      i_resp_name   IN   VARCHAR2,
      i_org_id      IN   NUMBER
   )
      RETURN VARCHAR2
   IS
   BEGIN
      NULL;
-- Inorder to reduce the content of the post I moved the implementation part of this function to another post and it is available here
   END set_context;
BEGIN
   DBMS_OUTPUT.put_line ('1');
--1. Set applications context if not already set.
   v_context := set_context ('&username', '&resp_name', '&org_id');
   IF v_context = 'F'
   THEN
      DBMS_OUTPUT.put_line ('Error while setting the context');
   END IF;

   DBMS_OUTPUT.put_line ('2');
   mo_global.init ('IBY');
   l_card_instrument.owner_id          := 51426;                      
   l_card_instrument.card_holder_name  := Share Oracle Apps';
   l_card_instrument.billing_address_id:= NULL;                             
   l_card_instrument.card_number       := '5011478596211882';
   l_card_instrument.expiration_date   := '21-OCT-2011';
   l_card_instrument.instrument_type   := 'CREDITCARD';
   l_card_instrument.purchasecard_flag := 'N';
   l_card_instrument.card_issuer       := 'VISA';
   l_card_instrument.single_use_flag   := 'N';
   l_card_instrument.info_only_flag    := 'N';
   l_card_instrument.card_purpose      := 'N';
   l_card_instrument.card_description  := 'Card for Testing';
   l_card_instrument.active_flag       := 'Y';

   IBY_FNDCPT_SETUP_PUB.CREATE_CARD
                       (p_api_version          => 1.0,
                        x_return_status        => l_return_status,
                        x_msg_count            => l_msg_count,
                        x_msg_data             => l_msg_data,
                        p_card_instrument      => l_card_instrument,
                        x_card_id              => l_card_id,
                        x_response             => l_response,
                        p_init_msg_list        => fnd_api.g_true,
                        p_commit               => fnd_api.g_false
                        );
   DBMS_OUTPUT.put_line ('l_return_status = ' || l_return_status);
   DBMS_OUTPUT.put_line ('l_msg_count = ' || l_msg_count);
   DBMS_OUTPUT.put_line ('l_card_id = ' || l_card_id);
   DBMS_OUTPUT.put_line ('l_response.Result_Code = ' ||               
                          l_response.result_code);
   DBMS_OUTPUT.put_line (   'l_response.Result_Category = '
                         || l_response.result_category
                        );
   DBMS_OUTPUT.put_line (   'l_response.Result_Message = '
                         || l_response.result_message
                        );

   IF l_msg_count = 1
   THEN
      DBMS_OUTPUT.put_line ('l_msg_data ' || l_msg_data);
   ELSIF l_msg_count > 1
   THEN
      LOOP
         p_count := p_count + 1;
         l_msg_data := fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false);

         IF l_msg_data IS NULL
         THEN
            EXIT;
         END IF;

         DBMS_OUTPUT.put_line ('Message' || p_count || ' ---' || l_msg_data);
      END LOOP;
   END IF;
END;

8 Responses to “Create Credit Card in Oracle Payments using API (IBY_FNDCPT_SETUP_PUB.CREATE_CARD)”

Anonymous said...
September 30, 2013 at 8:05 AM

Hi, Thanks for the program, I just ran the program but i don't see the record in IBY_CREDITCARD table. We are on 12.1.3. Is there any other program that i need to run after this script?

Thanks.
Raj.


Herbert M. Reed said...
March 26, 2019 at 4:01 AM

You have a real ability for writing unique content. I like how you think and the way you represent your views in this article. I agree with your way of thinking. Thank you for sharing. 650 credit score good


Mawazna.com said...
April 4, 2019 at 11:30 PM

This type of message always inspiring and I prefer to read quality content, so happy to find good place to many here in the post, the writing is just great, thanks for the post. Bank Alfalah Credit Card in Karachi - HBL Credit Card


Best Real Estate Company said...
April 12, 2019 at 5:57 AM

Really impressive stuff of writing. I was looking for this type of blog and i really appreciate your effort. Keep it up dear. zameen for you


Unknown said...
April 20, 2019 at 12:40 AM

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often. click for complete info


Excel Tmp said...
May 21, 2019 at 10:55 AM

Attractive, post. I just stumbled upon your weblog and wanted to say that I have liked browsing your blog posts. Rental Receipt Form Template


ExcelSHE - Letters & Templates said...
June 16, 2019 at 10:45 AM

Very good article and thanks for sharing such information. Already Read your Recent Post, its Great Thanks wedding budget | employee warning notice | reserved sign | weight loss competition | medical release


Study in Turkey - AWM said...
October 1, 2019 at 1:01 AM

Interesting and helpful post and i appreciate you for this. Keep sharing. study in turkey


Post a Comment

Disclaimer

The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.