Java Code Examples for com.alipay.api.request.AlipayTradeWapPayRequest#putOtherTextParam()

The following examples show how to use com.alipay.api.request.AlipayTradeWapPayRequest#putOtherTextParam() . 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: 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 2
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 3
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 4
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 5
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"));
}