com.alipay.api.response.AlipayTradeWapPayResponse Java Examples

The following examples show how to use com.alipay.api.response.AlipayTradeWapPayResponse. 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: CertificatePageExecuteTest.java    From alipay-sdk-java-all with Apache License 2.0 6 votes vote down vote up
@Test
public void should_return_correct_signed_order_form_contains_root_cert_sn_and_app_cert_sn() throws AlipayApiException {
    //given
    AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
    request.setBizContent("{" +
            "    \"body\":\"对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。\"," +
            "    \"subject\":\"大乐透\"," +
            "    \"out_trade_no\":\"70501111111S001111119\"," +
            "    \"timeout_express\":\"90m\"," +
            "    \"total_amount\":9.00," +
            "    \"product_code\":\"QUICK_WAP_WAY\"" +
            "  }");
    //when
    AlipayTradeWapPayResponse response = client.pageExecute(request);
    String orderString = response.getBody();
    //then
    assertThat(orderString.contains("app_cert_sn"), is(true));
    assertThat(orderString.contains("alipay_root_cert_sn"), is(true));
}
 
Example #2
Source File: CertificatePageExecuteTest.java    From alipay-sdk-java-all with Apache License 2.0 6 votes vote down vote up
@Test
public void should_return_query_string_contains_root_cert_sn_and_app_cert() throws AlipayApiException {
    //given
    AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
    request.setBizContent("{" +
            "    \"body\":\"对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。\"," +
            "    \"subject\":\"大乐透\"," +
            "    \"out_trade_no\":\"70501111111S001111119\"," +
            "    \"timeout_express\":\"90m\"," +
            "    \"total_amount\":9.00," +
            "    \"product_code\":\"QUICK_WAP_WAY\"" +
            "  }");
    //when
    AlipayTradeWapPayResponse response = client.pageExecute(request, "GET");
    String orderString = response.getBody();
    //then
    assertThat(orderString.contains("app_cert_sn"), is(true));
    assertThat(orderString.contains("alipay_root_cert_sn"), is(true));
}
 
Example #3
Source File: LoadTestAlipayClientTest.java    From alipay-sdk-java-all with Apache License 2.0 6 votes vote down vote up
@Ignore
public void should_get_app_id_with_load_test_flag_in_redirect_url_when_call_page_execute() throws AlipayApiException {
    //given
    AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
    request.setBizContent("{" +
            "    \"body\":\"对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。\"," +
            "    \"subject\":\"大乐透\"," +
            "    \"out_trade_no\":\"70501111111S001111119\"," +
            "    \"timeout_express\":\"90m\"," +
            "    \"total_amount\":9.00," +
            "    \"product_code\":\"QUICK_WAP_WAY\"" +
            "  }");
    //when
    AlipayTradeWapPayResponse response = alipayClient.pageExecute(request, "GET");
    String orderString = response.getBody();
    //then
    assertThat(orderString, containsString("app_id=2021000100600007_TEST_1A"));
}
 
Example #4
Source File: LoadTestAlipayClientTest.java    From alipay-sdk-java-all with Apache License 2.0 6 votes vote down vote up
@Ignore
public void should_get_app_id_with_load_test_flag_in_post_form_when_call_page_execute() throws AlipayApiException {
    //given
    AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
    request.setBizContent("{" +
            "    \"body\":\"对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。\"," +
            "    \"subject\":\"大乐透\"," +
            "    \"out_trade_no\":\"70501111111S001111119\"," +
            "    \"timeout_express\":\"90m\"," +
            "    \"total_amount\":9.00," +
            "    \"product_code\":\"QUICK_WAP_WAY\"" +
            "  }");
    //when
    AlipayTradeWapPayResponse response = alipayClient.pageExecute(request, "POST");
    String orderString = response.getBody();
    //then
    assertThat(orderString, containsString("app_id=2021000100600007_TEST_1A"));
}
 
Example #5
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 #6
Source File: PageExecuteTest.java    From alipay-sdk-java-all with Apache License 2.0 5 votes vote down vote up
@Test
public void should_return_correct_signed_order_form() throws AlipayApiException {
    //given
    AlipayTradeWapPayRequest request = getTradeWapPayRequest();
    //when
    AlipayTradeWapPayResponse response = client.pageExecute(request);
    String orderString = response.getBody();
    //then
    //必须拥有正确的签名串
    assertThat(orderString, containsString("sign="));
}
 
Example #7
Source File: PageExecuteTest.java    From alipay-sdk-java-all with Apache License 2.0 5 votes vote down vote up
@Test
public void should_return_order_form_with_app_auth_token() throws AlipayApiException {
    //given
    AlipayTradeWapPayRequest request = getTradeWapPayRequest();
    request.putOtherTextParam("app_auth_token", "123");
    //when
    AlipayTradeWapPayResponse response = client.pageExecute(request, "POST");
    String orderString = response.getBody();
    //then
    //必须含有app_auth_tokne参数,不包含auth_token参数
    assertThat(orderString, containsString("name=\"app_auth_token\" value=\"123\""));
    assertThat(orderString.contains("name=\"auth_token\""), is(false));
}
 
Example #8
Source File: PageExecuteTest.java    From alipay-sdk-java-all with Apache License 2.0 5 votes vote down vote up
@Test
public void should_return_order_form_with_access_token() throws AlipayApiException {
    //given
    AlipayTradeWapPayRequest request = getTradeWapPayRequest();
    request.putOtherTextParam("auth_token", "123");
    //when
    AlipayTradeWapPayResponse response = client.pageExecute(request, "POST");
    String orderString = response.getBody();
    //then
    //必须含有auth_tokne参数,不包含app_auth_token参数
    assertThat(orderString, containsString("name=\"auth_token\" value=\"123\""));
    assertThat(orderString.contains("app_auth_token"), is(false));
}
 
Example #9
Source File: PageExecuteTest.java    From alipay-sdk-java-all with Apache License 2.0 5 votes vote down vote up
@Test
public void should_return_order_form_with_access_token_and_app_auth_token() throws AlipayApiException {
    //given
    AlipayTradeWapPayRequest request = getTradeWapPayRequest();
    request.putOtherTextParam("app_auth_token", "123");
    request.putOtherTextParam("auth_token", "123");
    //when
    AlipayTradeWapPayResponse response = client.pageExecute(request, "POST");
    String orderString = response.getBody();
    //then
    //必须含有auth_tokne参数和app_auth_token参数
    assertThat(orderString, containsString("name=\"app_auth_token\" value=\"123\""));
    assertThat(orderString, containsString("name=\"auth_token\" value=\"123\""));
}
 
Example #10
Source File: PageExecuteTest.java    From alipay-sdk-java-all with Apache License 2.0 5 votes vote down vote up
@Test
public void should_return_query_string_with_access_token_and_app_auth_token() throws AlipayApiException {
    //given
    AlipayTradeWapPayRequest request = getTradeWapPayRequest();
    request.putOtherTextParam("app_auth_token", "123");
    request.putOtherTextParam("auth_token", "123");
    //when
    AlipayTradeWapPayResponse response = client.pageExecute(request, "GET");
    String orderString = response.getBody();
    //then
    //必须含有auth_tokne参数和app_auth_token参数
    assertThat(orderString, containsString("app_auth_token=123"));
    assertThat(orderString, containsString("auth_token=123"));
}
 
Example #11
Source File: PageExecuteTest.java    From alipay-sdk-java-all with Apache License 2.0 5 votes vote down vote up
@Test
public void should_return_order_string_with_correct_order_of_parameters() throws AlipayApiException {
    //given
    AlipayTradeWapPayRequest request = getTradeWapPayRequest();
    request.putOtherTextParam("A", "test");
    request.putOtherTextParam("a", "test");
    //when
    AlipayTradeWapPayResponse response = client.pageExecute(request, "GET");
    String orderString = response.getBody();
    //then
    //大写字符必须在小写字符前面
    assertThat(orderString, containsString("A=test&a=test"));
}
 
Example #12
Source File: AlipayTradeWapPayRequest.java    From alipay-sdk-java-all with Apache License 2.0 4 votes vote down vote up
public Class<AlipayTradeWapPayResponse> getResponseClass() {
	return AlipayTradeWapPayResponse.class;
}
 
Example #13
Source File: AlipayTradeWapPayRequest.java    From alipay-sdk-java-all with Apache License 2.0 4 votes vote down vote up
public Class<AlipayTradeWapPayResponse> getResponseClass() {
    return AlipayTradeWapPayResponse.class;
}
 
Example #14
Source File: AlipayTradeWapPayRequest.java    From alipay-sdk with Apache License 2.0 4 votes vote down vote up
public Class<AlipayTradeWapPayResponse> getResponseClass() {
	return AlipayTradeWapPayResponse.class;
}
 
Example #15
Source File: AlipayTradeWapPayRequest.java    From pay with Apache License 2.0 4 votes vote down vote up
public Class<AlipayTradeWapPayResponse> getResponseClass() {
	return AlipayTradeWapPayResponse.class;
}
 
Example #16
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;