Method and system for automatic payment test of payment system

By introducing the automatic payment time function into the payment system, automatic payment testing is realized, which solves the problem of high payment test funds and time constraints, improves testing efficiency and accuracy, and meets the needs of various applications.

CN118796680AActive Publication Date: 2024-10-18FUJIAN TQ DIGITAL
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410773390.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-18
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

In the mobile Internet industry, the payment testing process of aggregated payment systems requires a large amount of funds, and payments need to be made within a specified time under different test scenarios to simulate different payment scenarios to ensure test quality. However, existing technology is difficult to automate and efficiency.

Method used

By introducing the automatic delayed payment time (QA-Auto-Delay) function into the payment system, testers can encrypt the order amount and delayed payment time and pass them into the HTTP request header. The payment system generates the payment order number and passes it to the delay Message queue, automatically simulate the payment system to subscribe to the message queue to modify the order status, and notify the application system that the order has been paid, realizing automatic payment testing.

Benefits of technology

This method can significantly reduce testing expenses, improve testing efficiency and accuracy, and flexibly set payment times to meet the needs of various applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796680A_ABST
    Figure CN118796680A_ABST
Patent Text Reader

Abstract

The invention discloses a payment system automatic payment test method and system, and the method comprises the steps: a tester transmits an order amount and automatic delay payment time to a payment system through an application system, and the automatic delay payment time is encrypted and then transmitted to a QA-Auto-Delay of an HTTP request header; an order placing request is sent to the payment system, a payment order number is generated, a third-party payment interface is requested to obtain a payment address, the payment address is returned to the application system, if an HTTP request header contains QA-Auto-Delay, decryption is performed by using an agreed secret key, and the order number and the obtained delay time are transmitted to a delay message queue; the automatic simulation payment system subscribes to the delay message queue, modifies the order data of the order number corresponding to the database into a paid state, and notifies the accessed application system that the order is paid; and after the application system receives the payment notification, the tester confirms that the application system completes the test according to the payment condition. According to the invention, automatic simulation payment can be realized, payment test funds are reduced, and payment test efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer communication, and in particular to a method and system for automatic payment testing of a payment system. Background Art

[0002] In today's mobile Internet industry, the aggregate payment system plays an important role, providing a common interface function for multiple application parties to facilitate their payment access. However, for application parties with a wide variety of products or high prices, the testing process may require applying for a large amount of payment testing funds. At the same time, in different test scenarios, payments need to be made within a specified time to simulate different payment scenarios to ensure the quality of the test. Summary of the invention

[0003] To overcome the above problems, the purpose of the present invention is to provide a method for automatic payment testing of a payment system, which can automatically simulate payment, reduce payment testing expenses, and improve the efficiency and accuracy of payment testing.

[0004] The present invention is implemented by the following scheme: a method for automatic payment testing of a payment system, characterized in that the method comprises the following steps:

[0005] Step 1: The tester passes the order amount and automatic delayed payment time to the payment system through the application system. The automatic delayed payment time is encrypted and passed to the QA-Auto-Delay in the HTTP request header to send an order request to the payment system.

[0006] Step 2: After receiving the order request, the payment system generates a payment order number, uses the received order amount to request the third-party payment interface to obtain the payment address, returns the payment address to the application system, and determines whether the HTTP request header contains QA-Auto-Delay. If it does, it uses the agreed key to decrypt it, obtains an automatic delayed payment time, and passes the order number and delay time to the delayed message queue;

[0007] Step 3: Automatically simulate the payment system to subscribe to the delayed message queue, obtain the order number from the received message, modify the order data of this order number in the database to the paid status, and notify the connected application system that the order has been paid;

[0008] Step 4: After the application system receives the payment notification, the tester confirms the application system performance based on the payment situation and the test is completed.

[0009] Furthermore, the encryption method in step S1 is to perform DES symmetric encryption using a key agreed upon with the payment system.

[0010] Furthermore, the step S2 of "determine whether the HTTP request header contains QA-Auto-Delay, and if so, decrypt it with the agreed key to obtain an automatic delayed payment time, and pass the order number and delay time to the delayed message queue" is further as follows: determine whether the HTTP request header contains QA-Auto-Delay, and skip if not; if so, decrypt it with the des key to obtain the automatic delayed payment time, define the automatic message queue name, then create a message object to pass in the order number, call the message sending method SendSync, and transmit the order number and delay time message to the message queue.

[0011] Furthermore, the "judgment" in step S2 is further to obtain the automatic delayed payment time through the Head["QA-Auto-Delay"] code, and if it is empty, it does not exist.

[0012] 4. A system for automatic payment testing of a payment system, characterized in that: the system comprises a payment request module, a payment information transmission module, a payment status modification module, and a payment notification module;

[0013] The payment request module: the tester transmits the order amount and the automatic delayed payment time to the payment system through the application system. The automatic delayed payment time is encrypted and transmitted to the QA-Auto-Delay of the HTTP request header, and an order request is issued to the payment system;

[0014] The payment information transmission module: after receiving the order request, the payment system generates a payment order number, uses the received order amount to request the third-party payment interface to obtain the payment address, returns the payment address to the application system, and determines whether the HTTP request header contains QA-Auto-Delay. If it does, it decrypts it with the agreed key to obtain an automatic delayed payment time, and transmits the order number and delay time to the delayed message queue;

[0015] The payment status modification module automatically simulates the subscription of the payment system to the delayed message queue, obtains the order number from the received message, modifies the order data of this order number in the database to the paid status, and notifies the connected application system that the order has been paid;

[0016] After the payment notification module and the application system receive the payment notification, the tester confirms the application system performance based on the payment situation and the test is completed.

[0017] Furthermore, the encryption method in the payment request module is to perform DES symmetric encryption using a key agreed upon with the payment system.

[0018] Furthermore, the payment information transmission module further includes: determining whether the HTTP request header contains QA-Auto-Delay, and if so, decrypting it with the agreed key to obtain an automatic delayed payment time, and passing the order number and delay time to the delayed message queue. If not, skip it; if so, decrypt it with the des key to obtain the automatic delayed payment time, define the automatic message queue name, and then create a message object to pass in the order number, call the message sending method SendSync, and transmit the order number and delay time message to the message queue.

[0019] Furthermore, the "judgment" of the payment information transmission module is to obtain the automatic delayed payment time through the Head["QA-Auto-Delay"] code, and if it is empty, it does not exist.

[0020] The beneficial effects of the present invention are as follows: the present invention provides a method and system for automatic payment testing of a payment system, which can enable testers to significantly reduce payment testing expenses by automatically simulating payments and flexibly set payment times, which will help improve the efficiency and accuracy of payment testing and better meet the needs of various application parties. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic flow chart of the method of the present invention.

[0022] Figure 2 It is a system principle block diagram of the present invention. DETAILED DESCRIPTION

[0023] The present invention will be further described below in conjunction with the accompanying drawings.

[0024] See also Figure 1 As shown, a method for automatic payment testing of a payment system of the present invention comprises the following steps:

[0025] Step 1: The tester passes the order amount and automatic delayed payment time to the payment system through the application system. The automatic delayed payment time is encrypted and passed to the QA-Auto-Delay in the HTTP request header to send an order request to the payment system.

[0026] Step 2: After receiving the order request, the payment system generates a payment order number, uses the received order amount to request the third-party payment interface to obtain the payment address, returns the payment address to the application system, and determines whether the HTTP request header contains QA-Auto-Delay. If it does, it uses the agreed key to decrypt it, obtains an automatic delayed payment time, and passes the order number and delay time to the delayed message queue;

[0027] Step 3: Automatically simulate the payment system to subscribe to the delayed message queue, obtain the order number from the received message, modify the order data of this order number in the database to the paid status, and notify the connected application system that the order has been paid;

[0028] Step 4: After the application system receives the payment notification, the tester confirms the application system performance based on the payment situation and the test is completed.

[0029] The present invention will be further described below in conjunction with a specific embodiment:

[0030] A method for automatic payment testing of a payment system,

[0031] 1. The tester passes the order amount and automatic delayed payment time to the payment system through the application system. The automatic delayed payment time is encrypted and passed to the QA-Auto-Delay of the HTTP request header to send an order request to the payment system. When the application system has been successfully connected to the payment system, the tester of the application system needs to make a payment, and then wait for the payment notification to arrive. The tester needs to see the payment performance in the application system, such as the balance of the wallet application system increases; for example, the mall system shows that the order has been paid and is waiting for shipment. In addition to manual real payment, the tester can also test according to the automatic payment test method of this system. The application system refers to a system that needs to access payment capabilities to apply payment capabilities, such as game malls, online malls, etc. The payment system refers to a system with payment capabilities, which can be aggregated payment or payment channels. For example, we are an aggregated payment system, and Alipay and WeChat are a payment channel. The process of issuing an order request from the payment system is to first request the order interface, obtain the payment voucher to the user for payment, and the partner will issue a payment notification after the user pays. QA-Auto-Delay, which is "automatic delayed payment time", is used to specify the automatic delayed payment time for the interface.

[0032] 1.1 The encryption method described is to use the key agreed upon with the payment system for DES symmetric encryption.

[0033] For example: 1 The current tester needs to pay for a product of 100 yuan. The application system passes the order amount amount = 100 to the payment system, the automatic delayed payment time delay = 1s, and uses the agreed key with the payment system to perform des symmetric encryption to obtain delayDes = U2FsdGVkX1 / TgPBqejjaXeAhAh / o5pvN. The encrypted automatic delayed payment time is put into the HTTP request header, that is, Head[QA-Auto-Delay] = U2FsdGVkX1 / TgPBqejjaXeAhAh / o5pvN. Then send an order request to the payment system https: / / api.pay.com / create?amount=100&sign=xxx. sign is the signature rule of the order interface in the order request, which is not the focus here and will not be described.

[0034] 2. After receiving the order request, the payment system generates a payment order number, uses the received order amount to request the third-party payment interface to obtain the payment address, returns the payment address to the application system, and determines whether the HTTP request header contains QA-Auto-Delay. If it does, it uses the agreed key to decrypt it, obtains an automatic delayed payment time, and passes the order number and delay time to the delayed message queue;

[0035] 2.1 "Determine whether the HTTP request header contains QA-Auto-Delay. If so, decrypt it with the agreed key to obtain an automatic delayed payment time, and pass the order number and delay time to the delayed message queue" is further as follows: Determine whether the HTTP request header contains QA-Auto-Delay. If not, skip it; if so, decrypt it with the des key to obtain the automatic delayed payment time, define the automatic message queue name, then create a message object to pass in the order number, call the message sending method SendSync, and transmit the order number and delay time message to the message queue.

[0036] 2.2 “Judgment” is further to obtain the automatic delayed payment time through the Head[“QA-Auto-Delay”] code. If it is empty, it does not exist.

[0037] For example: 2. After receiving the order request, the payment system generates a payment order number orderno=1716124298533-gHTd, because the payment function of the aggregate payment system is connected to the third-party payment system, such as Alipay WeChat, etc. Use the order amount amount=100 to request an order from the third-party payment system, such as https: / / pay3.xxx.com / order / pay?money=100&no=1716124298533-gHTd&x=..., the third-party payment system will return the payment address, and return the obtained payment address to the application system.

[0038] 2.1 Then determine whether the HTTP request header contains QA-Auto-Delay, if not, skip it. If yes, decrypt it with the des key to get the automatic delayed payment time delay = 1s. Define the automatic message queue name as auto_pay, then create a message object and pass in the order number msg: = primitive.NewMessage ("auto_pay", []byte ("1716124298533-gHTd")), and set the message delay level to 1, that is, 1s, msg.DelayTimeLevel = 1, then call the message sending method SendSync to transfer the message to the message queue.

[0039] 3. Automatically simulate the payment system to subscribe to the delayed message queue, obtain the order number from the received message, modify the order data of this order number in the database to the paid status, and notify the connected application system that the order has been paid;

[0040] For example: 3. The automatic simulation payment system subscribes to the automatic message queue auto_pay, obtains the order number orderno=1716124298533-gHTd from the message queue, updates the payment status of the order data with the order number 1716124298533-gHTd in the order table of the database to paid. And notifies the payment notification address of the connected application system that the order has been paid successfully, such as notifying https: / / app.shop.com / pay / notify?no=1716124298533-gHTd&status=1&x=...

[0041] 4. After the application system receives the payment notification, the tester confirms the application system performance according to the payment status, and the test is completed. After the application system receives the payment notification, the tester can know that the order has been paid according to the order number, and then confirm the performance of the application system, that is, the application system shows that the order has been paid and is waiting for shipment. Then the tester completes the step test. Different application systems can have different performances. For example, after the connected application system completes the payment process, a page pops up to indicate that the payment is successful, which is the performance of his application system.

[0042] For example: 4. If the delayed payment time passed in is 10 minutes, then the application system will receive a payment notification 10 minutes later. The tester can then verify whether the user makes the payment after 10 minutes and whether the application system performs normally, such as whether the order cannot be shipped because the time is too long.

[0043] See also Figure 2 As shown, the present invention also provides a system for automatic payment testing of a payment system, the system comprising a payment request module, a payment information transmission module, a payment status modification module, and a payment notification module;

[0044] The payment request module: the tester passes the order amount and automatic delayed payment time to the payment system through the application system, and the automatic delayed payment time is encrypted and passed to the QA-Auto-Delay of the HTTP request header to send an order request to the payment system; when the application system has been successfully connected to the payment system, the tester of the application system needs to make a payment, and then wait for the payment notification to arrive. The tester needs to see the payment performance in the application system, such as the balance of the wallet application system increases; for example, the mall system shows that the order has been paid and is waiting for shipment. In addition to manual real payment, the tester can also test according to the automatic payment test method of this system. The application system refers to a system that needs to access the payment capability to apply the payment capability, such as a game mall, an online mall, etc. The payment system refers to a system with payment capabilities, which can be an aggregate payment or a payment channel. For example, we are an aggregate payment system, and Alipay and WeChat are a payment channel. The process of issuing an order request in the payment system is to first request the order interface, get the payment voucher to pay the user, and the partner will issue a payment notification after the user pays. QA-Auto-Delay, which is "automatic delayed payment time", is used to specify the automatic delayed payment time for the interface.

[0045] 1.1 The encryption method described is to use the key agreed upon with the payment system for DES symmetric encryption.

[0046] For example: 1 The current tester needs to pay for a product of 100 yuan. The application system passes the order amount amount = 100 to the payment system, the automatic delayed payment time delay = 1s, and uses the agreed key with the payment system to perform des symmetric encryption to obtain delayDes = U2FsdGVkX1 / TgPBqejjaXeAhAh / o5pvN. The encrypted automatic delayed payment time is put into the HTTP request header, that is, Head[QA-Auto-Delay] = U2FsdGVkX1 / TgPBqejjaXeAhAh / o5pvN. Then send an order request to the payment system https: / / api.pay.com / create?amount=100&sign=xxx. sign is the signature rule of the order interface in the order request, which is not the focus here and will not be described.

[0047] The payment information transmission module: after receiving the order request, the payment system generates a payment order number, uses the received order amount to request the third-party payment interface to obtain the payment address, returns the payment address to the application system, and determines whether the HTTP request header contains QA-Auto-Delay. If it does, it decrypts it with the agreed key to obtain an automatic delayed payment time, and transmits the order number and delay time to the delayed message queue;

[0048] The "determine whether the HTTP request header contains QA-Auto-Delay, if so, decrypt it with the agreed key to obtain an automatic delayed payment time, and pass the order number and delay time to the delayed message queue" in the payment information transmission module is further as follows: determine whether the HTTP request header contains QA-Auto-Delay, if not, skip it; if so, decrypt it with the des key to obtain the automatic delayed payment time, define the automatic message queue name, then create a message object to pass in the order number, call the message sending method SendSync, and transmit the order number and delay time message to the message queue.

[0049] The "judgment" of the payment information transmission module is further to obtain the automatic delayed payment time through the Head["QA-Auto-Delay"] code, if it is empty, it does not exist.

[0050] For example: 2. After receiving the order request, the payment system generates a payment order number orderno=1716124298533-gHTd, because the payment function of the aggregate payment system is connected to the third-party payment system, such as Alipay WeChat, etc. Use the order amount amount=100 to request an order from the third-party payment system, such as https: / / pay3.xxx.com / order / pay?money=100&no=1716124298533-gHTd&x=..., the third-party payment system will return the payment address, and return the obtained payment address to the application system.

[0051] The payment status modification module automatically simulates the subscription of the payment system to the delayed message queue, obtains the order number from the received message, modifies the order data of this order number in the database to the paid status, and notifies the connected application system that the order has been paid;

[0052] For example: 3. The automatic simulation payment system subscribes to the automatic message queue auto_pay, obtains the order number orderno=1716124298533-gHTd from the message queue, updates the payment status of the order data with the order number 1716124298533-gHTd in the order table of the database to paid. And notifies the payment notification address of the connected application system that the order has been paid successfully, such as notifying https: / / app.shop.com / pay / notify?no=1716124298533-gHTd&status=1&x=...

[0053] After the payment notification module and the application system receive the payment notification, the tester confirms the application system performance according to the payment status, and the test is completed. After the application system receives the payment notification, the tester can know that the order has been paid according to the order number, and then confirm the performance of the application system, that is, the application system shows that the order has been paid and is waiting for shipment. The tester completes the step test.

[0054] For example: 4. If the delayed payment time passed in is 10 minutes, then the application system will receive a payment notification 10 minutes later. The tester can then verify whether the user makes the payment after 10 minutes and whether the application system performs normally, such as whether the order cannot be shipped because the time is too long.

[0055] In summary, the present invention provides a method and system for automatic payment testing of a payment system, which can enable testers to significantly reduce payment testing expenses by automatically simulating payments and flexibly set payment times, which will help improve the efficiency and accuracy of payment testing and better meet the needs of various application parties.

[0056] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.

Claims

1. A method for automatic payment testing of a payment system, characterized in that: The method comprises the following steps: Step 1: The tester passes the order amount and automatic delayed payment time to the payment system through the application system. The automatic delayed payment time is encrypted and passed to the QA-Auto-Delay in the HTTP request header to send an order request to the payment system. Step 2: After receiving the order request, the payment system generates a payment order number, uses the received order amount to request the third-party payment interface to obtain the payment address, returns the payment address to the application system, and determines whether the HTTP request header contains QA-Auto-Delay. If it does, it uses the agreed key to decrypt it, obtains an automatic delayed payment time, and passes the order number and delay time to the delayed message queue; Step 3: Automatically simulate the payment system to subscribe to the delayed message queue, obtain the order number from the received message, modify the order data of this order number in the database to the paid status, and notify the connected application system that the order has been paid; Step 4: After the application system receives the payment notification, the tester confirms the application system performance based on the payment situation and the test is completed.

2. A method for automatic payment testing of a payment system according to claim 1, characterized in that: The encryption method in step S1 is to perform DES symmetric encryption using the key agreed upon with the payment system.

3. A method for automatic payment testing of a payment system according to claim 1, characterized in that: The step S2 of "determine whether the HTTP request header contains QA-Auto-Delay, and if so, decrypt it with the agreed key to obtain an automatic delayed payment time, and pass the order number and delay time to the delayed message queue" is further as follows: determine whether the HTTP request header contains QA-Auto-Delay, and skip if not; if so, decrypt it with the des key to obtain the automatic delayed payment time, define the automatic message queue name, then create a message object to pass in the order number, call the message sending method SendSync, and transmit the order number and delay time message to the message queue.

4. A method for automatic payment testing of a payment system according to claim 1, characterized in that: The "judgment" in step S2 is further to obtain the automatic delayed payment time through the Head["QA-Auto-Delay"] code, if it is empty, it does not exist.

5. A system for automatic payment testing of a payment system, characterized in that: The system includes a payment request module, a payment information transmission module, a payment status modification module, and a payment notification module; The payment request module: the tester transmits the order amount and the automatic delayed payment time to the payment system through the application system. The automatic delayed payment time is encrypted and transmitted to the QA-Auto-Delay of the HTTP request header, and an order request is issued to the payment system; The payment information transmission module: after receiving the order request, the payment system generates a payment order number, uses the received order amount to request the third-party payment interface to obtain the payment address, returns the payment address to the application system, and determines whether the HTTP request header contains QA-Auto-Delay. If it does, it decrypts it with the agreed key to obtain an automatic delayed payment time, and transmits the order number and delay time to the delayed message queue; The payment status modification module automatically simulates the subscription of the payment system to the delayed message queue, obtains the order number from the received message, modifies the order data of this order number in the database to the paid status, and notifies the connected application system that the order has been paid; After the payment notification module and the application system receive the payment notification, the tester confirms the application system performance based on the payment situation and the test is completed.

6. A payment system automatic payment test system as claimed in claim 4, characterized in that: The encryption method in the payment request module is to perform DES symmetric encryption using a key agreed upon with the payment system.

7. A system for automatic payment testing of a payment system according to claim 4, characterized in that: The "determine whether the HTTP request header contains QA-Auto-Delay, if so, decrypt it with the agreed key to obtain an automatic delayed payment time, and pass the order number and delay time to the delayed message queue" in the payment information transmission module is further as follows: determine whether the HTTP request header contains QA-Auto-Delay, if not, skip it; if so, decrypt it with the des key to obtain the automatic delayed payment time, define the automatic message queue name, then create a message object to pass in the order number, call the message sending method SendSync, and transmit the order number and delay time message to the message queue.

8. A system for automatic payment testing of a payment system according to claim 5, characterized in that: The "judgment" of the payment information transmission module is further to obtain the automatic delayed payment time through the Head["QA-Auto-Delay"] code, if it is empty, it does not exist.

Citation Information

Patent Citations

  • Self-service order placing method and system

    CN106934686A

  • Method and apparatus for generating key in automated testing process

    CN108337083A

  • Method and system for realizing high consistency of order payment states based on cloud payment center

    CN116384993A