Test method, device, computer equipment and storage medium

By generating simulated payment images and sending them to the corresponding barcode payment transfer callback interface, the problem of incompatibility of the bank's internal system and the third-party payment institution system is solved, and the accuracy and response speed of mobile payment testing is improved.

CN114661619BActive Publication Date: 2025-04-22INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210444485.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-26
Publication Date
2025-04-22
Estimated Expiration
2042-04-26

AI Technical Summary

Technical Problem

During the mobile payment testing process, the bank's internal system is incompatible with the payment system of third-party payment institutions, resulting in low test accuracy.

Method used

By receiving the test request from the payment system, a simulation payment image is generated based on the preset payment instructions and the type of the payment agency, and a simulated payment image is generated, and a corresponding barcode payment transfer callback interface is scanned to generate a payment message to determine the completion of the test request.

Benefits of technology

It improves the accuracy and response speed of the test, reduces the cost of testing, and completes the testing of the bank's internal system without connecting with third-party payment institutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661619B_ABST
    Figure CN114661619B_ABST
Patent Text Reader

Abstract

The present application relates to a testing method, device, computer equipment, storage medium and computer program product, which relates to the field of information security technology and can be used in the field of financial technology or other related fields. The method includes: receiving a test request of a payment system. According to a preset payment instruction generation algorithm and the type of payment institution, a simulated payment image is generated so that after the scanning device performs a scanning operation on the simulated payment image, the payment information contained in the simulated payment image is sent to the barcode payment transfer callback interface corresponding to the type of payment institution. When a payment message is detected, it is determined that the test request of the payment system is completed, and the payment message is generated by the barcode payment transfer callback interface based on the payment information. By adopting this method, the test of the internal system of the bank can be completed without docking with a third-party payment institution, the test efficiency is high, the test request response is timely, the test cost is reduced, and the automation degree of the test can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a testing method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] Mobile payment refers to the use of mobile clients such as mobile phones to make electronic currency payments. Mobile payment effectively combines the Internet, terminal devices, and financial institutions to form a new payment system. With the development of Internet technology, mobile payment has gradually become an ideal payment method for people.

[0003] In order to ensure the smooth operation of the mobile payment function, technical personnel are required to test the mobile payment process in various payment scenarios to discover and improve the problems in the mobile payment process. At present, in the process of testing mobile payments, if a complete mobile payment test process is to be completed, the bank's system needs to connect to the UnionPay system. In the case of inter-bank payment, in addition to the UnionPay system, the bank's system also needs to connect to multiple types of third-party payment institutions. The bank's internal testing system is incompatible with the payment system of the third-party payment institution, resulting in low test accuracy. Summary of the invention

[0004] Based on this, it is necessary to provide a test method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve test accuracy and test response speed in response to the above technical problems.

[0005] In a first aspect, the present application provides a testing method. The method comprises:

[0006] receiving a test request from a payment system, the test request including a type of a payment institution connected to the payment system;

[0007] Generate a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution, so that after the scanning device scans the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of the payment institution;

[0008] When the payment message is detected, it is determined that the test request of the payment system is completed, and the payment message is generated by the barcode payment transfer callback interface based on the payment information.

[0009] In one embodiment, generating a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution includes:

[0010] Generate a simulated payment instruction code according to a preset payment instruction generation algorithm and the type of the payment institution;

[0011] The simulated payment instruction code is converted according to a preset barcode image processing algorithm to determine a simulated payment image.

[0012] In one embodiment, the generating of the simulated payment instruction code according to the preset payment instruction generation algorithm and the type of the payment institution includes:

[0013] Get simulated payment account information and timestamp information;

[0014] Concatenate the first character string corresponding to the simulated payment account information and the second character string corresponding to the timestamp information to obtain a third character string;

[0015] Extracting a message digest of the third character string using a preset encryption algorithm;

[0016] Performing base conversion on bytes included in the message digest of the third character string to obtain a first target message digest in a target base form;

[0017] A simulated payment instruction code is determined according to the first target message digest and the type of the payment institution.

[0018] In one embodiment, converting the bytes included in the message digest of the third character string to obtain the first target message digest in the target system includes:

[0019] Performing base conversion on bytes included in the message digest of the third character string to obtain a conversion result;

[0020] Encrypting the conversion result according to a preset encryption algorithm to obtain an initial summary;

[0021] Extracting the initial summary to obtain a first extraction result;

[0022] The first extraction result is converted into a base, to obtain a first target message digest in a target base.

[0023] In one embodiment, determining the simulated payment instruction code according to the first target message digest and the type of the payment institution includes:

[0024] Determining the identification code of the target payment institution according to the type of the payment institution;

[0025] The identification code of the target payment institution and the first target message digest are concatenated to obtain a simulated payment instruction code.

[0026] In a second aspect, the present application also provides a testing device. The device comprises:

[0027] A receiving module, configured to receive a test request from a payment system, wherein the test request includes a type of a payment institution connected to the payment system;

[0028] A generation module, configured to generate a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution, so that after the scanning device scans the simulated payment image, the scanning device sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of the payment institution;

[0029] A determination module is used to determine that the test request of the payment system is completed when the payment message is detected, and the payment message is generated by the barcode payment transfer callback interface based on the payment information.

[0030] In one embodiment, the generating module is specifically used for:

[0031] Generate a simulated payment instruction code according to a preset payment instruction generation algorithm and the type of the payment institution;

[0032] The simulated payment instruction code is converted according to a preset barcode image processing algorithm to determine a simulated payment image.

[0033] In one embodiment, the generating module is specifically used for:

[0034] Get simulated payment account information and timestamp information;

[0035] Concatenate the first character string corresponding to the simulated payment account information and the second character string corresponding to the timestamp information to obtain a third character string;

[0036] Extracting a message digest of the third character string using a preset encryption algorithm;

[0037] Performing base conversion on bytes included in the message digest of the third character string to obtain a first target message digest in a target base form;

[0038] A simulated payment instruction code is determined according to the first target message digest and the type of the payment institution.

[0039] In one embodiment, the generating module is specifically used for:

[0040] Performing base conversion on bytes included in the message digest of the third character string to obtain a conversion result;

[0041] Encrypting the conversion result according to a preset encryption algorithm to obtain an initial summary;

[0042] Extracting the initial summary to obtain a first extraction result;

[0043] The first extraction result is converted into a base, to obtain a first target message digest in a target base.

[0044] In one embodiment, the determining module is specifically used to:

[0045] Determining the identification code of the target payment institution according to the type of the payment institution;

[0046] The identification code of the target payment institution and the first target message digest are concatenated to obtain a simulated payment instruction code.

[0047] In a third aspect, the present application further provides a test system, which includes a test terminal, a scanning device, and an interface device, wherein a barcode payment transfer callback interface is provided on the interface device:

[0048] The test terminal is used to receive a test request from a payment system, wherein the test request includes the type of a payment institution connected to the payment system; generate a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution, so that after the scanning device scans the simulated payment image, it sends the payment information contained in the simulated payment image to a barcode payment transfer callback interface corresponding to the type of the payment institution;

[0049] The test terminal is also used to determine that the test request of the payment system is completed when the payment message is detected, and the payment message is generated by the barcode payment transfer callback interface based on the payment information.

[0050] In a fourth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0051] receiving a test request from a payment system, the test request including a type of a payment institution connected to the payment system;

[0052] Generate a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution, so that after the scanning device scans the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of the payment institution;

[0053] When the payment message is detected, it is determined that the test request of the payment system is completed, and the payment message is generated by the barcode payment transfer callback interface based on the payment information.

[0054] In a fifth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0055] receiving a test request from a payment system, the test request including a type of a payment institution connected to the payment system;

[0056] Generate a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution, so that after the scanning device scans the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of the payment institution;

[0057] When the payment message is detected, it is determined that the test request of the payment system is completed, and the payment message is generated by the barcode payment transfer callback interface based on the payment information.

[0058] In a sixth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0059] receiving a test request from a payment system, the test request including a type of a payment institution connected to the payment system;

[0060] Generate a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution, so that after the scanning device scans the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of the payment institution;

[0061] When the payment message is detected, it is determined that the test request of the payment system is completed, and the payment message is generated by the barcode payment transfer callback interface based on the payment information.

[0062] The above-mentioned test method, device, computer equipment, storage medium and computer program product, the method comprises: receiving a test request of a payment system, the test request includes the type of payment institution connected to the payment system; generating a simulated payment image according to a preset payment instruction generation algorithm and the type of payment institution, so that after the scanning device performs a scanning operation on the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of payment institution; in the case of detecting the payment message, determining that the test request of the payment system is completed, the payment message is generated by the barcode payment transfer callback interface based on the payment information. By adopting this method, the test of the internal system of the bank can be completed without connecting with a third-party payment institution, the test efficiency is high, the test request response is timely, and the cost of the test can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 A schematic diagram of a test method in one embodiment;

[0064] Figure 2 A schematic diagram of a flow chart of a step of determining a simulated payment image in one embodiment;

[0065] Figure 3 A schematic diagram of a flow chart of a step of determining a simulated payment instruction code in one embodiment;

[0066] Figure 4 A schematic diagram of a flow chart of a step of obtaining a first target message digest in an embodiment;

[0067] Figure 5 A schematic diagram of a process of splicing steps in an embodiment;

[0068] Figure 6 A schematic diagram of a process for generating a payment message in one embodiment;

[0069] Figure 7 A schematic diagram of a structure for generating a payment message in an embodiment;

[0070] Figure 8 is a structural block diagram of a testing device in one embodiment;

[0071] Fig. 9 is an internal structure diagram of a computer device in one embodiment;

[0072] Fig.10 FIG. 4 is a diagram showing the internal structure of a test system in one embodiment. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0074] Aggregate payment is based on merchant acquiring services, which collects existing payment methods in the market so that merchants can provide customers with various types of payment methods, such as WeChat, Alipay, and third-party payment methods such as UnionPay, to complete the acquisition. Aggregate payment business based on bank background means that merchants can accept various third-party payment methods such as WeChat, Alipay, UnionPay QR code, etc., and carry out merchant acquiring services. For example, when a customer checks out at a supermarket, the cashier takes out the POS to scan the customer's payment code to complete the payment. Since banks need to connect to the third-party production environment when conducting payment tests, the verification of related business transactions consumes real resources, and the bank's internal testing system is incompatible with the payment system of third-party payment institutions, resulting in low test accuracy.

[0075] In one embodiment, Figure 1 As shown, a test method is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The above-mentioned terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented with an independent server or a server cluster composed of multiple servers. In this embodiment, the test method includes the following steps:

[0076] Step 102: Receive a test request from the payment system.

[0077] The test request includes the type of payment institution connected to the payment system. The payment institution may be a third-party payment institution, and there may be multiple types of third-party payment institutions.

[0078] Specifically, the terminal receives the test request and parses the test request to obtain information carried in the test request, which is used to characterize the type of the payment institution. The payment institution is used to interact with the payment system for payment. The type of the payment institution can be determined according to the actual application scenario or in response to the selection operation of the tester.

[0079] Step 104, generates a simulated payment image according to a preset payment instruction generation algorithm and the type of payment institution, so that after the scanning device scans the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of payment institution.

[0080] Specifically, the scanning device may be a test scanning device, such as a POS (point of sale) device; the terminal may generate a simulated payment image of a payment account for a simulated payment test based on the type of payment institution parsed in the test request and through a pre-configured payment instruction generation algorithm. After the terminal generates the simulated payment image, the test scanning device may scan the simulated payment image, so that the test scanning device may extract the payment information contained in the simulated payment image based on the scanning operation, and send the payment information to the target barcode payment transfer callback interface through the card organization payment front-end, and the target barcode payment transfer callback interface is an interface corresponding to the type of payment institution.

[0081] Step 106, when the payment message is detected, determining that the test request of the payment system is completed, wherein the payment message is generated by the barcode payment transfer callback interface based on the payment information.

[0082] Specifically, the terminal sends the payment information to the barcode payment transfer callback interface, and upon receiving the payment information at the barcode payment transfer callback interface, the terminal can assemble the messages to generate a payment message, which is a payment return message.

[0083] Specifically, if the barcode payment transfer callback interface returns a payment message, it means that the test of the payment system is completed, and the payment system can complete the acquiring service normally, that is, the payment system can normally allocate resources in the customer's account to the merchant's account.

[0084] Optionally, if the terminal detects a payment message returned by the barcode payment transfer callback interface, the terminal can determine that the payment system can be used normally.

[0085] In the above-mentioned test method, the method includes: receiving a test request from a payment system, the test request including the type of payment institution connected to the payment system. Generate a simulated payment image according to a preset payment instruction generation algorithm and the type of payment institution, so that after the scanning device performs a scanning operation on the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of payment institution. When the payment message is detected, it is determined that the test request of the payment system is completed, and the payment message is generated by the barcode payment transfer callback interface based on the payment information. By adopting this method, the test of the bank's internal system can be completed without connecting with a third-party payment institution, the test efficiency is high, the test request response is timely, the test cost is reduced, and the degree of automation of the test can be improved.

[0086] In one embodiment, Figure 2 As shown, the specific processing process of step 104 "generating a simulated payment image according to a preset payment instruction generation algorithm and the type of payment institution" includes:

[0087] Step 202, generating a simulated payment instruction code according to a preset payment instruction generation algorithm and the type of payment institution.

[0088] Specifically, the preset payment instruction generation algorithm may be an encryption algorithm based on SHA256, and the terminal processes the information corresponding to the type of the payment institution, the information of the simulated payment account provided by the tester, and the real-time timestamp information through the payment instruction generation algorithm to generate a simulated payment instruction code corresponding to the tester. That is, the input of the payment instruction generation algorithm may include the type of the payment institution, the information of the simulated payment account provided by the tester, and the real-time timestamp information, and the output of the payment instruction generation algorithm may be a simulated payment instruction code, which is used to perform simulated payment, including for the test scanning device to perform scanning operations, etc.

[0089] Step 204, converting the simulated payment instruction code according to a preset barcode image processing algorithm to determine a simulated payment image.

[0090] Specifically, the preset barcode image processing algorithm may be a zxing algorithm. When the simulated payment instruction code is a string of characters, the terminal may perform image conversion processing on the simulated payment instruction code to obtain a simulated payment image corresponding to the simulated payment instruction code. Optionally, the simulated payment image may be in the form of a QR code or a barcode, etc. The zxing algorithm may be an open source 1D or 2D barcode image processing library (image processing algorithm) in multiple formats implemented in Java.

[0091] In this embodiment, the simulated payment image generated by the payment instruction generation algorithm can complete the testing of the payment system under safer and more confidential conditions.

[0092] In one embodiment, Figure 3 As shown, the specific processing of the step "generating a simulated payment instruction code according to a preset payment instruction generation algorithm and the type of payment institution" includes:

[0093] Step 302, obtaining simulated payment account information and timestamp information.

[0094] Among them, the simulated payment account can be the account of the payment institution provided by the tester. When the payment institution is a bank, the simulated payment account can be the card number of the bank card, and the card number can be a virtual card number. When the payment institution is a third-party payment institution, the simulated payment account can be the digital account number of the third-party payment institution provided by the tester.

[0095] Specifically, the terminal obtains the simulated payment account information and timestamp information provided by the tester, and the timestamp information may be the start time information for generating the simulated instruction payment code.

[0096] Step 304: concatenate the first character string corresponding to the simulated payment account information and the second character string corresponding to the timestamp information to obtain a third character string.

[0097] Specifically, the terminal can directly concatenate the first string corresponding to the simulated payment account information and the second string corresponding to the timestamp information to obtain a third string. In this way, the terminal can determine the concatenation order of the first string and the second string according to the actual application scenario, and the concatenation order can be

[0098] In one example, the terminal may extract some bytes from the initial character string corresponding to the timestamp information to obtain the second character string. For example, the terminal may randomly extract the initial character string to obtain the second character string of random bits.

[0099] Step 306: extract the message digest of the third character string using a preset encryption algorithm.

[0100] Among them, the preset encryption algorithm can be the SHA256 algorithm.

[0101] Specifically, the terminal may encrypt the third string using the SHA256 algorithm to obtain a message digest of the third string, where the message digest may be a binary 32-byte message digest or a 256-bit message digest. The results of the terminal encrypting multiple different strings using the SHA256 algorithm are all 32-byte results, which may be referred to as a message digest.

[0102] Step 308: Perform base conversion on the bytes included in the message digest of the third character string to obtain a first target message digest in a target base format.

[0103] Specifically, the terminal may perform base conversion on the message digest of the third character string. The specific process of base conversion may be that the terminal converts the binary message digest into a first target message digest in a target base form, and the target base form may be hexadecimal.

[0104] In one example, when the message digest of the third character string is 32 bytes, the terminal can extract the message digest of the third character string, that is, intercept part of the bytes from the message digest to obtain the bytes of the target intercepted part, so that the terminal can perform base conversion on the bytes of the target intercepted part to obtain the first target message digest in the target base form. For example, the terminal can intercept the part from the 21st to the 30th bit of the message digest, and use the bytes contained in the part from the 21st to the 30th bit of the message digest as the bytes of the target intercepted part.

[0105] Step 310, determining a simulated payment instruction code according to the first target message digest and the type of payment institution.

[0106] Specifically, the terminal determines the institution identification code corresponding to the type of payment institution according to the type of the payment institution, so that the terminal can concatenate the first target message digest with the institution identification code corresponding to the type of payment institution to obtain a simulated payment instruction code.

[0107] Optionally, the first target message digest may be AAAA, and the institution identification code corresponding to the type of the payment institution may be BBBB. In this way, the terminal concatenates the first target message digest AAAA with the institution identification code BBBB corresponding to the type of the payment institution, and the resulting simulated payment instruction code may be AAAABBBB.

[0108] In another example, the terminal concatenates the first target message digest AAAA with the institution identification code BBBB corresponding to the type of the payment institution, and the obtained simulated payment instruction code may also be BBBBAAAA. That is, the concatenation order may be determined by the terminal according to the actual application scenario and the tester's selection operation.

[0109] In this embodiment, multiple encryption processes are performed based on a preset payment instruction generation algorithm and the type of payment institution, so that the encryption type of the obtained simulated payment instruction can be better and more secure.

[0110] In one embodiment, Figure 4As shown, the specific processing process of the step of "converting the bytes included in the message digest of the third character string to obtain the first target message digest in the target system" includes:

[0111] Step 402: Perform base conversion on the bytes included in the message digest of the third character string to obtain a conversion result.

[0112] Specifically, the terminal may perform base conversion on the message digest of the third string. The specific process of base conversion may be that the terminal converts the binary message digest of the third string into a message digest in a target base form, the target base form may be hexadecimal, and the message digest in the target base form is the conversion result.

[0113] In one example, when the message digest of the third character string is 32 bytes, the terminal can extract the message digest of the third character string, that is, intercept part of the bytes from the message digest to obtain the bytes of the target intercepted part, so that the terminal can perform base conversion on the bytes of the target intercepted part to obtain a conversion result, which is the message digest in the target base form. For example, the terminal can intercept the part from the 21st to the 30th bit of the message digest, and use the bytes contained in the part from the 21st to the 30th bit of the message digest as the bytes of the target intercepted part.

[0114] Step 404: encrypt the conversion result according to a preset encryption algorithm to obtain an initial summary.

[0115] Specifically, the preset encryption algorithm may be a DES encryption algorithm or a 3DES encryption algorithm. In this way, the terminal may encrypt the conversion result based on the DES encryption algorithm to obtain an initial summary, and the byte length of the initial summary may be consistent with the byte length of the conversion result. The byte length of the initial summary may also be twice the byte length of the conversion result.

[0116] Step 406: extract the initial summary to obtain a first extraction result.

[0117] Specifically, the terminal randomly extracts the multiple bytes included in the initial summary according to the arrangement order of each byte to obtain a first extraction result. For example, the terminal may extract the 32nd to 41st bytes of the initial summary to obtain the first extraction result.

[0118] In one example, the terminal may determine a byte extraction rule according to the type of each payment institution, so that the terminal may extract multiple bytes included in the initial summary according to the byte extraction rule to obtain a first extraction result.

[0119] Step 408: Convert the first extraction result into a base, and obtain a first target message digest in a target base.

[0120] Specifically, the terminal performs a base conversion on the first extraction result, for example, the first target message digest may be converted into a hexadecimal form.

[0121] In this embodiment, multiple encryption processes are performed based on a preset payment instruction generation algorithm and the type of payment institution, so that the encryption type of the obtained simulated payment instruction can be better and more secure.

[0122] In one embodiment, Figure 5 As shown, the specific processing process of the step "determining the simulated payment instruction code according to the first target message digest and the type of the payment institution" includes:

[0123] Step 502, determining the identification code of the target payment institution according to the type of the payment institution.

[0124] Specifically, the terminal can determine the identification code corresponding to the type of payment institution according to the type. For example, the identification code of the first type of payment institution may be xxxx1, the identification code of the second type of payment institution may be xxxx2, the identification code of the third type of payment institution may be xxxx3, and so on.

[0125] Step 504, concatenate the identification code of the target payment institution and the first target message digest to obtain a simulated payment instruction code.

[0126] Specifically, the first target message digest may be AAAA, and when the type of the payment institution is the first type, the terminal may determine that the identification code of the payment institution of the first type may be xxxx1. In this way, the terminal concatenates the first target message digest AAAA with the institution identification code xxxx1 corresponding to the type of the payment institution, and the obtained simulated payment instruction code may be xxxx1.

[0127] In an example, the terminal may concatenate the first target message digest AAAA with the institution identification code xxxx1 corresponding to the type of the payment institution, and the obtained simulated payment instruction code may also be xxxx1AAAA.

[0128] In this embodiment, multiple encryption processes are performed through a preset payment instruction generation algorithm and the type of payment institution. Different identification codes of payment institutions can also be determined according to the different types of payment institutions, so that the encryption type of the obtained simulated payment instructions can be better and more secure.

[0129] In one embodiment, Figure 6 As shown, the method also includes:

[0130] Step 602: Determine the payment message header and the payment message body through the preset calling tool class in the barcode payment transfer callback interface.

[0131] Step 604: Generate a payment message according to the payment information, the payment message header and the payment message body.

[0132] In this embodiment, by developing a barcode payment transfer callback interface, the interface can generate return messages of various types of payment institutions, i.e., payment messages, in a timely manner when receiving payment information. In this way, the interface can forward the generated payment message back to the caller, i.e., the payment system or terminal.

[0133] Specifically, Figure 7 As shown, the specific process of generating a payment message through the developed barcode transfer callback interface can be: the interface receives the payment message and performs statistics. In this way, the interface can call the tool class to complete the generation of the payment message. For example, the tool class can be called to assemble the message header and the message body, and the assembled result is used as the payment message. In this way, the interface can call the access layer service and forward the payment message to the caller (acquiring business application). In addition, the terminal can also record the transaction flow information corresponding to the payment information. The terminal needs to collect the identity information of the payment institution (institution number), transaction flow information (serial number), identification information returned by the payment message (return code) and the payment message.

[0134] The testing method in this embodiment can simulate scenarios that cannot be verified, such as payment status in progress and return timeout due to abnormal processing by a third-party payment institution. It has no difference from the production scenario and there is no risk of production fraud. It can also perform automated testing and avoid risks to the tester's account.

[0135] Hereinafter, the present invention describes in detail the specific process of executing the test method provided by the present invention in conjunction with a specific embodiment:

[0136] Step 1, generate a payment instruction code: The terminal can simulate and generate a payment instruction code that complies with the payment institution's specifications by using a preset payment instruction generation algorithm. The preset payment instruction generation algorithm is based on the SHA256 algorithm, which is irreversible. The algorithm implementation process can be as follows:

[0137] 1) Implement SHA256 encryption through account information and timestamp information to obtain a 32-byte message digest, or a 256-bit message digest.

[0138] Specifically, the above account number refers to the bank card number provided by the tester or the account of the third-party payment institution provided by the tester. Bank card number, such as a debit card (savings card) or credit card of xx bank. The account of the third-party payment institution can be, for example, when using the xx program to pay, the payment code itself is generated by the digital account corresponding to the xx program (third-party payment institution). The simulated payment code and the simulated payment image are subject to a time limit, which can generally be 60 seconds. The timestamp information can be the natural time when the simulated payment image is ready to be generated.

[0139] Specifically, the first string corresponding to the account information and the second string corresponding to the timestamp are concatenated, and the concatenated string is encrypted by the SHA256 algorithm to obtain a 32-byte message digest, or a 256-bit message digest. Optionally, for a message of any length, the SHA256 algorithm calculates a 32-byte result, which is called a message digest.

[0140] In one example, the terminal can randomly extract the second string corresponding to the timestamp to obtain a partial string. In this way, the terminal can concatenate the first string corresponding to the account information with the partial string of the second string corresponding to the timestamp to obtain a third string. In this way, the terminal encrypts the concatenated string (the third string) through the SHA256 algorithm to obtain a 32-byte message digest, or obtains a 256-bit message digest.

[0141] 2) Intercept some bytes for code value conversion.

[0142] Specifically, the terminal may intercept the message digest, for example, by intercepting part of the bytes.

[0143] In one example, the terminal may intercept the 21st to 30th bits of the message digest, and then convert the intercepted partial bytes (the 21st to 30th bits) into hexadecimal.

[0144] 3) Obtain a single or double length message digest.

[0145] The terminal may further encrypt the result after conversion in step 2), for example, by performing DES encryption or 3DES encryption to obtain a message digest.

[0146] 4) Then intercept some bytes for code value conversion to obtain the final result summary value, that is, the payment instruction code.

[0147] Specifically, the terminal intercepts some bytes of the converted result, for example, intercepts the 32nd to 41st byte, and converts the intercepted result into hexadecimal. Different types of payment institutions have different byte interception positions. In this way, the terminal can concatenate the above hexadecimal conversion result with the institution identification of the corresponding type of payment institution to obtain the final summary value, that is, the payment instruction code. For example,

[0148] Step 2: Generate a QR code.

[0149] The terminal can process the payment instruction code through a preset barcode image processing short code to generate a QR code image.

[0150] Step 3: Assemble the message.

[0151] The terminal simulates and generates return messages (payment messages) of various types of payment institutions through the barcode payment transfer callback interface, and forwards the messages to the caller.

[0152] Step 4, scan the QR code to pay.

[0153] The present invention can provide a device for generating a payment code, and the specific implementation logic is as follows:

[0154] The terminal can input the account information and timestamp information contained in the test request into the payment code generation interface, and the terminal also needs to input the type of the determined payment institution into the payment code generation interface. In this way, the payment code generation interface can generate a payment code based on the method described in the above embodiment. In this way, the terminal can use the test scanning device (POS machine) to scan the payment code. When the terminal can detect the return of the payment message, the terminal can determine that the payment institution is normal and the payment is successful.

[0155] The method provided by the embodiment of the present invention can receive a test request of a payment system, and the test request includes the type of payment institution connected to the payment system. According to the preset payment instruction generation algorithm and the type of payment institution, a simulated payment image is generated, so that after the scanning device scans the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of payment institution. When the payment message is detected, it is determined that the test request of the payment system is completed, and the payment message is generated by the barcode payment transfer callback interface based on the payment information. By adopting this method, the test of the bank's internal system can be completed without connecting with a third-party payment institution. The test efficiency is high, the test request response is timely, the test cost is reduced, and the degree of automation of the test can be improved.

[0156] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0157] Based on the same inventive concept, the embodiment of the present application also provides a test device for implementing the test method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more test device embodiments provided below can refer to the limitations on the test method above, and will not be repeated here.

[0158] In one embodiment, Figure 8 As shown, a testing device 700 is provided, comprising:

[0159] The receiving module 701 is used to receive a test request from the payment system, where the test request includes the type of payment institution connected to the payment system.

[0160] The generation module 702 is used to generate a simulated payment image according to a preset payment instruction generation algorithm and the type of payment institution, so that after the scanning device scans the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of payment institution.

[0161] The determination module 703 is used to determine that the test request of the payment system is completed when the payment message is detected, and the payment message is generated by the barcode payment transfer callback interface based on the payment information.

[0162] In one embodiment, the generating module is specifically used for:

[0163] Generate a simulated payment instruction code according to a preset payment instruction generation algorithm and the type of the payment institution;

[0164] The simulated payment instruction code is converted according to a preset barcode image processing algorithm to determine a simulated payment image.

[0165] In one embodiment, the generating module is specifically used for:

[0166] Get simulated payment account information and timestamp information;

[0167] Concatenate the first character string corresponding to the simulated payment account information and the second character string corresponding to the timestamp information to obtain a third character string;

[0168] Extracting a message digest of the third character string using a preset encryption algorithm;

[0169] Performing base conversion on bytes included in the message digest of the third character string to obtain a first target message digest in a target base form;

[0170] A simulated payment instruction code is determined according to the first target message digest and the type of the payment institution.

[0171] In one embodiment, the generating module is specifically used for:

[0172] Performing base conversion on bytes included in the message digest of the third character string to obtain a conversion result;

[0173] Encrypting the conversion result according to a preset encryption algorithm to obtain an initial summary;

[0174] Extracting the initial summary to obtain a first extraction result;

[0175] The first extraction result is converted into a base, to obtain a first target message digest in a target base.

[0176] In one embodiment, the determining module is specifically used to:

[0177] Determining the identification code of the target payment institution according to the type of the payment institution;

[0178] The identification code of the target payment institution and the first target message digest are concatenated to obtain a simulated payment instruction code.

[0179] Each module in the above-mentioned test device 700 can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0180] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store test-related data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a test method is implemented.

[0181] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0182] In one embodiment, the present invention also provides a testing system, such as Fig.10 As shown, the test system includes a test terminal 100, a scanning device 200 and an interface device 300, and the interface device is provided with a barcode payment transfer callback interface:

[0183] The test terminal 100 is used to receive a test request from a payment system, wherein the test request includes the type of the payment institution connected to the payment system; generate a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution, so that after the scanning device 200 scans the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of the payment institution; and generate a payment message through the barcode payment transfer callback interface on the interface device 300;

[0184] The test terminal is further configured to, upon detecting the payment message, determine that the test request of the payment system is completed.

[0185] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0186] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0187] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0188] It should be noted that the methods and devices of the embodiments of the present disclosure can be used in the field of information security technology, in the field of financial technology or other related fields, and the methods and devices of the embodiments of the present disclosure are not limited to the fields of application.

[0189] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0190] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0191] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A testing method, characterized in that: The method comprises: receiving a test request from a payment system, the test request including a type of a payment institution connected to the payment system; Generate a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution, so that after the scanning device scans the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of the payment institution; In the case of detecting a payment message, determining that the test request of the payment system is completed, wherein the payment message is generated by the barcode payment transfer callback interface based on the payment information; The generating of the simulated payment image according to the preset payment instruction generating algorithm and the type of the payment institution comprises: Generate a simulated payment instruction code according to a preset payment instruction generation algorithm and the type of the payment institution; The simulated payment instruction code is converted according to a preset barcode image processing algorithm to determine a simulated payment image.

2. The method according to claim 1, characterized in that The generating of the simulated payment instruction code according to the preset payment instruction generating algorithm and the type of the payment institution comprises: Get simulated payment account information and timestamp information; Concatenate the first character string corresponding to the simulated payment account information and the second character string corresponding to the timestamp information to obtain a third character string; Extracting a message digest of the third character string using a preset encryption algorithm; Performing base conversion on bytes included in the message digest of the third character string to obtain a first target message digest in a target base form; A simulated payment instruction code is determined according to the first target message digest and the type of the payment institution.

3. The method according to claim 2, characterized in that The step of converting the bytes contained in the message digest of the third character string to obtain a first target message digest in a target system includes: Performing base conversion on bytes included in the message digest of the third character string to obtain a conversion result; Encrypting the conversion result according to a preset encryption algorithm to obtain an initial summary; Extracting the initial summary to obtain a first extraction result; The first extraction result is converted into a base, to obtain a first target message digest in a target base.

4. The method according to claim 2, characterized in that: The step of determining the simulated payment instruction code according to the first target message digest and the type of the payment institution includes: Determining the identification code of the target payment institution according to the type of the payment institution; The identification code of the target payment institution and the first target message digest are concatenated to obtain a simulated payment instruction code.

5. A testing device, characterized in that: The device comprises: A receiving module, configured to receive a test request from a payment system, wherein the test request includes a type of a payment institution connected to the payment system; A generation module, configured to generate a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution, so that after the scanning device scans the simulated payment image, the scanning device sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of the payment institution; A determination module, configured to determine that the test request of the payment system is completed when a payment message is detected, wherein the payment message is generated by the barcode payment transfer callback interface based on the payment information; The generation module is used to: generate a simulated payment instruction code according to a preset payment instruction generation algorithm and the type of the payment institution; convert the simulated payment instruction code according to a preset barcode image processing algorithm to determine a simulated payment image.

6. A testing system, characterized in that: The test system includes a test terminal, a scanning device and an interface device, and the interface device is provided with a barcode payment transfer callback interface: The test terminal is used to receive a test request from the payment system, wherein the test request includes the type of the payment institution connected to the payment system; Generate a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution, so that after the scanning device scans the simulated payment image, it sends the payment information contained in the simulated payment image to the barcode payment transfer callback interface corresponding to the type of the payment institution; The test terminal is further used to determine that the test request of the payment system is completed when a payment message is detected, wherein the payment message is generated by the barcode payment transfer callback interface based on the payment information; The generating a simulated payment image according to a preset payment instruction generation algorithm and the type of the payment institution comprises: generating a simulated payment instruction code according to a preset payment instruction generation algorithm and the type of the payment institution; The simulated payment instruction code is converted according to a preset barcode image processing algorithm to determine a simulated payment image.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Payment app test method and device thereof

    CN106354628A

  • Scan code payment test method and system for controlling barcode

    CN108701389A