Disclosure of Invention
In view of the above, the application provides a test method for preferential payment, and the application of the method provided by the application can shorten the test link for preferential payment and reduce the test time for preferential payment, thereby reducing the input cost during test. The application also provides a test device for preferential payment, which is used for supporting the application of the method in practice.
In order to achieve the above purpose, the present application provides the following technical solutions:
a method for testing preferential payment, comprising:
when a payment test instruction for performing preferential payment test is received, acquiring each piece of payment preferential information corresponding to the payment test instruction in a preset payment preferential system;
according to a preset payment message assembly rule, assembling each payment preferential information into a preferential payment message corresponding to the payment test instruction;
sending the preferential payment message to a preset account deducting system, triggering the account deducting system to deduct accounts according to the preferential payment message, and generating a corresponding account deducting message;
acquiring the account deduction message fed back by the account deduction system, analyzing the account deduction message, and determining each account deduction preferential information in the account deduction message;
determining the account deduction preferential information corresponding to each piece of payment preferential information in the account deduction message;
and judging the effective state of each payment preferential information according to the account deduction preferential information corresponding to each payment preferential information to obtain a judging result of each payment preferential information so as to finish preferential payment test corresponding to the payment test instruction.
The method, optionally, the setting process of the payment preferential information includes:
determining each piece of preferential type information and each piece of preferential limiting information set according to preset preferential rules;
and carrying out association combination on each piece of preferential type information and each piece of preferential limiting information according to a preset preferential association rule to obtain each piece of combined preferential combination information, and generating payment preferential information corresponding to each piece of preferential combination information.
In the foregoing method, optionally, the obtaining, in the preset payment preference system, each payment preference information corresponding to the payment test instruction includes:
analyzing the payment test instruction and acquiring each preferential identifier in the payment test instruction;
determining each piece of payment preferential information in a preset payment preferential system;
and traversing each of the preferential identifiers in turn to determine the payment preferential information corresponding to each preferential identifier.
In the above method, optionally, the determining the effective state of each payment preferential information according to the account deduction preferential information corresponding to each payment preferential information includes:
comparing each piece of payment preferential information with the corresponding account deduction preferential information, and judging whether the payment preferential information is consistent with the corresponding account deduction preferential information or not;
when the payment preferential information is consistent with the account deduction preferential information in comparison, determining that the effective state of the payment preferential information is successful;
and when the comparison of the payment preferential information and the account deduction preferential information is inconsistent, determining that the effective state of the payment preferential information is failure.
The method, optionally, further comprises:
assembling the judgment result of each payment preferential information into a feedback message, and sending the feedback message to preset display equipment;
and triggering the display equipment to display the judgment result of each payment preferential information in the feedback message.
A test device for preferential payment, comprising:
the first acquisition unit is used for acquiring each piece of payment preferential information corresponding to the payment test instruction in a preset payment preferential system when receiving the payment test instruction for performing preferential payment test;
the assembly unit is used for assembling each piece of payment preferential information into a preferential payment message corresponding to the payment test instruction according to a preset payment message assembly rule;
the triggering unit is used for sending the preferential payment message to a preset account deducting system, triggering the account deducting system to deduct accounts according to the preferential payment message, and generating a corresponding account deducting message;
the second acquisition unit is used for acquiring the account deducting message fed back by the account deducting system, analyzing the account deducting message and determining each account deducting preferential information in the account deducting message;
the first determining unit is used for determining account deduction preferential information corresponding to each piece of payment preferential information in the account deduction message;
and the judging unit is used for judging the effective state of each payment preferential information according to the account deduction preferential information corresponding to each payment preferential information to obtain the judging result of each payment preferential information so as to complete preferential payment test corresponding to the payment test instruction.
The above device, optionally, further comprises:
the second determining unit is used for determining each piece of preferential type information and each piece of preferential limiting information set according to preset preferential rules;
and the generation unit is used for carrying out association combination on the coupon type information and the coupon limiting information according to preset coupon association rules to obtain combined coupon combination information, and generating payment coupon information corresponding to each coupon combination information.
The above apparatus, optionally, the first obtaining unit includes:
the analysis subunit is used for analyzing the payment test instruction and acquiring each preferential identifier in the payment test instruction;
a first determining subunit, configured to determine each piece of payment preference information in a preset payment preference system;
and the traversal subunit is used for traversing each of the preferential identifiers in turn to determine the payment preferential information corresponding to each preferential identifier.
The above device, optionally, the determining unit includes:
the comparison subunit is used for comparing each piece of payment preferential information with the corresponding account deduction preferential information and judging whether the payment preferential information is consistent with the corresponding account deduction preferential information or not;
the second determining subunit is used for determining that the effective state of the payment preferential information is successful when the payment preferential information is consistent with the deduction preferential information;
and the third determination subunit is used for determining that the effective state of the payment preferential information is failed when the comparison of the payment preferential information and the deduction preferential information is inconsistent.
The above device, optionally, further comprises:
the sending unit is used for assembling the judgment results of the payment preferential information into a feedback message and sending the feedback message to a preset display device;
and the display unit is used for triggering the display equipment to display the judgment result of each payment preferential information in the feedback message.
Compared with the prior art, the application has the following advantages:
the application provides a test method of preferential payment, which comprises the following steps: when a payment test instruction for performing preferential payment test is received, acquiring each piece of payment preferential information corresponding to the payment test instruction in a preset payment preferential system, and assembling each piece of payment preferential information into preferential payment messages corresponding to the payment test instruction according to preset payment message assembling rules; sending the preferential payment message to a preset account deducting system, and triggering the account deducting system to deduct accounts according to the preferential payment message; analyzing the account deduction message fed back by the account deduction system to obtain each account deduction preferential information in the account deduction message, judging the effective state of each payment preferential information according to each account deduction preferential information, and obtaining a judging result of each payment preferential information to finish preferential payment test corresponding to the payment test instruction. By applying the method provided by the application, the link of the preferential payment test is shortened by applying the preset payment preferential system, the time period for testing is shortened, a more convenient testing environment is provided for developers, and the input cost for testing is reduced.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the present disclosure, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The application is applicable to numerous general purpose or zhuang-wary computing device environments or configurations. For example: personal computers, server computers, multiprocessor devices, distributed computing environments that include any of the above devices or equipment, and so forth.
The embodiment of the application provides a method for testing preferential payment, which can be used for testing various preferential strategies formulated by banks, an execution subject can be a server of a computer terminal or a processor of various mobile devices, the flow of the method is shown in figure 1, and the specific description is as follows:
s101, when a payment test instruction for performing preferential payment test is received, acquiring each piece of payment preferential information corresponding to the payment test instruction in a preset payment preferential system.
In the method provided by the embodiment of the application, when a payment test instruction for performing a preferential payment test sent by a developer is received, each piece of payment preferential information corresponding to the payment test instruction is acquired in a preset payment preferential system, a plurality of pieces of payment preferential information are preset in the payment preferential system, and the payment preferential information comprises information such as amount of money reduced during payment. It should be noted that, the payment preferential system is an internal system built for a developer, and is only applied to preferential payment test.
S102, according to a preset payment message assembly rule, assembling each piece of payment preferential information into a preferential payment message corresponding to the payment test instruction.
In the method provided by the embodiment of the application, the preset payment message assembly rule is determined, and it is required to be explained that the payment message assembly rule of different merchants and different application software may be different, for example, when the pushed-out preferential activity is applied to a mobile phone bank, the applied payment message assembly rule is the payment message assembly rule corresponding to the mobile phone bank; when the pushed-out preferential activities are applied to the webpage, the applied payment message assembly rules are the payment message assembly rules corresponding to the webpage. And according to a preset payment message assembly rule, assembling the obtained payment preferential information into a preferential payment message, wherein the preferential payment message corresponds to the payment test instruction.
S103, sending the preferential payment message to a preset account deducting system, triggering the account deducting system to deduct accounts according to the preferential payment message, and generating a corresponding account deducting message.
In the method provided by the embodiment of the application, the generated preferential payment message is sent to a preset account deducting system, the account deducting system is triggered to deduct accounts according to the preferential payment message, and a corresponding account deducting message is generated. It should be noted that, the account deducting system may be a payment platform provided by a bank, such as a mobile phone bank; and the account deducting system deducts fees in the corresponding account according to the received preferential payment message and generates a corresponding account deducting message.
S104, acquiring the account deduction message fed back by the account deduction system, analyzing the account deduction message, and determining each account deduction preferential information in the account deduction message.
In the method provided by the embodiment of the application, the account deducting system receives the account deducting message fed back after the account deducting according to the preferential payment message, analyzes the account deducting message, and obtains each account deducting preferential information in the account deducting message, wherein the account deducting preferential information is specific information when the account deducting system deducts accounts.
S105, determining the account deduction preferential information corresponding to each piece of payment preferential information in the account deduction message.
In the method provided by the embodiment of the application, each piece of preferential payment information in the preferential payment message is determined, and the account deduction preferential information corresponding to each piece of preferential payment information in the account deduction message is determined; it should be noted that, each of the preferential payment information has corresponding deduction preferential information.
S106, judging the effective state of each payment preferential information according to the account deduction preferential information corresponding to each payment preferential information, and obtaining a judging result of each payment preferential information so as to complete preferential payment test corresponding to the payment test instruction.
In the method provided by the embodiment of the application, the effective state of each payment preferential information is judged according to the account deduction preferential information corresponding to each payment preferential information, the effective result of each payment preferential information is determined according to the judging result of each payment preferential information, and the preferential payment test corresponding to the payment test instruction is completed.
In the method provided by the embodiment of the application, when a payment test instruction for performing a preferential payment test is received, acquiring each piece of payment preferential information corresponding to the payment test instruction in a preset payment preferential system; generating a preferential payment message corresponding to the payment test instruction according to a preset payment message assembly rule; sending the preferential payment message to a preset account deducting system, triggering the account deducting system to deduct accounts according to the preferential payment message, and generating a corresponding account deducting message; and analyzing the account deduction message fed back by the account deduction system to obtain account deduction preferential information in the account deduction message, determining account deduction preferential information corresponding to each payment preferential information, and judging the generation state of each payment preferential information according to the account deduction preferential information so as to complete preferential payment test corresponding to the payment test instruction. According to the method provided by the application, the corresponding preferential payment message is generated by applying the preset preferential payment information in the preferential payment system, and then the effective state of each preferential payment message in the preferential payment message is judged according to the account deduction message generated by the account deduction system according to the preferential payment message, so that the preferential payment test corresponding to the payment test instruction is completed, and the test data of other systems is not required to be acquired, so that the test of the preferential payment by a developer is more convenient, a test link is shortened, and the time and labor cost of test investment are reduced.
In the method provided by the embodiment of the present application, the payment preferential information in the payment preferential test system is preset, and the setting process of the payment preferential information is shown in fig. 2, and specifically described as follows:
s201, determining each piece of preferential type information and each piece of preferential limitation information set according to preset preferential rules.
In the method provided by the embodiment of the application, a preset preferential rule is determined, and each preferential type information and each preferential limiting information are set according to the preferential rule; it should be noted that, the preferential rules correspond to different preferential rules at different merchants; for example, when the method is applied to the preferential payment test of the Union, corresponding preferential types and preferential limitation information are generated according to the preferential rules provided by the Union; it should be noted that, the information of the preference type includes, but is not limited to, information of full subtraction, random subtraction, discount, and incentive golden red package, and the information of the preference limitation includes, but is not limited to, information of card type, maximum preference number, maximum preference amount, and customer grade.
S202, according to preset coupon association rules, associating and combining the coupon type information with the coupon limitation information to obtain combined coupon combination information, and generating payment coupon information corresponding to each coupon combination information.
In the method provided by the embodiment of the application, a preset preferential association rule is determined, and each preferential type information and each preferential limitation information are associated and combined according to the preferential association rule so as to obtain each preferential combination information, and payment preferential information corresponding to each preferential combination information is generated.
In the method provided by the embodiment of the present application, for specifically describing a specific process of generating payment preference information, a specific example is described herein:
determining a preferential rule provided by the Union, wherein preferential type information in the preferential rule comprises the following steps: full and random subtractions; the preferential limiting information in the preferential rule comprises a card type and a maximum preferential amount; determining a preset preferential association rule, and combining each preferential type information with each preferential limitation information according to the preset preferential association rule to obtain preferential combination information, for example: preferential combination information 1: full minus + card type + maximum offer; preferential combination information 2: randomly subtracting and adding the maximum preferential amount; generating payment coupon information 1 and payment coupon information 2 according to the coupon combination information, wherein the specific content of the payment coupon information 1 can be that when the card type is a gold card, the maximum coupon limit of full reduction is 100 yuan; the specific content of the payment preferential information 2 may be that the maximum limit of the random subtraction is 8 yuan.
In the method for the embodiment of the application, the data support is provided for the developer to carry out the payment preferential test by setting the payment preferential information in the payment preferential system in advance.
In the method provided by the embodiment of the application, when a payment test instruction is received, each piece of payment preferential information corresponding to the payment test instruction in a preset payment preferential system is acquired, and a specific acquisition process can be shown by referring to fig. 3, and the specific description is as follows:
s301, analyzing the payment test instruction, and acquiring each preferential identification in the payment test instruction.
In the method provided by the embodiment of the application, the received payment test instruction is analyzed to obtain each preferential identifier in the payment test instruction; the offer identifier is used for determining corresponding payment offer information in a payment offer system.
S302, determining each piece of payment preferential information in a preset payment preferential system.
In the method provided by the embodiment of the application, each piece of payment preferential information in a preset payment preferential system is determined, and each piece of payment preferential information stores a preset identification which is a unique identification of the payment preferential information.
S303, traversing each of the preferential identifiers in turn to determine the payment preferential information corresponding to each preferential identifier.
In the method provided by the embodiment of the application, each preferential identifier is traversed through preset identifiers of the payment preferential information in sequence, and when the payment preferential information corresponding to the preset identifier consistent with the preferential identifier is determined to be the payment preferential information corresponding to the preferential identifier.
In the method provided by the embodiment of the application, after each piece of payment preferential information corresponding to the payment test instruction is obtained, each piece of payment preferential information is combined into a payment preferential message, the payment preferential message is sent to a preset account deduction system, the account deduction system and the payment preferential message are triggered to carry out account deduction, the account deduction message fed back by the account deduction system is received, and the effective state of each piece of payment preferential information in the payment preferential message is judged according to each piece of account deduction preferential information in the account deduction message, wherein the specific judging process is as follows:
comparing each piece of payment preferential information with the corresponding account deduction preferential information, and judging whether the payment preferential information is consistent with the corresponding account deduction preferential information or not;
when the payment preferential information is consistent with the account deduction preferential information in comparison, determining that the effective state of the payment preferential information is successful; for example, the payment preferential information contained in the payment preferential message sent to the account deducting system is full 200 yuan minus 20 yuan, and the payment preferential information is required to be deducted by 210 yuan; when the account deducting system deducts accounts according to the payment preferential message, the generated account deducting message contains account deducting preferential information which is full of 200 yuan minus 20 yuan, and the actual account deducting amount is 190 yuan, so that the payment preferential information is judged to be effective successfully.
When the comparison of the payment preferential information and the account deduction preferential information is inconsistent, determining that the effective state of the payment preferential information is failed; for example, the payment preferential information contained in the payment preferential message sent to the account deducting system is randomly reduced by 0.5%, and the maximum reduction of 8 yuan is realized when the payment preferential information is randomly reduced, the total reduction of 9 yuan is 150 yuan, the reduction of 5 yuan of the incentive gold red package is realized, and the fee deduction amount is 200 yuan; the account deduction system deducts accounts according to the payment preferential message, account deduction preferential information in the generated account deduction message is respectively reduced by 10 yuan randomly, reduced by 0 yuan when the account deduction preferential information is full of 150 yuan, reduced by 5 yuan when the account deduction preferential information is stimulated, the actual account deduction amount is 185 yuan, wherein the effective state of the payment preferential information is failed when the account deduction preferential information is reduced by 10 yuan randomly and is reduced by 8 yuan at most when the account deduction preferential information is reduced by 0 yuan when the account deduction preferential information is reduced by 150 yuan, the effective state of the payment preferential information is failed when the account deduction preferential information is stimulated by 5 yuan and the account deduction preferential information is stimulated by 5 yuan when the account deduction preferential information is reduced by 5 yuan randomly, and the effective state of the payment preferential information is successful.
In the method provided by the embodiment of the application, after the judgment result of each piece of payment preferential information in the payment preferential message is obtained, the judgment result of each piece of payment preferential information is assembled into a feedback message, and the feedback message is sent to a preset display device; triggering the display equipment to display the judgment result of each payment preferential information in the feedback message; and the developer analyzes the test condition of the preferential payment according to each judgment result in the feedback message, and adjusts corresponding data according to the test condition.
In the method provided by the embodiment of the application, when a payment test instruction for performing a preferential payment test is received, acquiring each piece of payment preferential information corresponding to the payment test instruction of a preset payment preferential system, assembling each piece of payment preferential information into a preferential payment message corresponding to the payment test instruction, sending the preferential payment message to a preset account deducting system, triggering the account deducting system to deduct accounts according to the preferential payment message, and generating an account deducting message; analyzing the account deducting message fed back by the account deducting system to obtain each account deducting preferential information in the account deducting message, judging the effective state of each payment preferential information according to each account deducting preferential information, and obtaining a judging result of each payment preferential information so as to complete preferential payment test corresponding to the payment test instruction. By applying the method provided by the application, the connection with an external system is not needed, the test link of preferential payment is shortened, the labor cost input during test is reduced, and the time spent for test is reduced.
Corresponding to fig. 1, the embodiment of the application also provides a preferential payment testing device, which can be arranged in a server or a process of a personal computer or intelligent equipment; the test device for preferential payment is used for supporting the application and implementation of the test method for preferential payment in practice; the schematic structure of the device is shown in fig. 4, and the specific description is as follows:
a first obtaining unit 401, configured to obtain, when a payment test instruction for performing a preferential payment test is received, each piece of payment preferential information corresponding to the payment test instruction in a preset payment preferential system;
an assembling unit 402, configured to assemble each of the payment preferential information into a preferential payment packet corresponding to the payment test instruction according to a preset payment packet assembling rule;
the triggering unit 403 is configured to send the preferential payment message to a preset account deducting system, trigger the account deducting system to deduct accounts according to the preferential payment message, and generate a corresponding account deducting message;
a second obtaining unit 404, configured to obtain the account deducting message fed back by the account deducting system, analyze the account deducting message, and determine each account deduction preferential information in the account deducting message;
a first determining unit 405, configured to determine the account deduction preference information corresponding to each of the payment preference information in the account deduction message;
and the judging unit 406 is configured to judge the effective state of each payment coupon according to the account deduction coupon corresponding to each payment coupon, so as to obtain a judgment result of each payment coupon, so as to complete a coupon payment test corresponding to the payment test instruction.
In the device provided by the embodiment of the application, when a payment test instruction for performing a preferential payment test is received, acquiring each piece of payment preferential information corresponding to the payment test instruction of a preset payment preferential system, assembling each piece of payment preferential information into a preferential payment message corresponding to the payment test instruction, sending the preferential payment message to a preset account deducting system, triggering the account deducting system to deduct accounts according to the preferential payment message, and generating an account deducting message; analyzing the account deducting message fed back by the account deducting system to obtain each account deducting preferential information in the account deducting message, judging the effective state of each payment preferential information according to each account deducting preferential information, and obtaining a judging result of each payment preferential information so as to complete preferential payment test corresponding to the payment test instruction. The device provided by the application can be used for shortening the test link of preferential payment without being connected with an external system, reducing the labor cost input during test and reducing the time spent for test.
The test device for preferential payment provided by the embodiment of the application can be further set as follows:
the second determining unit is used for determining each piece of preferential type information and each piece of preferential limiting information set according to preset preferential rules;
and the generation unit is used for carrying out association combination on the coupon type information and the coupon limiting information according to preset coupon association rules to obtain combined coupon combination information, and generating payment coupon information corresponding to each coupon combination information.
In the test device for preferential payment provided by the embodiment of the present application, the first obtaining unit 401 may be configured to:
the analysis subunit is used for analyzing the payment test instruction and acquiring each preferential identifier in the payment test instruction;
a first determining subunit, configured to determine each piece of payment preference information in a preset payment preference system;
and the traversal subunit is used for traversing each of the preferential identifiers in turn to determine the payment preferential information corresponding to each preferential identifier.
In the test device for preferential payment provided by the embodiment of the present application, the judging unit 406 may be configured to:
the comparison subunit is used for comparing each piece of payment preferential information with the corresponding account deduction preferential information and judging whether the payment preferential information is consistent with the corresponding account deduction preferential information or not;
the second determining subunit is used for determining that the effective state of the payment preferential information is successful when the payment preferential information is consistent with the deduction preferential information;
and the third determination subunit is used for determining that the effective state of the payment preferential information is failed when the comparison of the payment preferential information and the deduction preferential information is inconsistent.
The test device for preferential payment provided by the embodiment of the application can be further configured to:
the sending unit is used for assembling the judgment results of the payment preferential information into a feedback message and sending the feedback message to a preset display device;
and the display unit is used for triggering the display equipment to display the judgment result of each payment preferential information in the feedback message.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.