Network payment method and related equipment

文档序号:1557368 发布日期:2020-01-21 浏览:12次 中文

阅读说明:本技术 一种网络支付的方法以及相关设备 (Network payment method and related equipment ) 是由 汪刚 于 2018-07-11 设计创作,主要内容包括:本发明实施例提供了一种网络支付的方法及相关设备,用于提高网络支付的可靠性。本发明实施例方法包括:获取目标标识;获取所述用户对所述目标商品使用的目标支付类型;根据所述目标标识以及所述目标支付类型确定目标参数params;将所述目标参数params发送至服务器,以使得所述服务器通过所述目标参数params调用订单生成接口assist_payOrderByThird生成目标订单;当接收到所述服务器发送的目标订单中的错误码为预设值时,判断所述数据data的类型是否是预设类型;若是,对所述数据data进行解析,以得到所述扩展参数ext;根据所述扩展参数ext以及所述目标支付类型对应的支付服务确定支付结果。(The embodiment of the invention provides a network payment method and related equipment, which are used for improving the reliability of network payment. The method provided by the embodiment of the invention comprises the following steps: acquiring a target identifier; acquiring a target payment type used by the user for the target commodity; determining a target parameter params according to the target identification and the target payment type; sending the target parameter params to a server, so that the server calls an order generation interface assist _ payOrderByThird through the target parameter params to generate a target order; when an error code in a target order sent by the server is a preset value, judging whether the type of the data is a preset type; if so, analyzing the data to obtain the extended parameter ext; and determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type.)

1. A method of network payment, comprising:

acquiring a target identifier, wherein the target identifier is an identifier of an effective commodity to be purchased by a user in a live broadcast platform;

determining a target payment type used by the user for the target commodity;

determining a target parameter params according to the target identification and the target payment type;

sending the target parameter params to a server, so that the server calls an order generation interface assist _ payOrderByThird through the target parameter params to generate a target order, wherein the target order at least comprises an error code and data;

when an error code in a target order sent by the server is a preset value, judging whether the type of the data is a preset type;

if yes, analyzing the data to obtain an extended parameter ext, wherein the extended parameter ext at least comprises timestamp information of the target order, signature information of the target order, payment identification information corresponding to the target order, partner identification information and target payment type information;

and determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type.

2. The method of claim 1, wherein determining a target parameter params according to the target identifier and the target payment type comprises:

and packaging the payment type and the target identifier to obtain the target parameter params, wherein the payment type and the target identifier are value values of the target parameter params.

3. The method according to claim 1 or 2, wherein the determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type comprises:

converting the extended parameter ext into a character string;

and sending the character string to a payment service corresponding to the target payment type to obtain the payment result.

4. The method according to claim 3, wherein when the payment service corresponding to the target payment type is a Payment service, the determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type includes:

calling a defaultService for acquiring a function defaultService of the payment service through the AlipaySDK corresponding to the Payment service to create a PaySDK;

and sending the character string to the payment service paySDK to obtain the payment result.

5. The method according to claim 3, wherein when the payment service corresponding to the target payment type is a WeChat payment service, the determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type comprises:

calling an alloc function and an init function to create a request function payRequest through a payReq corresponding to the WeChat payment service;

and sending the character string to the request function payRequest to obtain the payment result.

6. The method according to claim 1 or 2, wherein after the sending the character string to the payment service corresponding to the target payment type to obtain the payment result, the method further comprises:

and sending prompt information, wherein the prompt information is used for indicating whether the valid commodity to be purchased is purchased successfully or not.

7. The method of claim 1, wherein the determining a target payment type for use of the target good by the user comprises:

determining the target payment type by judging the payment type used by the user for the target commodity.

8. An apparatus for network payment, comprising:

the system comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring a target identifier, and the target identifier is an identifier of an effective commodity to be purchased by a user in a live broadcast platform;

a first determination unit, configured to determine a target payment type used by the user for the target commodity;

a second determining unit, configured to determine a target parameter params according to the target identifier and the target payment type;

a sending unit, configured to send the target parameter params to a server, so that the server invokes an order generation interface, assist _ payorderbytird, to generate a target order through the target parameter params, where the target order at least includes an error code and data;

the judging unit is used for judging whether the type of the data is a preset type or not when the error code in the target order sent by the server is a preset value;

the analysis unit is used for analyzing the data to obtain an extended parameter ext when the type of the data is a preset type, wherein the extended parameter ext at least comprises timestamp information of a target order, signature information of the target order, payment identification information corresponding to the target order, partner identification information and target payment type information;

and the third determining unit is used for determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type.

9. An electronic device comprising a memory, a processor, wherein the processor is configured to implement the steps of the method for network payment according to any one of claims 1 to 7 when executing a computer management class program stored in the memory.

10. A computer-readable storage medium having stored thereon a computer management-like program, characterized in that: the computer management class program when executed by a processor implements the steps of the method of network payment according to any one of claims 1 to 7.

Technical Field

The invention relates to the field of payment, in particular to a network payment method and related equipment.

Background

With the rapid development of mobile terminals of mobile phones, the network payment of mobile terminals of mobile phones is also rapidly developed.

In the live application program, some commodities need to be purchased by a user through network payment, and the online payment is used for purchasing, so that the process is a relatively complex process, the process is required to be 100% reliable, the service purchased by the user is ensured to be paid, even if the network of the user is not good, the terminal caused by the bad network needs to ensure that the payment process is reliable, and the basic principle needs to be met: if the payment is successful, the merchandise or shark fin cannot be obtained if the purchase is failed.

However, the operation of generating the payment order in the payment mode is generated locally, and the user may counterfeit the order service, so that the reliability of the payment order is greatly reduced.

Disclosure of Invention

The embodiment of the invention provides a network payment method and related equipment, which are used for improving the reliability of network payment.

The first aspect of the embodiment of the invention provides a method for network payment, which comprises the following steps:

acquiring a target identifier, wherein the target identifier is an identifier of an effective commodity to be purchased by a user in a live broadcast platform;

determining a target payment type used by the user for the target commodity;

determining a target parameter params according to the target identification and the target payment type;

sending the target parameter params to a server, so that the server calls an order generation interface assist _ payOrderByThird through the target parameter params to generate a target order, wherein the target order at least comprises an error code and data;

when an error code in a target order sent by the server is a preset value, judging whether the type of the data is a preset type;

if yes, analyzing the data to obtain an extended parameter ext, wherein the extended parameter ext at least comprises timestamp information of the target order, signature information of the target order, payment identification information corresponding to the target order, partner identification information and target payment type information;

and determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type.

Optionally, the determining a target parameter params according to the target identifier and the target payment type includes:

and packaging the payment type and the target identifier to obtain the target parameter params, wherein the payment type and the target identifier are value values of the target parameter params.

Optionally, the determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type includes:

converting the extended parameter ext into a character string;

and sending the character string to a payment service corresponding to the target payment type to obtain the payment result.

Optionally, when the payment service corresponding to the target payment type is a pay payment service, the determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type includes:

calling a defaultService for acquiring a function defaultService of the payment service through the AlipaySDK corresponding to the Payment service to create a PaySDK;

and sending the character string to the payment service paySDK to obtain the payment result.

Optionally, when the payment service corresponding to the target payment type is a WeChat payment service, the determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type includes:

calling an alloc function and an init function to create a request function payRequest through a payReq corresponding to the WeChat payment service;

and sending the character string to the request function payRequest to obtain the payment result.

Optionally, after the sending the character string to the payment service corresponding to the target payment type to obtain the payment result, the method further includes:

and sending prompt information, wherein the prompt information is used for indicating whether the valid commodity to be purchased is purchased successfully or not.

Optionally, the determining a target payment type used by the user for the target commodity comprises:

determining the target payment type by judging the payment type used by the user for the target commodity.

A second aspect of the embodiments of the present invention provides an apparatus for network payment, including:

the system comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring a target identifier, and the target identifier is an identifier of an effective commodity to be purchased by a user in a live broadcast platform;

a first determination unit, configured to determine a target payment type used by the user for the target commodity;

a second determining unit, configured to determine a target parameter params according to the target identifier and the target payment type;

a sending unit, configured to send the target parameter params to a server, so that the server invokes an order generation interface, assist _ payorderbytird, to generate a target order through the target parameter params, where the target order at least includes an error code and data;

the judging unit is used for judging whether the type of the data is a preset type or not when the error code in the target order sent by the server is a preset value;

the analysis unit is used for analyzing the data to obtain an extended parameter ext when the type of the data is a preset type, wherein the extended parameter ext at least comprises timestamp information of a target order, signature information of the target order, payment identification information corresponding to the target order, partner identification information and target payment type information;

and the third determining unit is used for determining a payment result according to the extended parameter ext and the payment service corresponding to the target payment type.

Optionally, the second determining unit is specifically configured to:

and packaging the payment type and the target identifier to obtain the target parameter params, wherein the payment type and the target identifier are value values of the target parameter params.

Optionally, the third determining unit is specifically configured to:

converting the extended parameter ext into a character string;

and sending the character string to a payment service corresponding to the target payment type to obtain the payment result.

Optionally, the third determining unit is specifically configured to:

when the payment service corresponding to the target payment type is a PaySDK, calling a defaultService acquiring function defaultService corresponding to the PaySDK to create a PaySDK;

and sending the character string to the payment service paySDK to obtain the payment result.

Optionally, the third determining unit is specifically configured to:

when the payment service corresponding to the target payment type is a WeChat payment service, calling an alloc function and an init function to create a request function payRequest through a payReq corresponding to the WeChat payment service;

and sending the character string to the request function payRequest to obtain the payment result.

Optionally, the apparatus further comprises:

and the prompting unit is used for sending out prompting information, and the prompting information is used for indicating whether the effective commodity to be purchased is purchased successfully or not.

Optionally, the first determining unit is specifically configured to:

determining the target payment type by judging the payment type used by the user for the target commodity.

A third aspect of the present invention provides an electronic device, comprising a memory and a processor, wherein the processor is configured to implement the steps of the method for network payment as described in any one of the above when executing a computer management-like program stored in the memory.

A fourth aspect of the present invention provides a computer-readable storage medium having a computer management-like program stored thereon, characterized in that: the computer management class program, when executed by a processor, implements the steps of the method of network payment as described in any one of the above.

In summary, in the embodiment of the present invention, the target parameter params may be generated from the obtained target identifier and the target payment type, and the target parameter params is sent to the server by creating an order function makeOrderWithDic, so that the server generates the target order by calling the order generation interface "assign _ payorderbytrierd" through the target parameter params, analyzes the data in the target order to obtain the extended parameter ext, and determines the payment result according to the extended parameter and the payment service corresponding to the target payment type. Therefore, in the embodiment, the parameters of the target order are taken to call the corresponding payment service to obtain the payment result, the order parameters are some key parameters and are not easy to tamper, and the payment result is returned by the third-party service and is not easy to tamper, so that the method has very high reliability.

Drawings

Fig. 1 is a schematic flow chart of a method for network payment according to an embodiment of the present invention;

fig. 2 is a schematic diagram of an embodiment of an apparatus for network payment according to an embodiment of the present invention;

fig. 3 is a schematic hardware structure diagram of an apparatus for network payment according to an embodiment of the present invention;

fig. 4 is a schematic diagram of an embodiment of an electronic device according to an embodiment of the present invention;

fig. 5 is a schematic diagram of an embodiment of a computer-readable storage medium according to an embodiment of the present invention.

Detailed Description

The embodiment of the invention provides a network payment method and related equipment, which are used for improving the reliability of network payment.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:移动支付方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!