com.alipay.api.domain.AlipayTradeWapPayModel Java Examples

The following examples show how to use com.alipay.api.domain.AlipayTradeWapPayModel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AlipayWAPPayController.java    From springboot-pay-example with Apache License 2.0 6 votes vote down vote up
/**
 * 去支付
 *
 * 支付宝返回一个form表单,并自动提交,跳转到支付宝页面
 *
 * @param response
 * @throws Exception
 */
@PostMapping("/gotoPayPage")
public void gotoPayPage(HttpServletResponse response) throws AlipayApiException, IOException {
    // 订单模型
    String productCode="QUICK_WAP_WAY";
    AlipayTradeWapPayModel model = new AlipayTradeWapPayModel();
    model.setOutTradeNo(UUID.randomUUID().toString());
    model.setSubject("支付测试");
    model.setTotalAmount("0.01");
    model.setBody("支付测试,共0.01元");
    model.setTimeoutExpress("5m");
    model.setProductCode(productCode);

    AlipayTradeWapPayRequest wapPayRequest =new AlipayTradeWapPayRequest();
    wapPayRequest.setReturnUrl("http://yxep7y.natappfree.cc/alipay/wap/returnUrl");
    wapPayRequest.setNotifyUrl(alipayProperties.getNotifyUrl());
    wapPayRequest.setBizModel(model);

    // 调用SDK生成表单, 并直接将完整的表单html输出到页面
    String form = alipayClient.pageExecute(wapPayRequest).getBody();
    System.out.println(form);
    response.setContentType("text/html;charset=" + alipayProperties.getCharset());
    response.getWriter().write(form);
    response.getWriter().flush();
    response.getWriter().close();
}
 
Example #2
Source File: AlipayWapServiceImpl.java    From fast-family-master with Apache License 2.0 5 votes vote down vote up
@Override
public AlipayTradeWapPayResponse payWap(AlipayTradeWapPayModel model) throws AlipayApiException {
    AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
    request.setBizModel(model);
    request.setNotifyUrl(aliPayProperties.getNotifyUrl());
    request.setReturnUrl(aliPayProperties.getReturnUrl());
    return alipayClient.pageExecute(request);
}
 
Example #3
Source File: WapPayParamChain.java    From alipay with Apache License 2.0 4 votes vote down vote up
public WapPayParamChain(AlipayClient alipayClient, AlipayTradeWapPayModel alipayTradeWapPayModel) {
    this.alipayClient = alipayClient;
    this.alipayTradeWapPayModel = alipayTradeWapPayModel;
}
 
Example #4
Source File: WapPayChain.java    From alipay with Apache License 2.0 4 votes vote down vote up
public WapPayChain(AlipayClient alipayClient, AlipayTradeWapPayModel alipayTradeWapPayModel) {
    this.alipayClient = alipayClient;
    this.alipayTradeWapPayModel = alipayTradeWapPayModel;
}
 
Example #5
Source File: AlipayWapService.java    From fast-family-master with Apache License 2.0 2 votes vote down vote up
/**
 * 网页支付
 *
 * @param model
 * @return
 * @throws AlipayApiException
 */
AlipayTradeWapPayResponse payWap(AlipayTradeWapPayModel model) throws AlipayApiException;