use of jp.ne.paypay.model.NotDataResponse in project paypayopa-sdk-java by paypay.
the class PendingPaymentApiTest method cancelPaymentTest.
/**
* Cancel a payment
*
* This api is used to cancel the pending order. **Timeout: 15s**
*
* @throws ApiException if the Api call fails
*/
@Test
public void cancelPaymentTest() throws ApiException {
String merchantPaymentId = "merchantpaymentid";
NotDataResponse notDataResponse = new NotDataResponse();
notDataResponse.setResultInfo(resultInfo);
ApiResponse<NotDataResponse> notDataResponseApiResponse = new ApiResponse<>(00001, null, notDataResponse);
Assert.assertEquals(notDataResponseApiResponse.getStatusCode(), 00001);
Assert.assertNull(notDataResponseApiResponse.getHeaders());
Mockito.when(apiClient.escapeString(merchantPaymentId)).thenReturn(merchantPaymentId);
Mockito.when(api.cancelPendingOrderWithHttpInfo(merchantPaymentId)).thenReturn(notDataResponseApiResponse);
NotDataResponse response = api.cancelPendingOrder(merchantPaymentId);
Assert.assertEquals(response.getResultInfo().getMessage(), "SUCCESS");
}
use of jp.ne.paypay.model.NotDataResponse in project paypayopa-sdk-java by paypay.
the class UserApiTest method unlinkUserTest.
/**
* Unlink user
*
* Unlink a user from the client **Timeout: 15s**
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void unlinkUserTest() throws ApiException {
String userAuthorizationId = "userAuthorizationId";
NotDataResponse notDataResponse = new NotDataResponse();
notDataResponse.setResultInfo(resultInfo);
ApiResponse<NotDataResponse> notDataResponseApiResponse = new ApiResponse<>(00001, null, notDataResponse);
Mockito.when(apiClient.escapeString(userAuthorizationId)).thenReturn(userAuthorizationId);
Mockito.when(api.unlinkUserWithHttpInfo(userAuthorizationId)).thenReturn(notDataResponseApiResponse);
NotDataResponse response = api.unlinkUser(userAuthorizationId);
Assert.assertEquals(response.getResultInfo().getMessage(), "SUCCESS");
}
use of jp.ne.paypay.model.NotDataResponse in project paypayopa-sdk-java by paypay.
the class PaymentApiTest method cancelPaymentTest.
/**
* Cancel a payment
*
* This api is used in case, while creating a payment, the client can not determine the status of the payment. For example, client get timeout or the response cannot contain the information to indicate the exact payment status. By calling this api, if accepted, the OPA will guarantee the money eventually goes back to user's account. </br><b style=\"color:red\">Note:</b> The Cancel API can be used until 00:14:59 AM the day after the Payment has happened. </br>For 00:15 AM or later, please call the refund API to refund the payment. **Timeout: 15s**
*
* @throws ApiException if the Api call fails
*/
@Test
public void cancelPaymentTest() throws ApiException {
String merchantPaymentId = "merchantpaymentid";
NotDataResponse notDataResponse = new NotDataResponse();
notDataResponse.setResultInfo(resultInfo);
ApiResponse<NotDataResponse> notDataResponseApiResponse = new ApiResponse<>(00001, null, notDataResponse);
Assert.assertEquals(notDataResponseApiResponse.getStatusCode(), 00001);
Assert.assertNull(notDataResponseApiResponse.getHeaders());
Mockito.when(apiClient.escapeString(merchantPaymentId)).thenReturn(merchantPaymentId);
Mockito.when(api.cancelPaymentWithHttpInfo(merchantPaymentId)).thenReturn(notDataResponseApiResponse);
NotDataResponse response = api.cancelPayment(merchantPaymentId);
Assert.assertEquals(response.getResultInfo().getMessage(), "SUCCESS");
}
use of jp.ne.paypay.model.NotDataResponse in project paypayopa-sdk-java by paypay.
the class PaymentApi method cancelPaymentWithHttpInfo.
/**
* Cancel a payment
* This api is used in case, while creating a payment, the client can not determine the status of the payment. For example, client get timeout or the response cannot contain the information to indicate the exact payment status. By calling this api, if accepted, the OPA will guarantee the money eventually goes back to user's account. </br><b style=\"color:red\">Note:</b> The Cancel API can be used until 00:14:59 AM the day after the Payment has happened. </br>For 00:15 AM or later, please call the refund API to refund the payment. **Timeout: 15s**
*
* @param merchantPaymentId (required)
* @return ApiResponse<NotDataResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
protected ApiResponse<NotDataResponse> cancelPaymentWithHttpInfo(String merchantPaymentId) throws ApiException {
Call call = cancelPaymentValidateBeforeCall(merchantPaymentId);
Type localVarReturnType = new TypeToken<NotDataResponse>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.CANCEL_PAYMENT);
}
use of jp.ne.paypay.model.NotDataResponse in project paypayopa-sdk-java by paypay.
the class PaymentApi method deleteQRCodeWithHttpInfo.
/**
* Delete a Code
* Delete a created Code. **Timeout: 15s**
*
* @param codeId (required)
* @return ApiResponse<NotDataResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
protected ApiResponse<NotDataResponse> deleteQRCodeWithHttpInfo(String codeId) throws ApiException {
Call call = deleteQRCodeValidateBeforeCall(codeId);
Type localVarReturnType = new TypeToken<NotDataResponse>() {
}.getType();
return apiClient.execute(call, localVarReturnType, ApiNameConstants.DELETE_QRCODE);
}
Aggregations