支付宝线下门店扫码支付开发

支付宝扫码支付

一.开发前准备

https://doc.open.alipay.com/doc2/detail.htm?spm=0.0.0.0.B6xA20&treeId=26&articleId=103239&docType=1

1.开通支付宝企业号

2.签约认证

3.创建应用,审核通过。

4.上传应用公钥。

二.开发demo从支付宝官网下载

alipay-sdk-java-ALL20150604113758-source.jar

alipay-sdk-java-ALL20150604113758.jar

/**
	 * 调用支付宝扫码支付二维码生成
	 *
	 * @return
	 */
	public String aliQr() {
		String orderId = httpServletRequest.getParameter("orderId");
		String out_trade_no = getTradeNo();
		String total_amount = httpServletRequest.getParameter("total_amount");
		String subject = "";
		String companyId = getCompanyInfo().getCompanyId();
		Order o = null;
		try {
			o = orderService.getOrderById(Integer.parseInt(orderId));
			subject = CommonCompanyName(o.getCompanyId(), o.getSubCompanyId())
					+ "的商品" + total_amount + "元";
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		AlipayTradePrecreateResponse response = qrPay(out_trade_no,
				total_amount, subject, companyId, orderId, o.getSubCompanyId());
		if (null != response && response.isSuccess()) {
			ResponseWriteUtil.writeHTML("{\"code\":\"" + response.getQrCode()
					+ "\"," + "\"outTradeNo\":\"" + response.getOutTradeNo()
					+ "\"}");
			// 生成自定义二维码图片
			// String path = "/qrcode/" + companyId + "/" + out_trade_no +
			// ".png";
			// String qrCodePath = ServletActionContext.getServletContext()
			// .getRealPath(path);
			// ZXingQrCode.createQrCodeImg(300, 300, response.getQrCode(),
			// qrCodePath);
			// 保存二维码值
			HashMap<String, Object> map = new HashMap<String, Object>();
			map.put("orderId", orderId);
			map.put("aliqrcodeUrl", response.getQrCode());
			// map.put("aliqrcodeUrl", ConfigUtil.SYS_BASE_URL + path);
			orderService.updateAliQrCodeByOrderId(map);
		} else {
			ResponseWriteUtil.writeHTML("{\"code\":\"0\"}");// 不存在
		}
		return null;
	}

	public String CommonCompanyName(String companyId, String subCompanyId) {
		Seller seller = sellerService.findSellerByCompanyId(companyId);
		String commonMsg = "";
		SubCompany subCompany = null;
		if (StringUtils.isNotBlank(subCompanyId)) {
			subCompany = subCompanyService.fetchSubCompanyBySid(subCompanyId);
		}
		if (subCompany == null) {// 主店
			commonMsg = seller.getCompanyName();
		} else {// 分店
			commonMsg = subCompany.getCompanyShortName();
		}
		return commonMsg;
	}

	/**
	 * 是否配置了支付宝二维码支付
	 *
	 * @return
	 */
	public String isExistByAliPayQrCode() {
		String companyId = httpServletRequest.getParameter("companyId");
		String subCompanyId = httpServletRequest.getParameter("subCompanyId");
		HashMap<String, Object> map2 = new HashMap<String, Object>();
		map2.put("companyId", companyId);
		map2.put("subCompanyId", subCompanyId);
		ALIPayConfigure aliPayConfigure = aliPayConfigureService
				.selectAppId(map2);
		if (aliPayConfigure != null) {
			ResponseWriteUtil.writeHTML("{\"code\":\"" + 1 + "\"}");
		} else {
			ResponseWriteUtil.writeHTML("{\"code\":\"" + 0 + "\"}");
		}
		return null;
	}
/**
	 * 回调通知处理
	 *
	 * @return
	 */
	public String notifyMsgByAliPay() {
		String orderId = httpServletRequest.getParameter("orderId");
		String totalAmount = httpServletRequest.getParameter("totalAmount");
		String outTradeNo = httpServletRequest.getParameter("outTradeNo");
		System.out.println("订单号:" + orderId + ",订单金额:" + totalAmount
				+ ",商户交易号:" + outTradeNo);
		System.out.println("支付宝异步回调通知:");
		// 判断付款是否成功,已成功则不再记录付款信息
		if (orderService.ifOrderPaid(Integer.parseInt(orderId)) > 0) {
			log.info("付款已成功,不再记录付款信息");
			ResponseWriteUtil.writeHTML("success");
			return null;
		}
		aliPayService.aliPayFinsh(Integer.parseInt(orderId), totalAmount,
				outTradeNo);
		System.out.println("系统订单业务处理完成");
		ResponseWriteUtil.writeHTML("success");// 告诉支付宝我已处理,不需要重复发异步通知
		System.out.println("支付宝异步回调通知成功结束");
		return null;
	}

js页面

//*************start*********aliPayByQr******************************
//是否配置了支付宝扫码
function isExistByAliPayQrCode(){
	var companyId=$("#companyId").val();
	var subCompanyId=$("#subCompanyId").val();
	if(subCompanyId==null||subCompanyId=='null'||subCompanyId==undefined){
		subCompanyId="";
	}
	$.ajax({
		url : '<%=basePath%>/aliPay!isExistByAliPayQrCode.action?companyId='+companyId+'&subCompanyId='+subCompanyId,
		async : false,
		type : "post",
		dataType : "json",
		success : function(result) {
			 if(result.code!='0'){
			 	$("#aliQrBtn").show();
			 }else{
			 	$("#aliQrBtn").hide();
			 	layer.msg("商家没有配置支付宝扫码支付!");
			 }
		}
	});
}

function aliQrClick(){
	var total_amount=$("#paymentAmount").val();
	var orderId=$("#myorderId").val();
	//check
	var paySize=$(".payMoneyC").length;
	var ptypeNum=$(".ptype:checked").length;
	var paySum=0;
	if(ptypeNum<=0){
		layer.msg("支付方式至少选择一个!");
		return;
	}
	if(ptypeNum!=1){
		layer.msg("支付方式只能是支付宝扫码支付!");
		return;
	}
	var companyId=$("#companyId").val();
	var subCompanyId=$("#subCompanyId").val();
	if(subCompanyId==null||subCompanyId=='null'||subCompanyId==undefined){
		subCompanyId="";
	}
	$.ajax({
		url : '<%=basePath%>/aliPay!aliQr.action',
		async : false,
		type : "post",
		dataType : "json",
		data:{"total_amount":total_amount,"orderId":orderId},
		success : function(result) {
			if(result.code!='0'){
				$("#aliQrBtn").hide();
				$("#outputALIQr").show();
				<span style="color:#ff0000;">jQuery('#outputALIQr').qrcode({width:200,height:200,text:result.code});//</span><span style="color: rgb(255, 0, 0); font-family: Arial, Helvetica, sans-serif;">js</span><span style="color: rgb(255, 0, 0); font-family: Arial, Helvetica, sans-serif;">二维码生成</span><span style="color:#ff0000;">
</span>				window.setInterval(finshAliQrPay, 8000);
			}else{
				layer.msg("支付宝二维码生成出错!");
			}
		}
	});
}

function qrQueryRetry(out_trade_no){
	$.ajax({
		url : '<%=basePath%>/aliPay!aliQueryRetry.action',
		async : false,
		type : "post",
		dataType : "json",
		data:{"out_trade_no":out_trade_no},
		success : function(result) {
		}
	});
}
var aliNum=0;
function finshAliQrPay(){
 	var orderId=$("#myorderId").val();
	$.ajax({
		url : '<%=basePath%>/aliPay!<span style="color:#cc0000;background-color: rgb(255, 255, 255);">notifyOrderCashFinshed</span>.action?orderId='+orderId,
		async : false,
		type : "post",
		dataType : "json",
		data:$('#finishForm').serialize(),
		success : function(result) {
			 if(result.code!='0'){
			 	layer.msg("支付宝扫码支付交易成功,订单3秒后即将关闭!");
			 	window.setTimeout(function(){
			 	//关闭弹出窗之前,跳转到其他页面
			    parent.window.location.href="<%=path%>/"+result.redirectUrl;
			    closeLayerDialog();
			 	},3000);
			 }else{
			    aliNum=aliNum+1;
			 	$("#aliQrPayNotifyNum").val(aliNum);
			 }
		}
	});
}

//*************end*******aliPayByQr********************************

5.aliPayService 实现类

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipayTradePrecreateRequest;
import com.alipay.api.request.AlipayTradeQueryRequest;
import com.alipay.api.request.AlipayTradeRefundRequest;
import com.alipay.api.response.AlipayTradePrecreateResponse;
import com.alipay.api.response.AlipayTradeQueryResponse;
import com.alipay.api.response.AlipayTradeRefundResponse;

@Service("aliPayService")
public class ALIPayServiceImpl implements ALIPayService {
	Logger log = Logger.getLogger(ALIPayServiceImpl.class);

	@Resource
	private OrderDAO orderDAO;
	@Resource
	private SerialNumMngDAO serialNumMngDAO;
	@Resource
	private ALIPayTradeLogsDAO aliPayTradeLogsDAO;
	@Resource
	private ALIPayConfigureDAO aliPayConfigureDAO;

	@Resource
	private ALIPayTradeLogsService aliPayTradeLogsService;
	@Resource
	private ALIPayConfigureService aliPayConfigureService;
	@Resource
	private OrderService orderService;

	@Override
	public void aliPayFinsh(Integer orderId, String totalAmount,
			String outTradeNo) {
		// TODO Auto-generated method stub
		Order o = null;
		float paymentAmount = Float.parseFloat(totalAmount);
		try {
			o = orderDAO.getOrderbyId(orderId);
			// 系统交易流水记录
			List<OrderPlus> ops = new ArrayList<OrderPlus>();
			OrderPlus op = new OrderPlus();
			op.setOrderId(o.getId());
			op.setOrderAmount(o.getAmount());
			op.setPaymentAmount(paymentAmount);
			op.setPaymentTime(new Date());
			op.setPaymentType(EnumUtil.PAYMENT_TYPE.alipayqrbycompay.getCode());
			op.setNotes("支付宝扫码支付:支付金额为" + paymentAmount);
			ops.add(op);
			orderDAO.insertOrderPlusPitch(ops);

			// 更新系统订单业务
			HashMap<String, Object> map = new HashMap<String, Object>();
			map.put("orderId", o.getId());
			// 外卖
			if (o.getIsTakeOut() == 1) {
				map.put("dealSts", EnumUtil.ORDER_dealSts.finished.getCode());
			} else {
				map.put("dealSts", EnumUtil.ORDER_dealSts.paid.getCode());
			}
			map.put("finishTime", new Date());
			map.put("paymentAmount", paymentAmount);
			map.put("orderPersonNum", 0);
			map.put("orderTime", o.getOrderTime());
			serialNumMngDAO.finishOrder(map);

			// 支付宝交易流水记录
			HashMap<String, Object> map2 = new HashMap<String, Object>();
			map2.put("companyId", o.getCompanyId());
			map2.put("subCompanyId", o.getSubCompanyId());
			ALIPayConfigure alipc = aliPayConfigureDAO.selectAppId(map2);
			ALIPayTradeLogs aliPaytl = new ALIPayTradeLogs();
			aliPaytl.setOutTradeNo(outTradeNo);
			if (alipc != null) {
				aliPaytl.setAppId(alipc.getAppId());
			}
			aliPaytl.setOrderId(String.valueOf(orderId));
			aliPaytl.setTotalAmount(paymentAmount);
			aliPaytl.setChannel("ALI_OFFLINE_QRCODE");
			aliPaytl.setTradeDate(new Date());
			aliPayTradeLogsDAO.insert(aliPaytl);

		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Override
	public HashMap<String, Object> refundOrderByALIQr(String orderId,
			String refund_amount) {
		// TODO Auto-generated method stub
		HashMap<String, Object> map = new HashMap<String, Object>();
		ALIPayTradeLogs ali = aliPayTradeLogsService.selectByOrderId(Integer
				.parseInt(orderId));
		if (ali != null) {
			Order o = null;
			try {
				o = orderService.getOrderById(Integer.parseInt(orderId));
			} catch (Exception e) {
				e.printStackTrace();
			}
			HashMap<String, Object> queryMap = query(ali.getOutTradeNo(),
					o.getCompanyId(), o.getSubCompanyId());
			int flag = (Integer) queryMap.get("flag");
			String tradeNo = (String) queryMap.get("tradeNo");
			if (flag == 1) {
				boolean refundFlag = refundOrder(tradeNo, refund_amount, "",
						o.getCompanyId(), o.getSubCompanyId());
				map.put("refundFlag", refundFlag);
				map.put("refundMsg", "支付宝扫码(企业)提示:该支付款按原路退到买家帐号,请注意查收!");
			} else if (flag == 2) {
				map.put("refundFlag", false);
				map.put("refundMsg", "平台提示:支付宝扫码等待付款");
			} else if (flag == 3) {
				map.put("refundFlag", false);
				map.put("refundMsg", "平台提示:支付宝扫码未付款关闭,或已付款的订单全额退款后关闭");
			} else if (flag == 4) {
				map.put("refundFlag", false);
				map.put("refundMsg", "平台提示:支付宝扫码订单不可退款或撤销");
			} else if (flag == 0) {
				map.put("refundFlag", false);
				map.put("refundMsg", "平台提示:支付宝扫码请求未成功,请重试");
			}
		}
		return map;
	}

	public HashMap<String, Object> query(final String out_trade_no,
			String companyId, String subCompanyId) {
		String tradeNo = "";
		HashMap<String, Object> map = new HashMap<String, Object>();
		AlipayClient alipayClient = getAlipayClientByCompanyId(companyId,
				subCompanyId);
		AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
		String biz_content = "{\"out_trade_no\":\"" + out_trade_no + "\"}";
		request.setBizContent(biz_content);
		AlipayTradeQueryResponse response = null;
		try {
			response = alipayClient.execute(request);
			System.out.println(response.getBody());
			System.out.println(response.getCode());
			if (null != response && response.isSuccess()) {
				System.out.println("买家账号:" + response.getBuyerLogonId());
				System.out.println("商户订单号:" + response.getOutTradeNo());
				System.out.println("支付宝交易号:" + response.getTradeNo());
				System.out.println("总金额:" + response.getTotalAmount());
				System.out.println("订单状态:" + response.getTradeStatus());
				if (response.getCode().equals("10000")) {
					tradeNo = response.getTradeNo();
					if ("TRADE_SUCCESS".equalsIgnoreCase(response
							.getTradeStatus())) {
						map.put("tradeNo", tradeNo);
						map.put("flag", 1);
						// 表示已付款
					} else if ("WAIT_BUYER_PAY".equalsIgnoreCase(response
							.getTradeStatus())) {
						map.put("tradeNo", tradeNo);
						map.put("flag", 2);
						// 表示等待付款
					} else if ("TRADE_CLOSED".equalsIgnoreCase(response
							.getTradeStatus())) {
						map.put("tradeNo", tradeNo);
						map.put("flag", 3);
						// 表示未付款关闭,或已付款的订单全额退款后关闭
					} else if ("TRADE_FINISHED".equalsIgnoreCase(response
							.getTradeStatus())) {
						// 此状态,订单不可退款或撤销
						map.put("tradeNo", tradeNo);
						map.put("flag", 4);
					}
				} else {
					// 如果请求未成功,请重试
					map.put("tradeNo", tradeNo);
					map.put("flag", 0);
				}
			}
		} catch (AlipayApiException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return map;
	}

	/**
	 * 申请退单
	 *
	 * @param trade_no
	 * @author jinlong.rhj
	 * @date 2015年4月27日
	 * @version 1.0
	 * @return
	 */
	public boolean refundOrder(String trade_no, String refund_amount,
			String out_request_no, String companyId, String subCompanyId) {
		boolean flag = false;
		AlipayClient alipayClient = getAlipayClientByCompanyId(companyId,
				subCompanyId);
		AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();

		String biz_content = "{\"trade_no\":\""
				+ trade_no
				+ "\",\"refund_amount\":\""
				+ refund_amount
				+ "\",\"out_request_no\":\""
				+ out_request_no
				+ "\",\"refund_reason\":\"正常退单\",\"store_id\":\"\",\"terminal_id\":\"\"}";
		System.out.println(biz_content);
		request.setBizContent(biz_content);

		AlipayTradeRefundResponse response = null;

		try {
			response = alipayClient.execute(request);
			// System.out.println(response.getBody());
			// System.out.println(response.getCode());
			// System.out.println(response.getMsg());
			// System.out.println(response.getSubCode());
			// System.out.println(response.getSubMsg());
			// System.out.println(response.getBuyerLogonId());
			// System.out.println(response.getFundChange());
			// System.out.println(response.getOpenId());
			// System.out.println(response.getOutTradeNo());
			// System.out.println(response.getRefundFee());
			// System.out.println(response.getGmtRefundPay());
			// System.out.println(response.getOpenId());
			if (null != response && response.isSuccess()) {
				if (response.getCode().equals("10000")) {
					if (response.getFundChange().equals("Y")) {
						// 退款成功,资金有变动,做业务及账务处理
						flag = true;
					} else {
						// 资金无变动,不必做账务处理
					}
				} else {
					// 没有撤销成功,需要重试几次
					// refundOrderRetry(trade_no, refund_amount, out_request_no,
					// 6);
				}
			}
		} catch (AlipayApiException e) {
			e.printStackTrace();
		}
		return flag;
	}

	@Override
	public AlipayClient getAlipayClientByCompanyId(String companyId,
			String subCompanyId) {
		HashMap<String, Object> map2 = new HashMap<String, Object>();
		map2.put("companyId", companyId);
		map2.put("subCompanyId", subCompanyId);
		ALIPayConfigure aliPayConfigure = aliPayConfigureService
				.selectAppId(map2);
		DefaultAlipayClient alipayClient = null;
		if (aliPayConfigure != null) {
			alipayClient = new DefaultAlipayClient(
					AlipayServiceEnvConstants.ALIPAY_GATEWAY,
					aliPayConfigure.getAppId(),
					aliPayConfigure.getPrivateKey(), "json",
					AlipayServiceEnvConstants.CHARSET,
					AlipayServiceEnvConstants.ALIPAY_PUBLIC_KEY);
		}
		return alipayClient;
	}

	/**
	 * 支付宝扫码支付二维码生成接口
	 *
	 * @param out_trade_no
	 * @param total_amount
	 * @param subject
	 * @param companyId
	 * @return
	 */
	public AlipayTradePrecreateResponse qrPay(String out_trade_no,
			String total_amount, String subject, String companyId,
			String orderId, String subCompanyId) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String time_expire = sdf.format(System.currentTimeMillis() + 24 * 60
				* 60 * 1000);
		StringBuilder sb = new StringBuilder();
		sb.append("{\"out_trade_no\":\"" + out_trade_no + "\",");
		sb.append("\"total_amount\":\"" + total_amount
				+ "\",\"discountable_amount\":\"0.00\",");
		sb.append("\"subject\":\"" + subject + "\",");
		sb.append("\"time_expire\":\"" + time_expire + "\"}");
		System.out.println(sb.toString());

		AlipayClient alipayClient = getAlipayClientByCompanyId(companyId,
				subCompanyId);

		// 使用SDK,构建群发请求模型
		AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
		request.setBizContent(sb.toString());
		request.setNotifyUrl(ConfigUtil.SYS_BASE_URL
				+ "/aliPay!notifyMsgByAliPay.action" + "?orderId=" + orderId
				+ "&totalAmount=" + total_amount + "&outTradeNo="
				+ out_trade_no);
		AlipayTradePrecreateResponse response = null;
		// 商家配置不成功
		if (alipayClient == null) {
			return response;
		}
		try {
			// 使用SDK,调用交易下单接口
			response = alipayClient.execute(request);

			System.out.println(response.getBody());
			System.out.println(response.isSuccess());
			System.out.println(response.getMsg());
			// 这里只是简单的打印,请开发者根据实际情况自行进行处理
			if (null != response && response.isSuccess()) {
				if (response.getCode().equals("10000")) {
					System.out.println("商户订单号:" + response.getOutTradeNo());
					System.out.println("二维码值:" + response.getQrCode());// 商户将此二维码值生成二维码,然后展示给用户,用户用支付宝手机钱包扫码完成支付
					// 二维码的生成,网上有许多开源方法,可以参看:http://blog.csdn.net/feiyu84/article/details/9089497

				} else {
					// 打印错误码
					System.out.println("错误码:" + response.getSubCode());
					System.out.println("错误描述:" + response.getSubMsg());
				}
			}
		} catch (AlipayApiException e) {
		}
		return response;
	}

}

ALIPayService接口

import java.util.HashMap;

import com.alipay.api.AlipayClient;
import com.alipay.api.response.AlipayTradePrecreateResponse;

public interface ALIPayService {

	/**
	 * 支付宝扫码支付成功后,订单业务处理
	 *
	 * @param orderId
	 */
	public void aliPayFinsh(Integer orderId, String totalAmount,
			String outTradeNo);

	/**
	 * 支付宝扫码支付申请退款业务处理
	 *
	 * @param orderId
	 * @param refund_amount
	 * @return
	 */
	public HashMap<String, Object> refundOrderByALIQr(String orderId, String refund_amount);

	/**
	 * 各商家的获得API调用客户端
	 *
	 * @param companyId
	 * @param subCompanyId
	 * @return
	 */
	public AlipayClient getAlipayClientByCompanyId(String companyId,
			String subCompanyId);

	/**
	 * 支付宝扫码支付二维码生成接口
	 *
	 * @param out_trade_no
	 * @param total_amount
	 * @param subject
	 * @param companyId
	 * @return
	 */
	public AlipayTradePrecreateResponse qrPay(String out_trade_no,
			String total_amount, String subject, String companyId,
			String orderId, String subCompanyId);

}
时间: 2024-10-18 00:14:03

支付宝线下门店扫码支付开发的相关文章

Thinkphp5整合微信扫码支付开发实例

ThinkPHP框架是比较多人用的,曾经做过的一个Thinkphp5整合微信扫码支付开发实例,分享出来大家一起学习 打开首页生成订单,并显示支付二维码 public function index() { $wechat = new Wechat(); $data['order'] = date('Ymd') . substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8); //订单号 $

支付宝:web页面扫码支付、网站支付、支付宝即时到账 + springmvc

一.场景:公司需要在网站上进行支付宝支付. 二.API:使用支付宝开放平台的支付能力-即时到账接口.支付宝开放平台链接三.分析: 1.支付宝的文档比较容易看,主要是有相应的DEMO,我这里看的DEMO是 JAVA-UTF-8版本. 2.导入DEMO,在com.alipay.config中填入对应的partner和key(在对应的商户后台获取)就可以直接运行了解支付流程了. 3.改写:我这边使用的是springmvc+mybatis.商品发起购买(走支付宝支付).跳转到支付宝.支付宝回调支付状态.

支付宝扫码支付开发备忘

1.首先当然得注册有支付宝账号,最好是企业支付宝账号 2.进入支付宝开放平台的开发者中心:https://openhome.alipay.com/platform/developerIndex.htm 申请应用 3.申请应用之后,设置好应用图标.需要添加的功能为当面付和第三方应用授权,这个后续需要签约,否则调用接口会提示权限不够 4.设置应用网关 也就是支付成功之后的后台通知地址 5.设置应用公钥,这个非常重要,选择RSA2(SHA256)密钥(推荐),下载支付宝提供的RSA签名验签工具:htt

微信:微信扫码支付、调用统一下单接口、网站支付 + springmvc

一.场景:公司需要在网站上进行微信支付. 二.API:使用微信开放平台的接入微信支付 -扫码支付.微信支付开发者平台链接 三.分析: 接入扫码支付(包含PC网站支付)包含三个阶段,问这里只讲使用,也就是第2阶段的<启动设计和开发>. 点击查看开发者文档(扫码支付)后,这里感觉微信的文档没有支付宝好理解(稍微吐槽下~~~),不过我们忽略一切,直接进入模式二:模式二最简单直接,不需要在商户后台进行配置,推荐大家使用,微信也说流程更为简单,我这里也讲的是模式二,模式一大家有兴趣可以自行研究下. 如上

支付宝支付开发—当面付条码支付和扫码支付

关键字:支付宝 当面付 条码支付 扫码支付 二维码支付 订单查询 退款作者:方倍工作室 本文介绍支付宝中当面付下属的条码支付.扫码支付.订单查询.退款申请的集成开发过程. 本文分为以下五个部分: 条码支付和扫码支付介绍 申请应用 密钥生成及配置 API及SDK集成 条码支付.扫码支付.订单查询.退款申请 一.条码支付及二维码支付介绍 1. 条码支付 条码支付是支付宝给到线下传统行业的一种收款方式.商家使用扫码枪等条码识别设备扫描用户支付宝钱包上的条码/二维码,完成收款.用户仅需出示付款码,所有收

支付宝支付开发——当面付条码支付和扫码支付

关键字:支付宝 当面付 条码支付 扫码支付 二维码支付 订单查询 退款作者:方倍工作室原文: http://www.cnblogs.com/txw1958/p/alipay-f2fpay.html 本文介绍支付宝中当面付下属的条码支付.扫码支付.订单查询.退款申请的集成开发过程. 本文分为以下五个部分: 条码支付和扫码支付介绍 申请应用 密钥生成及配置 API及SDK集成 条码支付.扫码支付.订单查询.退款申请 注: 支付宝支付开发有一定的门槛,如果您愿意为知识付费来节省您宝贵的时间,请直接见底

支付宝当面付扫码支付接口开发

最近公司要做一个有关支付的相关项目,需要对接支付宝的支付接口,实现扫描二维码支付功能,为此研究了一下支付宝相关业务.主要依据就是支付宝的相关接口文档: https://docs.open.alipay.com/catalog,重点关注如下红色方框部分 先看一下支付宝扫描二维码支付的业务流程,直接摘出来如下: 扫码支付(接入指引) 扫码支付,指用户打开支付宝钱包中的"扫一扫"功能,扫描商家展示在某收银场景下的二维码并进行支付的模式.该模式适用于线下实体店支付.面对面支付等场景. 业务流程

支付宝开发 - 扫码支付

关键字:支付宝支付.支付宝扫码支付 一.支付场景 用户使用支付宝钱包上的"扫一扫"功能,扫码商户针对每个订单实时生成的订单二维码,并在手机端确认支付. 二.调用流程 图2.1 支付宝扫码支付调用流程 a. 商户系统调用支付宝[预下单接口alipay.trade.precreate],获得该订单二维码图片地址. b. 发起轮询获得支付结果:等待5秒后调用[交易查询接口alipay.trade.query],通过支付时传入的商户订单号(out_trade_no)查询支付结果(返回参数TRA

.NET MVC结构框架下的微信扫码支付模式二 API接口开发测试

直接上干货 ,我们的宗旨就是为人民服务.授人以鱼不如授人以渔.不吹毛求疵.不浮夸.不虚伪.不忽悠.一切都是为了社会共同进步,繁荣昌盛,小程序猿.大程序猿.老程序猿还是嫩程序猿,希望这个社会不要太急功近利 ,希望每个IT行业的BOSS要有良知,程序猿的青春年华都是无私默默奉献,都是拿命拼出来了现在的成就,如果卸磨杀驴,如果逼良为娼,请MM你的良心对得起你爹妈吗,你也有家,你也有小孩,你也有父母的. 在这里致敬程序猿, 致敬我们的攻城狮,致敬我们最可爱的人! 珍惜生命,换种活法也是依然精彩. Vie