China Merchants Bank AG-Enterprise Direct joint development record

Source: Internet
Author: User
Tags current time
1. OverviewRecently, China Merchants Bank's direct banking system was used as a channel of capital expenditure. The CMB system provides two ways to connect with the corporate financial system: one is front-mounted machine; one is Embedded。 and "embedded inline mode only for backward compatibility support, new customers please use front-mounted direct-mounted". Therefore, the front-mounted mode is used. The interface document used is "China Merchants Bank AG-Enterprise Straight Connector manual version 5.21.0" and "Internet Banking Interconnection Interface Specification version 1.0." For the former, using its 3.6 "direct payment" interface for payment within the CMB, and using the 3.3 "Query payment Results" interface for results query; for the latter, use its 2nd chapter "NET Silver Credit" interface for cross-line payment, and use the "Transaction Query" interface 1.2 section for payment results query. The installation of the front-facing machine refers to the document "the direct installation process of the Silver Enterprise (test environment)" and "China Merchants Bank Direct System Development Guide version 3.9.0", the article explains in detail, and provides the sample code. Development uses language as java. 2. Problems encountered in the development and solutions

There are many problems that cannot be found when using the test environment account number, parameters, until the production environment appears. The problems encountered here are summarized as follows, with a view to providing reference for later developers. 2.1 Testing

Questions about calling the query interface, querying the payment results, using the time period:

(1). The test uses the local front-end machine, and has been using the Bank of Commerce merchants to provide the test account, found that the payment can immediately return the results of the request received, but not the payment records. After asking the bank technician to know that the bank test server time is not the current time, need to use a tool software to query the test server date. This date is used to query the payment results.

(2). When querying transactions, it is important to note that the "Start date and end date interval cannot exceed 100 days". And the query time period should contain at least the day before and after the date of payment, because the transaction near 0 may be on the day before, or it may belong to the following days.

In addition, the use of pre-machine, do not need the message format conversion plug-in, because the program shown in the demo, we use the format is already three of the message. 2.2 Procedures

Use HTTP to forward the machine to send the request, when processing the payment and the query return message, the sample program made a few changes, the way the results are processed as follows (in the case of direct payment):

    /** * Processing the returned message * @param the message returned by the result pre-machine */private list<ntqpayrqz> Processresult (String result
        ) {list<ntqpayrqz> Ntqpayrqzs = null;
            if (result! = null && result.length () > 0) {xmlpacket PKTRSP = xmlpacket.valueof (result);
                if (PKTRSP! = null) {String sretcod = Pktrsp.getretcod (); if (Sretcod.equals ("0")) {/*start Bulk Payment package Returns the message start */vector<map> Vecto
                        r = Pktrsp.getproperty ("Ntqpayrqz");
                        Ntqpayrqzs = new arraylist<ntqpayrqz> (); if (Vector!=null) {for (Map map:vector) {NTQPAYRQZ NTQPAYRQ
                                z = new Ntqpayrqz ();
                                ntqpayrqz= (NTQPAYRQZ) Datautil.transmap2bean (MAP,NTQPAYRQZ);
                            Ntqpayrqzs.add (NTQPAYRQZ);
                    }    /*end Bulk Payment Package Returns the end of message */* here should be the processing of the return result of the multi-ratio transaction *//
                    The following is a single pen when processing int sectionsize = Pktrsp.getsectionsize ("Ntqpayrqz");
                    Map Proppayresult = Pktrsp.getproperty ("Ntqpayrqz", 0);//Because I am a single payment in the project, I will return a record at most, so take 0.
                    String sreqsts = (string) proppayresult.get ("reqsts");
                    String srtnflg = (string) proppayresult.get ("RTNFLG");
                                if (Sreqsts.equals ("FIN") && srtnflg.equals ("F")) {Logger.info ("Payment failed:"
                    + Proppayresult.get ("Errtxt"));
                    } else {Logger.info ("payment has been accepted by the Bank (Payment status:" + sreqsts + ")");
                            }} else if (Sretcod.equals ("9")) {logger.info ("Payment unknown exception, please check payment result to confirm payment status, error message:"
                + pktrsp.geterrmsg ()); } else {Logger.info ("paymentFailure: "+ pktrsp.geterrmsg ());
            }} else {Logger.info ("Response message parsing failed");
    }} return Ntqpayrqzs; Note: NTQPAYRQZ is a class constructed with nodes that return messages, with each field under node Ntqpayrqz as a property of the class.

The tool method used is as follows:

    /** * Get data record for specified interface * @param ssectionname * @param index index, starting from 0 * @return map<string,string>
            */Public Map GetProperty (String ssectionname, int index) {if (Data.containskey (Ssectionname)) {
        Return (MAP) ((Vector) Data.get (ssectionname)). get (index);
        }else{return null; }}/** * gets all data records for the specified interface * @param ssectionname * @return map<string,string> */Publ IC Vector getProperty (String ssectionname) {if (Data.containskey (Ssectionname)) {return (vector) data.ge
        T (Ssectionname);
        }else{return null; }}//Map--Bean 1: Using Introspector,propertydescriptor to implement MAP--bean public static Object TRANSMAP2 Bean (map<string, object> Map, Object obj) {try {BeanInfo BeanInfo = Introspector.getbeanin  
            Fo (Obj.getclass ()); propertydescriptor[] PropertyDescriptors = Beaninfo.getpropertYdescriptors ();  
                for (PropertyDescriptor property:propertydescriptors) {String key = Property.getname ();  
                    if (Map.containskey (key)) {Object value = Map.get (key);  
                    Get the property corresponding Setter method setter = Property.getwritemethod ();  
                Setter.invoke (obj, value);  
        }}} catch (Exception e) {logger.error ("Transmap2bean error:", e);  
    } return obj;   }
2.3 Production

(1). Production Environment Application Server connection does not forward server

Operation and maintenance personnel for the connection of the front of the server IP restrictions, in addition, the need for financial personnel telnet to the front server, the front-mounted machine;
  
(2). Return error message: There is approval business, not directly

The Busmod field value in the interface document was omitted when the program was written, with example busmod= 00001 in the document. Compared to the previous production environment pre-machine messages, found that the successful payment of this field value of 00002, modified the program succeeded. This field represents the business approval mode used by the payment settlement business.
Another value in the message: "Business type" field buscod refers to "payment, group payment or internal transfer, etc.", such as buscod=n02031. These two fields are easy to confuse and require special attention, and their lengths are different.
  
(3). In-line payment using the direct payment interface, return error message: Receiver pays must be a merchant account

Consulting technical staff learned that because our company in the bank's account is limited, the payee must join the white list in order to make money. Ask the finance staff, indeed, after joining the whitelist, the success of the payment.

The cross-line is not limited, and it is estimated that there is no limit to the central bank's super-net-banking channel.
  
(4). Cross-line payment of incoming provide NdFeB number issues

Cross-line payment needs to enter the payee line line number (CDTBRD field in the Network bank credit Interface), can only enter the row number of the head office, enter the branch line number error. Consulting China Merchants Bank technical staff, reply is the system does not have a branch number. When docking with China Merchants Bank, the business staff will provide the "Internet banking Interconnection (cross-line clearing system)" line number information. txt ", which has banks and corresponding line numbers.
   2.4 Questions about concurrent requests

In the document "China Merchants Bank Direct System Development Guide version 3.9.0" in section 3.4 and 3.5, there is a description of the frequency of calls and concurrency performance.
Excerpts are as follows:
  

3.4 Call Frequency
     request interval: The time difference between the invocation of this request and the last request, the frequency of the
     call control by the interface type difference control: Handle
 class Request: two times the minimum call interval for the class request is 1 seconds;
 Query class Request: Two query class request minimum call interval is 2 seconds;
 notification class Request: Two notification class request minimum call interval is 5 seconds.

    when the call frequency does not meet the above conditions (the actual call interval is less than the minimum call interval), the system will wait internally by default, waiting time is: The minimum call interval-the actual call interval, waiting to complete before processing the request.

    when the invocation frequency satisfies the above conditions (the actual call interval is greater than or equal to the minimum call interval), the system immediately processes the request and forwards it to the bank backend system.

    call frequency control to log on to the user unit, the different users are not affected by the landing.
3.5 Concurrency Performance
    The system supports multi-user concurrent requests, multiple requests for the same user are queued by priority queue, in order to avoid the request waiting time too long, it is recommended that the same user concurrent request not more than 50, the number of login users unlimited.

Note: A computer can only install a CMB front-mounted machine, more than one computer allows the installation of multiple CMB front-mounted machine.

Development, testing, on-line this channel, before and after about one months, with the bank business and technical personnel to maintain the telephone and QQ communication. Thank the bank technicians for their patient explanations and enthusiastic help.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.