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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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)

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

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...

How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? Apr 05, 2025 am 06:15 AM

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

How to implement adaptive layout of Y-axis position in web annotation? How to implement adaptive layout of Y-axis position in web annotation? Apr 04, 2025 pm 11:30 PM

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...

HTML, CSS, and JavaScript: Essential Tools for Web Developers HTML, CSS, and JavaScript: Essential Tools for Web Developers Apr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

See all articles