Table of Contents
一、网关支付&WAP支付
二、手机控件支付
三、无跳转支付
Home Web Front-end HTML Tutorial 银联支付开发_html/css_WEB-ITnose

银联支付开发_html/css_WEB-ITnose

Jun 24, 2016 am 11:24 AM

最近在接入各种支付机构,鉴于各种产品业务需求不同,具体开发实现不尽相同,不讨论具体业务实现。银联官方商家技术服务网站提供了很多可接入产品,本文仅讨论以下几种收款产品:

  • 网关支付(和手机网页支付(WAP支付)其实一样)
  • 手机控件支付
  • 无跳转支付

    一、网关支付&WAP支付

    先讨论这两种支付方式,比较简单而且容易理解,这两种支付方式只需要我们将请求参数值设置好,签名,组装成HTML返回给前台界面[java:response.getWriter().write()]即可。HTML报文示例:
    <html>  <head>      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  </head>  <body>      <form id="pay_form" action="https://101.231.204.80:5000/gateway/api/frontTransReq.do" method="post">          <input type="hidden" name="txnType" id="txnType" value="01" />          <input type="hidden" name="frontUrl" id="frontUrl" value="http://127.0.0.1:8080/ACPSample_B2C/frontRcvResponse" />          <input type="hidden" name="channelType" id="channelType" value="07" />          <input type="hidden" name="currencyCode" id="currencyCode" value="156" />          <input type="hidden" name="merId" id="merId" value="777290058110048" />          <input type="hidden" name="txnSubType" id="txnSubType" value="01" />          <input type="hidden" name="txnAmt" id="txnAmt" value="10000" />          <input type="hidden" name="version" id="version" value="5.0.0" />          <input type="hidden" name="signMethod" id="signMethod" value="01" />          <input type="hidden" name="backUrl" id="backUrl" value="http://222.222.222.222:8080/ACPSample_B2C/BackRcvResponse" />          <input type="hidden" name="certId" id="certId" value="68759663125" />          <input type="hidden" name="encoding" id="encoding" value="UTF-8" />          <input type="hidden" name="bizType" id="bizType" value="000201" />          <input type="hidden" name="signature" id="signature" value="q75cUw1E90Z/3zoPLoaWwOsHoiLmw4PvD1xgUIapsxKY3tcQpHmI/Y/4oKsG3lli4DpU63EoZScTEZNjdOvorAd5+DTSmKNLECVSBxy7mRTfTVISX/jYuVuc87ogdro8GpT4sHaY0jwVjp1dWalOSQ/jfoYniAggUuhSgQtz/0dSH//R4GVa3sP22jJjHWeWUVFJi5bMNeYe57qqcdZ5Ga04rnKnGuIpIQC3I3GosKziRtRGjdo+OYFmbl28W3QwB5qohG1QIqPvwpDM6WUlVbStuEVBf/FwpZ8yuai8WXOU+GQ9kZYuRSoSDNrRR9/jmYqkwyJDEMtWsl9pehQ4Og==" />          <input type="hidden" name="orderId" id="orderId" value="20160303100902" />          <input type="hidden" name="txnTime" id="txnTime" value="20160303100902" />          <input type="hidden" name="accessType" id="accessType" value="0" />      </form>      <script type="text/javascript">document.all.pay_form.submit();</script>  </body></html>
    Copy after login

不清楚的可以试试复制下上面的代码保存为.html格式的文档,然后用浏览器打开,即可跳转到银联页面,付款成功后银联会通过你请求参数中的backUrl通知你。

二、手机控件支付

手机控件支付更简单,不用组装报文,但是流程上与网页支付不同,需要先跟银联交互一次,拿到tn(银联受理订单号),然后客户端就可以调起银联手机控件进行支付了。

三、无跳转支付

介绍无跳转支付之前,需要先了解银联的两个概念:

  • 后台消费
  • 前台消费。

    前台消费:通过浏览器提交请求到银联的消费。后台消费:直接通过商户后台提交请求到银联完成支付,相对于前台消费,无需页面跳转。

无跳转支付就是后台支付,主要是为了方便用户完成交互过程(前提是用户银联卡已开通银联全渠道支付),用户选择银联卡/输入卡号后,向银联“获取短信”接口发送获取短信验证码请求,银联会将短信验证码发送到卡号(accNo)对应的绑定手机上,用户输入短信验证码后,后台将卡号(accNo)和短信验证码(smsCode)提交到银联,即可完成消费过程。

所以后台消费的整个过程可以理解为这样(假设卡已经开通了银联全渠道消费):客户端/前台界面选择银行卡/输入卡号-->点击获取短信-->后台发送报文到银联获取短信验证码-->银联将短信验证码发送到卡号绑定的手机-->用户输入验证码-->点击“消费/购买”-->后台将包含卡号(accNo)和短信验证码(smsCode)的报文发送到银联-->消费完成。

```sequence客户端->客户端: 选择卡/输入卡号客户端->后台:请求短信验证码后台->银联:调用发送短信接口note right of 银联:发送验证码到\n卡号绑定的手机note right of 客户端:用户输入验证码客户端->后台:消费后台->银联:发送消费报文\n包含accNo和smsCode```
Copy after login

以上代码在stackedit可以生成此图

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What are the best practices for cross-browser compatibility in HTML5? What are the best practices for cross-browser compatibility in HTML5? Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

How do I use HTML5 form validation attributes to validate user input? How do I use HTML5 form validation attributes to validate user input? Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

What is the viewport meta tag? Why is it important for responsive design? What is the viewport meta tag? Why is it important for responsive design? Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

The article discusses the &lt;iframe&gt; tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

See all articles