WAP支付

@param response
{HttpServletResponse}
@param model
{AlipayTradeWapPayModel}
@param returnUrl
异步通知URL
@param notifyUrl
同步通知URL
@throws {AlipayApiException}
@throws {IOException}
167717
public static void wapPay(HttpServletResponse response, AlipayTradeWapPayModel model, String returnUrl,
			String notifyUrl) throws AlipayApiException, IOException {
		String form = wapPayStr(response, model, returnUrl, notifyUrl);
		HttpServletResponse httpResponse = response;
		httpResponse.setContentType("text/html;charset=" + AliPayApiConfigKit.getAliPayApiConfig().getCharset());
		httpResponse.getWriter().write(form);// 直接将完整的表单html输出到页面
		httpResponse.getWriter().flush();
	}
817529
public static AlipayTradeCreateResponse tradeCreateToResponse(AlipayTradeCreateModel model, String notifyUrl)
			throws AlipayApiException {
		AlipayTradeCreateRequest request = new AlipayTradeCreateRequest();
		request.setBizModel(model);
		request.setNotifyUrl(notifyUrl);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
496103
public static AlipayFundTransToaccountTransferResponse transferToResponse(
			AlipayFundTransToaccountTransferModel model) throws AlipayApiException {
		AlipayFundTransToaccountTransferRequest request = new AlipayFundTransToaccountTransferRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
445809
private void handlePostAuthReturn() {
        final Uri intentUri = getIntent().getData();
        if (intentUri != null) {
            if ("stripe".equals(intentUri.getScheme()) &&
                    "payment-auth-return".equals(intentUri.getHost())) {
                final String paymentIntentClientSecret =
                        intentUri.getQueryParameter("payment_intent_client_secret");
                if (paymentIntentClientSecret != null) {
                    final Stripe stripe = new Stripe(getApplicationContext(),
                            PaymentConfiguration.getInstance().getPublishableKey());
                    final PaymentIntentParams paymentIntentParams = PaymentIntentParams
                            .createRetrievePaymentIntentParams(paymentIntentClientSecret);
                    mCompositeDisposable.add(Observable
                            .fromCallable(() ->
                                    stripe.retrievePaymentIntentSynchronous(paymentIntentParams,
                                            PaymentConfiguration.getInstance().getPublishableKey()))
                            .subscribeOn(Schedulers.io())
                            .observeOn(AndroidSchedulers.mainThread())
                            .subscribe((paymentIntent -> {
                                if (paymentIntent != null) {
                                    handleRetrievedPaymentIntent(paymentIntent);
                                }
                            }))
                    );
                }
            }
        }
    }
423618
public static AlipayTradeFastpayRefundQueryResponse tradeRefundQueryToResponse(
			AlipayTradeFastpayRefundQueryModel model) throws AlipayApiException {
		AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
497305
public static AlipayTradeOrderSettleResponse tradeOrderSettleToResponse(AlipayTradeOrderSettleModel model,
			String appAuthToken) throws AlipayApiException {
		AlipayTradeOrderSettleRequest request = new AlipayTradeOrderSettleRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request, null, appAuthToken);
	}
11413
public static AlipayFundAuthOrderUnfreezeResponse authOrderUnfreezeToResponse(
			AlipayFundAuthOrderUnfreezeModel model) throws AlipayApiException {
		AlipayFundAuthOrderUnfreezeRequest request = new AlipayFundAuthOrderUnfreezeRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
1091491
public void doPost (HttpServletRequest request, HttpServletResponse response)
    		throws ServletException, IOException {
        String alertId = request.getParameter("alertId");
        String tel = request.getParameter("tel");
        String alertText = request.getParameter("alertText");        
        if(alertText == null || alertText.length() < 1) {
	        // Get the content of the request as the text to parse
	        byte[] content = new byte[request.getContentLength()];
	        request.getInputStream().read(content,0, request.getContentLength());        
	        alertText = new String(content);
	        // Fix from Rafael Soares http://groups.google.com/group/mobicents-public/browse_thread/thread/16015a2e2c034806
	        // remove '\n' and ',' chars to avoid problems with TTS
	        alertText = alertText.replace('\n', ' ').replace(',', ' ');
	        if(logger.isInfoEnabled()) {
	        	logger.info("Got an alert : \n alertID : " + alertId + " \n tel : " + tel + " \n text : " +alertText);
	        }
        }
        alertText = "Hello Admin; the server 0.0.0.0:2999 you're monitoring is running out of memory";
		// Create app session and request
        SipApplicationSession appSession = 
        	((ConvergedHttpSession)request.getSession()).getApplicationSession();
        URI fromURI = sipFactory.createAddress(FROM).getURI();
        URI toURI = sipFactory.createAddress(tel).getURI();
        SipServletRequest sipServletRequest = sipFactory.createRequest(appSession, INVITE, fromURI, toURI);        
        sipServletRequest.setRequestURI(toURI);
		
        sipServletRequest.getSession().setAttribute("speechUri",
				java.net.URI.create("data:" + URLEncoder.encode("ts("+ alertText +")", "UTF-8")));
		try {
			// Media Server Control Creation
			MediaSession mediaSession = MMSUtil.getMsControl().createMediaSession();
			NetworkConnection connection = mediaSession
			.createNetworkConnection(NetworkConnection.BASIC);

			SdpPortManager sdpManag = connection.getSdpPortManager();
			sdpManag.generateSdpOffer();
			
			byte[] sdpOffer = null;
			int numTimes = 0;
			while(sdpOffer == null && numTimes<10) {
				sdpOffer = sdpManag.getMediaServerSessionDescription();
				Thread.sleep(500);
				numTimes++;
			}
			
			sipServletRequest.setContentLength(sdpOffer.length);
			sipServletRequest.setContent(sdpOffer, "application/sdp");	
			
			MediaGroup mg = mediaSession.createMediaGroup(MediaGroup.PLAYER_SIGNALDETECTOR);
			
			// storing helpful info for later during the call
			SipSession sipSession = sipServletRequest.getSession();
			sipSession.setAttribute("connection", connection);
			sipSession.setAttribute("alertId", alertId);
			sipSession.setAttribute("tel", tel);
			sipSession.setAttribute("alertText", alertText);
			sipSession.setAttribute("connection", connection);
			sipSession.setAttribute("mediaGroup", mg);
			sipSession.setAttribute("mediaSession", mediaSession);
			sipSession.setAttribute("feedbackUrl", (String)getServletContext().getAttribute("alert.feedback.url"));
			sipServletRequest.send();
			mg.getSignalDetector().addListener(new DTMFListener(alertId, (String)getServletContext().getAttribute("alert.feedback.url")));
			connection.join(Direction.DUPLEX, mg);
		} catch (Exception e) {
			// Should not happen
			logger.error("Unexpected exception while trying to send the SIP Request", e);
			response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
			String errorBody = "<HTML><BODY>Phone Alert not Sent, could not find Media Libraries !</BODY></HTML>";
			sendHttpResponse(response, errorBody);
			return;
		}
				
        sendHttpResponse(response, OK_BODY);
    }
271628
public static AlipayTradeRefundResponse tradeRefundToResponse(AlipayTradeRefundModel model)
			throws AlipayApiException {
		AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
889947
public static AlipayFundCouponOrderAgreementPayResponse fundCouponOrderAgreementPayToResponse(
			AlipayFundCouponOrderAgreementPayModel model) throws AlipayApiException {
		AlipayFundCouponOrderAgreementPayRequest request = new AlipayFundCouponOrderAgreementPayRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
219517
private <TResponse> TResponse callServiceOwnerGetApi(
            String path, Class<TResponse> responseClass) throws AuthleteApiException
    {
        return callServiceOwnerGetApi(path, (Map<String, String>)null, responseClass);
    }
1132116
public static AlipayFundTransOrderQueryResponse transferQueryToResponse(AlipayFundTransOrderQueryModel model)
			throws AlipayApiException {
		AlipayFundTransOrderQueryRequest request = new AlipayFundTransOrderQueryRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
114271
private <T extends AlipayResponse> void checkResponseSign(AlipayRequest<T> request,
                                                              AlipayParser<T> parser,
                                                              String responseBody,
                                                              boolean responseIsSucess) throws AlipayApiException {
        // 针对成功结果且有支付宝公钥的进行验签
        if (!StringUtils.isEmpty(this.alipayPublicKey)) {

            SignItem signItem = parser.getSignItem(request, responseBody);

            if (signItem == null) {

                throw new AlipayApiException("sign check fail: Body is Empty!");
            }

            if (responseIsSucess
                || (!responseIsSucess && !StringUtils.isEmpty(signItem.getSign()))) {

                boolean rsaCheckContent = AlipaySignature.rsaCheck(signItem.getSignSourceDate(),
                    signItem.getSign(), this.alipayPublicKey, this.charset, this.signType);

                if (!rsaCheckContent) {

                    // 针对JSON \/问题，替换/后再尝试做一次验证
                    if (!StringUtils.isEmpty(signItem.getSignSourceDate())
                        && signItem.getSignSourceDate().contains("\\/")) {

                        String srouceData = signItem.getSignSourceDate().replace("\\/", "/");

                        boolean jsonCheck = AlipaySignature.rsaCheck(srouceData, signItem.getSign(),
                            this.alipayPublicKey, this.charset, this.signType);

                        if (!jsonCheck) {
                            throw new AlipayApiException(
                                "sign check fail: check Sign and Data Fail！JSON also！");
                        }
                    } else {

                        throw new AlipayApiException("sign check fail: check Sign and Data Fail!");
                    }
                }
            }

        }
    }
91419
public void receiveResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) 
	{
		cancelReTransmissionTimer();
		cancelLongtranTimer();
		JainMgcpResponseEvent event = null;

		try 
		{
			event = decodeResponse(data,msg,txID,returnCode);
		} 
		catch (Exception e) 
		{
			logger.error("Could not decode message: ", e);
		}

		event.setTransactionHandle(remoteTID);
		if (this.isProvisional(event.getReturnCode())) 
			resetLongtranTimer();
		
		stack.provider.processMgcpResponseEvent(event, commandEvent);

		if (!this.isProvisional(event.getReturnCode())) 
			this.release();		
	}
895595
public static AlipayFundAuthOperationCancelResponse authOperationCancelToResponse(
			AlipayFundAuthOperationCancelModel model) throws AlipayApiException {
		AlipayFundAuthOperationCancelRequest request = new AlipayFundAuthOperationCancelRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
1161579
@Override
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    JsonGenerator jg = null;
    String jsonpcb = null;
    PrintWriter writer = null;
    try {

      writer = response.getWriter();

      // "callback" parameter implies JSONP output
      jsonpcb = request.getParameter(CALLBACK_PARAM);
      if (jsonpcb != null) {
        response.setContentType("application/javascript; charset=utf8");
        writer.write(jsonpcb + "(");
      } else {
        response.setContentType("application/json; charset=utf8");
      }

      jg = jsonFactory.createJsonGenerator(writer);
      jg.disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
      jg.useDefaultPrettyPrinter();

      int statusCode = renderMBeans(jg, request.getParameterValues("qry"));
      response.setStatus(statusCode);

    } catch (IOException e) {
      writeException(jg, e);
      response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    } catch (MalformedObjectNameException e) {
      writeException(jg, e);
      response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
    } finally {
      if (jg != null) {
        jg.close();
      }
      if (jsonpcb != null) {
        writer.write(");");
      }
      if (writer != null) {
        writer.close();
      }
    }

  }
53369
public static void returnStatusResponse(HttpServletResponse response, int status, String message) {
		if (response == null) {
			return;
		}
		PrintWriter out = null;
		try {
			response.setStatus(status);
			response.setContentType(MediaType.APPLICATION_JSON);
			out = response.getWriter();
			ParaObjectUtils.getJsonWriter().writeValue(out, getStatusResponse(Response.Status.
					fromStatusCode(status), message).getEntity());
		} catch (Exception ex) {
			logger.error(null, ex);
		} finally {
			if (out != null) {
				out.close();
			}
		}
	}