Application payment method and device based on H5, computer equipment and storage medium
By calling the payment interceptor on the H5 page to determine the target payment method and generate the payment modal box, the payment method update and target payment method of different devices and application support are solved, and the payment efficiency is improved.
Patent Information
- Application Number
- CN202411466620.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-24
AI Technical Summary
Different devices, systems and applications support different payment methods, which leads to difficulties in updating payment methods and determining target payment methods, thereby reducing payment efficiency.
Adopting the H5 -based application payment method, the payment interceptor is used to call the target payment method and obtain the payment parameters by calling the user payment request when receiving the user payment request, generate the payment method box, and simplify the payment method to add and update the process.
It improves the efficiency of adding and updating payment methods, accurately determines the target payment method, reduces user rollback and refresh operations, and improves payment efficiency.
Smart Images

Figure CN119359301A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and in particular to an H5-based application payment method, device, computer equipment and storage medium. Background Art
[0002] With the rapid development of mobile internet, corporate marketing has shifted from offline to online, leveraging mobile internet to launch marketing campaigns and achieve product sales. Simultaneously, an increasing number of payment methods are being used to pay for product purchases within various applications. However, since different systems, devices, and applications may support different payment methods, timely updates to user devices, device systems, and device applications are necessary. Furthermore, accurate and timely identification of the user's target payment method is crucial during the product order payment process. This is to prevent reduced payment efficiency due to applications not supporting the user's desired payment method or incorrectly identifying the target payment method. Therefore, efficiently integrating payment methods into applications and accurately identifying the user's target payment method, thereby improving payment efficiency, has become a pressing issue. Summary of the Invention
[0003] This application provides an H5-based application payment method, device, computer equipment and storage medium to efficiently access payment methods for applications and accurately determine the user's target payment method, thereby improving payment efficiency.
[0004] In a first aspect, the present application provides an H5-based application payment method, the method comprising:
[0005] Upon receiving a payment request from a user application, the payment interceptor corresponding to the payment request is called based on the H5 page;
[0006] Based on the payment interceptor, determine the target payment method corresponding to the payment request and obtain payment parameters corresponding to the payment request;
[0007] Based on the target payment method, determining a target payment channel class from a preset payment channel class;
[0008] Based on the target payment channel class and the payment parameters, a payment modal box of the user end is generated so that the user can make payment based on the payment modal box.
[0009] In a second aspect, the present application further provides an H5-based application payment device, the device comprising:
[0010] The payment interceptor calling module is used to call the payment interceptor corresponding to the payment request based on the H5 page when receiving the payment request from the user application;
[0011] a payment parameter acquisition module, configured to determine, based on the payment interceptor, a target payment method corresponding to the payment request and to acquire payment parameters corresponding to the payment request;
[0012] A payment channel class determination module, configured to determine a target payment channel class from among preset payment channel classes based on the target payment method;
[0013] The payment modal box generation module is used to generate a payment modal box on the user side based on the target payment channel class and the payment parameters, so that the user can make payment based on the payment modal box.
[0014] In a third aspect, the present application also provides a computer device comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the H5-based application payment method as described above when executing the computer program.
[0015] In a fourth aspect, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the H5-based application payment method as described above.
[0016] The present application discloses an application payment method, device, computer equipment and storage medium based on H5. When a payment request from a user application is received, the payment interceptor corresponding to the payment request is called based on the H5 page; based on the payment interceptor, the target payment method corresponding to the payment request is determined, and the payment parameters corresponding to the payment request are obtained; based on the target payment method, the target payment channel class is determined in the preset payment channel class; based on the target payment channel class and the payment parameters, a payment modal box on the user side is generated so that the user can make payment based on the payment modal box. In the present application, each payment method corresponds to a payment channel class, so that when adding or updating a payment method, the payment channel class corresponding to the payment method can be processed separately. Each payment channel class is independent of each other and does not affect each other, which simplifies the payment method addition and update process, improves the payment method addition and update efficiency, and thus improves the payment efficiency; secondly, the payment interceptor can be called through the H5 page to capture the payment request and determine the target payment method corresponding to the payment request, thereby improving the accuracy of the target payment method determination and avoiding user rollback, refresh and other operations caused by target payment method errors, thereby improving the payment efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 This is a schematic flow chart of a first embodiment of an H5-based application payment method provided in an embodiment of the present application;
[0019] Figure 2 This is a schematic flow chart of a second embodiment of an H5-based application payment method provided in an embodiment of the present application;
[0020] Figure 3 This is a schematic flow chart of a second embodiment of an H5-based application payment method provided in an embodiment of the present application;
[0021] Figure 4 A schematic block diagram of an H5-based application payment device provided in an embodiment of the present application;
[0022] Figure 5 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0024] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0025] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0026] It should be further understood that the term “and / or” used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0027] The embodiments of the present application provide an H5-based application payment method, device, computer equipment and storage medium. Among them, the H5-based application payment method can be applied to the server. When adding or updating a payment method, the payment channel class corresponding to the payment method can be processed separately. Each payment channel class is independent of each other and does not affect each other, which simplifies the payment method addition and update process, improves the payment method addition and update efficiency, and thus improves payment efficiency; secondly, the payment interceptor can be called through the H5 page to capture the payment request and determine the target payment method corresponding to the payment request, thereby improving the accuracy of the target payment method determination, avoiding user rollback, refresh and other operations caused by target payment method errors, and thus improving payment efficiency. Among them, the server can be an independent server or a server cluster.
[0028] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0029] See also Figure 1 , Figure 1 This is a schematic flow chart of an H5-based application payment method provided in an embodiment of the present application. The H5-based application payment method can be applied to a server and is used to process the payment channel class corresponding to a new payment method when adding or updating a payment method. Each payment channel class is independent of each other and does not affect each other, which simplifies the payment method addition and update process, improves the efficiency of adding and updating payment methods, and thus improves payment efficiency. Secondly, the payment interceptor can be called through the H5 page to capture the payment request and determine the target payment method corresponding to the payment request, thereby improving the accuracy of the target payment method determination, avoiding user rollback, refresh, and other operations caused by target payment method errors, and thus improving payment efficiency.
[0030] like Figure 1 As shown, the H5-based application payment method specifically includes steps S101 to S104.
[0031] S101. Upon receiving a payment request from a user application, calling a payment interceptor corresponding to the payment request based on an H5 page;
[0032] In one embodiment, upon receiving a payment request from a user application, a payment interceptor corresponding to the current user application is obtained based on the user application's requirements and configuration. Specifically, relevant interceptor information, such as the interceptor name and URL (Uniform Resource Locator), can be read from a backend service or configuration file.
[0033] In one embodiment, after obtaining relevant information about the payment interceptor, a call link is constructed through an HTML5 page. This link typically includes the payment interceptor URL and necessary query parameters, such as the order number, payment amount, and currency type. The call link triggers the payment interceptor to be called.
[0034] Among them, H5 is the fifth version of HTML (HyperText Markup Language). H5 refers to HTML5 pages, that is, web pages created using the HTML5 standard.
[0035] Furthermore, when receiving a payment request from a user application, before calling the payment interceptor corresponding to the payment request based on the H5 page, it also includes: when detecting a purchase order from the user application, creating a payment order based on the purchase order, and generating a payment order number; obtaining a cashier address based on the payment order number, and loading the cashier based on the cashier address; determining a list of available payment methods based on the cashier; receiving a target payment method determined by the user based on the list of available payment methods, and generating a payment request from the user application based on the target payment method.
[0036] Furthermore, determining the list of payment methods based on the cashier includes: obtaining the payment methods of the merchant corresponding to the purchase order through the configuration interface of the cashier; obtaining the payment methods corresponding to the user application, and determining the list of payment methods based on the payment methods of the merchant and the payment methods of the user application.
[0037] In one embodiment, once a user completes product selection within the app, decides to purchase, and submits the order, the transaction center in the system creates a payment order. This payment order is a document containing all necessary payment information, such as the order number, order amount, currency type, user information, and payment time. The payment order number is a unique identifier used to track and manage payment orders. Typically, this number includes a date, timestamp, and a randomly generated serial number to ensure uniqueness.
[0038] In one embodiment, the cashier address is a webpage or application interface where the user performs payment operations. The system obtains the cashier address based on the payment order number and loads the cashier interface, which displays all available payment methods to the user.
[0039] In one embodiment, the cashier determines which payment methods are available to the current user based on factors such as the user's geographic location, account settings, payment history, available payment methods used by the user, and available payment methods at the merchant for the current item. This generates a list of available payment methods. These payment methods may include credit cards, debit cards, and third-party payment services (such as Huawei Pay, Vivo Pay, Xiaomi Pay, Alipay, and WeChat Pay).
[0040] In one embodiment, the payment method determined by the user at the cashier is received. Specifically, the user can determine the payment method through voice or text instructions or by clicking a control corresponding to the payment method on the screen.
[0041] In one embodiment, a payment request is generated based on the target payment method and payment order information selected by the user, including the payment amount, payment method, user information, payment order number, etc.
[0042] S102: Determine, based on the payment interceptor, a target payment method corresponding to the payment request, and obtain payment parameters corresponding to the payment request;
[0043] In one embodiment, a payment interceptor captures the payment request and determines the payment method selected by the user, and then obtains payment parameters related to the payment method.
[0044] In a specific embodiment, a payment interceptor needs to be defined in the user-side application (such as the Hongmeng application), for example: "global_hw_pay". When the h5 page specifies to jump to "xxx: / / global_hw_pay", it can be matched by the interceptor. The payment interceptor can determine the target payment method and invoke the payment processing logic of the target payment method for subsequent payment processing. The payment interceptor contains the payment API of the target payment method, and the relevant payment parameters such as merc_mo, prepay_id, timestamp, nocestr, sign, auth_id, app_id, etc. are passed in according to the API.
[0045] S103. Determine a target payment channel class from among preset payment channel classes based on the target payment method;
[0046] In one embodiment, each payment method corresponds to a payment channel class, and the payment channel class corresponding to the target payment method is searched as the target payment channel class. Specifically, the payment channel class corresponding to the target payment method can be searched through the mapping relationship between the payment method and the payment channel class.
[0047] S104: Generate a payment modal box on the user side based on the target payment channel class and the payment parameters, so that the user can make payment based on the payment modal box.
[0048] Furthermore, generating a payment modal box on the user side based on the target payment channel class and the payment parameters includes: obtaining a payment template and a payment channel calling method corresponding to the target payment channel class; calling the target payment channel based on the payment channel calling method; and generating a payment modal box on the user side based on the payment template, the payment parameters and the target payment channel.
[0049] In one embodiment, the target payment channel type (such as Huawei Pay, Alipay, WeChat Pay, etc.) is determined based on the user's selection.
[0050] In one embodiment, the payment template is the HTML, CSS (Cascading Style Sheets), and JavaScript (JavaScript is a lightweight, interpreted or just-in-time compiled programming language) code used to generate the payment modal. The payment template corresponding to the target payment channel can be obtained from a backend service, database, or configuration file.
[0051] In one embodiment, the calling method refers to how to call the payment channel's API (Application Programming Interface) on the front end, including the API URL, required parameters, and request type, which can be obtained from the backend service or configuration file.
[0052] In one embodiment, the necessary payment parameters, such as the order number, amount, and currency type, are prepared based on the payment template and payment channel requirements. The obtained call method and payment parameters are used to construct a payment modal. Specifically, the prepared payment parameters, such as the order number and amount, are entered into the corresponding fields of the payment template. Once the payment modal is populated and ready, it is displayed to the user, allowing them to view payment details and make payment.
[0053] For example, the H5 page calls the interceptor via location.herf="xxx: / / global_hw_pay?content=" + JSON.Stringify(params), where params is the aforementioned parameters. The interceptor retrieves the required parameters and calls the payment API's paymentService method, successfully activating the target payment method's modal (such as the Huawei Pay modal). After binding a bank card, payment is completed.
[0054] Furthermore, the method generates a payment modal box on the user side based on the target payment channel class and the payment parameters so that the user can make payment based on the payment modal box. The method also includes: when it is detected that the user payment is completed, polling is performed based on the preset algorithm in the H5 page to obtain the order status and payment result, and the order status and payment result are returned to the user.
[0055] In one embodiment, the jsOnMessage function is globally mounted on the H5 page. After payment is completed, the jsOnMessage function is triggered on the user application side. Since H5 is in the user application container, the corresponding action, type, and data parameters can be directly passed in. The jsOnMessage method is executed based on these parameters. jsOnMessage primarily defines the logic processing for the corresponding type of status, including the page jump logic after successful payment, which is performed based on a specific code and action.
[0056] The action parameter is a string indicating the type of action to be performed. It's typically defined by the payment service and tells the user the result of the payment operation. For example, "payment_success" indicates a successful payment, "payment_failed" indicates a failed payment, or "payment_pending" indicates a payment in progress.
[0057] The type parameter is a string that provides additional information about the type of operation. For example, "order" indicates that the operation is related to an order; "refund" indicates that the operation is related to a refund.
[0058] The data parameter is an object containing detailed information related to the payment operation, such as orderId: order number, amount: payment amount, currency: currency type, status: payment status (such as "successful" or "failed"), and message: the message or error message returned by the payment service.
[0059] The code parameter is a number or string that typically represents a specific status code or error code. This is typically defined by the payment service and provides detailed information about the result of the operation. Examples include 200: Success; 400: Bad Request; 401: Unauthorized; and 500: Internal Server Error.
[0060] In one embodiment, when the target payment method does not return the order status, a payment confirmation page needs to be returned. After the user completes the payment, the page jumps to the page where the status of the current order is confirmed. The interface is polled to check whether the order is completed. Specifically, the pre-defined order status check method checkOrderStatus is used. In this method, the order status is checked through the interface. If the order status is returned, the page jumps to the specified callbackUrl page. If it is not returned, the polling continues. When the polling reaches the number of times threshold and no result is returned, the final page jump processing result logic is entered, and the link parameters of the callbackUrl are analyzed to jump to the specified page.
[0061] The above embodiment provides an application payment method, device, computer equipment and storage medium based on H5. When a payment request from a user application is received, the payment interceptor corresponding to the payment request is called based on the H5 page; based on the payment interceptor, the target payment method corresponding to the payment request is determined, and the payment parameters corresponding to the payment request are obtained; based on the target payment method, the target payment channel class is determined in the preset payment channel class; based on the target payment channel class and the payment parameters, a payment modal box on the user side is generated so that the user can make payments based on the payment modal box. In this application, each payment method corresponds to a payment channel class, so that when adding or updating a payment method, the payment channel class corresponding to the payment method can be processed separately. Each payment channel class is independent of each other and does not affect each other, which simplifies the payment method addition and update process, improves the payment method addition and update efficiency, and thus improves the payment efficiency; secondly, the payment interceptor can be called through the H5 page to capture the payment request and determine the target payment method corresponding to the payment request, thereby improving the accuracy of the target payment method determination and avoiding user rollback, refresh and other operations caused by target payment method errors, thereby improving the payment efficiency.
[0062] See also Figure 2 , Figure 2This is a schematic flow chart of an H5-based application payment method provided in an embodiment of the present application. This H5-based application payment method can be applied to a server and is used to define a general payment channel class and then create a specific payment channel class for each payment method, thereby isolating each payment method from each other and preventing them from interfering with each other. Furthermore, when adding a new payment method, only the corresponding payment channel class needs to be added. This allows for relatively independent payment channel access without affecting other payment channels, and simplifies the payment channel class access process.
[0063] like Figure 2 As shown, the H5-based application payment method specifically includes steps S201 to S202.
[0064] S201. Obtain universal payment configuration parameters, and construct a universal payment channel class based on the universal payment configuration parameters;
[0065] S202: Obtain at least one set of preset payment channel configuration parameters, and process the universal payment channel class and each set of payment channel configuration parameters respectively to construct the payment channel class corresponding to each set of payment channel configuration parameters.
[0066] In one embodiment, first, some common payment configuration parameters need to be defined. These parameters may include the payment interface URL, key, merchant ID, etc. Specifically, the common payment configuration parameters can be obtained from a configuration file, environment variables, or a database. The common payment configuration parameters are the basis for building the payment channel class.
[0067] In one embodiment, a universal payment channel class is defined, containing methods and properties common to all payment channels, such as initializing payment and submitting payment requests. The obtained universal payment configuration parameters are passed to the universal payment channel class to ensure that the methods in the class can use these parameters to perform payment operations.
[0068] In one embodiment, a set of specific configuration parameters corresponding to each payment method is obtained, which may include API keys, endpoints, supported currency types, etc. specific to each payment method. These preset payment channel configuration parameters can be obtained from a configuration file, environment variables, or a database.
[0069] In one embodiment, a generic payment channel class is combined with the configuration parameters for each payment method to create a specific payment channel class for each payment method. This specific payment channel class implements logic specific to that payment method, such as calling specific API interfaces and processing data in a specific format. Based on the user's payment selection or system configuration, the corresponding payment channel class is instantiated for use in the payment process.
[0070] In this specific implementation, a base parent class is first defined, defining general payment capabilities. All subclasses inherit and implement the parent class's capabilities. Next, a payment channel class is defined for a specific payment method (such as Huawei Pay, WeChat Pay, or Alipay), inheriting the properties and methods defined by the parent class and encapsulating all the capabilities of the payment channel. This includes determining whether the channel is visible and calling the payment method with doPay.
[0071] In the above embodiment, a general payment channel class is first defined, and then a specific payment channel class is created for each payment method, so that the payment methods are isolated from each other and do not affect each other; secondly, when accessing a new payment method, only the payment channel class corresponding to the new payment method needs to be added. The payment channel access is relatively independent and will not affect other payment channels, and the access process of the payment channel class is simplified.
[0072] See also Figure 3 , Figure 3 This is a schematic flow chart of an H5-based application payment method provided in an embodiment of the present application. This H5-based application payment method can be applied to a server to call a payment interceptor through an H5 page. The payment interceptor can accurately obtain the relevant parameters and target payment method of the payment request, ensuring that the payment request is properly processed and that the user can complete the payment in a secure environment.
[0073] like Figure 3 As shown, the H5-based application payment method specifically includes steps S301 to S302.
[0074] S301. Upon receiving the payment request, obtaining a payment interceptor corresponding to the user application based on the H5 page, and generating a call link for the payment interceptor;
[0075] S302: Call the payment interceptor based on the call link of the payment interceptor.
[0076] In one embodiment, based on the needs and configuration of the user application, a payment interceptor corresponding to the current user application is obtained. Specifically, relevant information of the interceptor, such as the name and URL of the interceptor, can be read from a backend service or configuration file.
[0077] In one embodiment, after obtaining the relevant information of the payment interceptor, a call link is constructed. This link usually includes the interceptor URL and necessary query parameters, such as order number, payment amount, currency type, etc.
[0078] In one embodiment, the call link may include additional configuration parameters, such as payment method preferences and user selections, depending on actual needs. Ensure that all necessary parameters are included in the call link so that the payment interceptor can correctly process the payment request. The call link triggers the call of the payment interceptor.
[0079] In a specific embodiment, a payment interceptor, for example, "global_hw_pay," needs to be defined within the user-side application (such as the Hongmeng application). This interceptor can match the H5 page that redirects to "xxx: / / global_hw_pay." The interceptor implements the logic for invoking the target payment method (such as Huawei Pay). This involves introducing a payment API to invoke the target payment method. Relevant parameters, such as merc_mo, prepay_id, timestamp, nocestr, sign, auth_id, and app_id, are passed in based on the API.
[0080] For example, the H5 page calls the interceptor via location.herf="xxx: / / global_hw_pay?content=" + JSON.Stringify(params), where params is the aforementioned parameters. The interceptor retrieves the required parameters and calls the payment API's paymentService method, successfully activating the target payment method's modal (such as the Huawei Pay modal). After binding a bank card, payment is completed.
[0081] In the above embodiment, the payment interceptor can be called through the H5 page, and the payment interceptor can accurately obtain the relevant parameters of the payment request and the target payment method, ensuring that the payment request is properly processed and the user can complete the payment in a safe environment.
[0082] See also Figure 4 , Figure 4 The embodiment of the present application provides a schematic block diagram of an H5-based application payment device, which is used to execute the aforementioned H5-based application payment method. The H5-based application payment device can be configured on a server.
[0083] like Figure 4 As shown, the H5-based application payment device 400 includes:
[0084] The payment interceptor calling module 401 is used to call the payment interceptor corresponding to the payment request based on the H5 page when receiving a payment request from the user application;
[0085] A payment parameter acquisition module 402 is configured to determine, based on the payment interceptor, the target payment method corresponding to the payment request and obtain payment parameters corresponding to the payment request;
[0086] The payment channel class determination module 403 is configured to determine a target payment channel class from among preset payment channel classes based on the target payment method;
[0087] The payment modal box generation module 404 is used to generate a payment modal box on the user side based on the target payment channel class and the payment parameters, so that the user can make payment based on the payment modal box.
[0088] Furthermore, the payment interceptor calling module 401 includes:
[0089] a call connection generating unit, configured to, upon receiving the payment request, obtain a payment interceptor corresponding to the user application based on the H5 page, and generate a call link for the payment interceptor;
[0090] A connector calling unit is configured to call the payment interceptor based on the calling link of the payment interceptor.
[0091] Furthermore, the H5-based application payment device 400 further includes a payment channel class building module, and the payment channel class building module includes:
[0092] A universal payment channel class construction unit, configured to obtain universal payment configuration parameters and construct a universal payment channel class based on the universal payment configuration parameters;
[0093] The special payment channel class construction unit is used to obtain at least one set of preset payment channel configuration parameters, and process the general payment channel class and each set of payment channel configuration parameters respectively to construct the payment channel class corresponding to each set of payment channel configuration parameters.
[0094] Furthermore, the payment modal box generation module 404 includes:
[0095] A payment template acquisition unit, configured to acquire the payment template and payment channel calling method corresponding to the target payment channel class;
[0096] A target payment channel calling unit, configured to call a target payment channel based on the payment channel calling method;
[0097] A payment modal box generating unit is used to generate a payment modal box for the user terminal based on the payment template, the payment parameters and the target payment channel.
[0098] Furthermore, the H5-based application payment device 400 further includes a payment request generation module, which includes:
[0099] a payment order number generating unit, configured to, upon detecting a purchase order applied by the user, create a payment order according to the purchase order and generate a payment order number;
[0100] A cashier loading unit, configured to obtain a cashier address based on the payment order number, and load the cashier based on the cashier address;
[0101] a payment method list determination unit, configured to determine a payment method list based on the cash register;
[0102] The payment request generating unit is configured to receive a target payment method determined by the user based on the list of available payment methods, and generate a payment request applied by the user based on the target payment method.
[0103] Furthermore, the unit for determining the list of payment methods includes:
[0104] A merchant payment method acquisition subunit, configured to acquire the merchant payment methods corresponding to the purchase order through the cashier's configuration interface;
[0105] The application payment method acquisition subunit is used to acquire the payment method corresponding to the user application, and determine the payment method list based on the payment method of the merchant and the payment method of the user application.
[0106] Furthermore, the H5-based application payment device 400 further includes:
[0107] The payment result and order status acquisition module is used to poll based on the preset algorithm in the H5 page when detecting that the user payment is completed, obtain the order status and payment result, and return the order status and payment result to the user.
[0108] It should be noted that those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0109] The above-mentioned device can be realized in the form of a computer program. The computer program can be used in Figure 5 Runs on the computer device shown.
[0110] See also Figure 5 , Figure 51 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0111] See Figure 5 The computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0112] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, which, when executed, can cause the processor to execute any H5-based application payment method.
[0113] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0114] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any H5-based application payment method.
[0115] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 5 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 shown in the figure, or combine certain components, or have a different component arrangement.
[0116] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0117] In one embodiment, the processor is configured to execute a computer program stored in the memory to implement the following steps:
[0118] Upon receiving a payment request from a user application, the payment interceptor corresponding to the payment request is called based on the H5 page;
[0119] Based on the payment interceptor, determine the target payment method corresponding to the payment request and obtain payment parameters corresponding to the payment request;
[0120] Based on the target payment method, determining a target payment channel class from a preset payment channel class;
[0121] Based on the target payment channel class and the payment parameters, a payment modal box of the user end is generated so that the user can make payment based on the payment modal box.
[0122] In one embodiment, when the processor receives a payment request from a user application and calls a payment interceptor corresponding to the payment request based on an H5 page, it is configured to:
[0123] Upon receiving the payment request, obtaining a payment interceptor corresponding to the user application based on the H5 page, and generating a call link for the payment interceptor;
[0124] The payment interceptor is called based on the calling link of the payment interceptor.
[0125] In one embodiment, before determining the target payment channel class from the preset payment channel class based on the target payment method, the processor is further configured to:
[0126] Obtaining universal payment configuration parameters, and constructing a universal payment channel class based on the universal payment configuration parameters;
[0127] At least one set of preset payment channel configuration parameters is obtained, and the universal payment channel class and each set of payment channel configuration parameters are processed respectively to construct the payment channel class corresponding to each set of payment channel configuration parameters.
[0128] In one embodiment, when the processor generates a payment modal box on the user side based on the target payment channel class and the payment parameters, it is configured to implement:
[0129] Obtain the payment template and payment channel calling method corresponding to the target payment channel class;
[0130] Based on the payment channel calling method, calling the target payment channel;
[0131] A payment modal box for the user terminal is generated based on the payment template, the payment parameters, and the target payment channel.
[0132] In one embodiment, the processor, upon receiving a payment request from a user application, before calling a payment interceptor corresponding to the payment request based on an H5 page, is further configured to:
[0133] When a purchase order of the user application is detected, a payment order is created according to the purchase order, and a payment order number is generated;
[0134] Obtaining a cashier address based on the payment order number, and loading the cashier based on the cashier address;
[0135] Based on the cash register, determining a list of available payment methods;
[0136] A target payment method determined by the user based on the list of available payment methods is received, and a payment request applied by the user is generated based on the target payment method.
[0137] In one embodiment, when determining a list of payment methods based on the cash register, the processor is configured to:
[0138] Obtaining the payment method of the merchant corresponding to the purchase order through the configuration interface of the cashier;
[0139] Obtain the payment method corresponding to the user application, and determine the payment method list based on the payment method of the merchant and the payment method of the user application.
[0140] In one embodiment, after generating a payment modal box on the user side based on the target payment channel class and the payment parameters so that the user can make a payment based on the payment modal box, the processor is further configured to:
[0141] When it is detected that the user payment is completed, polling is performed based on the preset algorithm in the H5 page to obtain the order status and payment result, and the order status and payment result are returned to the user.
[0142] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. The processor executes the program instructions to implement any H5-based application payment method provided in the embodiment of the present application.
[0143] The computer-readable storage medium may be an internal storage unit of the computer device described in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a SmartMedia Card (SMC), a Secure Digital (SD) card, a flash memory card, etc., equipped on the computer device.
[0144] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. An application payment method based on H5, characterized in that: include: Upon receiving a payment request from a user application, based on the H5 page, the payment interceptor corresponding to the payment request is called; Based on the payment interceptor, determine the target payment method corresponding to the payment request, and obtain the payment parameters corresponding to the payment request; Based on the target payment method, determining a target payment channel class in a preset payment channel class; Based on the target payment channel class and the payment parameters, a payment modal box of the user end is generated so that the user can make payment based on the payment modal box.
2. The H5-based application payment method according to claim 1, characterized in that: When receiving a payment request from a user application, based on the H5 page, calling a payment interceptor corresponding to the payment request includes: Upon receiving the payment request, obtaining a payment interceptor corresponding to the user application based on the H5 page, and generating a call link for the payment interceptor; Based on the calling link of the payment interceptor, the payment interceptor is called.
3. The H5-based application payment method according to claim 1, characterized in that: Before determining the target payment channel class in the preset payment channel class based on the target payment method, the method further includes: Obtaining universal payment configuration parameters, and constructing a universal payment channel class based on the universal payment configuration parameters; At least one set of preset payment channel configuration parameters is obtained, and the universal payment channel class and each set of payment channel configuration parameters are processed respectively to construct the payment channel class corresponding to each set of payment channel configuration parameters.
4. The H5-based application payment method according to claim 1, characterized in that: The generating a payment modal box of the user terminal based on the target payment channel class and the payment parameter includes: Obtain the payment template and payment channel calling method corresponding to the target payment channel class; Based on the payment channel calling method, calling the target payment channel; A payment modal box of the user terminal is generated based on the payment template, the payment parameters and the target payment channel.
5. The H5-based application payment method according to claim 1, characterized in that: When receiving a payment request from a user application, before calling a payment interceptor corresponding to the payment request based on an H5 page, the method further includes: When a purchase order of the user application is detected, a payment order is created according to the purchase order, and a payment order number is generated; Obtaining a cashier address based on the payment order number, and loading the cashier based on the cashier address; Based on the cash register, determining a list of available payment methods; A target payment method determined by the user based on the list of available payment methods is received, and a payment request applied by the user is generated based on the target payment method.
6. The H5-based application payment method according to claim 5, characterized in that: The method of determining a list of payment methods based on the cash register includes: Obtaining the payment method of the merchant corresponding to the purchase order through the configuration interface of the cashier; The payment method corresponding to the user application is obtained, and the payment method list is determined based on the payment methods of the merchant and the payment methods of the user application.
7. The H5-based application payment method according to any one of claims 1 to 6, characterized in that: After generating a payment modal box of the user terminal based on the target payment channel class and the payment parameter so that the user can make payment based on the payment modal box, the method further includes: When it is detected that the user payment is completed, polling is performed based on the preset algorithm in the H5 page to obtain the order status and payment result, and the order status and payment result are returned to the user.
8. An application payment device based on H5, characterized in that: include: The payment interceptor calling module is used to call the payment interceptor corresponding to the payment request based on the H5 page when receiving the payment request from the user application; A payment parameter acquisition module, used to determine the target payment method corresponding to the payment request based on the payment interceptor, and obtain the payment parameters corresponding to the payment request; A payment channel class determination module, used to determine a target payment channel class from a preset payment channel class based on the target payment method; The payment modal box generation module is used to generate a payment modal box on the user side based on the target payment channel class and the payment parameters, so that the user can make payment based on the payment modal box.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the H5-based application payment method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the H5-based application payment method according to any one of claims 1 to 7.